-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
executable file
·33 lines (27 loc) · 833 Bytes
/
Copy pathexample.py
File metadata and controls
executable file
·33 lines (27 loc) · 833 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
#!/usr/bin/env python
import optparse
from stripe.stripe import Stripe
from stripe.charges import Charges
def main():
#p = optparse.OptionParser()
#p.add_option('--person', '-p', default="world")
#options, arguments = p.parse_args()
stripe = Stripe("<API_TOKEN>")
charges = Charges(stripe)
chargeInfo = {
"amount": 400,
"currency": "usd",
"card": {
"number": "4242424242424242",
"exp_month": 12,
"exp_year": 2020,
},
"description": "Charge for python-stripe example"
}
charge = charges.charge(chargeInfo)
#chargeResponse = charges.getCharge(response["id"]);
#response = charges.listCharges()
response = charges.refund(charge["id"], charge["amount"])
print response
if __name__ == '__main__':
main()