Skip to content

fix(connector): (payload) currency auth key wasm changes #8825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/connector_configs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ v1 = ["api_models/v1", "common_utils/v1"]
# First party crates
api_models = { version = "0.1.0", path = "../api_models", package = "api_models" }
common_utils = { version = "0.1.0", path = "../common_utils" }
masking = { version = "0.1.0", path = "../masking" }

# Third party crates
serde = { version = "1.0.219", features = ["derive"] }
Expand Down
42 changes: 28 additions & 14 deletions crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,46 @@ use api_models::{
enums::{AuthenticationConnectors, Connector, PmAuthConnectors, TaxConnectors},
payments,
};
use serde::Deserialize;
use masking::Secret;
use serde::{Deserialize, Serialize};
use toml;

use crate::common_config::{CardProvider, InputData, Provider, ZenApplePay};

#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct PayloadCurrencyAuthKeyType {
pub api_key: Secret<String>,
pub processing_account_id: Secret<String>,
}

#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct Classic {
pub password_classic: String,
pub username_classic: String,
pub merchant_id_classic: String,
}

#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct Evoucher {
pub password_evoucher: String,
pub username_evoucher: String,
pub merchant_id_evoucher: String,
}

#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct CurrencyAuthKeyType {
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct CashtoCodeCurrencyAuthKeyType {
pub classic: Classic,
pub evoucher: Evoucher,
}

#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CurrencyAuthValue {
CashtoCode(CashtoCodeCurrencyAuthKeyType),
Payload(PayloadCurrencyAuthKeyType),
}

#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub enum ConnectorAuthType {
HeaderKey {
api_key: String,
Expand All @@ -52,7 +66,7 @@ pub enum ConnectorAuthType {
key2: String,
},
CurrencyAuthKey {
auth_key_map: HashMap<String, CurrencyAuthKeyType>,
auth_key_map: HashMap<String, CurrencyAuthValue>,
},
CertificateAuth {
certificate: String,
Expand All @@ -63,23 +77,23 @@ pub enum ConnectorAuthType {
}

#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(untagged)]
pub enum ApplePayTomlConfig {
Standard(Box<payments::ApplePayMetadata>),
Zen(ZenApplePay),
}

#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, serde::Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum KlarnaEndpoint {
Europe,
NorthAmerica,
Oceania,
}

#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct ConfigMerchantAdditionalDetails {
pub open_banking_recipient_data: Option<InputData>,
pub account_data: Option<InputData>,
Expand All @@ -96,7 +110,7 @@ pub struct ConfigMerchantAdditionalDetails {
}

#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct ConfigMetadata {
pub merchant_config_currency: Option<InputData>,
pub merchant_account_id: Option<InputData>,
Expand Down Expand Up @@ -136,15 +150,15 @@ pub struct ConfigMetadata {
}

#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct ConnectorWalletDetailsConfig {
pub samsung_pay: Option<Vec<InputData>>,
pub paze: Option<Vec<InputData>>,
pub google_pay: Option<Vec<InputData>>,
}

#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct ConnectorTomlConfig {
pub connector_auth: Option<ConnectorAuthType>,
pub connector_webhook_details: Option<api_models::admin::MerchantConnectorWebhookDetails>,
Expand All @@ -169,7 +183,7 @@ pub struct ConnectorTomlConfig {
pub real_time_payment: Option<Vec<Provider>>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct ConnectorConfig {
pub authipay: Option<ConnectorTomlConfig>,
pub juspaythreedsserver: Option<ConnectorTomlConfig>,
Expand Down
10 changes: 7 additions & 3 deletions crates/connector_configs/toml/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6416,9 +6416,13 @@ type="Text"
[[payload.debit]]
payment_method_type = "Visa"

[payload.connector_auth.HeaderKey]
api_key="API Key"

[payload.connector_auth.CurrencyAuthKey.auth_key_map.USD]
processing_account_id = "processing_account_id"
api_key = "API Key"
[payload.connector_auth.CurrencyAuthKey.auth_key_map.CAD]
processing_account_id = "processing_account_id"
api_key = "API Key"

[silverflow]
[[silverflow.credit]]
payment_method_type = "Mastercard"
Expand Down
10 changes: 7 additions & 3 deletions crates/connector_configs/toml/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5029,9 +5029,13 @@ payment_method_type = "Mastercard"
[[payload.debit]]
payment_method_type = "Visa"

[payload.connector_auth.HeaderKey]
api_key="API Key"

[payload.connector_auth.CurrencyAuthKey.auth_key_map.USD]
processing_account_id = "processing_account_id"
api_key = "API Key"
[payload.connector_auth.CurrencyAuthKey.auth_key_map.CAD]
processing_account_id = "processing_account_id"
api_key = "API Key"

[silverflow]
[[silverflow.credit]]
payment_method_type = "Mastercard"
Expand Down
10 changes: 7 additions & 3 deletions crates/connector_configs/toml/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6397,9 +6397,13 @@ payment_method_type = "Mastercard"
[[payload.debit]]
payment_method_type = "Visa"

[payload.connector_auth.HeaderKey]
api_key="API Key"

[payload.connector_auth.CurrencyAuthKey.auth_key_map.USD]
processing_account_id = "processing_account_id"
api_key = "API Key"
[payload.connector_auth.CurrencyAuthKey.auth_key_map.CAD]
processing_account_id = "processing_account_id"
api_key = "API Key"

[silverflow]
[[silverflow.credit]]
payment_method_type = "Mastercard"
Expand Down
Loading