-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample_create_card.py
More file actions
42 lines (36 loc) · 967 Bytes
/
example_create_card.py
File metadata and controls
42 lines (36 loc) · 967 Bytes
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
import sys
import chargeover
import pprint
# For authentication, fill in these values from your ChargeOver
# server information under "Configuraion->API and Webhooks"
endpoint =
username =
password =
# Set this to True to use "COv1 Signature" authorization
key_auth = False
co = chargeover.ChargeOver(
endpoint,
username,
password,
key_auth = key_auth)
# Our user/contact data
data = {
'customer_id': 71, # This is the customer id # this card should be attached to
'number': "1234 5678 9101 1121",
'expdate_year': '2017',
'expdate_month': '05',
'phone': '616-867-5309',
'name': 'Bob Dobbs',
'address': '123 E TheWay Drive',
'city': 'Chicago',
'state': 'IL',
'postcode': '60606',
'country': 'United States'
}
# create a new card
id = co.create('creditcard', data)
if id is None:
pprint.pprint(co.get_last_response())
exit()
else:
print("Our new creditcard ID is: " + str(id))