Skip to content

Commit

Permalink
completed condition
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed Dec 13, 2024
1 parent 7d0b862 commit acfe859
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/react/src/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions packages/checkout/src/views/PendingCreditCardTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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([
{
Expand All @@ -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'
Expand All @@ -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 || ''

Expand Down

0 comments on commit acfe859

Please sign in to comment.