Skip to content

Commit 614c59d

Browse files
committed
added crypto payment hook to checkout ui
1 parent 79d6f47 commit 614c59d

File tree

2 files changed

+410
-1
lines changed

2 files changed

+410
-1
lines changed

packages/checkout/src/hooks/useCheckoutUI/index.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Collectible, CreditCardProviders } from '../../contexts/SelectPaymentMo
77

88
import { useCreditCardPayment, type UseCreditCardPaymentReturn } from './useCreditCardPayment'
99
import { useOrderSummary, type UseOrderSummaryReturn } from './useOrderSummary'
10+
import { useCryptoPayment, type UseCryptoPaymentReturn } from './useCryptoPayment'
1011

1112
interface UseCheckoutUIArgs {
1213
chain: string | number
@@ -27,6 +28,7 @@ interface UseCheckoutUIArgs {
2728
interface UseCheckoutUIReturn {
2829
orderSummary: UseOrderSummaryReturn
2930
creditCardPayment: UseCreditCardPaymentReturn
31+
cryptoPayment: UseCryptoPaymentReturn
3032
}
3133

3234
export const useCheckoutUI = ({
@@ -117,8 +119,32 @@ export const useCheckoutUI = ({
117119
errorCurrencyInfo
118120
})
119121

122+
const cryptoPayment = useCryptoPayment({
123+
chain,
124+
currencyAddress,
125+
totalPriceRaw,
126+
collectible,
127+
collectionAddress,
128+
recipientAddress,
129+
targetContractAddress,
130+
txData,
131+
transactionConfirmations,
132+
onSuccess,
133+
onError,
134+
currencyInfo,
135+
tokenMetadatas,
136+
dataCollectionInfo,
137+
isLoadingCollectionInfo,
138+
errorCollectionInfo,
139+
isLoadingTokenMetadatas,
140+
errorTokenMetadata,
141+
isLoadingCurrencyInfo,
142+
errorCurrencyInfo
143+
})
144+
120145
return {
121146
orderSummary,
122-
creditCardPayment
147+
creditCardPayment,
148+
cryptoPayment
123149
}
124150
}

0 commit comments

Comments
 (0)