Skip to content

Commit

Permalink
feat: added 3ds connector for click to pay - mastercard (#1974)
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Dec 24, 2024
1 parent 9c1005b commit 09f68c9
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 3 deletions.
43 changes: 43 additions & 0 deletions public/hyperswitch/Gateway/CTP_MASTERCARD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/hyperswitch/wasm/euclid_bg.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/screens/Connectors/ConnectorTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ type payoutProcessorTypes =
| STRIPE
| WISE

type threeDsAuthenticatorTypes = THREEDSECUREIO | NETCETERA
type threeDsAuthenticatorTypes = THREEDSECUREIO | NETCETERA | CLICK_TO_PAY_MASTERCARD

type frmTypes =
| Signifyd
Expand Down
27 changes: 25 additions & 2 deletions src/screens/Connectors/ConnectorUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let payoutConnectorList: array<connectorTypes> = [
let threedsAuthenticatorList: array<connectorTypes> = [
ThreeDsAuthenticator(THREEDSECUREIO),
ThreeDsAuthenticator(NETCETERA),
ThreeDsAuthenticator(CLICK_TO_PAY_MASTERCARD),
]

let threedsAuthenticatorListForLive: array<connectorTypes> = [ThreeDsAuthenticator(NETCETERA)]
Expand Down Expand Up @@ -432,6 +433,10 @@ let netceteraInfo = {
description: "Cost-effective 3DS authentication platform ensuring security. Elevate checkout experience, boost conversion rates, and maintain regulatory compliance with Netcetera",
}

let clickToPayInfo = {
description: "Secure online payment method that allows customers to make purchases without manually entering their card details or reaching for their card",
}

let unknownConnectorInfo = {
description: "unkown connector",
}
Expand Down Expand Up @@ -624,6 +629,7 @@ let getThreeDsAuthenticatorNameString = (threeDsAuthenticator: threeDsAuthentica
switch threeDsAuthenticator {
| THREEDSECUREIO => "threedsecureio"
| NETCETERA => "netcetera"
| CLICK_TO_PAY_MASTERCARD => "ctp_mastercard"
}

let getFRMNameString = (frm: frmTypes) => {
Expand Down Expand Up @@ -750,6 +756,7 @@ let getConnectorNameTypeFromString = (connector, ~connectorType=ConnectorTypes.P
switch connector {
| "threedsecureio" => ThreeDsAuthenticator(THREEDSECUREIO)
| "netcetera" => ThreeDsAuthenticator(NETCETERA)
| "ctp_mastercard" => ThreeDsAuthenticator(CLICK_TO_PAY_MASTERCARD)
| _ => UnknownConnector("Not known")
}
| FRMPlayer =>
Expand Down Expand Up @@ -860,6 +867,7 @@ let getThreedsAuthenticatorInfo = threeDsAuthenticator =>
switch threeDsAuthenticator {
| THREEDSECUREIO => threedsecuredotioInfo
| NETCETERA => netceteraInfo
| CLICK_TO_PAY_MASTERCARD => clickToPayInfo
}
let getFrmInfo = frm =>
switch frm {
Expand Down Expand Up @@ -1257,8 +1265,22 @@ let validateConnectorRequiredFields = (
| Toggle => valuesFlattenJson->getBool(`${key}`, false)->getStringFromBool
| _ => ""
}
if value->String.length === 0 && required {
Dict.set(newDict, key, `Please enter ${label}`->JSON.Encode.string)

let multiSelectValue = switch \"type" {
| MultiSelect => valuesFlattenJson->getArrayFromDict(key, [])
| _ => []
}

switch \"type" {
| Text | Select | Toggle =>
if value->isEmptyString && required {
Dict.set(newDict, key, `Please enter ${label}`->JSON.Encode.string)
}
| MultiSelect =>
if multiSelectValue->Array.length === 0 && required {
Dict.set(newDict, key, `Please enter ${label}`->JSON.Encode.string)
}
| _ => ()
}
})
}
Expand Down Expand Up @@ -1692,6 +1714,7 @@ let getDisplayNameForThreedsAuthenticator = threeDsAuthenticator =>
switch threeDsAuthenticator {
| THREEDSECUREIO => "3dsecure.io"
| NETCETERA => "Netcetera"
| CLICK_TO_PAY_MASTERCARD => "Unified Click to Pay"
}

let getDisplayNameForFRMConnector = frmConnector =>
Expand Down

0 comments on commit 09f68c9

Please sign in to comment.