-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_experiment.py
More file actions
48 lines (43 loc) · 1.02 KB
/
json_experiment.py
File metadata and controls
48 lines (43 loc) · 1.02 KB
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
import socket
from flask import jsonify
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
order = {
"customer": {
"ZIPCODE":11779,
"PHONE":1234567890,
"ADDRESS2":" ",
"STATE":"VA",
"ADDRESS1":"123 Big St",
"NAME":"John Doe",
"COUNTRY":"US",
"IP":ip_address,
"EMAIL":"imaginologist@gmail.com",
"CITY":"Richmond"
},
"products": [
{
"PRICE":39.95,
"CARDMESSAGE":"This is a card message",
"RECIPIENT":{
"ZIPCODE":11779,
"PHONE":1234567890,
"ADDRESS2":" ",
"STATE":"DE",
"ADDRESS1":"123 Big St",
"NAME":"Howdy Doody",
"COUNTRY":"US",
"INSTITUTION":" ",
"CITY":"Wilmington"
},
"DELIVERYDATE":"2016-02-29",
"CODE":"F1-509"
}
],
"ccinfo": {
"AUTHORIZENET_TOKEN":"****"
},
"ordertotal":58.79
}
print(order)
""" NOTES: CAST ZIPCODE AS TEXT!!! """