I need authorize.net integration for subscription payments, likely using CIM. The requirements are simple - recurring monthly payments, with a few different price points. Custom
There is always Paython: https://github.com/abunsen/Paython
Currently supports 5+ payment gateways:
Here is an example:
from paython import CreditCard, AuthorizeNet
set up a card first:
credit_card = CreditCard(
number = '4111111111111111',
exp_mo = '02',
exp_yr = '2012',
first_name = 'John',
last_name = 'Doe',
cvv = '911',
strict = False
)
check if its valid:
if not credit_card.is_valid(): return 'houston, we have a problem' # checks card number + expiration date
Set up customer data to charge, not all fields are required:
customer_data = dict(
address='123 Main St',
address2='Apt 1',
city='Pleasantville',
state='IA',
zipcode='54321',
country='US',
phone='654-369-9589',
email='john@localwoodshop.com',
ip='127.0.0.1')
authorize against gateway, options include debug output or test credentials:
api = AuthorizeNet(username='test', password='testpassword', debug=True, test=True)
gateway_response = api.auth(amount='0.05', credit_card=credit_card, billing_info=customer_data, shipping_info=None)
now you can settle:
api = AuthorizeNet(username='test', password='testpassword', debug=True, test=True)
gateway_response = api.settle(amount='0.05', trans_id='2156729380')