forked from stripe/stripe-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.py
More file actions
33 lines (27 loc) · 865 Bytes
/
Copy pathproxy.py
File metadata and controls
33 lines (27 loc) · 865 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
import stripe
stripe.api_key = 'tGN0bIwXnHdwOa85VABjPdSn8nWY7G7I'
print( "Attempting charge..." )
stripe.proxy = {
"http": "http://<user>:<pass>@<proxy>:<port>",
"https": "http://<user>:<pass>@<proxy>:<port>" }
clients = (
stripe.http_client.RequestsClient(
verify_ssl_certs= stripe.verify_ssl_certs,
proxy= stripe.proxy )
,
stripe.http_client.PycurlClient(
verify_ssl_certs= stripe.verify_ssl_certs,
proxy= stripe.proxy )
,
stripe.http_client.Urllib2Client(
verify_ssl_certs= stripe.verify_ssl_certs,
proxy= stripe.proxy ) )
for c in clients:
stripe.default_http_client = c
resp = stripe.Charge.create(
amount=200,
currency='usd',
card='tok_visa',
description='customer@gmail.com'
)
print( 'Success: %s, %r' % ( c.name, resp, ) )