• Welcome to KonaKart Community Forum. Please login or sign up.
 

Single Click Order creation and dispatch

Started by sfsylz, April 02, 2007, 10:19:30 am

Previous topic - Next topic

sfsylz

I was wondering if there was a capability to submit a single form containing the product id and shipping country, which then constructs the order and then dispatches the order off to the payment processor (ie Worldpay via a HTML post)?

I was thinking that there could be a simple html page form that calls a servlet that connects into the KonaKart engine and which builds the values needed for the Worldpay post (for security/spoofing reasons I want the secret id to be generated) and then forwards it on to Worldpay with instructions from Worldpay to gather the shipping instructions. The Worldpay callback servlet will then take the information that was gathered and will fill in the vital information for the order.

Doable? What are the required fields for an order to be populated initially. I couldn't see anything of that type in the JavaDocs. Maybe I missed it, but are there JavaDocs for the KKEngine?

Steve

paolo

Hi Steve,

Yes there are JavaDocs for the engine ( http://www.konakart.com/javadoc/server/ ).

Before going into any details, I just wanted to make sure I understood what you want to achieve. Is the aim to miss out the Shipping and Payment windows during the checkout process and go directly to WorldPay ?

-Paolo

sfsylz

Paulo,

I must have missed that on my quick look around this morning.

That's basically it. Between the product id and the shipping country we should be able to determine the total amount to charge. It looks like Worldpay can be configured to gather the shipping address for us.

There shouldn't be a reason for them to log in or register, but I do want the capability of generating the secret id and passing it as a parameter to Worldpay and then verifying the secret id on the callback. At callback time, then the shipping/billing address and customer information will be populated.

Am I being naive to think passing the secret id will provide any protection in this scenario? Because if that isn't needed, then the call to world pay is fairly simple (a form post) and we can just build the complete order on the callback.

I suppose this is less feature request and more of a technical question, since I'll probably end up doing this myself.

Thanks,
Steve

paolo

Steve,

The code you need to look at is the following:

CheckoutDeliveryAction : A new order is created (but not saved in the database) and a list of shipping quotes is fetched. The order gets populated with the addresses of the logged in user so you will have to override these.

CheckoutDeliverySubmitAction : Selected Shipping quote is attached to the order

CheckoutPaymentAction : A list of payment gateways is fetched

CheckoutDeliverySubmitAction : Selected payment gateway is attached to the order

I think that you should be able to do all of those things behind the scenes to avoid having to get the user to flick through multiple pages.

The secret key gives you security when using SSL since you pass it to WorldPay and it gets passed back to you always using secure channels. You then use the secret key to get the orderId. If you don't use the secret key someone could send you callbacks and you'd have difficulty figuring out whether they were real ones or not.

-Paolo

p.s. We normally save the order in the DB before getting a result from WorldPay . The WorldPay result just changes the order state. In this way, you have a record of what has happened even if the payment gateway had a problem.