Skip to content

Commit

Permalink
fix: HS-167: Added Dynamic Fields for Open Banking Uk (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay authored Jan 23, 2024
1 parent 025ac7a commit 318272f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ let paymentMethodsFields = [
paymentMethodName: "open_banking_uk",
icon: Some(icon("open_banking", ~size=19, ~width=50)),
displayName: "Open Banking",
fields: [Country, InfoElement],
fields: [InfoElement],
miniIcon: Some(icon("open_banking", ~size=19)),
},
{
Expand Down Expand Up @@ -556,6 +556,7 @@ let dynamicFieldsEnabledPaymentMethods = [
"google_pay",
"apple_pay",
"bancontact_card",
"open_banking_uk",
]

let getIsBillingField = requiredFieldType => {
Expand Down
11 changes: 3 additions & 8 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ let cardRedirectBody = () => {
]
}

let openBankingUKBody = (~country) => {
let openBankingUKBody = () => {
[
("payment_method", "bank_redirect"->Js.Json.string),
("payment_method_type", "open_banking_uk"->Js.Json.string),
Expand All @@ -1439,12 +1439,7 @@ let openBankingUKBody = (~country) => {
[
(
"bank_redirect",
[
(
"open_banking_uk",
[("country", country->Js.Json.string)]->Js.Dict.fromArray->Js.Json.object_,
),
]
[("open_banking_uk", Js.Dict.empty()->Js.Json.object_)]
->Js.Dict.fromArray
->Js.Json.object_,
),
Expand Down Expand Up @@ -1516,7 +1511,7 @@ let getPaymentBody = (
| "multibanco" => multibancoBody(~email)
| "classic" => rewardBody(~paymentMethodType=paymentMethod)
| "card_redirect" => cardRedirectBody()
| "open_banking_uk" => openBankingUKBody(~country)
| "open_banking_uk" => openBankingUKBody()
| "evoucher" => rewardBody(~paymentMethodType=paymentMethod)
| _ => []
}
Expand Down

0 comments on commit 318272f

Please sign in to comment.