Paython
=========
Trying to make it easy to accept payments in Python. So far, we're Paython.
Currently - you can just import the gateway needed from gateways & auth/settle/capture (sale)/void/credit once you instantiate with the proper credentials.
Supported Gateways
==================
* Stripe
* Authorize.net
* Innovative Gateway Solutions (Intuit)
* First Data Global Gateway (formerly Linkpoint?)
* PlugnPay
* Samurai
Usage
===========================
It's super simple to start:
Importing what you need
```py
from paython import CreditCard, AuthorizeNet
```
Setting up a credit card
```py
credit_card = CreditCard(
number = '4111111111111111',
exp_mo = '02',
exp_yr = '2012',
first_name = 'John',
last_name = 'Doe',
cvv = '911',
strict = False
)
```
Checking to see if it's valid
```py
if not credit_card.is_valid(): return 'houston, we have a problem' # checks card number + expiration date
```
Setting up customer data to charge, not all fields are required.
```py
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')
```
Trying to authorize against gateway, options include debug output or test credentials
```py
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)
```
Keep in mind, if you authorize, you need to settle
```py
api = AuthorizeNet(username='test', password='testpassword', debug=True, test=True)
gateway_response = api.settle(amount='0.05', trans_id='2156729380')
```
OR, you can capture instead
```py
api = AuthorizeNet(username='test', password='testpassword', debug=True, test=True)
gateway_response = api.capture(amount='0.05', credit_card=credit_card, billing_info=customer_data, shipping_info=None)
```
This is the standard paython response.
```py
gateway_response = {
'response_text': 'This transaction has been approved.',
'cvv_response': 'P',
'response_code': '1',
'trans_type': 'auth_only',
'amount': '0.05',
'avs_response': 'Y',
'response_reason_code': '1',
'trans_id': '2156729380',
'alt_trans_id': '',
'auth_code': 'IL2UW7',
'approved': True,
'response_time': '0.55'
}
```
Install Requirements
===========================
You need pip::
pip install -r requirements.txt
Run Tests
=========
Just run::
nosetests
Or with stats::
nosetests --quiet --with-coverage --cover-package paython
When initializing a gateway, debug will output request params, xml & response text or xml. test will use the test gateway endpoint, if there is one & will raise an error otherwise (NoTestEndpointError).
=========
Trying to make it easy to accept payments in Python. So far, we're Paython.
Currently - you can just import the gateway needed from gateways & auth/settle/capture (sale)/void/credit once you instantiate with the proper credentials.
Supported Gateways
==================
* Stripe
* Authorize.net
* Innovative Gateway Solutions (Intuit)
* First Data Global Gateway (formerly Linkpoint?)
* PlugnPay
* Samurai
Usage
===========================
It's super simple to start:
Importing what you need
```py
from paython import CreditCard, AuthorizeNet
```
Setting up a credit card
```py
credit_card = CreditCard(
number = '4111111111111111',
exp_mo = '02',
exp_yr = '2012',
first_name = 'John',
last_name = 'Doe',
cvv = '911',
strict = False
)
```
Checking to see if it's valid
```py
if not credit_card.is_valid(): return 'houston, we have a problem' # checks card number + expiration date
```
Setting up customer data to charge, not all fields are required.
```py
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')
```
Trying to authorize against gateway, options include debug output or test credentials
```py
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)
```
Keep in mind, if you authorize, you need to settle
```py
api = AuthorizeNet(username='test', password='testpassword', debug=True, test=True)
gateway_response = api.settle(amount='0.05', trans_id='2156729380')
```
OR, you can capture instead
```py
api = AuthorizeNet(username='test', password='testpassword', debug=True, test=True)
gateway_response = api.capture(amount='0.05', credit_card=credit_card, billing_info=customer_data, shipping_info=None)
```
This is the standard paython response.
```py
gateway_response = {
'response_text': 'This transaction has been approved.',
'cvv_response': 'P',
'response_code': '1',
'trans_type': 'auth_only',
'amount': '0.05',
'avs_response': 'Y',
'response_reason_code': '1',
'trans_id': '2156729380',
'alt_trans_id': '',
'auth_code': 'IL2UW7',
'approved': True,
'response_time': '0.55'
}
```
Install Requirements
===========================
You need pip::
pip install -r requirements.txt
Run Tests
=========
Just run::
nosetests
Or with stats::
nosetests --quiet --with-coverage --cover-package paython
When initializing a gateway, debug will output request params, xml & response text or xml. test will use the test gateway endpoint, if there is one & will raise an error otherwise (NoTestEndpointError).
Release files for paython 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| paython-0.0.3.tar.gz | 23.8 kB | Details |
Release files / paython-0.0.3.tar.gz
| Download URL | paython-0.0.3.tar.gz |
|---|---|
| Size | 23.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
017cbb272fedb56341a02d7a56b9e61db94b69cd178cb7f398b0ca341c3a4c63
|
|
BLAKE2b-256 checksum How to use checksums |
4ae6c7f2517cf71149f639ae5d72fb184fb333a5d1360af68089b0748d116653
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |