|
13 | 13 | def client_secret(): |
14 | 14 | return config('appClientSecret') |
15 | 15 |
|
16 | | -# def authKey(request): |
17 | | -# signed_payload = request.GET.get('signed_payload') |
18 | | -# a = BigcommerceApi.oauth_verify_payload(signed_payload, client_secret()) |
19 | | -# store_hash = a['store_hash'] |
20 | | -# obj = get_object_or_404(Auth, storehash=store_hash) |
21 | | -# token = obj.token |
22 | | -# print(token) |
| 16 | +def authKey(request): |
| 17 | + signed_payload = request.GET.get('signed_payload') |
| 18 | + # a = BigcommerceApi.oauth_verify_payload(signed_payload, client_secret()) |
| 19 | + # store_hash = a['store_hash'] |
| 20 | + # obj = get_object_or_404(Auth, storehash=store_hash) |
| 21 | + # token = obj.token |
| 22 | + print(signed_payload) |
23 | 23 |
|
24 | 24 |
|
25 | 25 |
|
26 | 26 |
|
27 | 27 |
|
28 | 28 | # Function to GET BigComerce Orders |
29 | 29 | def orders(request): |
30 | | - print(request) |
| 30 | + authKey(request) |
31 | 31 | url = 'https://api.bigcommerce.com/stores/' + config('apiStoreHash') + '/v2/orders' |
32 | 32 | headers = {'X-Auth-Token': config('apiToken') , 'Accept': 'application/json', 'host':'api.bigcommerce.com' ,'Content-Type': 'application/json'} |
33 | 33 | r = requests.get(url, headers=headers) |
|
0 commit comments