Managing Recurring Billing through KonaKart

In this case the credit card details are stored by KonaKart in an encrypted format within the Order object. The actual payments are made by a KonaKart Batch program that interfaces to the payment gateway to perform the payment transaction. An example of this batch is provided in source code format so that it can be modified. The batch is called recurringBillingBatch() and can be found within AdminOrderBatchMgr.java. It loops through all subscriptions that are active and that have a nextBillingDate equal to or later than the current date. Based on the data found within the Subscription object and attached PaymentSchedule object, the batch program can make the payment and update the Subscription with a new nextBillingDate. The subscription object is also updated if the transaction with the payment gateway fails to indicate that there has been a problem.

The batch uses the callPaymentModule API call to communicate with the payment gateway. The source code example calls the admin payment module for AuthorizeNet (com.konakartadmin.modules.payment.authorizenet.AdminPayment).