@ns8/ns8-shopify-switches
Advanced tools
Comparing version 1.0.164 to 1.0.165
@@ -171,2 +171,7 @@ "use strict"; | ||
const { kind, payment_details, status, source_name, } = transaction; | ||
if (kind === 'authorization' && !payment_details) { | ||
console.log('authorization without payment_details', JSON.stringify({ | ||
contextData: transaction, | ||
})); | ||
} | ||
let shouldProcessOrder = false; | ||
@@ -197,2 +202,12 @@ if (!payment_details && kind !== 'void' && kind !== 'refund' && (status === 'pending' || status === 'success')) { | ||
const { id, name, currency, billing_address, shipping_address, customer, total_price, line_items = [], created_at, } = shopifyOrder; | ||
if (switchContext.data.kind === 'capture' && | ||
shopifyTransactionList.every((transaction) => transaction.kind !== 'authorization')) { | ||
console.log('capture without authorization', JSON.stringify({ | ||
orderId: id, | ||
orderName: name, | ||
domain: switchContext.merchant.domain, | ||
contextData: switchContext.data, | ||
transactions: shopifyTransactionList, | ||
})); | ||
} | ||
if (clientDetails instanceof Error) { | ||
@@ -199,0 +214,0 @@ console.log(clientDetails); |
{ | ||
"name": "@ns8/ns8-shopify-switches", | ||
"version": "1.0.164", | ||
"version": "1.0.165", | ||
"description": "Custom switches for the shopify integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
78718
931