Skip to content

Commit

Permalink
feat(connector): Integrate PAZE Wallet (#6030)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshu-iiitu authored Oct 8, 2024
1 parent 86a43b9 commit 535f2f1
Show file tree
Hide file tree
Showing 67 changed files with 837 additions and 85 deletions.
71 changes: 71 additions & 0 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -5592,6 +5592,11 @@
"type": "object",
"description": "This field contains the Samsung Pay certificates and credentials",
"nullable": true
},
"paze": {
"type": "object",
"description": "This field contains the Paze certificates and credentials",
"nullable": true
}
},
"additionalProperties": false
Expand Down Expand Up @@ -12548,6 +12553,7 @@
"open_banking_uk",
"pay_bright",
"paypal",
"paze",
"pix",
"pay_safe_card",
"przelewy24",
Expand Down Expand Up @@ -17138,6 +17144,39 @@
}
}
},
"PazeSessionTokenResponse": {
"type": "object",
"required": [
"client_id",
"client_name",
"client_profile_id"
],
"properties": {
"client_id": {
"type": "string",
"description": "Paze Client ID"
},
"client_name": {
"type": "string",
"description": "Client Name to be displayed on the Paze screen"
},
"client_profile_id": {
"type": "string",
"description": "Paze Client Profile ID"
}
}
},
"PazeWalletData": {
"type": "object",
"required": [
"complete_response"
],
"properties": {
"complete_response": {
"type": "string"
}
}
},
"PhoneDetails": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -19377,6 +19416,27 @@
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/PazeSessionTokenResponse"
},
{
"type": "object",
"required": [
"wallet_name"
],
"properties": {
"wallet_name": {
"type": "string",
"enum": [
"paze"
]
}
}
}
]
},
{
"type": "object",
"required": [
Expand Down Expand Up @@ -20551,6 +20611,17 @@
}
}
},
{
"type": "object",
"required": [
"paze"
],
"properties": {
"paze": {
"$ref": "#/components/schemas/PazeWalletData"
}
}
},
{
"type": "object",
"required": [
Expand Down
71 changes: 71 additions & 0 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -8884,6 +8884,11 @@
"type": "object",
"description": "This field contains the Samsung Pay certificates and credentials",
"nullable": true
},
"paze": {
"type": "object",
"description": "This field contains the Paze certificates and credentials",
"nullable": true
}
},
"additionalProperties": false
Expand Down Expand Up @@ -16185,6 +16190,7 @@
"open_banking_uk",
"pay_bright",
"paypal",
"paze",
"pix",
"pay_safe_card",
"przelewy24",
Expand Down Expand Up @@ -20883,6 +20889,39 @@
}
}
},
"PazeSessionTokenResponse": {
"type": "object",
"required": [
"client_id",
"client_name",
"client_profile_id"
],
"properties": {
"client_id": {
"type": "string",
"description": "Paze Client ID"
},
"client_name": {
"type": "string",
"description": "Client Name to be displayed on the Paze screen"
},
"client_profile_id": {
"type": "string",
"description": "Paze Client Profile ID"
}
}
},
"PazeWalletData": {
"type": "object",
"required": [
"complete_response"
],
"properties": {
"complete_response": {
"type": "string"
}
}
},
"PhoneDetails": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -23139,6 +23178,27 @@
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/PazeSessionTokenResponse"
},
{
"type": "object",
"required": [
"wallet_name"
],
"properties": {
"wallet_name": {
"type": "string",
"enum": [
"paze"
]
}
}
}
]
},
{
"type": "object",
"required": [
Expand Down Expand Up @@ -24395,6 +24455,17 @@
}
}
},
{
"type": "object",
"required": [
"paze"
],
"properties": {
"paze": {
"$ref": "#/components/schemas/PazeWalletData"
}
}
},
{
"type": "object",
"required": [
Expand Down
5 changes: 5 additions & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ debit = { currency = "USD,GBP,EUR" }
apple_pay = { currency = "USD,GBP,EUR" }
google_pay = { currency = "USD,GBP,EUR" }
samsung_pay = { currency = "USD,GBP,EUR" }
paze = { currency = "USD" }

[pm_filters.stax]
credit = { currency = "USD" }
Expand Down Expand Up @@ -581,6 +582,10 @@ apple_pay_ppc_key = "APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_KEY" # Private key
apple_pay_merchant_cert = "APPLE_PAY_MERCHNAT_CERTIFICATE" # Merchant Certificate provided by Apple Pay (https://developer.apple.com/) Certificates, Identifiers & Profiles > Apple Pay Merchant Identity Certificate
apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY" # Private key generated by RSA:2048 algorithm. Refer Hyperswitch Docs (https://docs.hyperswitch.io/hyperswitch-cloud/payment-methods-setup/wallets/apple-pay/ios-application/) to generate the private key

[paze_decrypt_keys]
paze_private_key = "PAZE_PRIVATE_KEY" # Base 64 Encoded Private Key File cakey.pem generated for Paze -> Command to create private key: openssl req -newkey rsa:2048 -x509 -keyout cakey.pem -out cacert.pem -days 365
paze_private_key_passphrase = "PAZE_PRIVATE_KEY_PASSPHRASE" # PEM Passphrase used for generating Private Key File cakey.pem

[applepay_merchant_configs]
# Run below command to get common merchant identifier for applepay in shell
#
Expand Down
4 changes: 4 additions & 0 deletions config/deployments/env_specific.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ apple_pay_ppc_key = "APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_KEY" # Private key
apple_pay_merchant_cert = "APPLE_PAY_MERCHNAT_CERTIFICATE" # Merchant Certificate provided by Apple Pay (https://developer.apple.com/) Certificates, Identifiers & Profiles > Apple Pay Merchant Identity Certificate
apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY" # Private key generated by RSA:2048 algorithm. Refer Hyperswitch Docs (https://docs.hyperswitch.io/hyperswitch-cloud/payment-methods-setup/wallets/apple-pay/ios-application/) to generate the private key

[paze_decrypt_keys]
paze_private_key = "PAZE_PRIVATE_KEY" # Base 64 Encoded Private Key File cakey.pem generated for Paze -> Command to create private key: openssl req -newkey rsa:2048 -x509 -keyout cakey.pem -out cacert.pem -days 365
paze_private_key_passphrase = "PAZE_PRIVATE_KEY_PASSPHRASE" # PEM Passphrase used for generating Private Key File cakey.pem

[applepay_merchant_configs]
common_merchant_identifier = "APPLE_PAY_COMMON_MERCHANT_IDENTIFIER" # Refer to config.example.toml to learn how you can generate this value
merchant_cert = "APPLE_PAY_MERCHANT_CERTIFICATE" # Merchant Certificate provided by Apple Pay (https://developer.apple.com/) Certificates, Identifiers & Profiles > Apple Pay Merchant Identity Certificate
Expand Down
1 change: 1 addition & 0 deletions config/deployments/integration_test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ debit = { currency = "USD,GBP,EUR" }
apple_pay = { currency = "USD,GBP,EUR" }
google_pay = { currency = "USD,GBP,EUR" }
samsung_pay = { currency = "USD,GBP,EUR" }
paze = { currency = "USD" }

[pm_filters.nexixpay]
credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" }
Expand Down
1 change: 1 addition & 0 deletions config/deployments/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ debit = { currency = "USD,GBP,EUR" }
apple_pay = { currency = "USD,GBP,EUR" }
google_pay = { currency = "USD,GBP,EUR" }
samsung_pay = { currency = "USD,GBP,EUR" }
paze = { currency = "USD" }

[pm_filters.nexixpay]
credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" }
Expand Down
1 change: 1 addition & 0 deletions config/deployments/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ debit = { currency = "USD,GBP,EUR" }
apple_pay = { currency = "USD,GBP,EUR" }
google_pay = { currency = "USD,GBP,EUR" }
samsung_pay = { currency = "USD,GBP,EUR" }
paze = { currency = "USD" }

[pm_filters.nexixpay]
credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" }
Expand Down
5 changes: 5 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ debit = { currency = "USD,GBP,EUR" }
apple_pay = { currency = "USD,GBP,EUR" }
google_pay = { currency = "USD,GBP,EUR" }
samsung_pay = { currency = "USD,GBP,EUR" }
paze = { currency = "USD" }

[pm_filters.nexixpay]
credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" }
Expand Down Expand Up @@ -617,6 +618,10 @@ apple_pay_ppc_key = "APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_KEY"
apple_pay_merchant_cert = "APPLE_PAY_MERCHNAT_CERTIFICATE"
apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY"

[paze_decrypt_keys]
paze_private_key = "PAZE_PRIVATE_KEY"
paze_private_key_passphrase = "PAZE_PRIVATE_KEY_PASSPHRASE"

[generic_link]
[generic_link.payment_method_collect]
sdk_url = "http://localhost:9050/HyperLoader.js"
Expand Down
1 change: 1 addition & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ debit = { currency = "USD,GBP,EUR" }
apple_pay = { currency = "USD,GBP,EUR" }
google_pay = { currency = "USD,GBP,EUR" }
samsung_pay = { currency = "USD,GBP,EUR" }
paze = { currency = "USD" }

[pm_filters.nexixpay]
credit = { country = "AT,BE,CY,EE,FI,FR,DE,GR,IE,IT,LV,LT,LU,MT,NL,PT,SK,SI,ES,BG,HR,DK,GB,NO,PL,CZ,RO,SE,CH,HU", currency = "ARS,AUD,BHD,CAD,CLP,CNY,COP,HRK,CZK,DKK,HKD,HUF,INR,JPY,KZT,JOD,KRW,KWD,MYR,MXN,NGN,NOK,PHP,QAR,RUB,SAR,SGD,VND,ZAR,SEK,CHF,THB,AED,EGP,GBP,USD,TWD,BYN,RSD,AZN,RON,TRY,AOA,BGN,EUR,UAH,PLN,BRL" }
Expand Down
4 changes: 4 additions & 0 deletions crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,10 @@ pub struct ConnectorWalletDetails {
#[serde(skip_serializing_if = "Option::is_none")]
#[schema(value_type = Option<Object>)]
pub samsung_pay: Option<pii::SecretSerdeValue>,
/// This field contains the Paze certificates and credentials
#[serde(skip_serializing_if = "Option::is_none")]
#[schema(value_type = Option<Object>)]
pub paze: Option<pii::SecretSerdeValue>,
}

/// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc."
Expand Down
37 changes: 37 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,7 @@ impl GetPaymentMethodType for WalletData {
Self::MbWayRedirect(_) => api_enums::PaymentMethodType::MbWay,
Self::MobilePayRedirect(_) => api_enums::PaymentMethodType::MobilePay,
Self::PaypalRedirect(_) | Self::PaypalSdk(_) => api_enums::PaymentMethodType::Paypal,
Self::Paze(_) => api_enums::PaymentMethodType::Paze,
Self::SamsungPay(_) => api_enums::PaymentMethodType::SamsungPay,
Self::TwintRedirect {} => api_enums::PaymentMethodType::Twint,
Self::VippsRedirect {} => api_enums::PaymentMethodType::Vipps,
Expand Down Expand Up @@ -2819,6 +2820,8 @@ pub enum WalletData {
PaypalRedirect(PaypalRedirection),
/// The wallet data for Paypal
PaypalSdk(PayPalWalletData),
/// The wallet data for Paze
Paze(PazeWalletData),
/// The wallet data for Samsung Pay
SamsungPay(Box<SamsungPayWalletData>),
/// Wallet data for Twint Redirection
Expand Down Expand Up @@ -2879,6 +2882,7 @@ impl GetAddressFromPaymentMethodData for WalletData {
| Self::GooglePayRedirect(_)
| Self::GooglePayThirdPartySdk(_)
| Self::PaypalSdk(_)
| Self::Paze(_)
| Self::SamsungPay(_)
| Self::TwintRedirect {}
| Self::VippsRedirect {}
Expand All @@ -2891,6 +2895,13 @@ impl GetAddressFromPaymentMethodData for WalletData {
}
}

#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct PazeWalletData {
#[schema(value_type = String)]
pub complete_response: Secret<String>,
}

#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletData {
Expand Down Expand Up @@ -4932,6 +4943,19 @@ pub struct GpaySessionTokenData {
pub data: GpayMetaData,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct PazeSessionTokenData {
#[serde(rename = "paze")]
pub data: PazeMetadata,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct PazeMetadata {
pub client_id: String,
pub client_name: String,
pub client_profile_id: String,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum SamsungPayCombinedMetadata {
Expand Down Expand Up @@ -5138,10 +5162,23 @@ pub enum SessionToken {
ApplePay(Box<ApplepaySessionTokenResponse>),
/// Session token for OpenBanking PIS flow
OpenBanking(OpenBankingSessionToken),
/// The session response structure for Paze
Paze(Box<PazeSessionTokenResponse>),
/// Whenever there is no session token response or an error in session response
NoSessionTokenReceived,
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema)]
#[serde(rename_all = "lowercase")]
pub struct PazeSessionTokenResponse {
/// Paze Client ID
pub client_id: String,
/// Client Name to be displayed on the Paze screen
pub client_name: String,
/// Paze Client Profile ID
pub client_profile_id: String,
}

#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, ToSchema)]
#[serde(untagged)]
pub enum GpaySessionTokenResponse {
Expand Down
1 change: 1 addition & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,7 @@ pub enum PaymentMethodType {
OpenBankingUk,
PayBright,
Paypal,
Paze,
Pix,
PaySafeCard,
Przelewy24,
Expand Down
Loading

0 comments on commit 535f2f1

Please # to comment.