Using a Payment Gateway that supports Recurring Billing

Many payment gateways support recurring billing and provide interfaces to create and manage subscriptions. In this case we recommend using the KonaKart Admin Custom engine in order to communicate to the Payment Gateway whenever a Subscription is created or edited so that the Subscription in the KonaKart database always reflects the subscription in the payment gateway. The Admin Engine contains a method to call a payment gateway callPaymentModule which may be used also for recurring billing although you may need to introduce the code specific to recurring billing. An example payment gateway implementation for the Admin Eng may be found for AuthorizeNet (com.konakartadmin.modules.payment.authorizenet.AdminPayment). These are the Custom Engine API calls that need to be customized:

Admin Engine API

In the case of the Application Engine, the OrderIntegrationMgr contains code that will insert a subscription object when the order is saved. This needs to be edited to also send the subscription to the Payment Gateway using the callPaymentModule method of the Admin App. The method called manageSubscriptions() is commented out by default. If your store supports recurring billing, this method must be uncommented. Note that the credit card details may be passed in as attributes of the order object from the application. Since you don’t want to save this information in the database but only use it to pass to the payment gateway, you should copy it into a temporary object in the beforeSaveOrder() method and delete it from the order so that it doesn’t get persisted into the database.