-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
67 lines (60 loc) · 1.83 KB
/
test.py
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
62
63
64
65
66
67
# import os
# from sendgrid import SendGridAPIClient
# from sendgrid.helpers.mail import Mail
# message = Mail(
# from_email='[email protected]',
# to_emails='[email protected]',
# subject='Sending with Twilio SendGrid is Fun',
# html_content='<strong>and easy to do anywhere, even with Python</strong>')
# try:
# print('api_key: ', os.environ.get('SENDGRID_API_KEY'))
# sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
# response = sg.send(message)
# print(response.status_code)
# print(response.body)
# print(response.headers)
# except Exception as e:
# print(e)
# import schedule
# import time
# def job():
# print("I'm working...")
# schedule.every(10).seconds.do(job)
# # schedule.every(10).minutes.do(job)
# # schedule.every().hour.do(job)
# # schedule.every().day.at("10:30").do(job)
# # schedule.every().monday.do(job)
# # schedule.every().wednesday.at("13:15").do(job)
# while True:
# schedule.run_pending()
# time.sleep(1)
import json
values = {
"merchantRefNum": "merchant 03.24.17_3",
"amount": 1000,
"settleWithAuth": False,
"dupCheck": False,
"card": {
"cardNum": "4111111111111111",
"cardExpiry": {
"month": 9,
"year": 2020
},
"cvv": "123"
},
"profile": {
"firstName": "Joe",
"lastName": "Smith",
"email": "[email protected]"
},
"billingDetails": {
"street": "100 Queen Street West",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zip": "M5H 2N2"
},
"customerIp": "204.91.0.12",
"description": "Video purchase"
}
print(type(json.dumps(values)))