Skip to content

Commit

Permalink
chore: enabled dynamic fields for multibanco bank transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
sakksham7 committed Nov 8, 2024
1 parent bb1990c commit 1df97dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ let paymentMethodsFields = [
paymentMethodName: "multibanco_transfer",
icon: Some(icon("multibanco", ~size=19)),
displayName: "Multibanco",
fields: [Email, InfoElement],
fields: [InfoElement],
miniIcon: None,
},
{
Expand Down
1 change: 1 addition & 0 deletions src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ let dynamicFieldsEnabledPaymentMethods = [
"ach",
"bacs",
"pay_bright",
"multibanco_transfer",
]

let getName = (item: PaymentMethodsRecord.required_fields, field: RecoilAtomTypes.field) => {
Expand Down
20 changes: 1 addition & 19 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -842,23 +842,6 @@ let thailandOBBody = (~bank) => [
),
]

let multibancoBody = (~email) => [
("payment_method", "bank_transfer"->JSON.Encode.string),
("payment_method_type", "multibanco"->JSON.Encode.string),
(
"payment_method_data",
[
("billing", [("email", email->JSON.Encode.string)]->Utils.getJsonFromArrayOfJson),
(
"bank_transfer",
[
("multibanco_bank_transfer", Dict.make()->JSON.Encode.object),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]

let pazeBody = (~completeResponse) => {
open Utils
let pazeCompleteResponse =
Expand Down Expand Up @@ -901,7 +884,7 @@ let appendRedirectPaymentMethods = [
]

let appendBankeDebitMethods = ["sepa"]
let appendBankTransferMethods = ["sepa", "ach", "bacs"]
let appendBankTransferMethods = ["sepa", "ach", "bacs", "multibanco"]

let getPaymentMethodSuffix = (~paymentMethodType, ~paymentMethod, ~isQrPaymentMethod) => {
if isQrPaymentMethod {
Expand Down Expand Up @@ -1008,7 +991,6 @@ let getPaymentBody = (
| "przelewy24" => p24Body(~email)
| "online_banking_fpx" => fpxOBBody(~bank)
| "online_banking_thailand" => thailandOBBody(~bank)
| "multibanco_transfer" => multibancoBody(~email)
| "classic"
| "evoucher" =>
rewardBody(~paymentMethodType)
Expand Down

0 comments on commit 1df97dc

Please sign in to comment.