Last active
June 11, 2021 19:02
-
-
Save anniethiessen/035aebed822cde3f10fced6b9620f9a0 to your computer and use it in GitHub Desktop.
Airtable automation to create record on Shopify Webhook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // trigger: When webhook received | |
| // action: run script | |
| let env = input.config(); | |
| // TODO: verify webhook | |
| // python ex | |
| // hmac.compare_digest( | |
| // base64.b64encode( | |
| // hmac.new( | |
| // env.shopifyWebhookSignature, | |
| // request.get_data().encode('utf-8'), | |
| // hashlib.sha256 | |
| // ).digest() | |
| // ), | |
| // request.headers.get('X-Shopify-Hmac-SHA256').encode('utf-8') | |
| // ) | |
| var tableName = 'Orders'; | |
| let table = base.getTable(tableName); | |
| await table.createRecordAsync({ | |
| 'ID': env.orderId, | |
| 'Order Number': env.orderNumber | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment