forked from getyouridx/pychargify
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
62 lines (43 loc) · 1.68 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Chargify API wrapper for Python
pychargify
This is a Python wrapper for the Chargify API. It allows you to interface with the Chargify API using a simple object orientated syntax.
Add customer example
chargify = Chargify('YOUR-API-KEY', 'YOUR-SUB-DOMAIN')
customer = chargify.Customer()
customer.first_name = 'John'
customer.last_name = 'Doe'
customer.email = '[email protected]'
customer.save()
Create a subscription example:
customer = chargify.Customer('customer_attributes')
customer.first_name = 'Paul'
customer.last_name = 'Trippett'
customer.email = '[email protected]'
creditcard = chargify.CreditCard('credit_card_attributes')
creditcard.full_number = 1
creditcard.expiration_month = 10
creditcard.expiration_year = 2020
subscription = chargify.Subscription()
subscription.product_handle = 'fhaar-mini'
subscription.customer = customer
subscription.credit_card = creditcard
subscription.save()
See tests.py for more usage examples.
Installation
Place this library in your project and import the module
from pychargify.api import *
Requirements
This library has no special requirements
Usage
Simply import this library before you use it:
from pychargify.api import *
Now you'll have access to classes the interact with the Chargify API, such as:
Chargify
ChargifyProduct
ChargifyCustomer
ChargifiySubscription
ChargifiyCreditCard
Chargify is a helper class that makes initialization easier of the ChargifyProduct, ChargifyCustomer, ChargifiySubscription and ChargifiyCreditCard classes
Contributors
Paul Trippett (pyhub) - Base Development
mrtron - Several Updates and bug fixes to pychargify library