• Welcome to KonaKart Community Forum. Please login or sign up.
 
April 30, 2025, 03:21:15 pm

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - ReLLiK75

1
Programming of KonaKart / Re: Shipping addresses
July 17, 2009, 12:39:45 am
I rewrote a good portion of KonaKart in Flex.  I have a checkout page that allows users to ship various items to different addresses.  It also allows users to select a single shipping address from their address book and apply it to the entire order.  I'd be happy to post the code, but it's all actionscript/c# based.  It's definitely doable.  The only thing I have yet to do is actually update the handler to deal with multiple shipping addresses.  Not quite sure how to do it properly yet.
2
I'm trying to understand how the SOAP API is able to work with the KK servlet engine to call the payment gateway.  For example, if I use the following code to create my order:

                   //Create the Order
                    Order order = kkServerApi.createOrderWithOptions(KKSessionID, basketItems, orderOptions, -1);

                    //Get shipping quotess for all installed shipping modules
                    ShippingQuote[] shippingQuotes = getShippingQuotes(order);

                    //Assign the default shipping method to the order
                    if (shippingQuotes.Length > 0)
                        order.shippingQuote = shippingQuotes[0];

                    order = kkServerApi.getOrderTotals(order, -1);

                    //Get payment details for specified payment gateway
                    order.paymentDetails = kkServerApi.getPaymentDetailsPerOrder(KKSessionID, "usaepay", order, kkServerApi.Url, -1);

                    order.paymentDetails.ccNumber= some_number;
                    order.paymentDetails.ccExpiryYear= year;
                    order.paymentDetails.ccExpiryMonth = month;
                    order.paymentDetails.ccOwner=owner;
                    order.paymentDetails.ccType=type;

                   order.id=kkServerApi.saveOrder(KKSessionID, order, -1);

