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

Checkout module questions

Started by mdesjard, November 27, 2007, 06:17:38 pm

Previous topic - Next topic

mdesjard

Hi, I'm new to KonaKart.

I want to use it to create an internet store for an already existing brick and mortar store.

We already have credit card processing in store. Also, we won't keep up to date stocks on the site, so at checkout, I would like to just take the credit card information. Store it temporarily in a file on my server (encrypted of course) and once the order is validated and shipping is calculated, then process the credit card in store. In that case, the shipping fees would just be an estimate.

Also, I would like to offer in store pickup as a payment and shipping options. If that is selected for payment, I would like the shipping method to adjust automatically.

Are those things possible? If so, please tell me which payment module would be most similar so that I can start from there to create my new modules.

If anybody already have something similar, would you be willing to share the code?

Thanks in advance for any help you can provide!

Brian

November 27, 2007, 07:51:08 pm #1 Last Edit: November 27, 2007, 07:54:25 pm by Brian
Hello,

Welcome to KonaKart  :)

For the first requirement, a simple solution would be to copy a payment module such as USAePay or Authorize.Net which collects credit card details on the KonaKart site (rather than going off to the payment gateway's site for these).   There are essentially 3 java files to modify, using USAePay as an example:

com\konakart\bl\modules\payment\usaepay\Usaepay.java
com\konakartadmin\modules\payment\usaepay\Usaepay.java
com\konakart\actions\gateways\UsaepayAction.java


The first is used to fetch the payment details and configuration data for the payment.  The second is used to define the configuration parameters used by the module (so that you can use the KonaKart Admin App to configure the module) and the last one, the "Action" is the one that does the posting of the data to the payment gateway, and processes the results.

Therefore, what you will have to do is to modify the last one and instead of posting data off to a payment gateway, you just store the encrypted data that you need in a database or a file or whatever you like..  You will see that the "Action" java file has access to all the information that you'll require about the credit card, the customer and the order.

To complete the task you will need to add the name of your new payment module to:

webapps\konakartadmin\WEB-INF\classes\konakartadmin.properties

Add your new payment module to this list:

konakart.modules.payment=Paypal Chronopay Epaybg Cod Worldpay Authorizenet Usaepay Yourpay Payjunction

Finally you'll need to modify the struts-config.xml by replicating the USAePay sections for your payment module.  The struts-config.xml is here:

webapps\konakart\WEB-INF\struts-config.xml

EG:  Add references to your new payment module in two places alongside these:

<action path="/CheckoutServerPaymentSubmit" type="com.konakart.actions.CheckoutServerPaymentSubmitAction" name="CreditCardForm" scope="request" validate="true" input="/CheckoutServerPayment.do">
<forward name="usaepay" path="/USAePay.do"/>
<forward name="authorizenet" path="/AuthorizeNet.do"/>
<forward name="payjunction" path="/PayJunction.do"/>
<forward name="yourpay" path="/YourPay.do"/>
</action>


and:

<!-- =========================================== Server Side Gateways -->
<action path="/USAePay" type="com.konakart.actions.gateways.UsaepayAction">
<forward name="Approved" path="/CheckoutFinished.do"/>
<forward name="TryAgain" path="/CheckoutServerPayment.do"/>
<forward name="NotLoggedIn" path="/CheckoutDelivery.do"/>
</action>
<action path="/AuthorizeNet" type="com.konakart.actions.gateways.AuthorizenetAction">
<forward name="Approved" path="/CheckoutFinished.do"/>
<forward name="TryAgain" path="/CheckoutServerPayment.do"/>
<forward name="NotLoggedIn" path="/CheckoutDelivery.do"/>
</action>


The second requirement is simple because there is already a shipping module for Local Collection - it's called "Free".

Regards,
Brian