Skip to content

Commit

Permalink
fix: ordering and body changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja committed Jun 5, 2024
1 parent 225e191 commit 3053af7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ let getPaymentMethodsFieldsOrder = paymentMethodField => {
| AddressLine2 => 5
| AddressCity => 6
| AddressState => 7
| AddressCountry(_) => 8
| AddressPincode => 9
| StateAndCity => 7
| AddressCountry(_) => 8
| CountryAndPincode(_) => 8
| AddressPincode => 9
| CryptoCurrencyNetworks => 10
| InfoElement => 99
| _ => 3
}
Expand Down
9 changes: 8 additions & 1 deletion src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,13 @@ let applePayThirdPartySdkBody = (~connectors) => [
),
]

let cryptoBody = [
("payment_method", "crypto"->JSON.Encode.string),
("payment_method_type", "crypto_currency"->JSON.Encode.string),
("payment_experience", "redirect_to_url"->JSON.Encode.string),
("payment_method_data", []->Utils.getJsonFromArrayOfJson),
]

let afterpayRedirectionBody = () => [
("payment_method", "pay_later"->JSON.Encode.string),
("payment_method_type", "afterpay_clearpay"->JSON.Encode.string),
Expand Down Expand Up @@ -1046,7 +1053,7 @@ let getPaymentBody = (
) =>
switch paymentMethodType {
| "afterpay_clearpay" => afterpayRedirectionBody()
| "crypto_currency" => []
| "crypto_currency" => cryptoBody
| "sofort" => sofortBody(~country, ~name=fullName, ~email)
| "ideal" => iDealBody(~name=fullName, ~bankName=bank)
| "eps" => epsBody(~name=fullName, ~bankName=bank)
Expand Down

0 comments on commit 3053af7

Please sign in to comment.