File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
packages/thirdweb/src/react/web/ui Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Respect feePayer property in Payment widgets
Original file line number Diff line number Diff line change @@ -292,7 +292,6 @@ export function BridgeOrchestrator({
292
292
amount = { state . context . destinationAmount }
293
293
client = { client }
294
294
destinationToken = { state . context . destinationToken }
295
- mode = { uiOptions . mode }
296
295
onBack = { ( ) => {
297
296
send ( { type : "BACK" } ) ;
298
297
} }
@@ -302,6 +301,7 @@ export function BridgeOrchestrator({
302
301
paymentMethod = { state . context . selectedPaymentMethod }
303
302
purchaseData = { purchaseData }
304
303
receiver = { state . context . receiverAddress }
304
+ uiOptions = { uiOptions }
305
305
/>
306
306
) }
307
307
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { Container } from "../components/basic.js";
17
17
import { Spacer } from "../components/Spacer.js" ;
18
18
import { Spinner } from "../components/Spinner.js" ;
19
19
import { Text } from "../components/text.js" ;
20
+ import type { UIOptions } from "./BridgeOrchestrator.js" ;
20
21
21
22
interface QuoteLoaderProps {
22
23
/**
@@ -78,14 +79,13 @@ interface QuoteLoaderProps {
78
79
paymentLinkId ?: string ;
79
80
80
81
/**
81
- * Fee payer for direct transfers (defaults to sender)
82
+ * UI options
82
83
*/
83
- feePayer ?: "sender" | "receiver" ;
84
- mode : "fund_wallet" | "direct_payment" | "transaction" ;
84
+ uiOptions : UIOptions ;
85
85
}
86
86
87
87
export function QuoteLoader ( {
88
- mode ,
88
+ uiOptions ,
89
89
destinationToken,
90
90
paymentMethod,
91
91
amount,
@@ -96,10 +96,14 @@ export function QuoteLoader({
96
96
onError,
97
97
purchaseData,
98
98
paymentLinkId,
99
- feePayer,
100
99
} : QuoteLoaderProps ) {
101
100
// For now, we'll use a simple buy operation
102
101
// This will be expanded to handle different bridge types based on the payment method
102
+ const feePayer =
103
+ uiOptions . mode === "direct_payment"
104
+ ? uiOptions . paymentInfo . feePayer
105
+ : undefined ;
106
+ const mode = uiOptions . mode ;
103
107
const request : BridgePrepareRequest = getBridgeParams ( {
104
108
amount,
105
109
client,
Original file line number Diff line number Diff line change @@ -380,6 +380,9 @@ export function PayEmbed(props: PayEmbedProps) {
380
380
chain = { props . payOptions . paymentInfo . chain }
381
381
client = { props . client }
382
382
description = { metadata ?. description }
383
+ feePayer = {
384
+ props . payOptions . paymentInfo . feePayer === "sender" ? "user" : "seller"
385
+ }
383
386
image = { metadata ?. image }
384
387
name = { metadata ?. name || "Checkout" }
385
388
onSuccess = { ( ) => props . payOptions ?. onPurchaseSuccess ?.( ) }
You can’t perform that action at this time.
0 commit comments