Skip to content

Commit

Permalink
fix(webhook-galaxpay): fix for not resetting itemsAndAmount
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Jan 10, 2024
1 parent a7d7fce commit b2f67af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions functions/routes/galaxpay/webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ exports.post = async ({ appSdk, admin }, req, res) => {
let { itemsAndAmount } = documentSnapshot.data()
try {
const transactionDoc = (await collectionTransactions.doc(`${storeId}-${GalaxPayTransaction.galaxPayId}`).get())?.data()
itemsAndAmount = transactionDoc?.itemsAndAmount
console.log('>> items to transaction')
if(transactionDoc && transactionDoc.itemsAndAmount){
itemsAndAmount = transactionDoc?.itemsAndAmount
console.log('>> items to transaction')
}
} catch (err) {
console.warn(err)
}
Expand Down

0 comments on commit b2f67af

Please sign in to comment.