Skip to content

Commit

Permalink
fix(webhook galaxpay): remove creation date for transactionPaymentDay
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Nov 6, 2023
1 parent d2ad2cc commit 1f66c49
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions functions/routes/galaxpay/webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ exports.post = async ({ appSdk, admin }, req, res) => {
})
}

if (galaxpayHook.confirmHash) {
console.log('> ', galaxpayHook.confirmHash)
}
// if (galaxpayHook.confirmHash) {
// console.log('> confirmHash:', galaxpayHook.confirmHash)
// }

if (type === 'transaction.updateStatus') {
const subscription = collectionSubscription.doc(subscriptionId)
Expand Down Expand Up @@ -292,7 +292,7 @@ exports.post = async ({ appSdk, admin }, req, res) => {
.get(`/transactions?galaxPayIds=${GalaxPayTransaction.galaxPayId}&startAt=0&limit=1`)

galaxPayTransactionStatus = data.Transactions[0]?.status
const dateTimeTransaction = data.Transactions[0]?.paydayDate || data.Transactions[0]?.createdAt
const dateTimeTransaction = data.Transactions[0]?.paydayDate
transactionPaymentDay = dateTimeTransaction && new Date(`${dateTimeTransaction} UTC-3`)
console.log('>> galaxpay webhook: Transaction status ', galaxPayTransactionStatus, ' ', transactionPaymentDay)

Expand Down Expand Up @@ -570,7 +570,7 @@ exports.post = async ({ appSdk, admin }, req, res) => {
itemsAndAmount,
updatedAt: new Date().toISOString()
},
{ merge: true }
{ merge: true }
)

try {
Expand Down

0 comments on commit 1f66c49

Please sign in to comment.