I would expect that by calling saveOrder with the paymentDetails populated, that KonaKart would automatically invoke the UsaepayAction class (provided it's been enabled in the Admin console).  However, this is not the case.  The gateway never gets called and there are no SOAP APIs to forcefully invoke the gateway or to get the response from the gateway, had it been automatically invoked by KonaKart.

Am I missing something here?

The workaround for me has been to write my own SOAP based payment gateway invoker that calls the payment service directly through my C# backend, and then build up the IPNHistory object with the results I get back from submitting a payment to the sandbox.  My concern with doing it this way is that I'm not capturing something that KK captures automatically.  For example, credit card number.  I've read in previous posts on the forum that the CC number is supposed to be returned by ccNumber field on the order object.  Even if I manually set those values before calling saveOrder, it doesn't appear that the credit card info is being saved with the order because I'm not using the KonaKart servlet engine to send the payment.

Aside from using the custom fields, what am I doing wrong?

Thanks!

3
Programming of KonaKart / Re: invoice as attachment
January 14, 2009, 07:54:20 pm
No prob!  Glad I could help!  I've been digging through all the KonaKart APIs like a madman trying to figure stuff out as a I go, so I figure I'll provide whatever help I can to those who need it.
4
Configuration of KonaKart / Re: Free Digital Downloads
January 13, 2009, 04:08:16 pm
If you're using SOAP, you can create your own method (I do this in my createOrder method) that checks to see if the product.type=1 (digital download) and the price=0 then call insertDigitalDownload(productID) which will make the digital download available for immediate download.  You can do the same thing in your java class if you're not using SOAP.
5
Programming of KonaKart / Re: invoice as attachment
January 13, 2009, 03:59:54 pm
You could use the iText PDF java library to create the order invoice and save it to a temp folder.  Then possibly modify the email class to insert the PDF as an attachment.  If the email class can't be modified you could use the custom API classes to create a new email class that can insert the attachment for you.
6
I'm stuck!

I'm noticing that when I call createOrder,  it seems like the finalPrice attributes are are not getting received by the SOAP engine and, as a result, when the order object is returned the subTotal attributes are = 0.00.  I have verified all this using Fiddler to watch the actual SOAP messages as their being sent/received.  This means I can't accurately call getOrderTotals because the subtotal object comes back = 0.00 and my order ends up with a total price equal only to shipping + tax.

I tried adding a globalconfig section to the service-config.wsdd and setting "sendMultiRefs" to false, but the SOAP engine didn't like the format of the SOAP message for a Basket Object (or any complex type) when I tried calling createOrder.

I then tried creating my own WSDL using the "wrapped" and "literal" switches in the java2WSDL util, but the resulting C# code that gets created when using the wsdl util on the new wsdl doesn't recognize the responses back from the SOAP engine, so something as simple as doesCustomerExistForEmail, which should return a true, get's a false value in my .net test client application.

I'm at a critical point in my development and really need to find a way to work around these SOAP issues.  I've tried everything I know how to do short of extracting the jars, decompiling the classes, and changing the KKWSEngIf class.

Please help!

Thanks!
Wayne
7
Any issues with using KK with Axis2 or a later version of tomcat?
8
Hi Brain...

Sure thing!  As soon as I can figure out how to iron out all the issues that I'm having trying to go from java to .Net

Do you know how to disable the RPC encoding?  I think this may also clear up some issues

Wayne
9
UPDATE--this is a bug in the WSDL.  Anyone using SOAP will have problems programmatically creating orders without changing the generated code until this WSDL bug gets corrected.

The WSDL declares prodRelationTypeArray as follows:

<element name="prodRelationTypeArray" nillable="true" type="xsd:int"/>

because the API is expecting an array of int, the WSDL needs to be changed to indicate the int should actually be an array of ints.
10
Ahhh...how great it feels when you figure out a solution to a problem.

This one is for the .Net guys out there.

If you are using Visual Studio (I happen to use 2008) to import the konakart WSDL as a web reference, there are a few places where code doesn't get created the way it should.  In this particular case, the prodRelationTypeArray parameter was defined in the reference.cs file incorrectly.  The KK API docs show that it should be of type int[], however the code generator typed it as simply int.

This is what was causing all my errors when trying to create a order via C# SOAP.

Other places I've had issues with the Visual Studio Code generator was for objects typed as System.Nullable<Decimal>.  These would always return null values.  When I changed them to just Decimal, I would get the correct values back from the SOAP response.

Cheers!
Wayne
11
One more bit of info....The tomcat trace shows the following:

ERROR (BeanPropertyTarget.java:set:135) Could not convert java.lang.Integer to bean field 'prodRelationTypeArray', type
12
Here's some more info that may help track down the problem.  I've inspected the SOAP response with Fiddler and this is what is being returned:

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Date: Fri, 05 Dec 2008 06:05:18 GMT
Connection: close
Content-Length: 533

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>java.lang.IllegalArgumentException: java.lang.ClassCastException@fe45d3</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">vm-xp1</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>;


How there's a class cast expection, I have no idea. I'm supplying the sessionID, an array of type Basket, and the integer value for Default Language.
13
I think I've figured it out. 

Currency is supposed to be null until you set order.currency=getCurrency(order.currencyCode).

Hopefully this bit of info also helps someone else out!
14

I've got the following code with I've added to the AxisExample.java file.   When I execute the class, the code completes with no errors.


       Basket[] basket=port.getBasketItemsPerCustomer(sessionId, customerId, -1);
       System.out.println("Basket count:  " + basket.length);
       port.createOrder(sessionId, basket, -1)


However, If I try to run similiar code via SOAP (return kkServerApi.createOrder ( KKSessionID, basketItems, -1 );) with the same items in the shopping cart, I get an the following error:

+      $exception   {System.Web.Services.Protocols.SoapException: java.lang.IllegalArgumentException: argument type mismatch
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at EPCProxy.KonaKartServer.KKWSEngIfService.createOrder(String in0, Basket[] in1, Int32 in2) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\EPCProxy\EPCProxy\Web References\KonaKartServer\Reference.cs:line 2393
   at EPCProxy.EPCProxy.createOrder() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\EPCProxy\EPCProxy\KonaKart.cs:line 183}   System.Exception {System.Web.Services.Protocols.SoapException}


Please help!
Thanks!
15
Programming of KonaKart / Currency in Order Object null?
December 05, 2008, 01:11:40 am
Is the currency object that gets returned by within the orderArray of Orders when calling getOrdersPerCustomer supposed to be null?  I've verified using your java examples that it does, in fact get returned as null while properties like currencyCode and currencyValue get returned with values.

Thanks!