Skip to content

Commit 1a7c100

Browse files
committed
fix: passed currency in paypal sdk script from payments call
1 parent ec88de9 commit 1a7c100

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Payments/PaypalSDK.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ let make = (~sessionObj: SessionsType.token) => {
3131
Window.document(Window.window)->Window.getElementById("braintree-checkout")->Nullable.toOption
3232
let clientScript =
3333
Window.document(Window.window)->Window.getElementById("braintree-client")->Nullable.toOption
34+
let paymentMethodListValue = Recoil.useRecoilValueFromAtom(PaymentUtils.paymentMethodListValue)
3435

3536
let options = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom)
3637
let (_, _, buttonType, _) = options.wallets.style.type_
@@ -69,7 +70,7 @@ let make = (~sessionObj: SessionsType.token) => {
6970

7071
let mountPaypalSDK = () => {
7172
let clientId = sessionObj.token
72-
let paypalScriptURL = `https://www.paypal.com/sdk/js?client-id=${clientId}&components=buttons,hosted-fields`
73+
let paypalScriptURL = `https://www.paypal.com/sdk/js?client-id=${clientId}&components=buttons,hosted-fields&currency=${paymentMethodListValue.currency}`
7374
loggerState.setLogInfo(~value="PayPal SDK Script Loading", ~eventName=PAYPAL_SDK_FLOW)
7475
let paypalScript = Window.createElement("script")
7576
paypalScript->Window.elementSrc(paypalScriptURL)

0 commit comments

Comments
 (0)