vteam #602 was required to develop a recurring cart extension for Magento. The client wanted its customers to place orders automatically using a Cron script.
Creation of recurring cart functionality was a straight forward task. But the payment method for automatic orders was problematic. vteams engineer Tahir Yasin had to use Authorize.Net CIM Payment Gateway recommended by the client. This method was used to gather credit cards’ account information of customers. Once the account data was stored in the CIM, there would be no need of requiring that particular individual’s card number to access the information.
It was impossible to fetch the stored credit card account details and create a new order using that information. The data was tokenized and Magento required full credit card number, CVV, card expiry and billing address. Hence, the information was clearly unavailable. The following attempt didn’t work:
Based on research, Tahir created a quote and converted it into order. After that, Authorize.Net CIM payment gateway was applied to the quote. The card hash was then added to the quote/order payment object. Using tokenized information, the payment method handled its billing.
The following cron script solved the issue using saved credit cards that placed orders automatically: