Skip to content

Commit

Permalink
feat: HS-167: Added Open Banking UK Payment Method (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay authored Nov 23, 2023
1 parent 185c242 commit 05888e5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
21 changes: 21 additions & 0 deletions public/icons/orca.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ let paymentMethodsFields = [
fields: [InfoElement],
miniIcon: None,
},
{
paymentMethodName: "open_banking_uk",
icon: Some(icon("open_banking", ~size=19, ~width=50)),
displayName: "Open Banking UK",
fields: [Country, InfoElement],
miniIcon: Some(icon("open_banking", ~size=19)),
},
]

type required_fields = {
Expand Down
26 changes: 26 additions & 0 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,31 @@ let cardRedirectBody = () => {
]
}

let openBankingUKBody = (~country) => {
[
("payment_method", "bank_redirect"->Js.Json.string),
("payment_method_type", "open_banking_uk"->Js.Json.string),
(
"payment_method_data",
[
(
"bank_redirect",
[
(
"open_banking_uk",
[("country", country->Js.Json.string)]->Js.Dict.fromArray->Js.Json.object_,
),
]
->Js.Dict.fromArray
->Js.Json.object_,
),
]
->Js.Dict.fromArray
->Js.Json.object_,
),
]
}

let getPaymentBody = (
~paymentMethod,
~fullName,
Expand Down Expand Up @@ -1516,6 +1541,7 @@ let getPaymentBody = (
| "multibanco" => multibancoBody(~email)
| "classic" => rewardBody()
| "card_redirect" => cardRedirectBody()
| "open_banking_uk" => openBankingUKBody(~country)
| _ => []
}
}

0 comments on commit 05888e5

Please sign in to comment.