Skip to content

Commit e956628

Browse files
authored
fix: fixed crypto pay body payload (#919)
1 parent 21864ad commit e956628

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Utilities/PaymentBody.res

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,14 @@ let applePayThirdPartySdkBody = (~connectors) => [
569569
),
570570
]
571571

572-
let cryptoBody = [
572+
let cryptoBody = () => [
573573
("payment_method", "crypto"->JSON.Encode.string),
574574
("payment_method_type", "crypto_currency"->JSON.Encode.string),
575575
("payment_experience", "redirect_to_url"->JSON.Encode.string),
576-
("payment_method_data", []->Utils.getJsonFromArrayOfJson),
576+
(
577+
"payment_method_data",
578+
[("crypto", []->Utils.getJsonFromArrayOfJson)]->Utils.getJsonFromArrayOfJson,
579+
),
577580
]
578581

579582
let afterpayRedirectionBody = () => [
@@ -997,7 +1000,7 @@ let getPaymentBody = (
9971000
) =>
9981001
switch paymentMethodType {
9991002
| "afterpay_clearpay" => afterpayRedirectionBody()
1000-
| "crypto_currency" => cryptoBody
1003+
| "crypto_currency" => cryptoBody()
10011004
| "sofort" => sofortBody(~country, ~name=fullName, ~email)
10021005
| "ideal" => iDealBody(~name=fullName, ~bankName=bank)
10031006
| "eps" => epsBody(~name=fullName, ~bankName=bank)

0 commit comments

Comments
 (0)