File tree 2 files changed +14
-5
lines changed
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Add support for filtering fiat payment providers in PayEmbed
Original file line number Diff line number Diff line change @@ -86,10 +86,14 @@ export function FiatScreenContent(props: {
86
86
const supportedProviders = ( ( ) => {
87
87
if ( ! buyWithFiatOptions ) return [ ...FiatProviders ] ;
88
88
const options = buyWithFiatOptions ?. supportedProviders ?? [ ] ;
89
- return options . length > 0 &&
90
- ( ! preferredProvider || options . includes ( preferredProvider ) )
91
- ? options
92
- : [ ...FiatProviders ] ;
89
+ const optionsWithPreferred =
90
+ options . length > 0
91
+ ? new Set ( [
92
+ ...( preferredProvider ? [ preferredProvider ] : [ ] ) ,
93
+ ...options ,
94
+ ] )
95
+ : FiatProviders ;
96
+ return Array . from ( optionsWithPreferred ) ;
93
97
} ) ( ) ;
94
98
95
99
const fiatQuoteQuery = useBuyWithFiatQuote (
@@ -106,8 +110,8 @@ export function FiatScreenContent(props: {
106
110
isTestMode : buyWithFiatOptions ?. testMode ,
107
111
purchaseData : props . payOptions . purchaseData ,
108
112
fromAddress : payer . account . address ,
109
- preferredProvider : preferredProvider ,
110
113
paymentLinkId : paymentLinkId ,
114
+ preferredProvider : preferredProvider ?? "COINBASE" ,
111
115
}
112
116
: undefined ,
113
117
) ;
You can’t perform that action at this time.
0 commit comments