Skip to content

Commit

Permalink
fix: order_token updated in shopify (#1865)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashasvibajpai authored Feb 14, 2023
1 parent ae627d3 commit 7fc608e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/v0/sources/shopify/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ const processEvent = (inputEvent) => {
// attaching cart, checkout and order tokens in context object
message.setProperty(`context.cart_token`, event.cart_token);
message.setProperty(`context.checkout_token`, event.checkout_token);
message.setProperty(`context.order_token`, event.order_token);
if (shopifyTopic === 'orders_updated') {
message.setProperty(`context.order_token`, event.token);
}

message = removeUndefinedAndNullValues(message);
stats.increment('shopify_server_side_identifier_event', 1, {
Expand Down
3 changes: 2 additions & 1 deletion test/__tests__/data/shopify_source_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
},
"topic": "orders_updated",
"cart_token": "7ed2aa8c6e74666534b023e197fffd41",
"checkout_token": "7ed2aa8c6e74666534b023e197fffd41"
"checkout_token": "7ed2aa8c6e74666534b023e197fffd41",
"order_token": "4e72b2e04f9e9faa1ec4f8bdb5a36502"
},
"integrations": {
"SHOPIFY": true
Expand Down

0 comments on commit 7fc608e

Please sign in to comment.