Skip to content

Commit

Permalink
feat: HS-170: Added Card Redirect Payment Method Type (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay authored Nov 22, 2023
1 parent ff7c2e8 commit e9c310b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,13 @@ let paymentMethodsFields = [
fields: [Email, InfoElement],
miniIcon: None,
},
{
paymentMethodName: "card_redirect",
icon: Some(icon("default-card", ~size=19)),
displayName: "Card",
fields: [InfoElement],
miniIcon: None,
},
]

type required_fields = {
Expand Down
19 changes: 19 additions & 0 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,24 @@ let multibancoBody = (~email) => [
),
]

let cardRedirectBody = () => {
[
("payment_method", "card_redirect"->Js.Json.string),
("payment_method_type", "card_redirect"->Js.Json.string),
(
"payment_method_data",
[
(
"card_redirect",
[("card_redirect", Js.Dict.empty()->Js.Json.object_)]->Js.Dict.fromArray->Js.Json.object_,
),
]
->Js.Dict.fromArray
->Js.Json.object_,
),
]
}

let getPaymentBody = (
~paymentMethod,
~fullName,
Expand Down Expand Up @@ -1497,6 +1515,7 @@ let getPaymentBody = (
| "atome" => atomeBody()
| "multibanco" => multibancoBody(~email)
| "classic" => rewardBody()
| "card_redirect" => cardRedirectBody()
| _ => []
}
}

0 comments on commit e9c310b

Please sign in to comment.