Skip to content

Commit

Permalink
feat: added new redirection payment method local bank transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay committed Apr 12, 2024
1 parent bb31a17 commit 7e39d51
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,13 @@ let paymentMethodsFields = [
fields: [InfoElement],
miniIcon: None,
},
{
paymentMethodName: "local_bank_transfer_transfer",
fields: [InfoElement],
icon: Some(icon("bank", ~size=19)),
displayName: "Local Bank Transfer",
miniIcon: None,
},
]

type required_fields = {
Expand Down Expand Up @@ -579,6 +586,7 @@ let dynamicFieldsEnabledPaymentMethods = [
"sofort",
"pix_transfer",
"giropay",
"local_bank_transfer_transfer",
]

let getIsBillingField = requiredFieldType => {
Expand Down
21 changes: 21 additions & 0 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,26 @@ let pixTransferBody = () => {
]
}

let localBankTransferBody = () => {
[
("payment_method", "bank_transfer"->JSON.Encode.string),
("payment_method_type", "local_bank_transfer"->JSON.Encode.string),
(
"payment_method_data",
[
(
"bank_transfer",
[("local_bank_transfer", Dict.make()->JSON.Encode.object)]
->Dict.fromArray
->JSON.Encode.object,
),
]
->Dict.fromArray
->JSON.Encode.object,
),
]
}

let getPaymentBody = (
~paymentMethod,
~fullName,
Expand Down Expand Up @@ -1616,6 +1636,7 @@ let getPaymentBody = (
| "open_banking_uk" => openBankingUKBody()
| "evoucher" => rewardBody(~paymentMethodType=paymentMethod)
| "pix_transfer" => pixTransferBody()
| "local_bank_transfer_transfer" => localBankTransferBody()
| _ => []
}
}

0 comments on commit 7e39d51

Please sign in to comment.