Skip to content

Commit

Permalink
fix(order-to-horus): add skip if without total
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Aug 13, 2024
1 parent e29eb59 commit 9bb1ed0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions functions/lib/integration/exports/orders-to-horus.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ module.exports = async ({ appSdk, storeId, auth }, orderId, opts = {}) => {
}
const { amount, number } = order

if (amount && !amount.total) {
console.log(`${logHead} skipped, order without total`)
throw new Error(skipCreate)
}

const transaction = order.transactions && order.transactions.length && order.transactions[0]
const paymentMethodCode = transaction && transaction.payment_method.code
const shippingLine = order.shipping_lines && order.shipping_lines.length && order.shipping_lines[0]
Expand Down Expand Up @@ -293,11 +298,6 @@ module.exports = async ({ appSdk, storeId, auth }, orderId, opts = {}) => {
throw new Error(skipCreate)
}

if (order.amount && !order.amount.total) {
console.log(`${logHead} skipped, order without total`)
throw new Error(skipCreate)
}

return {
order,
saleCodeHorus,
Expand Down

0 comments on commit 9bb1ed0

Please sign in to comment.