From acfe859f2f0fd199ae273f0a6ed6dc2f76db02b2 Mon Sep 17 00:00:00 2001 From: samuelea Date: Fri, 13 Dec 2024 11:10:59 -0500 Subject: [PATCH] completed condition --- examples/react/src/components/Connected.tsx | 4 ++-- .../checkout/src/views/PendingCreditCardTransaction.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/react/src/components/Connected.tsx b/examples/react/src/components/Connected.tsx index e68a5ab0..3a293cd7 100644 --- a/examples/react/src/components/Connected.tsx +++ b/examples/react/src/components/Connected.tsx @@ -354,9 +354,9 @@ export const Connected = () => { creditCardProviders: ['transak'], transakConfig: { // contractId for native sale contract: '0xf0056139095224f4eec53c578ab4de1e227b9597' - // contractId: '674eb55a3d739107bbd18ecb', + contractId: '674eb55a3d739107bbd18ecb', // contractId for ERC20 sale contract: '0xe65b75eb7c58ffc0bf0e671d64d0e1c6cd0d3e5b' - contractId: '674eb5613d739107bbd18ed2', + // contractId: '674eb5613d739107bbd18ed2', apiKey: '5911d9ec-46b5-48fa-a755-d59a715ff0cf' }, isDev: false, diff --git a/packages/checkout/src/views/PendingCreditCardTransaction.tsx b/packages/checkout/src/views/PendingCreditCardTransaction.tsx index 2ee8a198..c289e9fe 100644 --- a/packages/checkout/src/views/PendingCreditCardTransaction.tsx +++ b/packages/checkout/src/views/PendingCreditCardTransaction.tsx @@ -64,7 +64,6 @@ export const PendingCreditCardTransactionTransak = () => { const transakCallData = encodeURIComponent(btoa(String.fromCharCode.apply(null, pakoData))) const price = Number(formatUnits(BigInt(creditCardCheckout.currencyQuantity), Number(creditCardCheckout.currencyDecimals))) - const formattedQuantity = Number(creditCardCheckout.currencyQuantity) const transakNftDataJson = JSON.stringify([ { @@ -73,11 +72,12 @@ export const PendingCreditCardTransactionTransak = () => { collectionAddress: creditCardCheckout.nftAddress, tokenID: [creditCardCheckout.nftId], price: [price], - quantity: formattedQuantity, + quantity: Number(creditCardCheckout.nftQuantity), nftType: collectionInfo?.type || 'ERC721' } ]) + console.log('transakNftDataJson', JSON.parse(transakNftDataJson)) const transakNftData = encodeURIComponent(btoa(transakNftDataJson)) const estimatedGasLimit = '500000' @@ -99,7 +99,7 @@ export const PendingCreditCardTransactionTransak = () => { const readMessage = (message: any) => { if (message.source !== transakIframe) return - if (message?.data?.event_id === 'TRANSAK_ORDER_SUCCESSFUL') { + if (message?.data?.event_id === 'TRANSAK_ORDER_SUCCESSFUL' && message?.data?.data?.status === 'COMPLETED') { console.log('Order Data: ', message?.data?.data) const txHash = message?.data?.data?.transactionHash || ''