repo stringclasses 4 values | file_path stringlengths 6 193 | extension stringclasses 23 values | content stringlengths 0 1.73M | token_count int64 0 724k | __index_level_0__ int64 0 10.8k |
|---|---|---|---|---|---|
hyperswitch | crates/diesel_models/src/payment_methods_session.rs | .rs | #[cfg(feature = "v2")]
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct PaymentMethodSession {
pub id: common_utils::id_type::GlobalPaymentMethodSessionId,
pub customer_id: common_utils::id_type::GlobalCustomerId,
pub billing: Option<common_utils::encryption::Encryption>,
pub psp_tokenization: Option<common_types::payment_methods::PspTokenization>,
pub network_tokenization: Option<common_types::payment_methods::NetworkTokenization>,
pub return_url: Option<common_utils::types::Url>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub expires_at: time::PrimitiveDateTime,
pub associated_payment_methods: Option<Vec<common_utils::id_type::GlobalPaymentMethodId>>,
pub associated_payment: Option<common_utils::id_type::GlobalPaymentId>,
}
#[cfg(feature = "v2")]
impl PaymentMethodSession {
pub fn apply_changeset(self, update_session: PaymentMethodsSessionUpdateInternal) -> Self {
let Self {
id,
customer_id,
billing,
psp_tokenization,
network_tokenization,
expires_at,
return_url,
associated_payment_methods,
associated_payment,
} = self;
Self {
id,
customer_id,
billing: update_session.billing.or(billing),
psp_tokenization: update_session.psp_tokenization.or(psp_tokenization),
network_tokenization: update_session.network_tokenization.or(network_tokenization),
expires_at,
return_url,
associated_payment_methods,
associated_payment,
}
}
}
#[cfg(feature = "v2")]
pub struct PaymentMethodsSessionUpdateInternal {
pub billing: Option<common_utils::encryption::Encryption>,
pub psp_tokenization: Option<common_types::payment_methods::PspTokenization>,
pub network_tokenization: Option<common_types::payment_methods::NetworkTokenization>,
}
| 414 | 805 |
hyperswitch | crates/diesel_models/src/dynamic_routing_stats.rs | .rs | use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use crate::schema::dynamic_routing_stats;
#[derive(Clone, Debug, Eq, Insertable, PartialEq)]
#[diesel(table_name = dynamic_routing_stats)]
pub struct DynamicRoutingStatsNew {
pub payment_id: common_utils::id_type::PaymentId,
pub attempt_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub profile_id: common_utils::id_type::ProfileId,
pub amount: common_utils::types::MinorUnit,
pub success_based_routing_connector: String,
pub payment_connector: String,
pub currency: Option<common_enums::Currency>,
pub payment_method: Option<common_enums::PaymentMethod>,
pub capture_method: Option<common_enums::CaptureMethod>,
pub authentication_type: Option<common_enums::AuthenticationType>,
pub payment_status: common_enums::AttemptStatus,
pub conclusive_classification: common_enums::SuccessBasedRoutingConclusiveState,
pub created_at: time::PrimitiveDateTime,
pub payment_method_type: Option<common_enums::PaymentMethodType>,
pub global_success_based_connector: Option<String>,
}
#[derive(Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Insertable)]
#[diesel(table_name = dynamic_routing_stats, primary_key(attempt_id, merchant_id), check_for_backend(diesel::pg::Pg))]
pub struct DynamicRoutingStats {
pub payment_id: common_utils::id_type::PaymentId,
pub attempt_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub profile_id: common_utils::id_type::ProfileId,
pub amount: common_utils::types::MinorUnit,
pub success_based_routing_connector: String,
pub payment_connector: String,
pub currency: Option<common_enums::Currency>,
pub payment_method: Option<common_enums::PaymentMethod>,
pub capture_method: Option<common_enums::CaptureMethod>,
pub authentication_type: Option<common_enums::AuthenticationType>,
pub payment_status: common_enums::AttemptStatus,
pub conclusive_classification: common_enums::SuccessBasedRoutingConclusiveState,
pub created_at: time::PrimitiveDateTime,
pub payment_method_type: Option<common_enums::PaymentMethodType>,
pub global_success_based_connector: Option<String>,
}
#[derive(
Clone, Debug, Eq, PartialEq, AsChangeset, router_derive::DebugAsDisplay, serde::Deserialize,
)]
#[diesel(table_name = dynamic_routing_stats)]
pub struct DynamicRoutingStatsUpdate {
pub amount: common_utils::types::MinorUnit,
pub success_based_routing_connector: String,
pub payment_connector: String,
pub currency: Option<common_enums::Currency>,
pub payment_method: Option<common_enums::PaymentMethod>,
pub capture_method: Option<common_enums::CaptureMethod>,
pub authentication_type: Option<common_enums::AuthenticationType>,
pub payment_status: common_enums::AttemptStatus,
pub conclusive_classification: common_enums::SuccessBasedRoutingConclusiveState,
pub payment_method_type: Option<common_enums::PaymentMethodType>,
pub global_success_based_connector: Option<String>,
}
| 690 | 806 |
hyperswitch | crates/diesel_models/src/process_tracker.rs | .rs | pub use common_enums::{enums::ProcessTrackerRunner, ApiVersion};
use common_utils::ext_traits::Encode;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use error_stack::ResultExt;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, errors, schema::process_tracker, StorageResult};
#[derive(
Clone,
Debug,
Eq,
PartialEq,
Deserialize,
Identifiable,
Queryable,
Selectable,
Serialize,
router_derive::DebugAsDisplay,
)]
#[diesel(table_name = process_tracker, check_for_backend(diesel::pg::Pg))]
pub struct ProcessTracker {
pub id: String,
pub name: Option<String>,
#[diesel(deserialize_as = super::DieselArray<String>)]
pub tag: Vec<String>,
pub runner: Option<String>,
pub retry_count: i32,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub schedule_time: Option<PrimitiveDateTime>,
pub rule: String,
pub tracking_data: serde_json::Value,
pub business_status: String,
pub status: storage_enums::ProcessTrackerStatus,
#[diesel(deserialize_as = super::DieselArray<String>)]
pub event: Vec<String>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub updated_at: PrimitiveDateTime,
pub version: ApiVersion,
}
impl ProcessTracker {
#[inline(always)]
pub fn is_valid_business_status(&self, valid_statuses: &[&str]) -> bool {
valid_statuses.iter().any(|&x| x == self.business_status)
}
}
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = process_tracker)]
pub struct ProcessTrackerNew {
pub id: String,
pub name: Option<String>,
pub tag: Vec<String>,
pub runner: Option<String>,
pub retry_count: i32,
pub schedule_time: Option<PrimitiveDateTime>,
pub rule: String,
pub tracking_data: serde_json::Value,
pub business_status: String,
pub status: storage_enums::ProcessTrackerStatus,
pub event: Vec<String>,
pub created_at: PrimitiveDateTime,
pub updated_at: PrimitiveDateTime,
pub version: ApiVersion,
}
impl ProcessTrackerNew {
#[allow(clippy::too_many_arguments)]
pub fn new<T>(
process_tracker_id: impl Into<String>,
task: impl Into<String>,
runner: ProcessTrackerRunner,
tag: impl IntoIterator<Item = impl Into<String>>,
tracking_data: T,
retry_count: Option<i32>,
schedule_time: PrimitiveDateTime,
api_version: ApiVersion,
) -> StorageResult<Self>
where
T: Serialize + std::fmt::Debug,
{
let current_time = common_utils::date_time::now();
Ok(Self {
id: process_tracker_id.into(),
name: Some(task.into()),
tag: tag.into_iter().map(Into::into).collect(),
runner: Some(runner.to_string()),
retry_count: retry_count.unwrap_or(0),
schedule_time: Some(schedule_time),
rule: String::new(),
tracking_data: tracking_data
.encode_to_value()
.change_context(errors::DatabaseError::Others)
.attach_printable("Failed to serialize process tracker tracking data")?,
business_status: String::from(business_status::PENDING),
status: storage_enums::ProcessTrackerStatus::New,
event: vec![],
created_at: current_time,
updated_at: current_time,
version: api_version,
})
}
}
#[derive(Debug)]
pub enum ProcessTrackerUpdate {
Update {
name: Option<String>,
retry_count: Option<i32>,
schedule_time: Option<PrimitiveDateTime>,
tracking_data: Option<serde_json::Value>,
business_status: Option<String>,
status: Option<storage_enums::ProcessTrackerStatus>,
updated_at: Option<PrimitiveDateTime>,
},
StatusUpdate {
status: storage_enums::ProcessTrackerStatus,
business_status: Option<String>,
},
StatusRetryUpdate {
status: storage_enums::ProcessTrackerStatus,
retry_count: i32,
schedule_time: PrimitiveDateTime,
},
}
#[derive(Debug, Clone, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = process_tracker)]
pub struct ProcessTrackerUpdateInternal {
name: Option<String>,
retry_count: Option<i32>,
schedule_time: Option<PrimitiveDateTime>,
tracking_data: Option<serde_json::Value>,
business_status: Option<String>,
status: Option<storage_enums::ProcessTrackerStatus>,
updated_at: Option<PrimitiveDateTime>,
}
impl Default for ProcessTrackerUpdateInternal {
fn default() -> Self {
Self {
name: Option::default(),
retry_count: Option::default(),
schedule_time: Option::default(),
tracking_data: Option::default(),
business_status: Option::default(),
status: Option::default(),
updated_at: Some(common_utils::date_time::now()),
}
}
}
impl From<ProcessTrackerUpdate> for ProcessTrackerUpdateInternal {
fn from(process_tracker_update: ProcessTrackerUpdate) -> Self {
match process_tracker_update {
ProcessTrackerUpdate::Update {
name,
retry_count,
schedule_time,
tracking_data,
business_status,
status,
updated_at,
} => Self {
name,
retry_count,
schedule_time,
tracking_data,
business_status,
status,
updated_at,
},
ProcessTrackerUpdate::StatusUpdate {
status,
business_status,
} => Self {
status: Some(status),
business_status,
..Default::default()
},
ProcessTrackerUpdate::StatusRetryUpdate {
status,
retry_count,
schedule_time,
} => Self {
status: Some(status),
retry_count: Some(retry_count),
schedule_time: Some(schedule_time),
..Default::default()
},
}
}
}
#[cfg(test)]
mod tests {
#![allow(clippy::unwrap_used)]
use common_utils::ext_traits::StringExt;
use super::ProcessTrackerRunner;
#[test]
fn test_enum_to_string() {
let string_format = "PAYMENTS_SYNC_WORKFLOW".to_string();
let enum_format: ProcessTrackerRunner =
string_format.parse_enum("ProcessTrackerRunner").unwrap();
assert_eq!(enum_format, ProcessTrackerRunner::PaymentsSyncWorkflow);
}
}
pub mod business_status {
/// Indicates that an irrecoverable error occurred during the workflow execution.
pub const GLOBAL_FAILURE: &str = "GLOBAL_FAILURE";
/// Task successfully completed by consumer.
/// A task that reaches this status should not be retried (rescheduled for execution) later.
pub const COMPLETED_BY_PT: &str = "COMPLETED_BY_PT";
/// An error occurred during the workflow execution which prevents further execution and
/// retries.
/// A task that reaches this status should not be retried (rescheduled for execution) later.
pub const FAILURE: &str = "FAILURE";
/// The resource associated with the task was removed, due to which further retries can/should
/// not be done.
pub const REVOKED: &str = "Revoked";
/// The task was executed for the maximum possible number of times without a successful outcome.
/// A task that reaches this status should not be retried (rescheduled for execution) later.
pub const RETRIES_EXCEEDED: &str = "RETRIES_EXCEEDED";
/// The outgoing webhook was successfully delivered in the initial attempt.
/// Further retries of the task are not required.
pub const INITIAL_DELIVERY_ATTEMPT_SUCCESSFUL: &str = "INITIAL_DELIVERY_ATTEMPT_SUCCESSFUL";
/// Indicates that an error occurred during the workflow execution.
/// This status is typically set by the workflow error handler.
/// A task that reaches this status should not be retried (rescheduled for execution) later.
pub const GLOBAL_ERROR: &str = "GLOBAL_ERROR";
/// The resource associated with the task has been significantly modified since the task was
/// created, due to which further retries of the current task are not required.
/// A task that reaches this status should not be retried (rescheduled for execution) later.
pub const RESOURCE_STATUS_MISMATCH: &str = "RESOURCE_STATUS_MISMATCH";
/// Business status set for newly created tasks.
pub const PENDING: &str = "Pending";
/// For the PCR Workflow
///
/// This status indicates the completion of a execute task
pub const EXECUTE_WORKFLOW_COMPLETE: &str = "COMPLETED_EXECUTE_TASK";
/// This status indicates that the execute task was completed to trigger the psync task
pub const EXECUTE_WORKFLOW_COMPLETE_FOR_PSYNC: &str = "COMPLETED_EXECUTE_TASK_TO_TRIGGER_PSYNC";
/// This status indicates that the execute task was completed to trigger the review task
pub const EXECUTE_WORKFLOW_COMPLETE_FOR_REVIEW: &str =
"COMPLETED_EXECUTE_TASK_TO_TRIGGER_REVIEW";
/// This status indicates the completion of a psync task
pub const PSYNC_WORKFLOW_COMPLETE: &str = "COMPLETED_PSYNC_TASK";
}
| 2,038 | 807 |
hyperswitch | crates/diesel_models/src/dispute.rs | .rs | use common_utils::custom_serde;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use masking::Secret;
use serde::Serialize;
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, schema::dispute};
#[derive(Clone, Debug, Insertable, Serialize, router_derive::DebugAsDisplay)]
#[diesel(table_name = dispute)]
#[serde(deny_unknown_fields)]
pub struct DisputeNew {
pub dispute_id: String,
pub amount: String,
pub currency: String,
pub dispute_stage: storage_enums::DisputeStage,
pub dispute_status: storage_enums::DisputeStatus,
pub payment_id: common_utils::id_type::PaymentId,
pub attempt_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub connector_status: String,
pub connector_dispute_id: String,
pub connector_reason: Option<String>,
pub connector_reason_code: Option<String>,
pub challenge_required_by: Option<PrimitiveDateTime>,
pub connector_created_at: Option<PrimitiveDateTime>,
pub connector_updated_at: Option<PrimitiveDateTime>,
pub connector: String,
pub evidence: Option<Secret<serde_json::Value>>,
pub profile_id: Option<common_utils::id_type::ProfileId>,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub dispute_amount: i64,
pub organization_id: common_utils::id_type::OrganizationId,
pub dispute_currency: Option<storage_enums::Currency>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Identifiable, Queryable, Selectable)]
#[diesel(table_name = dispute, primary_key(dispute_id), check_for_backend(diesel::pg::Pg))]
pub struct Dispute {
pub dispute_id: String,
pub amount: String,
pub currency: String,
pub dispute_stage: storage_enums::DisputeStage,
pub dispute_status: storage_enums::DisputeStatus,
pub payment_id: common_utils::id_type::PaymentId,
pub attempt_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub connector_status: String,
pub connector_dispute_id: String,
pub connector_reason: Option<String>,
pub connector_reason_code: Option<String>,
pub challenge_required_by: Option<PrimitiveDateTime>,
pub connector_created_at: Option<PrimitiveDateTime>,
pub connector_updated_at: Option<PrimitiveDateTime>,
#[serde(with = "custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "custom_serde::iso8601")]
pub modified_at: PrimitiveDateTime,
pub connector: String,
pub evidence: Secret<serde_json::Value>,
pub profile_id: Option<common_utils::id_type::ProfileId>,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub dispute_amount: i64,
pub organization_id: common_utils::id_type::OrganizationId,
pub dispute_currency: Option<storage_enums::Currency>,
}
#[derive(Debug)]
pub enum DisputeUpdate {
Update {
dispute_stage: storage_enums::DisputeStage,
dispute_status: storage_enums::DisputeStatus,
connector_status: String,
connector_reason: Option<String>,
connector_reason_code: Option<String>,
challenge_required_by: Option<PrimitiveDateTime>,
connector_updated_at: Option<PrimitiveDateTime>,
},
StatusUpdate {
dispute_status: storage_enums::DisputeStatus,
connector_status: Option<String>,
},
EvidenceUpdate {
evidence: Secret<serde_json::Value>,
},
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = dispute)]
pub struct DisputeUpdateInternal {
dispute_stage: Option<storage_enums::DisputeStage>,
dispute_status: Option<storage_enums::DisputeStatus>,
connector_status: Option<String>,
connector_reason: Option<String>,
connector_reason_code: Option<String>,
challenge_required_by: Option<PrimitiveDateTime>,
connector_updated_at: Option<PrimitiveDateTime>,
modified_at: PrimitiveDateTime,
evidence: Option<Secret<serde_json::Value>>,
}
impl From<DisputeUpdate> for DisputeUpdateInternal {
fn from(merchant_account_update: DisputeUpdate) -> Self {
match merchant_account_update {
DisputeUpdate::Update {
dispute_stage,
dispute_status,
connector_status,
connector_reason,
connector_reason_code,
challenge_required_by,
connector_updated_at,
} => Self {
dispute_stage: Some(dispute_stage),
dispute_status: Some(dispute_status),
connector_status: Some(connector_status),
connector_reason,
connector_reason_code,
challenge_required_by,
connector_updated_at,
modified_at: common_utils::date_time::now(),
evidence: None,
},
DisputeUpdate::StatusUpdate {
dispute_status,
connector_status,
} => Self {
dispute_status: Some(dispute_status),
connector_status,
modified_at: common_utils::date_time::now(),
dispute_stage: None,
connector_reason: None,
connector_reason_code: None,
challenge_required_by: None,
connector_updated_at: None,
evidence: None,
},
DisputeUpdate::EvidenceUpdate { evidence } => Self {
evidence: Some(evidence),
dispute_stage: None,
dispute_status: None,
connector_status: None,
connector_reason: None,
connector_reason_code: None,
challenge_required_by: None,
connector_updated_at: None,
modified_at: common_utils::date_time::now(),
},
}
}
}
| 1,220 | 808 |
hyperswitch | crates/diesel_models/src/generic_link.rs | .rs | use common_utils::{
consts,
link_utils::{
EnabledPaymentMethod, GenericLinkStatus, GenericLinkUiConfig, PaymentMethodCollectStatus,
PayoutLinkData, PayoutLinkStatus,
},
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use masking::Secret;
use serde::{Deserialize, Serialize};
use time::{Duration, PrimitiveDateTime};
use crate::{enums as storage_enums, schema::generic_link};
#[derive(
Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Serialize, Deserialize,
)]
#[diesel(table_name = generic_link, primary_key(link_id), check_for_backend(diesel::pg::Pg))]
pub struct GenericLink {
pub link_id: String,
pub primary_reference: String,
pub merchant_id: common_utils::id_type::MerchantId,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub expiry: PrimitiveDateTime,
pub link_data: serde_json::Value,
pub link_status: GenericLinkStatus,
pub link_type: storage_enums::GenericLinkType,
pub url: Secret<String>,
pub return_url: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GenericLinkState {
pub link_id: String,
pub primary_reference: String,
pub merchant_id: common_utils::id_type::MerchantId,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub expiry: PrimitiveDateTime,
pub link_data: GenericLinkData,
pub link_status: GenericLinkStatus,
pub link_type: storage_enums::GenericLinkType,
pub url: Secret<String>,
pub return_url: Option<String>,
}
#[derive(
Clone,
Debug,
Eq,
PartialEq,
Insertable,
serde::Serialize,
serde::Deserialize,
router_derive::DebugAsDisplay,
)]
#[diesel(table_name = generic_link)]
pub struct GenericLinkNew {
pub link_id: String,
pub primary_reference: String,
pub merchant_id: common_utils::id_type::MerchantId,
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub created_at: Option<PrimitiveDateTime>,
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub last_modified_at: Option<PrimitiveDateTime>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub expiry: PrimitiveDateTime,
pub link_data: serde_json::Value,
pub link_status: GenericLinkStatus,
pub link_type: storage_enums::GenericLinkType,
pub url: Secret<String>,
pub return_url: Option<String>,
}
impl Default for GenericLinkNew {
fn default() -> Self {
let now = common_utils::date_time::now();
Self {
link_id: String::default(),
primary_reference: String::default(),
merchant_id: common_utils::id_type::MerchantId::default(),
created_at: Some(now),
last_modified_at: Some(now),
expiry: now + Duration::seconds(consts::DEFAULT_SESSION_EXPIRY),
link_data: serde_json::Value::default(),
link_status: GenericLinkStatus::default(),
link_type: common_enums::GenericLinkType::default(),
url: Secret::default(),
return_url: Option::default(),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GenericLinkData {
PaymentMethodCollect(PaymentMethodCollectLinkData),
PayoutLink(PayoutLinkData),
}
impl GenericLinkData {
pub fn get_payment_method_collect_data(&self) -> Result<&PaymentMethodCollectLinkData, String> {
match self {
Self::PaymentMethodCollect(pm) => Ok(pm),
_ => Err("Invalid link type for fetching payment method collect data".to_string()),
}
}
pub fn get_payout_link_data(&self) -> Result<&PayoutLinkData, String> {
match self {
Self::PayoutLink(pl) => Ok(pl),
_ => Err("Invalid link type for fetching payout link data".to_string()),
}
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct PaymentMethodCollectLink {
pub link_id: String,
pub primary_reference: String,
pub merchant_id: common_utils::id_type::MerchantId,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub expiry: PrimitiveDateTime,
pub link_data: PaymentMethodCollectLinkData,
pub link_status: PaymentMethodCollectStatus,
pub link_type: storage_enums::GenericLinkType,
pub url: Secret<String>,
pub return_url: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PaymentMethodCollectLinkData {
pub pm_collect_link_id: String,
pub customer_id: common_utils::id_type::CustomerId,
pub link: Secret<String>,
pub client_secret: Secret<String>,
pub session_expiry: u32,
#[serde(flatten)]
pub ui_config: GenericLinkUiConfig,
pub enabled_payment_methods: Option<Vec<EnabledPaymentMethod>>,
}
#[derive(Clone, Debug, Identifiable, Queryable, Serialize, Deserialize)]
#[diesel(table_name = generic_link)]
#[diesel(primary_key(link_id))]
pub struct PayoutLink {
pub link_id: String,
pub primary_reference: String,
pub merchant_id: common_utils::id_type::MerchantId,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub expiry: PrimitiveDateTime,
pub link_data: PayoutLinkData,
pub link_status: PayoutLinkStatus,
pub link_type: storage_enums::GenericLinkType,
pub url: Secret<String>,
pub return_url: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum PayoutLinkUpdate {
StatusUpdate { link_status: PayoutLinkStatus },
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = generic_link)]
pub struct GenericLinkUpdateInternal {
pub link_status: Option<GenericLinkStatus>,
}
impl From<PayoutLinkUpdate> for GenericLinkUpdateInternal {
fn from(generic_link_update: PayoutLinkUpdate) -> Self {
match generic_link_update {
PayoutLinkUpdate::StatusUpdate { link_status } => Self {
link_status: Some(GenericLinkStatus::PayoutLink(link_status)),
},
}
}
}
| 1,631 | 809 |
hyperswitch | crates/diesel_models/src/user_authentication_method.rs | .rs | use common_utils::encryption::Encryption;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::{enums, schema::user_authentication_methods};
#[derive(Clone, Debug, Identifiable, Queryable, Selectable)]
#[diesel(table_name = user_authentication_methods, check_for_backend(diesel::pg::Pg))]
pub struct UserAuthenticationMethod {
pub id: String,
pub auth_id: String,
pub owner_id: String,
pub owner_type: enums::Owner,
pub auth_type: enums::UserAuthType,
pub private_config: Option<Encryption>,
pub public_config: Option<serde_json::Value>,
pub allow_signup: bool,
pub created_at: PrimitiveDateTime,
pub last_modified_at: PrimitiveDateTime,
pub email_domain: String,
}
#[derive(router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = user_authentication_methods)]
pub struct UserAuthenticationMethodNew {
pub id: String,
pub auth_id: String,
pub owner_id: String,
pub owner_type: enums::Owner,
pub auth_type: enums::UserAuthType,
pub private_config: Option<Encryption>,
pub public_config: Option<serde_json::Value>,
pub allow_signup: bool,
pub created_at: PrimitiveDateTime,
pub last_modified_at: PrimitiveDateTime,
pub email_domain: String,
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = user_authentication_methods)]
pub struct OrgAuthenticationMethodUpdateInternal {
pub private_config: Option<Encryption>,
pub public_config: Option<serde_json::Value>,
pub last_modified_at: PrimitiveDateTime,
pub email_domain: Option<String>,
}
pub enum UserAuthenticationMethodUpdate {
UpdateConfig {
private_config: Option<Encryption>,
public_config: Option<serde_json::Value>,
},
EmailDomain {
email_domain: String,
},
}
impl From<UserAuthenticationMethodUpdate> for OrgAuthenticationMethodUpdateInternal {
fn from(value: UserAuthenticationMethodUpdate) -> Self {
let last_modified_at = common_utils::date_time::now();
match value {
UserAuthenticationMethodUpdate::UpdateConfig {
private_config,
public_config,
} => Self {
private_config,
public_config,
last_modified_at,
email_domain: None,
},
UserAuthenticationMethodUpdate::EmailDomain { email_domain } => Self {
private_config: None,
public_config: None,
last_modified_at,
email_domain: Some(email_domain),
},
}
}
}
| 566 | 810 |
hyperswitch | crates/diesel_models/src/user_key_store.rs | .rs | use common_utils::encryption::Encryption;
use diesel::{Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::schema::user_key_store;
#[derive(
Clone, Debug, serde::Serialize, serde::Deserialize, Identifiable, Queryable, Selectable,
)]
#[diesel(table_name = user_key_store, primary_key(user_id), check_for_backend(diesel::pg::Pg))]
pub struct UserKeyStore {
pub user_id: String,
pub key: Encryption,
pub created_at: PrimitiveDateTime,
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Insertable)]
#[diesel(table_name = user_key_store)]
pub struct UserKeyStoreNew {
pub user_id: String,
pub key: Encryption,
pub created_at: PrimitiveDateTime,
}
| 173 | 811 |
hyperswitch | crates/diesel_models/src/ephemeral_key.rs | .rs | #[cfg(feature = "v2")]
use masking::{PeekInterface, Secret};
#[cfg(feature = "v2")]
pub struct ClientSecretTypeNew {
pub id: common_utils::id_type::ClientSecretId,
pub merchant_id: common_utils::id_type::MerchantId,
pub secret: Secret<String>,
pub resource_id: common_utils::types::authentication::ResourceId,
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct ClientSecretType {
pub id: common_utils::id_type::ClientSecretId,
pub merchant_id: common_utils::id_type::MerchantId,
pub resource_id: common_utils::types::authentication::ResourceId,
pub created_at: time::PrimitiveDateTime,
pub expires: time::PrimitiveDateTime,
pub secret: Secret<String>,
}
#[cfg(feature = "v2")]
impl ClientSecretType {
pub fn generate_secret_key(&self) -> String {
format!("cs_{}", self.secret.peek())
}
}
pub struct EphemeralKeyNew {
pub id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub customer_id: common_utils::id_type::CustomerId,
pub secret: String,
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct EphemeralKey {
pub id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub customer_id: common_utils::id_type::CustomerId,
pub created_at: i64,
pub expires: i64,
pub secret: String,
}
impl common_utils::events::ApiEventMetric for EphemeralKey {
fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {
Some(common_utils::events::ApiEventsType::Miscellaneous)
}
}
| 397 | 812 |
hyperswitch | crates/diesel_models/src/customers.rs | .rs | use common_enums::ApiVersion;
use common_utils::{encryption::Encryption, pii, types::Description};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
#[cfg(all(feature = "v2", feature = "customer_v2"))]
use crate::enums::DeleteStatus;
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
use crate::schema::customers;
#[cfg(all(feature = "v2", feature = "customer_v2"))]
use crate::schema_v2::customers;
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[derive(
Clone, Debug, router_derive::DebugAsDisplay, serde::Deserialize, serde::Serialize, Insertable,
)]
#[diesel(table_name = customers)]
pub struct CustomerNew {
pub customer_id: common_utils::id_type::CustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub name: Option<Encryption>,
pub email: Option<Encryption>,
pub phone: Option<Encryption>,
pub description: Option<Description>,
pub phone_country_code: Option<String>,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_customer: Option<pii::SecretSerdeValue>,
pub created_at: PrimitiveDateTime,
pub modified_at: PrimitiveDateTime,
pub address_id: Option<String>,
pub updated_by: Option<String>,
pub version: ApiVersion,
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
impl CustomerNew {
pub fn update_storage_scheme(&mut self, storage_scheme: common_enums::MerchantStorageScheme) {
self.updated_by = Some(storage_scheme.to_string());
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
impl From<CustomerNew> for Customer {
fn from(customer_new: CustomerNew) -> Self {
Self {
customer_id: customer_new.customer_id,
merchant_id: customer_new.merchant_id,
name: customer_new.name,
email: customer_new.email,
phone: customer_new.phone,
phone_country_code: customer_new.phone_country_code,
description: customer_new.description,
created_at: customer_new.created_at,
metadata: customer_new.metadata,
connector_customer: customer_new.connector_customer,
modified_at: customer_new.modified_at,
address_id: customer_new.address_id,
default_payment_method_id: None,
updated_by: customer_new.updated_by,
version: customer_new.version,
}
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[derive(
Clone, Debug, Insertable, router_derive::DebugAsDisplay, serde::Deserialize, serde::Serialize,
)]
#[diesel(table_name = customers, primary_key(id))]
pub struct CustomerNew {
pub merchant_id: common_utils::id_type::MerchantId,
pub name: Option<Encryption>,
pub email: Option<Encryption>,
pub phone: Option<Encryption>,
pub phone_country_code: Option<String>,
pub description: Option<Description>,
pub created_at: PrimitiveDateTime,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_customer: Option<common_types::customers::ConnectorCustomerMap>,
pub modified_at: PrimitiveDateTime,
pub default_payment_method_id: Option<common_utils::id_type::GlobalPaymentMethodId>,
pub updated_by: Option<String>,
pub version: ApiVersion,
pub merchant_reference_id: Option<common_utils::id_type::CustomerId>,
pub default_billing_address: Option<Encryption>,
pub default_shipping_address: Option<Encryption>,
pub status: DeleteStatus,
pub id: common_utils::id_type::GlobalCustomerId,
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
impl CustomerNew {
pub fn update_storage_scheme(&mut self, storage_scheme: common_enums::MerchantStorageScheme) {
self.updated_by = Some(storage_scheme.to_string());
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
impl From<CustomerNew> for Customer {
fn from(customer_new: CustomerNew) -> Self {
Self {
merchant_id: customer_new.merchant_id,
name: customer_new.name,
email: customer_new.email,
phone: customer_new.phone,
phone_country_code: customer_new.phone_country_code,
description: customer_new.description,
created_at: customer_new.created_at,
metadata: customer_new.metadata,
connector_customer: customer_new.connector_customer,
modified_at: customer_new.modified_at,
default_payment_method_id: None,
updated_by: customer_new.updated_by,
merchant_reference_id: customer_new.merchant_reference_id,
default_billing_address: customer_new.default_billing_address,
default_shipping_address: customer_new.default_shipping_address,
id: customer_new.id,
version: customer_new.version,
status: customer_new.status,
}
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[derive(
Clone, Debug, Identifiable, Queryable, Selectable, serde::Deserialize, serde::Serialize,
)]
#[diesel(table_name = customers, primary_key(customer_id, merchant_id), check_for_backend(diesel::pg::Pg))]
pub struct Customer {
pub customer_id: common_utils::id_type::CustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub name: Option<Encryption>,
pub email: Option<Encryption>,
pub phone: Option<Encryption>,
pub phone_country_code: Option<String>,
pub description: Option<Description>,
pub created_at: PrimitiveDateTime,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_customer: Option<pii::SecretSerdeValue>,
pub modified_at: PrimitiveDateTime,
pub address_id: Option<String>,
pub default_payment_method_id: Option<String>,
pub updated_by: Option<String>,
pub version: ApiVersion,
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[derive(
Clone, Debug, Identifiable, Queryable, Selectable, serde::Serialize, serde::Deserialize,
)]
#[diesel(table_name = customers, primary_key(id))]
pub struct Customer {
pub merchant_id: common_utils::id_type::MerchantId,
pub name: Option<Encryption>,
pub email: Option<Encryption>,
pub phone: Option<Encryption>,
pub phone_country_code: Option<String>,
pub description: Option<Description>,
pub created_at: PrimitiveDateTime,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_customer: Option<common_types::customers::ConnectorCustomerMap>,
pub modified_at: PrimitiveDateTime,
pub default_payment_method_id: Option<common_utils::id_type::GlobalPaymentMethodId>,
pub updated_by: Option<String>,
pub version: ApiVersion,
pub merchant_reference_id: Option<common_utils::id_type::CustomerId>,
pub default_billing_address: Option<Encryption>,
pub default_shipping_address: Option<Encryption>,
pub status: DeleteStatus,
pub id: common_utils::id_type::GlobalCustomerId,
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[derive(
Clone, Debug, AsChangeset, router_derive::DebugAsDisplay, serde::Deserialize, serde::Serialize,
)]
#[diesel(table_name = customers)]
pub struct CustomerUpdateInternal {
pub name: Option<Encryption>,
pub email: Option<Encryption>,
pub phone: Option<Encryption>,
pub description: Option<Description>,
pub phone_country_code: Option<String>,
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: PrimitiveDateTime,
pub connector_customer: Option<pii::SecretSerdeValue>,
pub address_id: Option<String>,
pub default_payment_method_id: Option<Option<String>>,
pub updated_by: Option<String>,
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
impl CustomerUpdateInternal {
pub fn apply_changeset(self, source: Customer) -> Customer {
let Self {
name,
email,
phone,
description,
phone_country_code,
metadata,
connector_customer,
address_id,
default_payment_method_id,
..
} = self;
Customer {
name: name.map_or(source.name, Some),
email: email.map_or(source.email, Some),
phone: phone.map_or(source.phone, Some),
description: description.map_or(source.description, Some),
phone_country_code: phone_country_code.map_or(source.phone_country_code, Some),
metadata: metadata.map_or(source.metadata, Some),
modified_at: common_utils::date_time::now(),
connector_customer: connector_customer.map_or(source.connector_customer, Some),
address_id: address_id.map_or(source.address_id, Some),
default_payment_method_id: default_payment_method_id
.flatten()
.map_or(source.default_payment_method_id, Some),
..source
}
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[derive(
Clone, Debug, AsChangeset, router_derive::DebugAsDisplay, serde::Deserialize, serde::Serialize,
)]
#[diesel(table_name = customers)]
pub struct CustomerUpdateInternal {
pub name: Option<Encryption>,
pub email: Option<Encryption>,
pub phone: Option<Encryption>,
pub description: Option<Description>,
pub phone_country_code: Option<String>,
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: PrimitiveDateTime,
pub connector_customer: Option<common_types::customers::ConnectorCustomerMap>,
pub default_payment_method_id: Option<Option<common_utils::id_type::GlobalPaymentMethodId>>,
pub updated_by: Option<String>,
pub default_billing_address: Option<Encryption>,
pub default_shipping_address: Option<Encryption>,
pub status: Option<DeleteStatus>,
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
impl CustomerUpdateInternal {
pub fn apply_changeset(self, source: Customer) -> Customer {
let Self {
name,
email,
phone,
description,
phone_country_code,
metadata,
connector_customer,
default_payment_method_id,
default_billing_address,
default_shipping_address,
status,
..
} = self;
Customer {
name: name.map_or(source.name, Some),
email: email.map_or(source.email, Some),
phone: phone.map_or(source.phone, Some),
description: description.map_or(source.description, Some),
phone_country_code: phone_country_code.map_or(source.phone_country_code, Some),
metadata: metadata.map_or(source.metadata, Some),
modified_at: common_utils::date_time::now(),
connector_customer: connector_customer.map_or(source.connector_customer, Some),
default_payment_method_id: default_payment_method_id
.flatten()
.map_or(source.default_payment_method_id, Some),
default_billing_address: default_billing_address
.map_or(source.default_billing_address, Some),
default_shipping_address: default_shipping_address
.map_or(source.default_shipping_address, Some),
status: status.unwrap_or(source.status),
..source
}
}
}
| 2,449 | 813 |
hyperswitch | crates/diesel_models/src/payout_attempt.rs | .rs | use common_utils::{
payout_method_utils,
types::{UnifiedCode, UnifiedMessage},
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{self, Deserialize, Serialize};
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, schema::payout_attempt};
#[derive(
Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Serialize, Deserialize,
)]
#[diesel(table_name = payout_attempt, primary_key(payout_attempt_id), check_for_backend(diesel::pg::Pg))]
pub struct PayoutAttempt {
pub payout_attempt_id: String,
pub payout_id: String,
pub customer_id: Option<common_utils::id_type::CustomerId>,
pub merchant_id: common_utils::id_type::MerchantId,
pub address_id: Option<String>,
pub connector: Option<String>,
pub connector_payout_id: Option<String>,
pub payout_token: Option<String>,
pub status: storage_enums::PayoutStatus,
pub is_eligible: Option<bool>,
pub error_message: Option<String>,
pub error_code: Option<String>,
pub business_country: Option<storage_enums::CountryAlpha2>,
pub business_label: Option<String>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
pub profile_id: common_utils::id_type::ProfileId,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub routing_info: Option<serde_json::Value>,
pub unified_code: Option<UnifiedCode>,
pub unified_message: Option<UnifiedMessage>,
pub additional_payout_method_data: Option<payout_method_utils::AdditionalPayoutMethodData>,
}
#[derive(
Clone,
Debug,
Eq,
PartialEq,
Insertable,
serde::Serialize,
serde::Deserialize,
router_derive::DebugAsDisplay,
router_derive::Setter,
)]
#[diesel(table_name = payout_attempt)]
pub struct PayoutAttemptNew {
pub payout_attempt_id: String,
pub payout_id: String,
pub customer_id: Option<common_utils::id_type::CustomerId>,
pub merchant_id: common_utils::id_type::MerchantId,
pub address_id: Option<String>,
pub connector: Option<String>,
pub connector_payout_id: Option<String>,
pub payout_token: Option<String>,
pub status: storage_enums::PayoutStatus,
pub is_eligible: Option<bool>,
pub error_message: Option<String>,
pub error_code: Option<String>,
pub business_country: Option<storage_enums::CountryAlpha2>,
pub business_label: Option<String>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
pub profile_id: common_utils::id_type::ProfileId,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub routing_info: Option<serde_json::Value>,
pub unified_code: Option<UnifiedCode>,
pub unified_message: Option<UnifiedMessage>,
pub additional_payout_method_data: Option<payout_method_utils::AdditionalPayoutMethodData>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum PayoutAttemptUpdate {
StatusUpdate {
connector_payout_id: Option<String>,
status: storage_enums::PayoutStatus,
error_message: Option<String>,
error_code: Option<String>,
is_eligible: Option<bool>,
unified_code: Option<UnifiedCode>,
unified_message: Option<UnifiedMessage>,
},
PayoutTokenUpdate {
payout_token: String,
},
BusinessUpdate {
business_country: Option<storage_enums::CountryAlpha2>,
business_label: Option<String>,
address_id: Option<String>,
customer_id: Option<common_utils::id_type::CustomerId>,
},
UpdateRouting {
connector: String,
routing_info: Option<serde_json::Value>,
merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
},
AdditionalPayoutMethodDataUpdate {
additional_payout_method_data: Option<payout_method_utils::AdditionalPayoutMethodData>,
},
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = payout_attempt)]
pub struct PayoutAttemptUpdateInternal {
pub payout_token: Option<String>,
pub connector_payout_id: Option<String>,
pub status: Option<storage_enums::PayoutStatus>,
pub error_message: Option<String>,
pub error_code: Option<String>,
pub is_eligible: Option<bool>,
pub business_country: Option<storage_enums::CountryAlpha2>,
pub business_label: Option<String>,
pub connector: Option<String>,
pub routing_info: Option<serde_json::Value>,
pub last_modified_at: PrimitiveDateTime,
pub address_id: Option<String>,
pub customer_id: Option<common_utils::id_type::CustomerId>,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub unified_code: Option<UnifiedCode>,
pub unified_message: Option<UnifiedMessage>,
pub additional_payout_method_data: Option<payout_method_utils::AdditionalPayoutMethodData>,
}
impl Default for PayoutAttemptUpdateInternal {
fn default() -> Self {
Self {
payout_token: None,
connector_payout_id: None,
status: None,
error_message: None,
error_code: None,
is_eligible: None,
business_country: None,
business_label: None,
connector: None,
routing_info: None,
merchant_connector_id: None,
last_modified_at: common_utils::date_time::now(),
address_id: None,
customer_id: None,
unified_code: None,
unified_message: None,
additional_payout_method_data: None,
}
}
}
impl From<PayoutAttemptUpdate> for PayoutAttemptUpdateInternal {
fn from(payout_update: PayoutAttemptUpdate) -> Self {
match payout_update {
PayoutAttemptUpdate::PayoutTokenUpdate { payout_token } => Self {
payout_token: Some(payout_token),
..Default::default()
},
PayoutAttemptUpdate::StatusUpdate {
connector_payout_id,
status,
error_message,
error_code,
is_eligible,
unified_code,
unified_message,
} => Self {
connector_payout_id,
status: Some(status),
error_message,
error_code,
is_eligible,
unified_code,
unified_message,
..Default::default()
},
PayoutAttemptUpdate::BusinessUpdate {
business_country,
business_label,
address_id,
customer_id,
} => Self {
business_country,
business_label,
address_id,
customer_id,
..Default::default()
},
PayoutAttemptUpdate::UpdateRouting {
connector,
routing_info,
merchant_connector_id,
} => Self {
connector: Some(connector),
routing_info,
merchant_connector_id,
..Default::default()
},
PayoutAttemptUpdate::AdditionalPayoutMethodDataUpdate {
additional_payout_method_data,
} => Self {
additional_payout_method_data,
..Default::default()
},
}
}
}
impl PayoutAttemptUpdate {
pub fn apply_changeset(self, source: PayoutAttempt) -> PayoutAttempt {
let PayoutAttemptUpdateInternal {
payout_token,
connector_payout_id,
status,
error_message,
error_code,
is_eligible,
business_country,
business_label,
connector,
routing_info,
last_modified_at,
address_id,
customer_id,
merchant_connector_id,
unified_code,
unified_message,
additional_payout_method_data,
} = self.into();
PayoutAttempt {
payout_token: payout_token.or(source.payout_token),
connector_payout_id: connector_payout_id.or(source.connector_payout_id),
status: status.unwrap_or(source.status),
error_message: error_message.or(source.error_message),
error_code: error_code.or(source.error_code),
is_eligible: is_eligible.or(source.is_eligible),
business_country: business_country.or(source.business_country),
business_label: business_label.or(source.business_label),
connector: connector.or(source.connector),
routing_info: routing_info.or(source.routing_info),
last_modified_at,
address_id: address_id.or(source.address_id),
customer_id: customer_id.or(source.customer_id),
merchant_connector_id: merchant_connector_id.or(source.merchant_connector_id),
unified_code: unified_code.or(source.unified_code),
unified_message: unified_message.or(source.unified_message),
additional_payout_method_data: additional_payout_method_data
.or(source.additional_payout_method_data),
..source
}
}
}
| 1,963 | 814 |
hyperswitch | crates/diesel_models/src/payment_method.rs | .rs | use std::collections::HashMap;
use common_enums::MerchantStorageScheme;
use common_utils::{
encryption::Encryption,
errors::{CustomResult, ParsingError},
pii,
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use error_stack::ResultExt;
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
use masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
use crate::{enums as storage_enums, schema::payment_methods};
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
use crate::{enums as storage_enums, schema_v2::payment_methods};
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
#[derive(
Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Serialize, Deserialize,
)]
#[diesel(table_name = payment_methods, primary_key(payment_method_id), check_for_backend(diesel::pg::Pg))]
pub struct PaymentMethod {
pub customer_id: common_utils::id_type::CustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub payment_method_id: String,
#[diesel(deserialize_as = super::OptionalDieselArray<storage_enums::Currency>)]
pub accepted_currency: Option<Vec<storage_enums::Currency>>,
pub scheme: Option<String>,
pub token: Option<String>,
pub cardholder_name: Option<Secret<String>>,
pub issuer_name: Option<String>,
pub issuer_country: Option<String>,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub payer_country: Option<Vec<String>>,
pub is_stored: Option<bool>,
pub swift_code: Option<String>,
pub direct_debit_token: Option<String>,
pub created_at: PrimitiveDateTime,
pub last_modified: PrimitiveDateTime,
pub payment_method: Option<storage_enums::PaymentMethod>,
pub payment_method_type: Option<storage_enums::PaymentMethodType>,
pub payment_method_issuer: Option<String>,
pub payment_method_issuer_code: Option<storage_enums::PaymentMethodIssuerCode>,
pub metadata: Option<pii::SecretSerdeValue>,
pub payment_method_data: Option<Encryption>,
pub locker_id: Option<String>,
pub last_used_at: PrimitiveDateTime,
pub connector_mandate_details: Option<serde_json::Value>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub status: storage_enums::PaymentMethodStatus,
pub network_transaction_id: Option<String>,
pub client_secret: Option<String>,
pub payment_method_billing_address: Option<Encryption>,
pub updated_by: Option<String>,
pub version: common_enums::ApiVersion,
pub network_token_requestor_reference_id: Option<String>,
pub network_token_locker_id: Option<String>,
pub network_token_payment_method_data: Option<Encryption>,
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
#[derive(Clone, Debug, Identifiable, Queryable, Selectable, Serialize, Deserialize)]
#[diesel(table_name = payment_methods, primary_key(id), check_for_backend(diesel::pg::Pg))]
pub struct PaymentMethod {
pub customer_id: common_utils::id_type::GlobalCustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub created_at: PrimitiveDateTime,
pub last_modified: PrimitiveDateTime,
pub payment_method_data: Option<Encryption>,
pub locker_id: Option<String>,
pub last_used_at: PrimitiveDateTime,
pub connector_mandate_details: Option<CommonMandateReference>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub status: storage_enums::PaymentMethodStatus,
pub network_transaction_id: Option<String>,
pub client_secret: Option<String>,
pub payment_method_billing_address: Option<Encryption>,
pub updated_by: Option<String>,
pub version: common_enums::ApiVersion,
pub network_token_requestor_reference_id: Option<String>,
pub network_token_locker_id: Option<String>,
pub network_token_payment_method_data: Option<Encryption>,
pub locker_fingerprint_id: Option<String>,
pub payment_method_type_v2: Option<storage_enums::PaymentMethod>,
pub payment_method_subtype: Option<storage_enums::PaymentMethodType>,
pub id: common_utils::id_type::GlobalPaymentMethodId,
}
impl PaymentMethod {
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
pub fn get_id(&self) -> &String {
&self.payment_method_id
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
pub fn get_id(&self) -> &common_utils::id_type::GlobalPaymentMethodId {
&self.id
}
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
#[derive(
Clone, Debug, Eq, PartialEq, Insertable, router_derive::DebugAsDisplay, Serialize, Deserialize,
)]
#[diesel(table_name = payment_methods)]
pub struct PaymentMethodNew {
pub customer_id: common_utils::id_type::CustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub payment_method_id: String,
pub payment_method: Option<storage_enums::PaymentMethod>,
pub payment_method_type: Option<storage_enums::PaymentMethodType>,
pub payment_method_issuer: Option<String>,
pub payment_method_issuer_code: Option<storage_enums::PaymentMethodIssuerCode>,
pub accepted_currency: Option<Vec<storage_enums::Currency>>,
pub scheme: Option<String>,
pub token: Option<String>,
pub cardholder_name: Option<Secret<String>>,
pub issuer_name: Option<String>,
pub issuer_country: Option<String>,
pub payer_country: Option<Vec<String>>,
pub is_stored: Option<bool>,
pub swift_code: Option<String>,
pub direct_debit_token: Option<String>,
pub created_at: PrimitiveDateTime,
pub last_modified: PrimitiveDateTime,
pub metadata: Option<pii::SecretSerdeValue>,
pub payment_method_data: Option<Encryption>,
pub locker_id: Option<String>,
pub last_used_at: PrimitiveDateTime,
pub connector_mandate_details: Option<serde_json::Value>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub status: storage_enums::PaymentMethodStatus,
pub network_transaction_id: Option<String>,
pub client_secret: Option<String>,
pub payment_method_billing_address: Option<Encryption>,
pub updated_by: Option<String>,
pub version: common_enums::ApiVersion,
pub network_token_requestor_reference_id: Option<String>,
pub network_token_locker_id: Option<String>,
pub network_token_payment_method_data: Option<Encryption>,
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay, Serialize, Deserialize)]
#[diesel(table_name = payment_methods)]
pub struct PaymentMethodNew {
pub customer_id: common_utils::id_type::GlobalCustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub created_at: PrimitiveDateTime,
pub last_modified: PrimitiveDateTime,
pub payment_method_data: Option<Encryption>,
pub locker_id: Option<String>,
pub last_used_at: PrimitiveDateTime,
pub connector_mandate_details: Option<CommonMandateReference>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub status: storage_enums::PaymentMethodStatus,
pub network_transaction_id: Option<String>,
pub client_secret: Option<String>,
pub payment_method_billing_address: Option<Encryption>,
pub updated_by: Option<String>,
pub version: common_enums::ApiVersion,
pub network_token_requestor_reference_id: Option<String>,
pub network_token_locker_id: Option<String>,
pub network_token_payment_method_data: Option<Encryption>,
pub locker_fingerprint_id: Option<String>,
pub payment_method_type_v2: Option<storage_enums::PaymentMethod>,
pub payment_method_subtype: Option<storage_enums::PaymentMethodType>,
pub id: common_utils::id_type::GlobalPaymentMethodId,
}
impl PaymentMethodNew {
pub fn update_storage_scheme(&mut self, storage_scheme: MerchantStorageScheme) {
self.updated_by = Some(storage_scheme.to_string());
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
pub fn get_id(&self) -> &String {
&self.payment_method_id
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
pub fn get_id(&self) -> &common_utils::id_type::GlobalPaymentMethodId {
&self.id
}
}
#[derive(Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct TokenizeCoreWorkflow {
pub lookup_key: String,
pub pm: storage_enums::PaymentMethod,
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
#[derive(Debug, Serialize, Deserialize)]
pub enum PaymentMethodUpdate {
MetadataUpdateAndLastUsed {
metadata: Option<serde_json::Value>,
last_used_at: PrimitiveDateTime,
},
UpdatePaymentMethodDataAndLastUsed {
payment_method_data: Option<Encryption>,
scheme: Option<String>,
last_used_at: PrimitiveDateTime,
},
PaymentMethodDataUpdate {
payment_method_data: Option<Encryption>,
},
LastUsedUpdate {
last_used_at: PrimitiveDateTime,
},
NetworkTransactionIdAndStatusUpdate {
network_transaction_id: Option<String>,
status: Option<storage_enums::PaymentMethodStatus>,
},
StatusUpdate {
status: Option<storage_enums::PaymentMethodStatus>,
},
AdditionalDataUpdate {
payment_method_data: Option<Encryption>,
status: Option<storage_enums::PaymentMethodStatus>,
locker_id: Option<String>,
payment_method: Option<storage_enums::PaymentMethod>,
payment_method_type: Option<storage_enums::PaymentMethodType>,
payment_method_issuer: Option<String>,
network_token_requestor_reference_id: Option<String>,
network_token_locker_id: Option<String>,
network_token_payment_method_data: Option<Encryption>,
},
ConnectorMandateDetailsUpdate {
connector_mandate_details: Option<serde_json::Value>,
},
NetworkTokenDataUpdate {
network_token_requestor_reference_id: Option<String>,
network_token_locker_id: Option<String>,
network_token_payment_method_data: Option<Encryption>,
},
ConnectorNetworkTransactionIdAndMandateDetailsUpdate {
connector_mandate_details: Option<pii::SecretSerdeValue>,
network_transaction_id: Option<Secret<String>>,
},
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
#[derive(Debug, Serialize, Deserialize)]
pub enum PaymentMethodUpdate {
UpdatePaymentMethodDataAndLastUsed {
payment_method_data: Option<Encryption>,
scheme: Option<String>,
last_used_at: PrimitiveDateTime,
},
PaymentMethodDataUpdate {
payment_method_data: Option<Encryption>,
},
LastUsedUpdate {
last_used_at: PrimitiveDateTime,
},
NetworkTransactionIdAndStatusUpdate {
network_transaction_id: Option<String>,
status: Option<storage_enums::PaymentMethodStatus>,
},
StatusUpdate {
status: Option<storage_enums::PaymentMethodStatus>,
},
GenericUpdate {
payment_method_data: Option<Encryption>,
status: Option<storage_enums::PaymentMethodStatus>,
locker_id: Option<String>,
payment_method_type_v2: Option<storage_enums::PaymentMethod>,
payment_method_subtype: Option<storage_enums::PaymentMethodType>,
network_token_requestor_reference_id: Option<String>,
network_token_locker_id: Option<String>,
network_token_payment_method_data: Option<Encryption>,
locker_fingerprint_id: Option<String>,
connector_mandate_details: Option<CommonMandateReference>,
},
ConnectorMandateDetailsUpdate {
connector_mandate_details: Option<CommonMandateReference>,
},
}
impl PaymentMethodUpdate {
pub fn convert_to_payment_method_update(
self,
storage_scheme: MerchantStorageScheme,
) -> PaymentMethodUpdateInternal {
let mut update_internal: PaymentMethodUpdateInternal = self.into();
update_internal.updated_by = Some(storage_scheme.to_string());
update_internal
}
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay, Serialize, Deserialize)]
#[diesel(table_name = payment_methods)]
pub struct PaymentMethodUpdateInternal {
payment_method_data: Option<Encryption>,
last_used_at: Option<PrimitiveDateTime>,
network_transaction_id: Option<String>,
status: Option<storage_enums::PaymentMethodStatus>,
locker_id: Option<String>,
payment_method_type_v2: Option<storage_enums::PaymentMethod>,
connector_mandate_details: Option<CommonMandateReference>,
updated_by: Option<String>,
payment_method_subtype: Option<storage_enums::PaymentMethodType>,
last_modified: PrimitiveDateTime,
network_token_requestor_reference_id: Option<String>,
network_token_locker_id: Option<String>,
network_token_payment_method_data: Option<Encryption>,
locker_fingerprint_id: Option<String>,
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
impl PaymentMethodUpdateInternal {
pub fn apply_changeset(self, source: PaymentMethod) -> PaymentMethod {
let Self {
payment_method_data,
last_used_at,
network_transaction_id,
status,
locker_id,
payment_method_type_v2,
connector_mandate_details,
updated_by,
payment_method_subtype,
last_modified,
network_token_requestor_reference_id,
network_token_locker_id,
network_token_payment_method_data,
locker_fingerprint_id,
} = self;
PaymentMethod {
customer_id: source.customer_id,
merchant_id: source.merchant_id,
created_at: source.created_at,
last_modified,
payment_method_data: payment_method_data.or(source.payment_method_data),
locker_id: locker_id.or(source.locker_id),
last_used_at: last_used_at.unwrap_or(source.last_used_at),
connector_mandate_details: connector_mandate_details
.or(source.connector_mandate_details),
customer_acceptance: source.customer_acceptance,
status: status.unwrap_or(source.status),
network_transaction_id: network_transaction_id.or(source.network_transaction_id),
client_secret: source.client_secret,
payment_method_billing_address: source.payment_method_billing_address,
updated_by: updated_by.or(source.updated_by),
locker_fingerprint_id: locker_fingerprint_id.or(source.locker_fingerprint_id),
payment_method_type_v2: payment_method_type_v2.or(source.payment_method_type_v2),
payment_method_subtype: payment_method_subtype.or(source.payment_method_subtype),
id: source.id,
version: source.version,
network_token_requestor_reference_id: network_token_requestor_reference_id
.or(source.network_token_requestor_reference_id),
network_token_locker_id: network_token_locker_id.or(source.network_token_locker_id),
network_token_payment_method_data: network_token_payment_method_data
.or(source.network_token_payment_method_data),
}
}
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay, Serialize, Deserialize)]
#[diesel(table_name = payment_methods)]
pub struct PaymentMethodUpdateInternal {
metadata: Option<serde_json::Value>,
payment_method_data: Option<Encryption>,
last_used_at: Option<PrimitiveDateTime>,
network_transaction_id: Option<String>,
status: Option<storage_enums::PaymentMethodStatus>,
locker_id: Option<String>,
network_token_requestor_reference_id: Option<String>,
payment_method: Option<storage_enums::PaymentMethod>,
connector_mandate_details: Option<serde_json::Value>,
updated_by: Option<String>,
payment_method_type: Option<storage_enums::PaymentMethodType>,
payment_method_issuer: Option<String>,
last_modified: PrimitiveDateTime,
network_token_locker_id: Option<String>,
network_token_payment_method_data: Option<Encryption>,
scheme: Option<String>,
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
impl PaymentMethodUpdateInternal {
pub fn apply_changeset(self, source: PaymentMethod) -> PaymentMethod {
let Self {
metadata,
payment_method_data,
last_used_at,
network_transaction_id,
status,
locker_id,
network_token_requestor_reference_id,
payment_method,
connector_mandate_details,
updated_by,
payment_method_type,
payment_method_issuer,
last_modified,
network_token_locker_id,
network_token_payment_method_data,
scheme,
} = self;
PaymentMethod {
customer_id: source.customer_id,
merchant_id: source.merchant_id,
payment_method_id: source.payment_method_id,
accepted_currency: source.accepted_currency,
scheme: scheme.or(source.scheme),
token: source.token,
cardholder_name: source.cardholder_name,
issuer_name: source.issuer_name,
issuer_country: source.issuer_country,
payer_country: source.payer_country,
is_stored: source.is_stored,
swift_code: source.swift_code,
direct_debit_token: source.direct_debit_token,
created_at: source.created_at,
last_modified,
payment_method: payment_method.or(source.payment_method),
payment_method_type: payment_method_type.or(source.payment_method_type),
payment_method_issuer: payment_method_issuer.or(source.payment_method_issuer),
payment_method_issuer_code: source.payment_method_issuer_code,
metadata: metadata.map_or(source.metadata, |v| Some(v.into())),
payment_method_data: payment_method_data.or(source.payment_method_data),
locker_id: locker_id.or(source.locker_id),
last_used_at: last_used_at.unwrap_or(source.last_used_at),
connector_mandate_details: connector_mandate_details
.or(source.connector_mandate_details),
customer_acceptance: source.customer_acceptance,
status: status.unwrap_or(source.status),
network_transaction_id: network_transaction_id.or(source.network_transaction_id),
client_secret: source.client_secret,
payment_method_billing_address: source.payment_method_billing_address,
updated_by: updated_by.or(source.updated_by),
version: source.version,
network_token_requestor_reference_id: network_token_requestor_reference_id
.or(source.network_token_requestor_reference_id),
network_token_locker_id: network_token_locker_id.or(source.network_token_locker_id),
network_token_payment_method_data: network_token_payment_method_data
.or(source.network_token_payment_method_data),
}
}
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
impl From<PaymentMethodUpdate> for PaymentMethodUpdateInternal {
fn from(payment_method_update: PaymentMethodUpdate) -> Self {
match payment_method_update {
PaymentMethodUpdate::MetadataUpdateAndLastUsed {
metadata,
last_used_at,
} => Self {
metadata,
payment_method_data: None,
last_used_at: Some(last_used_at),
network_transaction_id: None,
status: None,
locker_id: None,
network_token_requestor_reference_id: None,
payment_method: None,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme: None,
},
PaymentMethodUpdate::PaymentMethodDataUpdate {
payment_method_data,
} => Self {
metadata: None,
payment_method_data,
last_used_at: None,
network_transaction_id: None,
status: None,
locker_id: None,
network_token_requestor_reference_id: None,
payment_method: None,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme: None,
},
PaymentMethodUpdate::LastUsedUpdate { last_used_at } => Self {
metadata: None,
payment_method_data: None,
last_used_at: Some(last_used_at),
network_transaction_id: None,
status: None,
locker_id: None,
network_token_requestor_reference_id: None,
payment_method: None,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme: None,
},
PaymentMethodUpdate::UpdatePaymentMethodDataAndLastUsed {
payment_method_data,
scheme,
last_used_at,
} => Self {
metadata: None,
payment_method_data,
last_used_at: Some(last_used_at),
network_transaction_id: None,
status: None,
locker_id: None,
network_token_requestor_reference_id: None,
payment_method: None,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme,
},
PaymentMethodUpdate::NetworkTransactionIdAndStatusUpdate {
network_transaction_id,
status,
} => Self {
metadata: None,
payment_method_data: None,
last_used_at: None,
network_transaction_id,
status,
locker_id: None,
network_token_requestor_reference_id: None,
payment_method: None,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme: None,
},
PaymentMethodUpdate::StatusUpdate { status } => Self {
metadata: None,
payment_method_data: None,
last_used_at: None,
network_transaction_id: None,
status,
locker_id: None,
network_token_requestor_reference_id: None,
payment_method: None,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme: None,
},
PaymentMethodUpdate::AdditionalDataUpdate {
payment_method_data,
status,
locker_id,
network_token_requestor_reference_id,
payment_method,
payment_method_type,
payment_method_issuer,
network_token_locker_id,
network_token_payment_method_data,
} => Self {
metadata: None,
payment_method_data,
last_used_at: None,
network_transaction_id: None,
status,
locker_id,
network_token_requestor_reference_id,
payment_method,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer,
payment_method_type,
last_modified: common_utils::date_time::now(),
network_token_locker_id,
network_token_payment_method_data,
scheme: None,
},
PaymentMethodUpdate::ConnectorMandateDetailsUpdate {
connector_mandate_details,
} => Self {
metadata: None,
payment_method_data: None,
last_used_at: None,
status: None,
locker_id: None,
network_token_requestor_reference_id: None,
payment_method: None,
connector_mandate_details,
network_transaction_id: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme: None,
},
PaymentMethodUpdate::NetworkTokenDataUpdate {
network_token_requestor_reference_id,
network_token_locker_id,
network_token_payment_method_data,
} => Self {
metadata: None,
payment_method_data: None,
last_used_at: None,
status: None,
locker_id: None,
payment_method: None,
connector_mandate_details: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
last_modified: common_utils::date_time::now(),
network_transaction_id: None,
network_token_requestor_reference_id,
network_token_locker_id,
network_token_payment_method_data,
scheme: None,
},
PaymentMethodUpdate::ConnectorNetworkTransactionIdAndMandateDetailsUpdate {
connector_mandate_details,
network_transaction_id,
} => Self {
connector_mandate_details: connector_mandate_details
.map(|mandate_details| mandate_details.expose()),
network_transaction_id: network_transaction_id.map(|txn_id| txn_id.expose()),
last_modified: common_utils::date_time::now(),
status: None,
metadata: None,
payment_method_data: None,
last_used_at: None,
locker_id: None,
payment_method: None,
updated_by: None,
payment_method_issuer: None,
payment_method_type: None,
network_token_requestor_reference_id: None,
network_token_locker_id: None,
network_token_payment_method_data: None,
scheme: None,
},
}
}
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
impl From<PaymentMethodUpdate> for PaymentMethodUpdateInternal {
fn from(payment_method_update: PaymentMethodUpdate) -> Self {
match payment_method_update {
PaymentMethodUpdate::PaymentMethodDataUpdate {
payment_method_data,
} => Self {
payment_method_data,
last_used_at: None,
network_transaction_id: None,
status: None,
locker_id: None,
payment_method_type_v2: None,
connector_mandate_details: None,
updated_by: None,
payment_method_subtype: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_requestor_reference_id: None,
network_token_payment_method_data: None,
locker_fingerprint_id: None,
},
PaymentMethodUpdate::LastUsedUpdate { last_used_at } => Self {
payment_method_data: None,
last_used_at: Some(last_used_at),
network_transaction_id: None,
status: None,
locker_id: None,
payment_method_type_v2: None,
connector_mandate_details: None,
updated_by: None,
payment_method_subtype: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_requestor_reference_id: None,
network_token_payment_method_data: None,
locker_fingerprint_id: None,
},
PaymentMethodUpdate::UpdatePaymentMethodDataAndLastUsed {
payment_method_data,
last_used_at,
..
} => Self {
payment_method_data,
last_used_at: Some(last_used_at),
network_transaction_id: None,
status: None,
locker_id: None,
payment_method_type_v2: None,
connector_mandate_details: None,
updated_by: None,
payment_method_subtype: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_requestor_reference_id: None,
network_token_payment_method_data: None,
locker_fingerprint_id: None,
},
PaymentMethodUpdate::NetworkTransactionIdAndStatusUpdate {
network_transaction_id,
status,
} => Self {
payment_method_data: None,
last_used_at: None,
network_transaction_id,
status,
locker_id: None,
payment_method_type_v2: None,
connector_mandate_details: None,
updated_by: None,
payment_method_subtype: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_requestor_reference_id: None,
network_token_payment_method_data: None,
locker_fingerprint_id: None,
},
PaymentMethodUpdate::StatusUpdate { status } => Self {
payment_method_data: None,
last_used_at: None,
network_transaction_id: None,
status,
locker_id: None,
payment_method_type_v2: None,
connector_mandate_details: None,
updated_by: None,
payment_method_subtype: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_requestor_reference_id: None,
network_token_payment_method_data: None,
locker_fingerprint_id: None,
},
PaymentMethodUpdate::GenericUpdate {
payment_method_data,
status,
locker_id,
payment_method_type_v2,
payment_method_subtype,
network_token_requestor_reference_id,
network_token_locker_id,
network_token_payment_method_data,
locker_fingerprint_id,
connector_mandate_details,
} => Self {
payment_method_data,
last_used_at: None,
network_transaction_id: None,
status,
locker_id,
payment_method_type_v2,
connector_mandate_details,
updated_by: None,
payment_method_subtype,
last_modified: common_utils::date_time::now(),
network_token_requestor_reference_id,
network_token_locker_id,
network_token_payment_method_data,
locker_fingerprint_id,
},
PaymentMethodUpdate::ConnectorMandateDetailsUpdate {
connector_mandate_details,
} => Self {
payment_method_data: None,
last_used_at: None,
status: None,
locker_id: None,
payment_method_type_v2: None,
connector_mandate_details,
network_transaction_id: None,
updated_by: None,
payment_method_subtype: None,
last_modified: common_utils::date_time::now(),
network_token_locker_id: None,
network_token_requestor_reference_id: None,
network_token_payment_method_data: None,
locker_fingerprint_id: None,
},
}
}
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
impl From<&PaymentMethodNew> for PaymentMethod {
fn from(payment_method_new: &PaymentMethodNew) -> Self {
Self {
customer_id: payment_method_new.customer_id.clone(),
merchant_id: payment_method_new.merchant_id.clone(),
payment_method_id: payment_method_new.payment_method_id.clone(),
locker_id: payment_method_new.locker_id.clone(),
network_token_requestor_reference_id: payment_method_new
.network_token_requestor_reference_id
.clone(),
accepted_currency: payment_method_new.accepted_currency.clone(),
scheme: payment_method_new.scheme.clone(),
token: payment_method_new.token.clone(),
cardholder_name: payment_method_new.cardholder_name.clone(),
issuer_name: payment_method_new.issuer_name.clone(),
issuer_country: payment_method_new.issuer_country.clone(),
payer_country: payment_method_new.payer_country.clone(),
is_stored: payment_method_new.is_stored,
swift_code: payment_method_new.swift_code.clone(),
direct_debit_token: payment_method_new.direct_debit_token.clone(),
created_at: payment_method_new.created_at,
last_modified: payment_method_new.last_modified,
payment_method: payment_method_new.payment_method,
payment_method_type: payment_method_new.payment_method_type,
payment_method_issuer: payment_method_new.payment_method_issuer.clone(),
payment_method_issuer_code: payment_method_new.payment_method_issuer_code,
metadata: payment_method_new.metadata.clone(),
payment_method_data: payment_method_new.payment_method_data.clone(),
last_used_at: payment_method_new.last_used_at,
connector_mandate_details: payment_method_new.connector_mandate_details.clone(),
customer_acceptance: payment_method_new.customer_acceptance.clone(),
status: payment_method_new.status,
network_transaction_id: payment_method_new.network_transaction_id.clone(),
client_secret: payment_method_new.client_secret.clone(),
updated_by: payment_method_new.updated_by.clone(),
payment_method_billing_address: payment_method_new
.payment_method_billing_address
.clone(),
version: payment_method_new.version,
network_token_locker_id: payment_method_new.network_token_locker_id.clone(),
network_token_payment_method_data: payment_method_new
.network_token_payment_method_data
.clone(),
}
}
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
impl From<&PaymentMethodNew> for PaymentMethod {
fn from(payment_method_new: &PaymentMethodNew) -> Self {
Self {
customer_id: payment_method_new.customer_id.clone(),
merchant_id: payment_method_new.merchant_id.clone(),
locker_id: payment_method_new.locker_id.clone(),
created_at: payment_method_new.created_at,
last_modified: payment_method_new.last_modified,
payment_method_data: payment_method_new.payment_method_data.clone(),
last_used_at: payment_method_new.last_used_at,
connector_mandate_details: payment_method_new.connector_mandate_details.clone(),
customer_acceptance: payment_method_new.customer_acceptance.clone(),
status: payment_method_new.status,
network_transaction_id: payment_method_new.network_transaction_id.clone(),
client_secret: payment_method_new.client_secret.clone(),
updated_by: payment_method_new.updated_by.clone(),
payment_method_billing_address: payment_method_new
.payment_method_billing_address
.clone(),
locker_fingerprint_id: payment_method_new.locker_fingerprint_id.clone(),
payment_method_type_v2: payment_method_new.payment_method_type_v2,
payment_method_subtype: payment_method_new.payment_method_subtype,
id: payment_method_new.id.clone(),
version: payment_method_new.version,
network_token_requestor_reference_id: payment_method_new
.network_token_requestor_reference_id
.clone(),
network_token_locker_id: payment_method_new.network_token_locker_id.clone(),
network_token_payment_method_data: payment_method_new
.network_token_payment_method_data
.clone(),
}
}
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct PaymentsMandateReferenceRecord {
pub connector_mandate_id: String,
pub payment_method_type: Option<common_enums::PaymentMethodType>,
pub original_payment_authorized_amount: Option<i64>,
pub original_payment_authorized_currency: Option<common_enums::Currency>,
pub mandate_metadata: Option<pii::SecretSerdeValue>,
pub connector_mandate_status: Option<common_enums::ConnectorMandateStatus>,
pub connector_mandate_request_reference_id: Option<String>,
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ConnectorTokenReferenceRecord {
pub connector_token: String,
pub payment_method_subtype: Option<common_enums::PaymentMethodType>,
pub original_payment_authorized_amount: Option<common_utils::types::MinorUnit>,
pub original_payment_authorized_currency: Option<common_enums::Currency>,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_token_status: common_enums::ConnectorTokenStatus,
pub connector_token_request_reference_id: Option<String>,
}
#[cfg(feature = "v1")]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct PaymentsMandateReference(
pub HashMap<common_utils::id_type::MerchantConnectorAccountId, PaymentsMandateReferenceRecord>,
);
#[cfg(feature = "v1")]
impl std::ops::Deref for PaymentsMandateReference {
type Target =
HashMap<common_utils::id_type::MerchantConnectorAccountId, PaymentsMandateReferenceRecord>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[cfg(feature = "v1")]
impl std::ops::DerefMut for PaymentsMandateReference {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[cfg(feature = "v2")]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct PaymentsTokenReference(
pub HashMap<common_utils::id_type::MerchantConnectorAccountId, ConnectorTokenReferenceRecord>,
);
#[cfg(feature = "v2")]
impl std::ops::Deref for PaymentsTokenReference {
type Target =
HashMap<common_utils::id_type::MerchantConnectorAccountId, ConnectorTokenReferenceRecord>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[cfg(feature = "v2")]
impl std::ops::DerefMut for PaymentsTokenReference {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[cfg(feature = "v1")]
common_utils::impl_to_sql_from_sql_json!(PaymentsMandateReference);
#[cfg(feature = "v2")]
common_utils::impl_to_sql_from_sql_json!(PaymentsTokenReference);
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
pub struct PayoutsMandateReferenceRecord {
pub transfer_method_id: Option<String>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct PayoutsMandateReference(
pub HashMap<common_utils::id_type::MerchantConnectorAccountId, PayoutsMandateReferenceRecord>,
);
impl std::ops::Deref for PayoutsMandateReference {
type Target =
HashMap<common_utils::id_type::MerchantConnectorAccountId, PayoutsMandateReferenceRecord>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for PayoutsMandateReference {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[cfg(feature = "v1")]
#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct CommonMandateReference {
pub payments: Option<PaymentsMandateReference>,
pub payouts: Option<PayoutsMandateReference>,
}
#[cfg(feature = "v2")]
#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct CommonMandateReference {
pub payments: Option<PaymentsTokenReference>,
pub payouts: Option<PayoutsMandateReference>,
}
impl CommonMandateReference {
pub fn get_mandate_details_value(&self) -> CustomResult<serde_json::Value, ParsingError> {
let mut payments = self
.payments
.as_ref()
.map_or_else(|| Ok(serde_json::json!({})), serde_json::to_value)
.change_context(ParsingError::StructParseFailure("payment mandate details"))?;
self.payouts
.as_ref()
.map(|payouts_mandate| {
serde_json::to_value(payouts_mandate).map(|payouts_mandate_value| {
payments.as_object_mut().map(|payments_object| {
payments_object.insert("payouts".to_string(), payouts_mandate_value);
})
})
})
.transpose()
.change_context(ParsingError::StructParseFailure("payout mandate details"))?;
Ok(payments)
}
#[cfg(feature = "v2")]
/// Insert a new payment token reference for the given connector_id
pub fn insert_payment_token_reference_record(
&mut self,
connector_id: &common_utils::id_type::MerchantConnectorAccountId,
record: ConnectorTokenReferenceRecord,
) {
match self.payments {
Some(ref mut payments_reference) => {
payments_reference.insert(connector_id.clone(), record);
}
None => {
let mut payments_reference = HashMap::new();
payments_reference.insert(connector_id.clone(), record);
self.payments = Some(PaymentsTokenReference(payments_reference));
}
}
}
}
impl diesel::serialize::ToSql<diesel::sql_types::Jsonb, diesel::pg::Pg> for CommonMandateReference {
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, diesel::pg::Pg>,
) -> diesel::serialize::Result {
let payments = self.get_mandate_details_value()?;
<serde_json::Value as diesel::serialize::ToSql<
diesel::sql_types::Jsonb,
diesel::pg::Pg,
>>::to_sql(&payments, &mut out.reborrow())
}
}
#[cfg(feature = "v1")]
impl<DB: diesel::backend::Backend> diesel::deserialize::FromSql<diesel::sql_types::Jsonb, DB>
for CommonMandateReference
where
serde_json::Value: diesel::deserialize::FromSql<diesel::sql_types::Jsonb, DB>,
{
fn from_sql(bytes: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
let value = <serde_json::Value as diesel::deserialize::FromSql<
diesel::sql_types::Jsonb,
DB,
>>::from_sql(bytes)?;
let payments_data = value
.clone()
.as_object_mut()
.map(|obj| {
obj.remove("payouts");
serde_json::from_value::<PaymentsMandateReference>(serde_json::Value::Object(
obj.clone(),
))
.inspect_err(|err| {
router_env::logger::error!("Failed to parse payments data: {}", err);
})
.change_context(ParsingError::StructParseFailure(
"Failed to parse payments data",
))
})
.transpose()?;
let payouts_data = serde_json::from_value::<Option<Self>>(value)
.inspect_err(|err| {
router_env::logger::error!("Failed to parse payouts data: {}", err);
})
.change_context(ParsingError::StructParseFailure(
"Failed to parse payouts data",
))
.map(|optional_common_mandate_details| {
optional_common_mandate_details
.and_then(|common_mandate_details| common_mandate_details.payouts)
})?;
Ok(Self {
payments: payments_data,
payouts: payouts_data,
})
}
}
#[cfg(feature = "v2")]
impl<DB: diesel::backend::Backend> diesel::deserialize::FromSql<diesel::sql_types::Jsonb, DB>
for CommonMandateReference
where
serde_json::Value: diesel::deserialize::FromSql<diesel::sql_types::Jsonb, DB>,
{
fn from_sql(bytes: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
let value = <serde_json::Value as diesel::deserialize::FromSql<
diesel::sql_types::Jsonb,
DB,
>>::from_sql(bytes)?;
let payments_data = value
.clone()
.as_object_mut()
.map(|obj| {
obj.remove("payouts");
serde_json::from_value::<PaymentsTokenReference>(serde_json::Value::Object(
obj.clone(),
))
.inspect_err(|err| {
router_env::logger::error!("Failed to parse payments data: {}", err);
})
.change_context(ParsingError::StructParseFailure(
"Failed to parse payments data",
))
})
.transpose()?;
let payouts_data = serde_json::from_value::<Option<Self>>(value)
.inspect_err(|err| {
router_env::logger::error!("Failed to parse payouts data: {}", err);
})
.change_context(ParsingError::StructParseFailure(
"Failed to parse payouts data",
))
.map(|optional_common_mandate_details| {
optional_common_mandate_details
.and_then(|common_mandate_details| common_mandate_details.payouts)
})?;
Ok(Self {
payments: payments_data,
payouts: payouts_data,
})
}
}
#[cfg(feature = "v1")]
impl From<PaymentsMandateReference> for CommonMandateReference {
fn from(payment_reference: PaymentsMandateReference) -> Self {
Self {
payments: Some(payment_reference),
payouts: None,
}
}
}
| 9,954 | 815 |
hyperswitch | crates/diesel_models/src/fraud_check.rs | .rs | use common_enums as storage_enums;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use masking::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use crate::{
enums::{FraudCheckLastStep, FraudCheckStatus, FraudCheckType},
schema::fraud_check,
};
#[derive(Clone, Debug, Identifiable, Queryable, Selectable, Serialize, Deserialize)]
#[diesel(table_name = fraud_check, primary_key(payment_id, merchant_id), check_for_backend(diesel::pg::Pg))]
pub struct FraudCheck {
pub frm_id: String,
pub payment_id: common_utils::id_type::PaymentId,
pub merchant_id: common_utils::id_type::MerchantId,
pub attempt_id: String,
pub created_at: PrimitiveDateTime,
pub frm_name: String,
pub frm_transaction_id: Option<String>,
pub frm_transaction_type: FraudCheckType,
pub frm_status: FraudCheckStatus,
pub frm_score: Option<i32>,
pub frm_reason: Option<serde_json::Value>,
pub frm_error: Option<String>,
pub payment_details: Option<serde_json::Value>,
pub metadata: Option<serde_json::Value>,
pub modified_at: PrimitiveDateTime,
pub last_step: FraudCheckLastStep,
pub payment_capture_method: Option<storage_enums::CaptureMethod>, // In postFrm, we are updating capture method from automatic to manual. To store the merchant actual capture method, we are storing the actual capture method in payment_capture_method. It will be useful while approving the FRM decision.
}
#[derive(router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = fraud_check)]
pub struct FraudCheckNew {
pub frm_id: String,
pub payment_id: common_utils::id_type::PaymentId,
pub merchant_id: common_utils::id_type::MerchantId,
pub attempt_id: String,
pub created_at: PrimitiveDateTime,
pub frm_name: String,
pub frm_transaction_id: Option<String>,
pub frm_transaction_type: FraudCheckType,
pub frm_status: FraudCheckStatus,
pub frm_score: Option<i32>,
pub frm_reason: Option<serde_json::Value>,
pub frm_error: Option<String>,
pub payment_details: Option<serde_json::Value>,
pub metadata: Option<serde_json::Value>,
pub modified_at: PrimitiveDateTime,
pub last_step: FraudCheckLastStep,
pub payment_capture_method: Option<storage_enums::CaptureMethod>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum FraudCheckUpdate {
//Refer PaymentAttemptUpdate for other variants implementations
ResponseUpdate {
frm_status: FraudCheckStatus,
frm_transaction_id: Option<String>,
frm_reason: Option<serde_json::Value>,
frm_score: Option<i32>,
metadata: Option<serde_json::Value>,
modified_at: PrimitiveDateTime,
last_step: FraudCheckLastStep,
payment_capture_method: Option<storage_enums::CaptureMethod>,
},
ErrorUpdate {
status: FraudCheckStatus,
error_message: Option<Option<String>>,
},
}
#[derive(Clone, Debug, Default, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = fraud_check)]
pub struct FraudCheckUpdateInternal {
frm_status: Option<FraudCheckStatus>,
frm_transaction_id: Option<String>,
frm_reason: Option<serde_json::Value>,
frm_score: Option<i32>,
frm_error: Option<Option<String>>,
metadata: Option<serde_json::Value>,
last_step: FraudCheckLastStep,
payment_capture_method: Option<storage_enums::CaptureMethod>,
}
impl From<FraudCheckUpdate> for FraudCheckUpdateInternal {
fn from(fraud_check_update: FraudCheckUpdate) -> Self {
match fraud_check_update {
FraudCheckUpdate::ResponseUpdate {
frm_status,
frm_transaction_id,
frm_reason,
frm_score,
metadata,
modified_at: _,
last_step,
payment_capture_method,
} => Self {
frm_status: Some(frm_status),
frm_transaction_id,
frm_reason,
frm_score,
metadata,
last_step,
payment_capture_method,
..Default::default()
},
FraudCheckUpdate::ErrorUpdate {
status,
error_message,
} => Self {
frm_status: Some(status),
frm_error: error_message,
..Default::default()
},
}
}
}
| 968 | 816 |
hyperswitch | crates/diesel_models/src/types.rs | .rs | #[cfg(feature = "v2")]
use common_enums::enums::PaymentConnectorTransmission;
#[cfg(feature = "v2")]
use common_utils::id_type;
use common_utils::{hashing::HashedString, pii, types::MinorUnit};
use diesel::{
sql_types::{Json, Jsonb},
AsExpression, FromSqlRow,
};
use masking::{Secret, WithType};
use serde::{self, Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, FromSqlRow, AsExpression)]
#[diesel(sql_type = Jsonb)]
pub struct OrderDetailsWithAmount {
/// Name of the product that is being purchased
pub product_name: String,
/// The quantity of the product to be purchased
pub quantity: u16,
/// the amount per quantity of product
pub amount: MinorUnit,
// Does the order includes shipping
pub requires_shipping: Option<bool>,
/// The image URL of the product
pub product_img_link: Option<String>,
/// ID of the product that is being purchased
pub product_id: Option<String>,
/// Category of the product that is being purchased
pub category: Option<String>,
/// Sub category of the product that is being purchased
pub sub_category: Option<String>,
/// Brand of the product that is being purchased
pub brand: Option<String>,
/// Type of the product that is being purchased
pub product_type: Option<common_enums::ProductType>,
/// The tax code for the product
pub product_tax_code: Option<String>,
/// tax rate applicable to the product
pub tax_rate: Option<f64>,
/// total tax amount applicable to the product
pub total_tax_amount: Option<MinorUnit>,
}
impl masking::SerializableSecret for OrderDetailsWithAmount {}
common_utils::impl_to_sql_from_sql_json!(OrderDetailsWithAmount);
#[cfg(feature = "v2")]
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize, FromSqlRow, AsExpression)]
#[diesel(sql_type = Json)]
pub struct FeatureMetadata {
/// Redirection response coming in request as metadata field only for redirection scenarios
pub redirect_response: Option<RedirectResponse>,
/// Additional tags to be used for global search
pub search_tags: Option<Vec<HashedString<WithType>>>,
/// Recurring payment details required for apple pay Merchant Token
pub apple_pay_recurring_details: Option<ApplePayRecurringDetails>,
/// revenue recovery data for payment intent
pub payment_revenue_recovery_metadata: Option<PaymentRevenueRecoveryMetadata>,
}
#[cfg(feature = "v2")]
impl FeatureMetadata {
pub fn get_payment_method_sub_type(&self) -> Option<common_enums::PaymentMethodType> {
self.payment_revenue_recovery_metadata
.as_ref()
.map(|rrm| rrm.payment_method_subtype)
}
pub fn get_payment_method_type(&self) -> Option<common_enums::PaymentMethod> {
self.payment_revenue_recovery_metadata
.as_ref()
.map(|recovery_metadata| recovery_metadata.payment_method_type)
}
pub fn get_billing_merchant_connector_account_id(
&self,
) -> Option<id_type::MerchantConnectorAccountId> {
self.payment_revenue_recovery_metadata
.as_ref()
.map(|recovery_metadata| recovery_metadata.billing_connector_id.clone())
}
// TODO: Check search_tags for relevant payment method type
// TODO: Check redirect_response metadata if applicable
// TODO: Check apple_pay_recurring_details metadata if applicable
}
#[cfg(feature = "v1")]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, FromSqlRow, AsExpression)]
#[diesel(sql_type = Json)]
pub struct FeatureMetadata {
/// Redirection response coming in request as metadata field only for redirection scenarios
pub redirect_response: Option<RedirectResponse>,
/// Additional tags to be used for global search
pub search_tags: Option<Vec<HashedString<WithType>>>,
/// Recurring payment details required for apple pay Merchant Token
pub apple_pay_recurring_details: Option<ApplePayRecurringDetails>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, FromSqlRow, AsExpression)]
#[diesel(sql_type = Json)]
pub struct ApplePayRecurringDetails {
/// A description of the recurring payment that Apple Pay displays to the user in the payment sheet
pub payment_description: String,
/// The regular billing cycle for the recurring payment, including start and end dates, an interval, and an interval count
pub regular_billing: ApplePayRegularBillingDetails,
/// A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment
pub billing_agreement: Option<String>,
/// A URL to a web page where the user can update or delete the payment method for the recurring payment
pub management_url: common_utils::types::Url,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, FromSqlRow, AsExpression)]
#[diesel(sql_type = Json)]
pub struct ApplePayRegularBillingDetails {
/// The label that Apple Pay displays to the user in the payment sheet with the recurring details
pub label: String,
/// The date of the first payment
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub recurring_payment_start_date: Option<time::PrimitiveDateTime>,
/// The date of the final payment
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub recurring_payment_end_date: Option<time::PrimitiveDateTime>,
/// The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval
pub recurring_payment_interval_unit: Option<RecurringPaymentIntervalUnit>,
/// The number of interval units that make up the total payment interval
pub recurring_payment_interval_count: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, FromSqlRow, AsExpression)]
#[diesel(sql_type = Json)]
#[serde(rename_all = "snake_case")]
pub enum RecurringPaymentIntervalUnit {
Year,
Month,
Day,
Hour,
Minute,
}
common_utils::impl_to_sql_from_sql_json!(ApplePayRecurringDetails);
common_utils::impl_to_sql_from_sql_json!(ApplePayRegularBillingDetails);
common_utils::impl_to_sql_from_sql_json!(RecurringPaymentIntervalUnit);
common_utils::impl_to_sql_from_sql_json!(FeatureMetadata);
#[derive(Default, Debug, Eq, PartialEq, Deserialize, Serialize, Clone)]
pub struct RedirectResponse {
pub param: Option<Secret<String>>,
pub json_payload: Option<pii::SecretSerdeValue>,
}
impl masking::SerializableSecret for RedirectResponse {}
common_utils::impl_to_sql_from_sql_json!(RedirectResponse);
#[cfg(feature = "v2")]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct PaymentRevenueRecoveryMetadata {
/// Total number of billing connector + recovery retries for a payment intent.
pub total_retry_count: u16,
/// Flag for the payment connector's call
pub payment_connector_transmission: PaymentConnectorTransmission,
/// Billing Connector Id to update the invoices
pub billing_connector_id: id_type::MerchantConnectorAccountId,
/// Payment Connector Id to retry the payments
pub active_attempt_payment_connector_id: id_type::MerchantConnectorAccountId,
/// Billing Connector Payment Details
pub billing_connector_payment_details: BillingConnectorPaymentDetails,
///Payment Method Type
pub payment_method_type: common_enums::enums::PaymentMethod,
/// PaymentMethod Subtype
pub payment_method_subtype: common_enums::enums::PaymentMethodType,
/// The name of the payment connector through which the payment attempt was made.
pub connector: common_enums::connector_enums::Connector,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[cfg(feature = "v2")]
pub struct BillingConnectorPaymentDetails {
/// Payment Processor Token to process the Revenue Recovery Payment
pub payment_processor_token: String,
/// Billing Connector's Customer Id
pub connector_customer_id: String,
}
| 1,734 | 817 |
hyperswitch | crates/diesel_models/src/mandate.rs | .rs | use common_enums::MerchantStorageScheme;
use common_utils::pii;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use masking::Secret;
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, schema::mandate};
#[derive(
Clone, Debug, Identifiable, Queryable, Selectable, serde::Serialize, serde::Deserialize,
)]
#[diesel(table_name = mandate, primary_key(mandate_id), check_for_backend(diesel::pg::Pg))]
pub struct Mandate {
pub mandate_id: String,
pub customer_id: common_utils::id_type::CustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub payment_method_id: String,
pub mandate_status: storage_enums::MandateStatus,
pub mandate_type: storage_enums::MandateType,
pub customer_accepted_at: Option<PrimitiveDateTime>,
pub customer_ip_address: Option<Secret<String, pii::IpAddress>>,
pub customer_user_agent: Option<String>,
pub network_transaction_id: Option<String>,
pub previous_attempt_id: Option<String>,
pub created_at: PrimitiveDateTime,
pub mandate_amount: Option<i64>,
pub mandate_currency: Option<storage_enums::Currency>,
pub amount_captured: Option<i64>,
pub connector: String,
pub connector_mandate_id: Option<String>,
pub start_date: Option<PrimitiveDateTime>,
pub end_date: Option<PrimitiveDateTime>,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_mandate_ids: Option<pii::SecretSerdeValue>,
pub original_payment_id: Option<common_utils::id_type::PaymentId>,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub updated_by: Option<String>,
}
#[derive(
router_derive::Setter,
Clone,
Debug,
Default,
Insertable,
router_derive::DebugAsDisplay,
serde::Serialize,
serde::Deserialize,
)]
#[diesel(table_name = mandate)]
pub struct MandateNew {
pub mandate_id: String,
pub customer_id: common_utils::id_type::CustomerId,
pub merchant_id: common_utils::id_type::MerchantId,
pub payment_method_id: String,
pub mandate_status: storage_enums::MandateStatus,
pub mandate_type: storage_enums::MandateType,
pub customer_accepted_at: Option<PrimitiveDateTime>,
pub customer_ip_address: Option<Secret<String, pii::IpAddress>>,
pub customer_user_agent: Option<String>,
pub network_transaction_id: Option<String>,
pub previous_attempt_id: Option<String>,
pub created_at: Option<PrimitiveDateTime>,
pub mandate_amount: Option<i64>,
pub mandate_currency: Option<storage_enums::Currency>,
pub amount_captured: Option<i64>,
pub connector: String,
pub connector_mandate_id: Option<String>,
pub start_date: Option<PrimitiveDateTime>,
pub end_date: Option<PrimitiveDateTime>,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_mandate_ids: Option<pii::SecretSerdeValue>,
pub original_payment_id: Option<common_utils::id_type::PaymentId>,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub updated_by: Option<String>,
}
impl MandateNew {
pub fn update_storage_scheme(&mut self, storage_scheme: MerchantStorageScheme) {
self.updated_by = Some(storage_scheme.to_string());
}
}
#[derive(Debug)]
pub enum MandateUpdate {
StatusUpdate {
mandate_status: storage_enums::MandateStatus,
},
CaptureAmountUpdate {
amount_captured: Option<i64>,
},
ConnectorReferenceUpdate {
connector_mandate_ids: Option<pii::SecretSerdeValue>,
},
ConnectorMandateIdUpdate {
connector_mandate_id: Option<String>,
connector_mandate_ids: Option<pii::SecretSerdeValue>,
payment_method_id: String,
original_payment_id: Option<common_utils::id_type::PaymentId>,
},
}
impl MandateUpdate {
pub fn convert_to_mandate_update(
self,
storage_scheme: MerchantStorageScheme,
) -> MandateUpdateInternal {
let mut updated_object = MandateUpdateInternal::from(self);
updated_object.updated_by = Some(storage_scheme.to_string());
updated_object
}
}
#[derive(Clone, Eq, PartialEq, Copy, Debug, Default, serde::Serialize, serde::Deserialize)]
pub struct SingleUseMandate {
pub amount: i64,
pub currency: storage_enums::Currency,
}
#[derive(
Clone,
Debug,
Default,
AsChangeset,
router_derive::DebugAsDisplay,
serde::Serialize,
serde::Deserialize,
)]
#[diesel(table_name = mandate)]
pub struct MandateUpdateInternal {
mandate_status: Option<storage_enums::MandateStatus>,
amount_captured: Option<i64>,
connector_mandate_ids: Option<pii::SecretSerdeValue>,
connector_mandate_id: Option<String>,
payment_method_id: Option<String>,
original_payment_id: Option<common_utils::id_type::PaymentId>,
updated_by: Option<String>,
}
impl From<MandateUpdate> for MandateUpdateInternal {
fn from(mandate_update: MandateUpdate) -> Self {
match mandate_update {
MandateUpdate::StatusUpdate { mandate_status } => Self {
mandate_status: Some(mandate_status),
connector_mandate_ids: None,
amount_captured: None,
connector_mandate_id: None,
payment_method_id: None,
original_payment_id: None,
updated_by: None,
},
MandateUpdate::CaptureAmountUpdate { amount_captured } => Self {
mandate_status: None,
amount_captured,
connector_mandate_ids: None,
connector_mandate_id: None,
payment_method_id: None,
original_payment_id: None,
updated_by: None,
},
MandateUpdate::ConnectorReferenceUpdate {
connector_mandate_ids,
} => Self {
connector_mandate_ids,
..Default::default()
},
MandateUpdate::ConnectorMandateIdUpdate {
connector_mandate_id,
connector_mandate_ids,
payment_method_id,
original_payment_id,
} => Self {
connector_mandate_id,
connector_mandate_ids,
payment_method_id: Some(payment_method_id),
original_payment_id,
..Default::default()
},
}
}
}
impl MandateUpdateInternal {
pub fn apply_changeset(self, source: Mandate) -> Mandate {
let Self {
mandate_status,
amount_captured,
connector_mandate_ids,
connector_mandate_id,
payment_method_id,
original_payment_id,
updated_by,
} = self;
Mandate {
mandate_status: mandate_status.unwrap_or(source.mandate_status),
amount_captured: amount_captured.map_or(source.amount_captured, Some),
connector_mandate_ids: connector_mandate_ids.map_or(source.connector_mandate_ids, Some),
connector_mandate_id: connector_mandate_id.map_or(source.connector_mandate_id, Some),
payment_method_id: payment_method_id.unwrap_or(source.payment_method_id),
original_payment_id: original_payment_id.map_or(source.original_payment_id, Some),
updated_by: updated_by.map_or(source.updated_by, Some),
..source
}
}
}
impl From<&MandateNew> for Mandate {
fn from(mandate_new: &MandateNew) -> Self {
Self {
mandate_id: mandate_new.mandate_id.clone(),
customer_id: mandate_new.customer_id.clone(),
merchant_id: mandate_new.merchant_id.clone(),
payment_method_id: mandate_new.payment_method_id.clone(),
mandate_status: mandate_new.mandate_status,
mandate_type: mandate_new.mandate_type,
customer_accepted_at: mandate_new.customer_accepted_at,
customer_ip_address: mandate_new.customer_ip_address.clone(),
customer_user_agent: mandate_new.customer_user_agent.clone(),
network_transaction_id: mandate_new.network_transaction_id.clone(),
previous_attempt_id: mandate_new.previous_attempt_id.clone(),
created_at: mandate_new
.created_at
.unwrap_or_else(common_utils::date_time::now),
mandate_amount: mandate_new.mandate_amount,
mandate_currency: mandate_new.mandate_currency,
amount_captured: mandate_new.amount_captured,
connector: mandate_new.connector.clone(),
connector_mandate_id: mandate_new.connector_mandate_id.clone(),
start_date: mandate_new.start_date,
end_date: mandate_new.end_date,
metadata: mandate_new.metadata.clone(),
connector_mandate_ids: mandate_new.connector_mandate_ids.clone(),
original_payment_id: mandate_new.original_payment_id.clone(),
merchant_connector_id: mandate_new.merchant_connector_id.clone(),
updated_by: mandate_new.updated_by.clone(),
}
}
}
| 1,960 | 818 |
hyperswitch | crates/diesel_models/src/gsm.rs | .rs | //! Gateway status mapping
use common_enums::ErrorCategory;
use common_utils::{
custom_serde,
events::{ApiEventMetric, ApiEventsType},
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::schema::gateway_status_map;
#[derive(
Clone,
Debug,
Eq,
PartialEq,
Ord,
PartialOrd,
router_derive::DebugAsDisplay,
Identifiable,
Queryable,
Selectable,
serde::Serialize,
)]
#[diesel(table_name = gateway_status_map, primary_key(connector, flow, sub_flow, code, message), check_for_backend(diesel::pg::Pg))]
pub struct GatewayStatusMap {
pub connector: String,
pub flow: String,
pub sub_flow: String,
pub code: String,
pub message: String,
pub status: String,
pub router_error: Option<String>,
pub decision: String,
#[serde(with = "custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "custom_serde::iso8601")]
pub last_modified: PrimitiveDateTime,
pub step_up_possible: bool,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub error_category: Option<ErrorCategory>,
pub clear_pan_possible: bool,
}
#[derive(Clone, Debug, Eq, PartialEq, Insertable)]
#[diesel(table_name = gateway_status_map)]
pub struct GatewayStatusMappingNew {
pub connector: String,
pub flow: String,
pub sub_flow: String,
pub code: String,
pub message: String,
pub status: String,
pub router_error: Option<String>,
pub decision: String,
pub step_up_possible: bool,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub error_category: Option<ErrorCategory>,
pub clear_pan_possible: bool,
}
#[derive(
Clone, Debug, PartialEq, Eq, AsChangeset, router_derive::DebugAsDisplay, serde::Deserialize,
)]
#[diesel(table_name = gateway_status_map)]
pub struct GatewayStatusMapperUpdateInternal {
pub connector: Option<String>,
pub flow: Option<String>,
pub sub_flow: Option<String>,
pub code: Option<String>,
pub message: Option<String>,
pub status: Option<String>,
pub router_error: Option<Option<String>>,
pub decision: Option<String>,
pub step_up_possible: Option<bool>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub error_category: Option<ErrorCategory>,
pub last_modified: PrimitiveDateTime,
pub clear_pan_possible: Option<bool>,
}
#[derive(Debug)]
pub struct GatewayStatusMappingUpdate {
pub status: Option<String>,
pub router_error: Option<Option<String>>,
pub decision: Option<String>,
pub step_up_possible: Option<bool>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub error_category: Option<ErrorCategory>,
pub clear_pan_possible: Option<bool>,
}
impl From<GatewayStatusMappingUpdate> for GatewayStatusMapperUpdateInternal {
fn from(value: GatewayStatusMappingUpdate) -> Self {
let GatewayStatusMappingUpdate {
decision,
status,
router_error,
step_up_possible,
unified_code,
unified_message,
error_category,
clear_pan_possible,
} = value;
Self {
status,
router_error,
decision,
step_up_possible,
unified_code,
unified_message,
error_category,
last_modified: common_utils::date_time::now(),
connector: None,
flow: None,
sub_flow: None,
code: None,
message: None,
clear_pan_possible,
}
}
}
impl ApiEventMetric for GatewayStatusMap {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Gsm)
}
}
| 849 | 819 |
hyperswitch | crates/diesel_models/src/merchant_key_store.rs | .rs | use common_utils::{custom_serde, encryption::Encryption};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::schema::merchant_key_store;
#[derive(
Clone,
Debug,
serde::Serialize,
serde::Deserialize,
Identifiable,
Queryable,
Selectable,
router_derive::DebugAsDisplay,
)]
#[diesel(table_name = merchant_key_store, primary_key(merchant_id), check_for_backend(diesel::pg::Pg))]
pub struct MerchantKeyStore {
pub merchant_id: common_utils::id_type::MerchantId,
pub key: Encryption,
#[serde(with = "custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
}
#[derive(
Clone, Debug, serde::Serialize, serde::Deserialize, Insertable, router_derive::DebugAsDisplay,
)]
#[diesel(table_name = merchant_key_store)]
pub struct MerchantKeyStoreNew {
pub merchant_id: common_utils::id_type::MerchantId,
pub key: Encryption,
pub created_at: PrimitiveDateTime,
}
#[derive(
Clone, Debug, serde::Serialize, serde::Deserialize, AsChangeset, router_derive::DebugAsDisplay,
)]
#[diesel(table_name = merchant_key_store)]
pub struct MerchantKeyStoreUpdateInternal {
pub merchant_id: common_utils::id_type::MerchantId,
pub key: Encryption,
}
| 306 | 820 |
hyperswitch | crates/diesel_models/src/lib.rs | .rs | pub mod address;
pub mod api_keys;
pub mod blocklist_lookup;
pub mod business_profile;
pub mod capture;
pub mod cards_info;
pub mod configs;
pub mod authentication;
pub mod authorization;
pub mod blocklist;
pub mod blocklist_fingerprint;
pub mod callback_mapper;
pub mod customers;
pub mod dispute;
pub mod dynamic_routing_stats;
pub mod enums;
pub mod ephemeral_key;
pub mod errors;
pub mod events;
pub mod file;
#[allow(unused)]
pub mod fraud_check;
pub mod generic_link;
pub mod gsm;
#[cfg(feature = "kv_store")]
pub mod kv;
pub mod locker_mock_up;
pub mod mandate;
pub mod merchant_account;
pub mod merchant_connector_account;
pub mod merchant_key_store;
pub mod organization;
pub mod payment_attempt;
pub mod payment_intent;
pub mod payment_link;
pub mod payment_method;
pub mod payout_attempt;
pub mod payouts;
pub mod process_tracker;
pub mod query;
pub mod refund;
pub mod relay;
pub mod reverse_lookup;
pub mod role;
pub mod routing_algorithm;
pub mod types;
pub mod unified_translations;
#[cfg(feature = "v2")]
pub mod payment_methods_session;
#[allow(unused_qualifications)]
pub mod schema;
#[allow(unused_qualifications)]
pub mod schema_v2;
pub mod user;
pub mod user_authentication_method;
pub mod user_key_store;
pub mod user_role;
use diesel_impl::{DieselArray, OptionalDieselArray};
pub type StorageResult<T> = error_stack::Result<T, errors::DatabaseError>;
pub type PgPooledConn = async_bb8_diesel::Connection<diesel::PgConnection>;
pub use self::{
address::*, api_keys::*, callback_mapper::*, cards_info::*, configs::*, customers::*,
dispute::*, ephemeral_key::*, events::*, file::*, generic_link::*, locker_mock_up::*,
mandate::*, merchant_account::*, merchant_connector_account::*, payment_attempt::*,
payment_intent::*, payment_method::*, payout_attempt::*, payouts::*, process_tracker::*,
refund::*, reverse_lookup::*, user_authentication_method::*,
};
/// The types and implementations provided by this module are required for the schema generated by
/// `diesel_cli` 2.0 to work with the types defined in Rust code. This is because
/// [`diesel`][diesel] 2.0 [changed the nullability of array elements][diesel-2.0-array-nullability],
/// which causes [`diesel`][diesel] to deserialize arrays as `Vec<Option<T>>`. To prevent declaring
/// array elements as `Option<T>`, this module provides types and implementations to deserialize
/// arrays as `Vec<T>`, considering only non-null values (`Some(T)`) among the deserialized
/// `Option<T>` values.
///
/// [diesel-2.0-array-nullability]: https://diesel.rs/guides/migration_guide.html#2-0-0-nullability-of-array-elements
#[doc(hidden)]
pub(crate) mod diesel_impl {
use diesel::{
deserialize::FromSql,
pg::Pg,
sql_types::{Array, Nullable},
Queryable,
};
pub struct DieselArray<T>(Vec<Option<T>>);
impl<T> From<DieselArray<T>> for Vec<T> {
fn from(array: DieselArray<T>) -> Self {
array.0.into_iter().flatten().collect()
}
}
impl<T, U> Queryable<Array<Nullable<U>>, Pg> for DieselArray<T>
where
T: FromSql<U, Pg>,
Vec<Option<T>>: FromSql<Array<Nullable<U>>, Pg>,
{
type Row = Vec<Option<T>>;
fn build(row: Self::Row) -> diesel::deserialize::Result<Self> {
Ok(Self(row))
}
}
pub struct OptionalDieselArray<T>(Option<Vec<Option<T>>>);
impl<T> From<OptionalDieselArray<T>> for Option<Vec<T>> {
fn from(option_array: OptionalDieselArray<T>) -> Self {
option_array
.0
.map(|array| array.into_iter().flatten().collect())
}
}
impl<T, U> Queryable<Nullable<Array<Nullable<U>>>, Pg> for OptionalDieselArray<T>
where
Option<Vec<Option<T>>>: FromSql<Nullable<Array<Nullable<U>>>, Pg>,
{
type Row = Option<Vec<Option<T>>>;
fn build(row: Self::Row) -> diesel::deserialize::Result<Self> {
Ok(Self(row))
}
}
}
pub(crate) mod metrics {
use router_env::{counter_metric, global_meter, histogram_metric_f64, once_cell};
global_meter!(GLOBAL_METER, "ROUTER_API");
counter_metric!(DATABASE_CALLS_COUNT, GLOBAL_METER);
histogram_metric_f64!(DATABASE_CALL_TIME, GLOBAL_METER);
}
| 1,029 | 821 |
hyperswitch | crates/diesel_models/src/blocklist_fingerprint.rs | .rs | use diesel::{Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};
use crate::schema::blocklist_fingerprint;
#[derive(Clone, Debug, Eq, Insertable, PartialEq, Serialize, Deserialize)]
#[diesel(table_name = blocklist_fingerprint)]
pub struct BlocklistFingerprintNew {
pub merchant_id: common_utils::id_type::MerchantId,
pub fingerprint_id: String,
pub data_kind: common_enums::BlocklistDataKind,
pub encrypted_fingerprint: String,
pub created_at: time::PrimitiveDateTime,
}
#[derive(
Clone, Debug, Eq, PartialEq, Queryable, Identifiable, Selectable, Deserialize, Serialize,
)]
#[diesel(table_name = blocklist_fingerprint, primary_key(merchant_id, fingerprint_id), check_for_backend(diesel::pg::Pg))]
pub struct BlocklistFingerprint {
pub merchant_id: common_utils::id_type::MerchantId,
pub fingerprint_id: String,
pub data_kind: common_enums::BlocklistDataKind,
pub encrypted_fingerprint: String,
pub created_at: time::PrimitiveDateTime,
}
| 239 | 822 |
hyperswitch | crates/diesel_models/src/payouts.rs | .rs | use common_utils::{pii, types::MinorUnit};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{self, Deserialize, Serialize};
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, schema::payouts};
// Payouts
#[derive(
Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Serialize, Deserialize,
)]
#[diesel(table_name = payouts, primary_key(payout_id), check_for_backend(diesel::pg::Pg))]
pub struct Payouts {
pub payout_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub customer_id: Option<common_utils::id_type::CustomerId>,
pub address_id: Option<String>,
pub payout_type: Option<storage_enums::PayoutType>,
pub payout_method_id: Option<String>,
pub amount: MinorUnit,
pub destination_currency: storage_enums::Currency,
pub source_currency: storage_enums::Currency,
pub description: Option<String>,
pub recurring: bool,
pub auto_fulfill: bool,
pub return_url: Option<String>,
pub entity_type: storage_enums::PayoutEntityType,
pub metadata: Option<pii::SecretSerdeValue>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
pub attempt_count: i16,
pub profile_id: common_utils::id_type::ProfileId,
pub status: storage_enums::PayoutStatus,
pub confirm: Option<bool>,
pub payout_link_id: Option<String>,
pub client_secret: Option<String>,
pub priority: Option<storage_enums::PayoutSendPriority>,
}
#[derive(
Clone,
Debug,
Eq,
PartialEq,
Insertable,
serde::Serialize,
serde::Deserialize,
router_derive::DebugAsDisplay,
router_derive::Setter,
)]
#[diesel(table_name = payouts)]
pub struct PayoutsNew {
pub payout_id: String,
pub merchant_id: common_utils::id_type::MerchantId,
pub customer_id: Option<common_utils::id_type::CustomerId>,
pub address_id: Option<String>,
pub payout_type: Option<storage_enums::PayoutType>,
pub payout_method_id: Option<String>,
pub amount: MinorUnit,
pub destination_currency: storage_enums::Currency,
pub source_currency: storage_enums::Currency,
pub description: Option<String>,
pub recurring: bool,
pub auto_fulfill: bool,
pub return_url: Option<String>,
pub entity_type: storage_enums::PayoutEntityType,
pub metadata: Option<pii::SecretSerdeValue>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub last_modified_at: PrimitiveDateTime,
pub attempt_count: i16,
pub profile_id: common_utils::id_type::ProfileId,
pub status: storage_enums::PayoutStatus,
pub confirm: Option<bool>,
pub payout_link_id: Option<String>,
pub client_secret: Option<String>,
pub priority: Option<storage_enums::PayoutSendPriority>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum PayoutsUpdate {
Update {
amount: MinorUnit,
destination_currency: storage_enums::Currency,
source_currency: storage_enums::Currency,
description: Option<String>,
recurring: bool,
auto_fulfill: bool,
return_url: Option<String>,
entity_type: storage_enums::PayoutEntityType,
metadata: Option<pii::SecretSerdeValue>,
profile_id: Option<common_utils::id_type::ProfileId>,
status: Option<storage_enums::PayoutStatus>,
confirm: Option<bool>,
payout_type: Option<storage_enums::PayoutType>,
address_id: Option<String>,
customer_id: Option<common_utils::id_type::CustomerId>,
},
PayoutMethodIdUpdate {
payout_method_id: String,
},
RecurringUpdate {
recurring: bool,
},
AttemptCountUpdate {
attempt_count: i16,
},
StatusUpdate {
status: storage_enums::PayoutStatus,
},
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = payouts)]
pub struct PayoutsUpdateInternal {
pub amount: Option<MinorUnit>,
pub destination_currency: Option<storage_enums::Currency>,
pub source_currency: Option<storage_enums::Currency>,
pub description: Option<String>,
pub recurring: Option<bool>,
pub auto_fulfill: Option<bool>,
pub return_url: Option<String>,
pub entity_type: Option<storage_enums::PayoutEntityType>,
pub metadata: Option<pii::SecretSerdeValue>,
pub payout_method_id: Option<String>,
pub profile_id: Option<common_utils::id_type::ProfileId>,
pub status: Option<storage_enums::PayoutStatus>,
pub last_modified_at: PrimitiveDateTime,
pub attempt_count: Option<i16>,
pub confirm: Option<bool>,
pub payout_type: Option<common_enums::PayoutType>,
pub address_id: Option<String>,
pub customer_id: Option<common_utils::id_type::CustomerId>,
}
impl Default for PayoutsUpdateInternal {
fn default() -> Self {
Self {
amount: None,
destination_currency: None,
source_currency: None,
description: None,
recurring: None,
auto_fulfill: None,
return_url: None,
entity_type: None,
metadata: None,
payout_method_id: None,
profile_id: None,
status: None,
last_modified_at: common_utils::date_time::now(),
attempt_count: None,
confirm: None,
payout_type: None,
address_id: None,
customer_id: None,
}
}
}
impl From<PayoutsUpdate> for PayoutsUpdateInternal {
fn from(payout_update: PayoutsUpdate) -> Self {
match payout_update {
PayoutsUpdate::Update {
amount,
destination_currency,
source_currency,
description,
recurring,
auto_fulfill,
return_url,
entity_type,
metadata,
profile_id,
status,
confirm,
payout_type,
address_id,
customer_id,
} => Self {
amount: Some(amount),
destination_currency: Some(destination_currency),
source_currency: Some(source_currency),
description,
recurring: Some(recurring),
auto_fulfill: Some(auto_fulfill),
return_url,
entity_type: Some(entity_type),
metadata,
profile_id,
status,
confirm,
payout_type,
address_id,
customer_id,
..Default::default()
},
PayoutsUpdate::PayoutMethodIdUpdate { payout_method_id } => Self {
payout_method_id: Some(payout_method_id),
..Default::default()
},
PayoutsUpdate::RecurringUpdate { recurring } => Self {
recurring: Some(recurring),
..Default::default()
},
PayoutsUpdate::AttemptCountUpdate { attempt_count } => Self {
attempt_count: Some(attempt_count),
..Default::default()
},
PayoutsUpdate::StatusUpdate { status } => Self {
status: Some(status),
..Default::default()
},
}
}
}
impl PayoutsUpdate {
pub fn apply_changeset(self, source: Payouts) -> Payouts {
let PayoutsUpdateInternal {
amount,
destination_currency,
source_currency,
description,
recurring,
auto_fulfill,
return_url,
entity_type,
metadata,
payout_method_id,
profile_id,
status,
last_modified_at,
attempt_count,
confirm,
payout_type,
address_id,
customer_id,
} = self.into();
Payouts {
amount: amount.unwrap_or(source.amount),
destination_currency: destination_currency.unwrap_or(source.destination_currency),
source_currency: source_currency.unwrap_or(source.source_currency),
description: description.or(source.description),
recurring: recurring.unwrap_or(source.recurring),
auto_fulfill: auto_fulfill.unwrap_or(source.auto_fulfill),
return_url: return_url.or(source.return_url),
entity_type: entity_type.unwrap_or(source.entity_type),
metadata: metadata.or(source.metadata),
payout_method_id: payout_method_id.or(source.payout_method_id),
profile_id: profile_id.unwrap_or(source.profile_id),
status: status.unwrap_or(source.status),
last_modified_at,
attempt_count: attempt_count.unwrap_or(source.attempt_count),
confirm: confirm.or(source.confirm),
payout_type: payout_type.or(source.payout_type),
address_id: address_id.or(source.address_id),
customer_id: customer_id.or(source.customer_id),
..source
}
}
}
| 1,978 | 823 |
hyperswitch | crates/diesel_models/src/errors.rs | .rs | #[derive(Copy, Clone, Debug, thiserror::Error)]
pub enum DatabaseError {
#[error("An error occurred when obtaining database connection")]
DatabaseConnectionError,
#[error("The requested resource was not found in the database")]
NotFound,
#[error("A unique constraint violation occurred")]
UniqueViolation,
#[error("No fields were provided to be updated")]
NoFieldsToUpdate,
#[error("An error occurred when generating typed SQL query")]
QueryGenerationFailed,
// InsertFailed,
#[error("An unknown error occurred")]
Others,
}
impl From<diesel::result::Error> for DatabaseError {
fn from(error: diesel::result::Error) -> Self {
match error {
diesel::result::Error::DatabaseError(
diesel::result::DatabaseErrorKind::UniqueViolation,
_,
) => Self::UniqueViolation,
diesel::result::Error::NotFound => Self::NotFound,
diesel::result::Error::QueryBuilderError(_) => Self::QueryGenerationFailed,
_ => Self::Others,
}
}
}
| 226 | 824 |
hyperswitch | crates/diesel_models/src/blocklist_lookup.rs | .rs | use diesel::{Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};
use crate::schema::blocklist_lookup;
#[derive(Default, Clone, Debug, Eq, Insertable, PartialEq, Serialize, Deserialize)]
#[diesel(table_name = blocklist_lookup)]
pub struct BlocklistLookupNew {
pub merchant_id: common_utils::id_type::MerchantId,
pub fingerprint: String,
}
#[derive(
Default,
Clone,
Debug,
Eq,
PartialEq,
Identifiable,
Queryable,
Selectable,
Deserialize,
Serialize,
)]
#[diesel(table_name = blocklist_lookup, primary_key(merchant_id, fingerprint), check_for_backend(diesel::pg::Pg))]
pub struct BlocklistLookup {
pub merchant_id: common_utils::id_type::MerchantId,
pub fingerprint: String,
}
| 180 | 825 |
hyperswitch | crates/diesel_models/src/merchant_connector_account.rs | .rs | #[cfg(feature = "v2")]
use std::collections::HashMap;
use std::fmt::Debug;
use common_utils::{encryption::Encryption, id_type, pii};
#[cfg(feature = "v2")]
use diesel::{sql_types::Jsonb, AsExpression};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use crate::enums as storage_enums;
#[cfg(feature = "v1")]
use crate::schema::merchant_connector_account;
#[cfg(feature = "v2")]
use crate::{enums, schema_v2::merchant_connector_account, types};
#[cfg(feature = "v1")]
#[derive(
Clone,
Debug,
serde::Serialize,
serde::Deserialize,
Identifiable,
Queryable,
Selectable,
router_derive::DebugAsDisplay,
)]
#[diesel(table_name = merchant_connector_account, primary_key(merchant_connector_id), check_for_backend(diesel::pg::Pg))]
pub struct MerchantConnectorAccount {
pub merchant_id: id_type::MerchantId,
pub connector_name: String,
pub connector_account_details: Encryption,
pub test_mode: Option<bool>,
pub disabled: Option<bool>,
pub merchant_connector_id: id_type::MerchantConnectorAccountId,
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
pub payment_methods_enabled: Option<Vec<pii::SecretSerdeValue>>,
pub connector_type: storage_enums::ConnectorType,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_label: Option<String>,
pub business_country: Option<storage_enums::CountryAlpha2>,
pub business_label: Option<String>,
pub business_sub_label: Option<String>,
pub frm_configs: Option<pii::SecretSerdeValue>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub connector_webhook_details: Option<pii::SecretSerdeValue>,
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
pub frm_config: Option<Vec<pii::SecretSerdeValue>>,
pub profile_id: Option<id_type::ProfileId>,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub pm_auth_config: Option<pii::SecretSerdeValue>,
pub status: storage_enums::ConnectorStatus,
pub additional_merchant_data: Option<Encryption>,
pub connector_wallets_details: Option<Encryption>,
pub version: common_enums::ApiVersion,
pub id: Option<id_type::MerchantConnectorAccountId>,
}
#[cfg(feature = "v1")]
impl MerchantConnectorAccount {
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.merchant_connector_id.clone()
}
}
#[cfg(feature = "v2")]
#[derive(
Clone,
Debug,
serde::Serialize,
serde::Deserialize,
Identifiable,
Queryable,
Selectable,
router_derive::DebugAsDisplay,
)]
#[diesel(table_name = merchant_connector_account, check_for_backend(diesel::pg::Pg))]
pub struct MerchantConnectorAccount {
pub merchant_id: id_type::MerchantId,
pub connector_name: common_enums::connector_enums::Connector,
pub connector_account_details: Encryption,
pub disabled: Option<bool>,
#[diesel(deserialize_as = super::OptionalDieselArray<common_types::payment_methods::PaymentMethodsEnabled>)]
pub payment_methods_enabled: Option<Vec<common_types::payment_methods::PaymentMethodsEnabled>>,
pub connector_type: storage_enums::ConnectorType,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_label: Option<String>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub connector_webhook_details: Option<pii::SecretSerdeValue>,
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
pub frm_config: Option<Vec<pii::SecretSerdeValue>>,
pub profile_id: id_type::ProfileId,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub pm_auth_config: Option<pii::SecretSerdeValue>,
pub status: storage_enums::ConnectorStatus,
pub additional_merchant_data: Option<Encryption>,
pub connector_wallets_details: Option<Encryption>,
pub version: common_enums::ApiVersion,
pub id: id_type::MerchantConnectorAccountId,
pub feature_metadata: Option<MerchantConnectorAccountFeatureMetadata>,
}
#[cfg(feature = "v2")]
impl MerchantConnectorAccount {
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
}
#[cfg(feature = "v1")]
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = merchant_connector_account)]
pub struct MerchantConnectorAccountNew {
pub merchant_id: Option<id_type::MerchantId>,
pub connector_type: Option<storage_enums::ConnectorType>,
pub connector_name: Option<String>,
pub connector_account_details: Option<Encryption>,
pub test_mode: Option<bool>,
pub disabled: Option<bool>,
pub merchant_connector_id: id_type::MerchantConnectorAccountId,
pub payment_methods_enabled: Option<Vec<pii::SecretSerdeValue>>,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_label: Option<String>,
pub business_country: Option<storage_enums::CountryAlpha2>,
pub business_label: Option<String>,
pub business_sub_label: Option<String>,
pub frm_configs: Option<pii::SecretSerdeValue>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub connector_webhook_details: Option<pii::SecretSerdeValue>,
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
pub frm_config: Option<Vec<pii::SecretSerdeValue>>,
pub profile_id: Option<id_type::ProfileId>,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub pm_auth_config: Option<pii::SecretSerdeValue>,
pub status: storage_enums::ConnectorStatus,
pub additional_merchant_data: Option<Encryption>,
pub connector_wallets_details: Option<Encryption>,
pub version: common_enums::ApiVersion,
pub id: Option<id_type::MerchantConnectorAccountId>,
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = merchant_connector_account)]
pub struct MerchantConnectorAccountNew {
pub merchant_id: Option<id_type::MerchantId>,
pub connector_type: Option<storage_enums::ConnectorType>,
pub connector_name: Option<common_enums::connector_enums::Connector>,
pub connector_account_details: Option<Encryption>,
pub disabled: Option<bool>,
#[diesel(deserialize_as = super::OptionalDieselArray<common_types::payment_methods::PaymentMethodsEnabled>)]
pub payment_methods_enabled: Option<Vec<common_types::payment_methods::PaymentMethodsEnabled>>,
pub metadata: Option<pii::SecretSerdeValue>,
pub connector_label: Option<String>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub connector_webhook_details: Option<pii::SecretSerdeValue>,
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
pub frm_config: Option<Vec<pii::SecretSerdeValue>>,
pub profile_id: id_type::ProfileId,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub pm_auth_config: Option<pii::SecretSerdeValue>,
pub status: storage_enums::ConnectorStatus,
pub additional_merchant_data: Option<Encryption>,
pub connector_wallets_details: Option<Encryption>,
pub version: common_enums::ApiVersion,
pub id: id_type::MerchantConnectorAccountId,
pub feature_metadata: Option<MerchantConnectorAccountFeatureMetadata>,
}
#[cfg(feature = "v1")]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = merchant_connector_account)]
pub struct MerchantConnectorAccountUpdateInternal {
pub connector_type: Option<storage_enums::ConnectorType>,
pub connector_name: Option<String>,
pub connector_account_details: Option<Encryption>,
pub connector_label: Option<String>,
pub test_mode: Option<bool>,
pub disabled: Option<bool>,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub payment_methods_enabled: Option<Vec<pii::SecretSerdeValue>>,
pub frm_configs: Option<pii::SecretSerdeValue>,
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: Option<time::PrimitiveDateTime>,
pub connector_webhook_details: Option<pii::SecretSerdeValue>,
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
pub frm_config: Option<Vec<pii::SecretSerdeValue>>,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub pm_auth_config: Option<pii::SecretSerdeValue>,
pub status: Option<storage_enums::ConnectorStatus>,
pub connector_wallets_details: Option<Encryption>,
pub additional_merchant_data: Option<Encryption>,
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = merchant_connector_account)]
pub struct MerchantConnectorAccountUpdateInternal {
pub connector_type: Option<storage_enums::ConnectorType>,
pub connector_account_details: Option<Encryption>,
pub connector_label: Option<String>,
pub disabled: Option<bool>,
#[diesel(deserialize_as = super::OptionalDieselArray<common_types::payment_methods::PaymentMethodsEnabled>)]
pub payment_methods_enabled: Option<Vec<common_types::payment_methods::PaymentMethodsEnabled>>,
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: Option<time::PrimitiveDateTime>,
pub connector_webhook_details: Option<pii::SecretSerdeValue>,
#[diesel(deserialize_as = super::OptionalDieselArray<pii::SecretSerdeValue>)]
pub frm_config: Option<Vec<pii::SecretSerdeValue>>,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub pm_auth_config: Option<pii::SecretSerdeValue>,
pub status: Option<storage_enums::ConnectorStatus>,
pub connector_wallets_details: Option<Encryption>,
pub additional_merchant_data: Option<Encryption>,
pub feature_metadata: Option<MerchantConnectorAccountFeatureMetadata>,
}
#[cfg(feature = "v1")]
impl MerchantConnectorAccountUpdateInternal {
pub fn create_merchant_connector_account(
self,
source: MerchantConnectorAccount,
) -> MerchantConnectorAccount {
MerchantConnectorAccount {
merchant_id: source.merchant_id,
connector_type: self.connector_type.unwrap_or(source.connector_type),
connector_account_details: self
.connector_account_details
.unwrap_or(source.connector_account_details),
test_mode: self.test_mode,
disabled: self.disabled,
merchant_connector_id: self
.merchant_connector_id
.unwrap_or(source.merchant_connector_id),
payment_methods_enabled: self.payment_methods_enabled,
frm_config: self.frm_config,
modified_at: self.modified_at.unwrap_or(source.modified_at),
pm_auth_config: self.pm_auth_config,
status: self.status.unwrap_or(source.status),
..source
}
}
}
#[cfg(feature = "v2")]
impl MerchantConnectorAccountUpdateInternal {
pub fn create_merchant_connector_account(
self,
source: MerchantConnectorAccount,
) -> MerchantConnectorAccount {
MerchantConnectorAccount {
connector_type: self.connector_type.unwrap_or(source.connector_type),
connector_account_details: self
.connector_account_details
.unwrap_or(source.connector_account_details),
disabled: self.disabled,
payment_methods_enabled: self.payment_methods_enabled,
frm_config: self.frm_config,
modified_at: self.modified_at.unwrap_or(source.modified_at),
pm_auth_config: self.pm_auth_config,
status: self.status.unwrap_or(source.status),
feature_metadata: self.feature_metadata,
..source
}
}
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, AsExpression)]
#[diesel(sql_type = Jsonb)]
pub struct MerchantConnectorAccountFeatureMetadata {
pub revenue_recovery: Option<RevenueRecoveryMetadata>,
}
#[cfg(feature = "v2")]
common_utils::impl_to_sql_from_sql_json!(MerchantConnectorAccountFeatureMetadata);
#[cfg(feature = "v2")]
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct RevenueRecoveryMetadata {
/// The maximum number of retries allowed for an invoice. This limit is set by the merchant for each `billing connector`.Once this limit is reached, no further retries will be attempted.
pub max_retry_count: u16,
/// Maximum number of `billing connector` retries before revenue recovery can start executing retries.
pub billing_connector_retry_threshold: u16,
/// Billing account reference id is payment gateway id at billing connector end.
/// Merchants need to provide a mapping between these merchant connector account and the corresponding
/// account reference IDs for each `billing connector`.
pub billing_account_reference: BillingAccountReference,
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct BillingAccountReference(pub HashMap<id_type::MerchantConnectorAccountId, String>);
| 3,009 | 826 |
hyperswitch | crates/diesel_models/src/user_role.rs | .rs | use std::hash::Hash;
use common_enums::EntityType;
use common_utils::{consts, id_type};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::{enums, schema::user_roles};
#[derive(Clone, Debug, Identifiable, Queryable, Selectable, Eq)]
#[diesel(table_name = user_roles, check_for_backend(diesel::pg::Pg))]
pub struct UserRole {
pub id: i32,
pub user_id: String,
pub merchant_id: Option<id_type::MerchantId>,
pub role_id: String,
pub org_id: Option<id_type::OrganizationId>,
pub status: enums::UserStatus,
pub created_by: String,
pub last_modified_by: String,
pub created_at: PrimitiveDateTime,
pub last_modified: PrimitiveDateTime,
pub profile_id: Option<id_type::ProfileId>,
pub entity_id: Option<String>,
pub entity_type: Option<EntityType>,
pub version: enums::UserRoleVersion,
pub tenant_id: id_type::TenantId,
}
impl UserRole {
pub fn get_entity_id_and_type(&self) -> Option<(String, EntityType)> {
match (self.version, self.entity_type, self.role_id.as_str()) {
(enums::UserRoleVersion::V1, None, consts::ROLE_ID_ORGANIZATION_ADMIN) => {
let org_id = self.org_id.clone()?.get_string_repr().to_string();
Some((org_id, EntityType::Organization))
}
(enums::UserRoleVersion::V1, None, _) => {
let merchant_id = self.merchant_id.clone()?.get_string_repr().to_string();
Some((merchant_id, EntityType::Merchant))
}
(enums::UserRoleVersion::V1, Some(_), _) => {
self.entity_id.clone().zip(self.entity_type)
}
(enums::UserRoleVersion::V2, _, _) => self.entity_id.clone().zip(self.entity_type),
}
}
}
impl Hash for UserRole {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.user_id.hash(state);
if let Some((entity_id, entity_type)) = self.get_entity_id_and_type() {
entity_id.hash(state);
entity_type.hash(state);
}
}
}
impl PartialEq for UserRole {
fn eq(&self, other: &Self) -> bool {
match (
self.get_entity_id_and_type(),
other.get_entity_id_and_type(),
) {
(
Some((self_entity_id, self_entity_type)),
Some((other_entity_id, other_entity_type)),
) => {
self.user_id == other.user_id
&& self_entity_id == other_entity_id
&& self_entity_type == other_entity_type
}
_ => self.user_id == other.user_id,
}
}
}
#[derive(router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = user_roles)]
pub struct UserRoleNew {
pub user_id: String,
pub merchant_id: Option<id_type::MerchantId>,
pub role_id: String,
pub org_id: Option<id_type::OrganizationId>,
pub status: enums::UserStatus,
pub created_by: String,
pub last_modified_by: String,
pub created_at: PrimitiveDateTime,
pub last_modified: PrimitiveDateTime,
pub profile_id: Option<id_type::ProfileId>,
pub entity_id: Option<String>,
pub entity_type: Option<EntityType>,
pub version: enums::UserRoleVersion,
pub tenant_id: id_type::TenantId,
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = user_roles)]
pub struct UserRoleUpdateInternal {
role_id: Option<String>,
status: Option<enums::UserStatus>,
last_modified_by: Option<String>,
last_modified: PrimitiveDateTime,
}
#[derive(Clone)]
pub enum UserRoleUpdate {
UpdateStatus {
status: enums::UserStatus,
modified_by: String,
},
UpdateRole {
role_id: String,
modified_by: String,
},
}
impl From<UserRoleUpdate> for UserRoleUpdateInternal {
fn from(value: UserRoleUpdate) -> Self {
let last_modified = common_utils::date_time::now();
match value {
UserRoleUpdate::UpdateRole {
role_id,
modified_by,
} => Self {
role_id: Some(role_id),
last_modified_by: Some(modified_by),
status: None,
last_modified,
},
UserRoleUpdate::UpdateStatus {
status,
modified_by,
} => Self {
status: Some(status),
last_modified,
last_modified_by: Some(modified_by),
role_id: None,
},
}
}
}
| 1,038 | 827 |
hyperswitch | crates/diesel_models/src/events.rs | .rs | use common_utils::{custom_serde, encryption::Encryption};
use diesel::{
expression::AsExpression, AsChangeset, Identifiable, Insertable, Queryable, Selectable,
};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, schema::events};
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = events)]
pub struct EventNew {
pub event_id: String,
pub event_type: storage_enums::EventType,
pub event_class: storage_enums::EventClass,
pub is_webhook_notified: bool,
pub primary_object_id: String,
pub primary_object_type: storage_enums::EventObjectType,
pub created_at: PrimitiveDateTime,
pub merchant_id: Option<common_utils::id_type::MerchantId>,
pub business_profile_id: Option<common_utils::id_type::ProfileId>,
pub primary_object_created_at: Option<PrimitiveDateTime>,
pub idempotent_event_id: Option<String>,
pub initial_attempt_id: Option<String>,
pub request: Option<Encryption>,
pub response: Option<Encryption>,
pub delivery_attempt: Option<storage_enums::WebhookDeliveryAttempt>,
pub metadata: Option<EventMetadata>,
pub is_overall_delivery_successful: Option<bool>,
}
#[derive(Clone, Debug, Default, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = events)]
pub struct EventUpdateInternal {
pub is_webhook_notified: Option<bool>,
pub response: Option<Encryption>,
pub is_overall_delivery_successful: Option<bool>,
}
#[derive(Clone, Debug, Deserialize, Serialize, Identifiable, Queryable, Selectable)]
#[diesel(table_name = events, primary_key(event_id), check_for_backend(diesel::pg::Pg))]
pub struct Event {
pub event_id: String,
pub event_type: storage_enums::EventType,
pub event_class: storage_enums::EventClass,
pub is_webhook_notified: bool,
pub primary_object_id: String,
pub primary_object_type: storage_enums::EventObjectType,
#[serde(with = "custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
pub merchant_id: Option<common_utils::id_type::MerchantId>,
pub business_profile_id: Option<common_utils::id_type::ProfileId>,
// This column can be used to partition the database table, so that all events related to a
// single object would reside in the same partition
pub primary_object_created_at: Option<PrimitiveDateTime>,
pub idempotent_event_id: Option<String>,
pub initial_attempt_id: Option<String>,
pub request: Option<Encryption>,
pub response: Option<Encryption>,
pub delivery_attempt: Option<storage_enums::WebhookDeliveryAttempt>,
pub metadata: Option<EventMetadata>,
pub is_overall_delivery_successful: Option<bool>,
}
#[derive(Clone, Debug, Deserialize, Serialize, AsExpression, diesel::FromSqlRow)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub enum EventMetadata {
Payment {
payment_id: common_utils::id_type::PaymentId,
},
Payout {
payout_id: String,
},
Refund {
payment_id: common_utils::id_type::PaymentId,
refund_id: String,
},
Dispute {
payment_id: common_utils::id_type::PaymentId,
attempt_id: String,
dispute_id: String,
},
Mandate {
payment_method_id: String,
mandate_id: String,
},
}
common_utils::impl_to_sql_from_sql_json!(EventMetadata);
| 782 | 828 |
hyperswitch | crates/diesel_models/src/payment_attempt.rs | .rs | use common_types::primitive_wrappers::{
ExtendedAuthorizationAppliedBool, RequestExtendedAuthorizationBool,
};
use common_utils::{
id_type, pii,
types::{ConnectorTransactionId, ConnectorTransactionIdTrait, MinorUnit},
};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use crate::enums as storage_enums;
#[cfg(feature = "v1")]
use crate::schema::payment_attempt;
#[cfg(feature = "v2")]
use crate::schema_v2::payment_attempt;
common_utils::impl_to_sql_from_sql_json!(ConnectorMandateReferenceId);
#[derive(
Clone, Debug, serde::Deserialize, serde::Serialize, Eq, PartialEq, diesel::AsExpression,
)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct ConnectorMandateReferenceId {
pub connector_mandate_id: Option<String>,
pub payment_method_id: Option<String>,
pub mandate_metadata: Option<pii::SecretSerdeValue>,
pub connector_mandate_request_reference_id: Option<String>,
}
impl ConnectorMandateReferenceId {
pub fn get_connector_mandate_request_reference_id(&self) -> Option<String> {
self.connector_mandate_request_reference_id.clone()
}
}
#[cfg(feature = "v2")]
#[derive(
Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Serialize, Deserialize, Selectable,
)]
#[diesel(table_name = payment_attempt, primary_key(id), check_for_backend(diesel::pg::Pg))]
pub struct PaymentAttempt {
pub payment_id: id_type::GlobalPaymentId,
pub merchant_id: id_type::MerchantId,
pub status: storage_enums::AttemptStatus,
pub connector: Option<String>,
pub error_message: Option<String>,
pub surcharge_amount: Option<MinorUnit>,
pub payment_method_id: Option<id_type::GlobalPaymentMethodId>,
pub authentication_type: storage_enums::AuthenticationType,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub modified_at: PrimitiveDateTime,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub last_synced: Option<PrimitiveDateTime>,
pub cancellation_reason: Option<String>,
pub amount_to_capture: Option<MinorUnit>,
pub browser_info: Option<common_utils::types::BrowserInformation>,
pub error_code: Option<String>,
pub payment_token: Option<String>,
pub connector_metadata: Option<pii::SecretSerdeValue>,
pub payment_experience: Option<storage_enums::PaymentExperience>,
pub payment_method_data: Option<pii::SecretSerdeValue>,
pub preprocessing_step_id: Option<String>,
pub error_reason: Option<String>,
pub multiple_capture_count: Option<i16>,
pub connector_response_reference_id: Option<String>,
pub amount_capturable: MinorUnit,
pub updated_by: String,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub encoded_data: Option<masking::Secret<String>>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub net_amount: MinorUnit,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub fingerprint_id: Option<String>,
pub client_source: Option<String>,
pub client_version: Option<String>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub profile_id: id_type::ProfileId,
pub organization_id: id_type::OrganizationId,
pub card_network: Option<String>,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
pub request_extended_authorization: Option<RequestExtendedAuthorizationBool>,
pub extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,
pub capture_before: Option<PrimitiveDateTime>,
pub card_discovery: Option<storage_enums::CardDiscovery>,
pub charges: Option<common_types::payments::ConnectorChargeResponseData>,
pub payment_method_type_v2: storage_enums::PaymentMethod,
pub connector_payment_id: Option<ConnectorTransactionId>,
pub payment_method_subtype: storage_enums::PaymentMethodType,
pub routing_result: Option<serde_json::Value>,
pub authentication_applied: Option<common_enums::AuthenticationType>,
pub external_reference_id: Option<String>,
pub tax_on_surcharge: Option<MinorUnit>,
pub payment_method_billing_address: Option<common_utils::encryption::Encryption>,
pub redirection_data: Option<RedirectForm>,
pub connector_payment_data: Option<String>,
pub connector_token_details: Option<ConnectorTokenDetails>,
pub id: id_type::GlobalAttemptId,
pub feature_metadata: Option<PaymentAttemptFeatureMetadata>,
/// This field can be returned for both approved and refused Mastercard payments.
/// This code provides additional information about the type of transaction or the reason why the payment failed.
/// If the payment failed, the network advice code gives guidance on if and when you can retry the payment.
pub network_advice_code: Option<String>,
/// For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed.
pub network_decline_code: Option<String>,
/// A string indicating how to proceed with an network error if payment gateway provide one. This is used to understand the network error code better.
pub network_error_message: Option<String>,
}
#[cfg(feature = "v1")]
#[derive(
Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Serialize, Deserialize, Selectable,
)]
#[diesel(table_name = payment_attempt, primary_key(attempt_id, merchant_id), check_for_backend(diesel::pg::Pg))]
pub struct PaymentAttempt {
pub payment_id: id_type::PaymentId,
pub merchant_id: id_type::MerchantId,
pub attempt_id: String,
pub status: storage_enums::AttemptStatus,
pub amount: MinorUnit,
pub currency: Option<storage_enums::Currency>,
pub save_to_locker: Option<bool>,
pub connector: Option<String>,
pub error_message: Option<String>,
pub offer_amount: Option<MinorUnit>,
pub surcharge_amount: Option<MinorUnit>,
pub tax_amount: Option<MinorUnit>,
pub payment_method_id: Option<String>,
pub payment_method: Option<storage_enums::PaymentMethod>,
pub connector_transaction_id: Option<ConnectorTransactionId>,
pub capture_method: Option<storage_enums::CaptureMethod>,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub capture_on: Option<PrimitiveDateTime>,
pub confirm: bool,
pub authentication_type: Option<storage_enums::AuthenticationType>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub modified_at: PrimitiveDateTime,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub last_synced: Option<PrimitiveDateTime>,
pub cancellation_reason: Option<String>,
pub amount_to_capture: Option<MinorUnit>,
pub mandate_id: Option<String>,
pub browser_info: Option<serde_json::Value>,
pub error_code: Option<String>,
pub payment_token: Option<String>,
pub connector_metadata: Option<serde_json::Value>,
pub payment_experience: Option<storage_enums::PaymentExperience>,
pub payment_method_type: Option<storage_enums::PaymentMethodType>,
pub payment_method_data: Option<serde_json::Value>,
pub business_sub_label: Option<String>,
pub straight_through_algorithm: Option<serde_json::Value>,
pub preprocessing_step_id: Option<String>,
// providing a location to store mandate details intermediately for transaction
pub mandate_details: Option<storage_enums::MandateDataType>,
pub error_reason: Option<String>,
pub multiple_capture_count: Option<i16>,
// reference to the payment at connector side
pub connector_response_reference_id: Option<String>,
pub amount_capturable: MinorUnit,
pub updated_by: String,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub authentication_data: Option<serde_json::Value>,
pub encoded_data: Option<String>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub net_amount: Option<MinorUnit>,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub mandate_data: Option<storage_enums::MandateDetails>,
pub fingerprint_id: Option<String>,
pub payment_method_billing_address_id: Option<String>,
pub charge_id: Option<String>,
pub client_source: Option<String>,
pub client_version: Option<String>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub profile_id: id_type::ProfileId,
pub organization_id: id_type::OrganizationId,
pub card_network: Option<String>,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
/// INFO: This field is deprecated and replaced by processor_transaction_data
pub connector_transaction_data: Option<String>,
pub connector_mandate_detail: Option<ConnectorMandateReferenceId>,
pub request_extended_authorization: Option<RequestExtendedAuthorizationBool>,
pub extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,
pub capture_before: Option<PrimitiveDateTime>,
pub processor_transaction_data: Option<String>,
pub card_discovery: Option<storage_enums::CardDiscovery>,
pub charges: Option<common_types::payments::ConnectorChargeResponseData>,
pub issuer_error_code: Option<String>,
pub issuer_error_message: Option<String>,
}
#[cfg(feature = "v1")]
impl ConnectorTransactionIdTrait for PaymentAttempt {
fn get_optional_connector_transaction_id(&self) -> Option<&String> {
match self
.connector_transaction_id
.as_ref()
.map(|txn_id| txn_id.get_txn_id(self.processor_transaction_data.as_ref()))
.transpose()
{
Ok(txn_id) => txn_id,
// In case hashed data is missing from DB, use the hashed ID as connector transaction ID
Err(_) => self
.connector_transaction_id
.as_ref()
.map(|txn_id| txn_id.get_id()),
}
}
}
#[cfg(feature = "v2")]
impl ConnectorTransactionIdTrait for PaymentAttempt {
fn get_optional_connector_transaction_id(&self) -> Option<&String> {
match self
.connector_payment_id
.as_ref()
.map(|txn_id| txn_id.get_txn_id(self.connector_payment_data.as_ref()))
.transpose()
{
Ok(txn_id) => txn_id,
// In case hashed data is missing from DB, use the hashed ID as connector payment ID
Err(_) => self
.connector_payment_id
.as_ref()
.map(|txn_id| txn_id.get_id()),
}
}
}
#[cfg(feature = "v2")]
#[derive(
Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize, diesel::AsExpression,
)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct ConnectorTokenDetails {
pub connector_mandate_id: Option<String>,
pub connector_token_request_reference_id: Option<String>,
}
#[cfg(feature = "v2")]
common_utils::impl_to_sql_from_sql_json!(ConnectorTokenDetails);
#[cfg(feature = "v2")]
impl ConnectorTokenDetails {
pub fn get_connector_token_request_reference_id(&self) -> Option<String> {
self.connector_token_request_reference_id.clone()
}
}
#[derive(Clone, Debug, Eq, PartialEq, Queryable, Serialize, Deserialize)]
pub struct PaymentListFilters {
pub connector: Vec<String>,
pub currency: Vec<storage_enums::Currency>,
pub status: Vec<storage_enums::IntentStatus>,
pub payment_method: Vec<storage_enums::PaymentMethod>,
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay, Serialize, Deserialize)]
#[diesel(table_name = payment_attempt)]
pub struct PaymentAttemptNew {
pub payment_id: id_type::GlobalPaymentId,
pub merchant_id: id_type::MerchantId,
pub status: storage_enums::AttemptStatus,
pub error_message: Option<String>,
pub surcharge_amount: Option<MinorUnit>,
pub tax_on_surcharge: Option<MinorUnit>,
pub payment_method_id: Option<id_type::GlobalPaymentMethodId>,
pub authentication_type: storage_enums::AuthenticationType,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub modified_at: PrimitiveDateTime,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub last_synced: Option<PrimitiveDateTime>,
pub cancellation_reason: Option<String>,
pub amount_to_capture: Option<MinorUnit>,
pub browser_info: Option<common_utils::types::BrowserInformation>,
pub payment_token: Option<String>,
pub error_code: Option<String>,
pub connector_metadata: Option<pii::SecretSerdeValue>,
pub payment_experience: Option<storage_enums::PaymentExperience>,
pub payment_method_data: Option<pii::SecretSerdeValue>,
pub preprocessing_step_id: Option<String>,
pub error_reason: Option<String>,
pub connector_response_reference_id: Option<String>,
pub multiple_capture_count: Option<i16>,
pub amount_capturable: MinorUnit,
pub updated_by: String,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub redirection_data: Option<RedirectForm>,
pub encoded_data: Option<masking::Secret<String>>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub net_amount: MinorUnit,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub fingerprint_id: Option<String>,
pub payment_method_billing_address: Option<common_utils::encryption::Encryption>,
pub client_source: Option<String>,
pub client_version: Option<String>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub profile_id: id_type::ProfileId,
pub organization_id: id_type::OrganizationId,
pub card_network: Option<String>,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
pub charges: Option<common_types::payments::ConnectorChargeResponseData>,
pub feature_metadata: Option<PaymentAttemptFeatureMetadata>,
pub payment_method_type_v2: storage_enums::PaymentMethod,
pub connector_payment_id: Option<ConnectorTransactionId>,
pub payment_method_subtype: storage_enums::PaymentMethodType,
pub id: id_type::GlobalAttemptId,
pub connector_token_details: Option<ConnectorTokenDetails>,
pub card_discovery: Option<storage_enums::CardDiscovery>,
pub request_extended_authorization: Option<RequestExtendedAuthorizationBool>,
pub extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,
pub capture_before: Option<PrimitiveDateTime>,
pub connector: Option<String>,
pub network_decline_code: Option<String>,
pub network_advice_code: Option<String>,
pub network_error_message: Option<String>,
}
#[cfg(feature = "v1")]
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay, Serialize, Deserialize)]
#[diesel(table_name = payment_attempt)]
pub struct PaymentAttemptNew {
pub payment_id: id_type::PaymentId,
pub merchant_id: id_type::MerchantId,
pub attempt_id: String,
pub status: storage_enums::AttemptStatus,
pub amount: MinorUnit,
pub currency: Option<storage_enums::Currency>,
// pub auto_capture: Option<bool>,
pub save_to_locker: Option<bool>,
pub connector: Option<String>,
pub error_message: Option<String>,
pub offer_amount: Option<MinorUnit>,
pub surcharge_amount: Option<MinorUnit>,
pub tax_amount: Option<MinorUnit>,
pub payment_method_id: Option<String>,
pub payment_method: Option<storage_enums::PaymentMethod>,
pub capture_method: Option<storage_enums::CaptureMethod>,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub capture_on: Option<PrimitiveDateTime>,
pub confirm: bool,
pub authentication_type: Option<storage_enums::AuthenticationType>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub modified_at: PrimitiveDateTime,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub last_synced: Option<PrimitiveDateTime>,
pub cancellation_reason: Option<String>,
pub amount_to_capture: Option<MinorUnit>,
pub mandate_id: Option<String>,
pub browser_info: Option<serde_json::Value>,
pub payment_token: Option<String>,
pub error_code: Option<String>,
pub connector_metadata: Option<serde_json::Value>,
pub payment_experience: Option<storage_enums::PaymentExperience>,
pub payment_method_type: Option<storage_enums::PaymentMethodType>,
pub payment_method_data: Option<serde_json::Value>,
pub business_sub_label: Option<String>,
pub straight_through_algorithm: Option<serde_json::Value>,
pub preprocessing_step_id: Option<String>,
pub mandate_details: Option<storage_enums::MandateDataType>,
pub error_reason: Option<String>,
pub connector_response_reference_id: Option<String>,
pub multiple_capture_count: Option<i16>,
pub amount_capturable: MinorUnit,
pub updated_by: String,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub authentication_data: Option<serde_json::Value>,
pub encoded_data: Option<String>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub net_amount: Option<MinorUnit>,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub mandate_data: Option<storage_enums::MandateDetails>,
pub fingerprint_id: Option<String>,
pub payment_method_billing_address_id: Option<String>,
pub client_source: Option<String>,
pub client_version: Option<String>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub profile_id: id_type::ProfileId,
pub organization_id: id_type::OrganizationId,
pub card_network: Option<String>,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
pub connector_mandate_detail: Option<ConnectorMandateReferenceId>,
pub request_extended_authorization: Option<RequestExtendedAuthorizationBool>,
pub extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub capture_before: Option<PrimitiveDateTime>,
pub card_discovery: Option<storage_enums::CardDiscovery>,
}
#[cfg(feature = "v1")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum PaymentAttemptUpdate {
Update {
amount: MinorUnit,
currency: storage_enums::Currency,
status: storage_enums::AttemptStatus,
authentication_type: Option<storage_enums::AuthenticationType>,
payment_method: Option<storage_enums::PaymentMethod>,
payment_token: Option<String>,
payment_method_data: Option<serde_json::Value>,
payment_method_type: Option<storage_enums::PaymentMethodType>,
payment_experience: Option<storage_enums::PaymentExperience>,
business_sub_label: Option<String>,
amount_to_capture: Option<MinorUnit>,
capture_method: Option<storage_enums::CaptureMethod>,
surcharge_amount: Option<MinorUnit>,
tax_amount: Option<MinorUnit>,
fingerprint_id: Option<String>,
payment_method_billing_address_id: Option<String>,
updated_by: String,
},
UpdateTrackers {
payment_token: Option<String>,
connector: Option<String>,
straight_through_algorithm: Option<serde_json::Value>,
amount_capturable: Option<MinorUnit>,
surcharge_amount: Option<MinorUnit>,
tax_amount: Option<MinorUnit>,
updated_by: String,
merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
},
AuthenticationTypeUpdate {
authentication_type: storage_enums::AuthenticationType,
updated_by: String,
},
ConfirmUpdate {
amount: MinorUnit,
currency: storage_enums::Currency,
status: storage_enums::AttemptStatus,
authentication_type: Option<storage_enums::AuthenticationType>,
capture_method: Option<storage_enums::CaptureMethod>,
payment_method: Option<storage_enums::PaymentMethod>,
browser_info: Option<serde_json::Value>,
connector: Option<String>,
payment_token: Option<String>,
payment_method_data: Option<serde_json::Value>,
payment_method_type: Option<storage_enums::PaymentMethodType>,
payment_experience: Option<storage_enums::PaymentExperience>,
business_sub_label: Option<String>,
straight_through_algorithm: Option<serde_json::Value>,
error_code: Option<Option<String>>,
error_message: Option<Option<String>>,
amount_capturable: Option<MinorUnit>,
surcharge_amount: Option<MinorUnit>,
tax_amount: Option<MinorUnit>,
fingerprint_id: Option<String>,
updated_by: String,
merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
payment_method_id: Option<String>,
external_three_ds_authentication_attempted: Option<bool>,
authentication_connector: Option<String>,
authentication_id: Option<String>,
payment_method_billing_address_id: Option<String>,
client_source: Option<String>,
client_version: Option<String>,
customer_acceptance: Option<pii::SecretSerdeValue>,
shipping_cost: Option<MinorUnit>,
order_tax_amount: Option<MinorUnit>,
connector_mandate_detail: Option<ConnectorMandateReferenceId>,
card_discovery: Option<storage_enums::CardDiscovery>,
},
VoidUpdate {
status: storage_enums::AttemptStatus,
cancellation_reason: Option<String>,
updated_by: String,
},
PaymentMethodDetailsUpdate {
payment_method_id: Option<String>,
updated_by: String,
},
ConnectorMandateDetailUpdate {
connector_mandate_detail: Option<ConnectorMandateReferenceId>,
updated_by: String,
},
BlocklistUpdate {
status: storage_enums::AttemptStatus,
error_code: Option<Option<String>>,
error_message: Option<Option<String>>,
updated_by: String,
},
RejectUpdate {
status: storage_enums::AttemptStatus,
error_code: Option<Option<String>>,
error_message: Option<Option<String>>,
updated_by: String,
},
ResponseUpdate {
status: storage_enums::AttemptStatus,
connector: Option<String>,
connector_transaction_id: Option<String>,
authentication_type: Option<storage_enums::AuthenticationType>,
payment_method_id: Option<String>,
mandate_id: Option<String>,
connector_metadata: Option<serde_json::Value>,
payment_token: Option<String>,
error_code: Option<Option<String>>,
error_message: Option<Option<String>>,
error_reason: Option<Option<String>>,
connector_response_reference_id: Option<String>,
amount_capturable: Option<MinorUnit>,
updated_by: String,
authentication_data: Option<serde_json::Value>,
encoded_data: Option<String>,
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
capture_before: Option<PrimitiveDateTime>,
extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,
payment_method_data: Option<serde_json::Value>,
connector_mandate_detail: Option<ConnectorMandateReferenceId>,
charges: Option<common_types::payments::ConnectorChargeResponseData>,
},
UnresolvedResponseUpdate {
status: storage_enums::AttemptStatus,
connector: Option<String>,
connector_transaction_id: Option<String>,
payment_method_id: Option<String>,
error_code: Option<Option<String>>,
error_message: Option<Option<String>>,
error_reason: Option<Option<String>>,
connector_response_reference_id: Option<String>,
updated_by: String,
},
StatusUpdate {
status: storage_enums::AttemptStatus,
updated_by: String,
},
ErrorUpdate {
connector: Option<String>,
status: storage_enums::AttemptStatus,
error_code: Option<Option<String>>,
error_message: Option<Option<String>>,
error_reason: Option<Option<String>>,
amount_capturable: Option<MinorUnit>,
updated_by: String,
unified_code: Option<Option<String>>,
unified_message: Option<Option<String>>,
connector_transaction_id: Option<String>,
payment_method_data: Option<serde_json::Value>,
authentication_type: Option<storage_enums::AuthenticationType>,
issuer_error_code: Option<String>,
issuer_error_message: Option<String>,
},
CaptureUpdate {
amount_to_capture: Option<MinorUnit>,
multiple_capture_count: Option<i16>,
updated_by: String,
},
AmountToCaptureUpdate {
status: storage_enums::AttemptStatus,
amount_capturable: MinorUnit,
updated_by: String,
},
PreprocessingUpdate {
status: storage_enums::AttemptStatus,
payment_method_id: Option<String>,
connector_metadata: Option<serde_json::Value>,
preprocessing_step_id: Option<String>,
connector_transaction_id: Option<String>,
connector_response_reference_id: Option<String>,
updated_by: String,
},
ConnectorResponse {
authentication_data: Option<serde_json::Value>,
encoded_data: Option<String>,
connector_transaction_id: Option<String>,
connector: Option<String>,
charges: Option<common_types::payments::ConnectorChargeResponseData>,
updated_by: String,
},
IncrementalAuthorizationAmountUpdate {
amount: MinorUnit,
amount_capturable: MinorUnit,
},
AuthenticationUpdate {
status: storage_enums::AttemptStatus,
external_three_ds_authentication_attempted: Option<bool>,
authentication_connector: Option<String>,
authentication_id: Option<String>,
updated_by: String,
},
ManualUpdate {
status: Option<storage_enums::AttemptStatus>,
error_code: Option<String>,
error_message: Option<String>,
error_reason: Option<String>,
updated_by: String,
unified_code: Option<String>,
unified_message: Option<String>,
connector_transaction_id: Option<String>,
},
PostSessionTokensUpdate {
updated_by: String,
connector_metadata: Option<serde_json::Value>,
},
}
#[cfg(feature = "v2")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum PaymentAttemptUpdate {
// Update {
// amount: MinorUnit,
// currency: storage_enums::Currency,
// status: storage_enums::AttemptStatus,
// authentication_type: Option<storage_enums::AuthenticationType>,
// payment_method: Option<storage_enums::PaymentMethod>,
// payment_token: Option<String>,
// payment_method_data: Option<serde_json::Value>,
// payment_method_type: Option<storage_enums::PaymentMethodType>,
// payment_experience: Option<storage_enums::PaymentExperience>,
// business_sub_label: Option<String>,
// amount_to_capture: Option<MinorUnit>,
// capture_method: Option<storage_enums::CaptureMethod>,
// surcharge_amount: Option<MinorUnit>,
// tax_amount: Option<MinorUnit>,
// fingerprint_id: Option<String>,
// payment_method_billing_address_id: Option<String>,
// updated_by: String,
// },
// UpdateTrackers {
// payment_token: Option<String>,
// connector: Option<String>,
// straight_through_algorithm: Option<serde_json::Value>,
// amount_capturable: Option<MinorUnit>,
// surcharge_amount: Option<MinorUnit>,
// tax_amount: Option<MinorUnit>,
// updated_by: String,
// merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
// },
// AuthenticationTypeUpdate {
// authentication_type: storage_enums::AuthenticationType,
// updated_by: String,
// },
// ConfirmUpdate {
// amount: MinorUnit,
// currency: storage_enums::Currency,
// status: storage_enums::AttemptStatus,
// authentication_type: Option<storage_enums::AuthenticationType>,
// capture_method: Option<storage_enums::CaptureMethod>,
// payment_method: Option<storage_enums::PaymentMethod>,
// browser_info: Option<serde_json::Value>,
// connector: Option<String>,
// payment_token: Option<String>,
// payment_method_data: Option<serde_json::Value>,
// payment_method_type: Option<storage_enums::PaymentMethodType>,
// payment_experience: Option<storage_enums::PaymentExperience>,
// business_sub_label: Option<String>,
// straight_through_algorithm: Option<serde_json::Value>,
// error_code: Option<Option<String>>,
// error_message: Option<Option<String>>,
// amount_capturable: Option<MinorUnit>,
// surcharge_amount: Option<MinorUnit>,
// tax_amount: Option<MinorUnit>,
// fingerprint_id: Option<String>,
// updated_by: String,
// merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
// payment_method_id: Option<String>,
// external_three_ds_authentication_attempted: Option<bool>,
// authentication_connector: Option<String>,
// authentication_id: Option<String>,
// payment_method_billing_address_id: Option<String>,
// client_source: Option<String>,
// client_version: Option<String>,
// customer_acceptance: Option<pii::SecretSerdeValue>,
// },
// VoidUpdate {
// status: storage_enums::AttemptStatus,
// cancellation_reason: Option<String>,
// updated_by: String,
// },
// PaymentMethodDetailsUpdate {
// payment_method_id: Option<String>,
// updated_by: String,
// },
// ConnectorMandateDetailUpdate {
// connector_mandate_detail: Option<ConnectorMandateReferenceId>,
// updated_by: String,
// }
// BlocklistUpdate {
// status: storage_enums::AttemptStatus,
// error_code: Option<Option<String>>,
// error_message: Option<Option<String>>,
// updated_by: String,
// },
// RejectUpdate {
// status: storage_enums::AttemptStatus,
// error_code: Option<Option<String>>,
// error_message: Option<Option<String>>,
// updated_by: String,
// },
// ResponseUpdate {
// status: storage_enums::AttemptStatus,
// connector: Option<String>,
// connector_transaction_id: Option<String>,
// authentication_type: Option<storage_enums::AuthenticationType>,
// payment_method_id: Option<String>,
// mandate_id: Option<String>,
// connector_metadata: Option<serde_json::Value>,
// payment_token: Option<String>,
// error_code: Option<Option<String>>,
// error_message: Option<Option<String>>,
// error_reason: Option<Option<String>>,
// connector_response_reference_id: Option<String>,
// amount_capturable: Option<MinorUnit>,
// updated_by: String,
// authentication_data: Option<serde_json::Value>,
// encoded_data: Option<String>,
// unified_code: Option<Option<String>>,
// unified_message: Option<Option<String>>,
// payment_method_data: Option<serde_json::Value>,
// charge_id: Option<String>,
// },
// UnresolvedResponseUpdate {
// status: storage_enums::AttemptStatus,
// connector: Option<String>,
// connector_transaction_id: Option<String>,
// payment_method_id: Option<String>,
// error_code: Option<Option<String>>,
// error_message: Option<Option<String>>,
// error_reason: Option<Option<String>>,
// connector_response_reference_id: Option<String>,
// updated_by: String,
// },
// StatusUpdate {
// status: storage_enums::AttemptStatus,
// updated_by: String,
// },
// ErrorUpdate {
// connector: Option<String>,
// status: storage_enums::AttemptStatus,
// error_code: Option<Option<String>>,
// error_message: Option<Option<String>>,
// error_reason: Option<Option<String>>,
// amount_capturable: Option<MinorUnit>,
// updated_by: String,
// unified_code: Option<Option<String>>,
// unified_message: Option<Option<String>>,
// connector_transaction_id: Option<String>,
// payment_method_data: Option<serde_json::Value>,
// authentication_type: Option<storage_enums::AuthenticationType>,
// },
// CaptureUpdate {
// amount_to_capture: Option<MinorUnit>,
// multiple_capture_count: Option<MinorUnit>,
// updated_by: String,
// },
// AmountToCaptureUpdate {
// status: storage_enums::AttemptStatus,
// amount_capturable: MinorUnit,
// updated_by: String,
// },
// PreprocessingUpdate {
// status: storage_enums::AttemptStatus,
// payment_method_id: Option<String>,
// connector_metadata: Option<serde_json::Value>,
// preprocessing_step_id: Option<String>,
// connector_transaction_id: Option<String>,
// connector_response_reference_id: Option<String>,
// updated_by: String,
// },
// ConnectorResponse {
// authentication_data: Option<serde_json::Value>,
// encoded_data: Option<String>,
// connector_transaction_id: Option<String>,
// connector: Option<String>,
// charge_id: Option<String>,
// updated_by: String,
// },
// IncrementalAuthorizationAmountUpdate {
// amount: MinorUnit,
// amount_capturable: MinorUnit,
// },
// AuthenticationUpdate {
// status: storage_enums::AttemptStatus,
// external_three_ds_authentication_attempted: Option<bool>,
// authentication_connector: Option<String>,
// authentication_id: Option<String>,
// updated_by: String,
// },
// ManualUpdate {
// status: Option<storage_enums::AttemptStatus>,
// error_code: Option<String>,
// error_message: Option<String>,
// error_reason: Option<String>,
// updated_by: String,
// unified_code: Option<String>,
// unified_message: Option<String>,
// connector_transaction_id: Option<String>,
// },
}
// TODO: uncomment fields as and when required
#[cfg(feature = "v2")]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = payment_attempt)]
pub struct PaymentAttemptUpdateInternal {
pub status: Option<storage_enums::AttemptStatus>,
pub authentication_type: Option<storage_enums::AuthenticationType>,
pub error_message: Option<String>,
pub connector_payment_id: Option<String>,
// payment_method_id: Option<String>,
// cancellation_reason: Option<String>,
pub modified_at: PrimitiveDateTime,
pub browser_info: Option<serde_json::Value>,
// payment_token: Option<String>,
pub error_code: Option<String>,
pub connector_metadata: Option<pii::SecretSerdeValue>,
// payment_method_data: Option<serde_json::Value>,
// payment_experience: Option<storage_enums::PaymentExperience>,
// preprocessing_step_id: Option<String>,
pub error_reason: Option<String>,
// connector_response_reference_id: Option<String>,
// multiple_capture_count: Option<i16>,
// pub surcharge_amount: Option<MinorUnit>,
// tax_on_surcharge: Option<MinorUnit>,
pub amount_capturable: Option<MinorUnit>,
pub amount_to_capture: Option<MinorUnit>,
pub updated_by: String,
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
pub connector: Option<String>,
pub redirection_data: Option<RedirectForm>,
// encoded_data: Option<String>,
pub unified_code: Option<Option<String>>,
pub unified_message: Option<Option<String>>,
// external_three_ds_authentication_attempted: Option<bool>,
// authentication_connector: Option<String>,
// authentication_id: Option<String>,
// fingerprint_id: Option<String>,
// charge_id: Option<String>,
// client_source: Option<String>,
// client_version: Option<String>,
// customer_acceptance: Option<pii::SecretSerdeValue>,
// card_network: Option<String>,
pub connector_token_details: Option<ConnectorTokenDetails>,
pub feature_metadata: Option<PaymentAttemptFeatureMetadata>,
pub network_decline_code: Option<String>,
pub network_advice_code: Option<String>,
pub network_error_message: Option<String>,
}
#[cfg(feature = "v1")]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = payment_attempt)]
pub struct PaymentAttemptUpdateInternal {
pub amount: Option<MinorUnit>,
pub net_amount: Option<MinorUnit>,
pub currency: Option<storage_enums::Currency>,
pub status: Option<storage_enums::AttemptStatus>,
pub connector_transaction_id: Option<ConnectorTransactionId>,
pub amount_to_capture: Option<MinorUnit>,
pub connector: Option<Option<String>>,
pub authentication_type: Option<storage_enums::AuthenticationType>,
pub payment_method: Option<storage_enums::PaymentMethod>,
pub error_message: Option<Option<String>>,
pub payment_method_id: Option<String>,
pub cancellation_reason: Option<String>,
pub modified_at: PrimitiveDateTime,
pub mandate_id: Option<String>,
pub browser_info: Option<serde_json::Value>,
pub payment_token: Option<String>,
pub error_code: Option<Option<String>>,
pub connector_metadata: Option<serde_json::Value>,
pub payment_method_data: Option<serde_json::Value>,
pub payment_method_type: Option<storage_enums::PaymentMethodType>,
pub payment_experience: Option<storage_enums::PaymentExperience>,
pub business_sub_label: Option<String>,
pub straight_through_algorithm: Option<serde_json::Value>,
pub preprocessing_step_id: Option<String>,
pub error_reason: Option<Option<String>>,
pub capture_method: Option<storage_enums::CaptureMethod>,
pub connector_response_reference_id: Option<String>,
pub multiple_capture_count: Option<i16>,
pub surcharge_amount: Option<MinorUnit>,
pub tax_amount: Option<MinorUnit>,
pub amount_capturable: Option<MinorUnit>,
pub updated_by: String,
pub merchant_connector_id: Option<Option<id_type::MerchantConnectorAccountId>>,
pub authentication_data: Option<serde_json::Value>,
pub encoded_data: Option<String>,
pub unified_code: Option<Option<String>>,
pub unified_message: Option<Option<String>>,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub fingerprint_id: Option<String>,
pub payment_method_billing_address_id: Option<String>,
pub client_source: Option<String>,
pub client_version: Option<String>,
pub customer_acceptance: Option<pii::SecretSerdeValue>,
pub card_network: Option<String>,
pub capture_before: Option<PrimitiveDateTime>,
pub extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
pub connector_mandate_detail: Option<ConnectorMandateReferenceId>,
pub processor_transaction_data: Option<String>,
pub card_discovery: Option<common_enums::CardDiscovery>,
pub charges: Option<common_types::payments::ConnectorChargeResponseData>,
pub issuer_error_code: Option<String>,
pub issuer_error_message: Option<String>,
}
#[cfg(feature = "v1")]
impl PaymentAttemptUpdateInternal {
pub fn populate_derived_fields(self, source: &PaymentAttempt) -> Self {
let mut update_internal = self;
update_internal.net_amount = Some(
update_internal.amount.unwrap_or(source.amount)
+ update_internal
.surcharge_amount
.or(source.surcharge_amount)
.unwrap_or(MinorUnit::new(0))
+ update_internal
.tax_amount
.or(source.tax_amount)
.unwrap_or(MinorUnit::new(0))
+ update_internal
.shipping_cost
.or(source.shipping_cost)
.unwrap_or(MinorUnit::new(0))
+ update_internal
.order_tax_amount
.or(source.order_tax_amount)
.unwrap_or(MinorUnit::new(0)),
);
update_internal.card_network = update_internal
.payment_method_data
.as_ref()
.and_then(|data| data.as_object())
.and_then(|card| card.get("card"))
.and_then(|data| data.as_object())
.and_then(|card| card.get("card_network"))
.and_then(|network| network.as_str())
.map(|network| network.to_string());
update_internal
}
}
#[cfg(feature = "v2")]
impl PaymentAttemptUpdate {
pub fn apply_changeset(self, source: PaymentAttempt) -> PaymentAttempt {
todo!()
// let PaymentAttemptUpdateInternal {
// net_amount,
// status,
// authentication_type,
// error_message,
// payment_method_id,
// cancellation_reason,
// modified_at: _,
// browser_info,
// payment_token,
// error_code,
// connector_metadata,
// payment_method_data,
// payment_experience,
// straight_through_algorithm,
// preprocessing_step_id,
// error_reason,
// connector_response_reference_id,
// multiple_capture_count,
// surcharge_amount,
// tax_amount,
// amount_capturable,
// updated_by,
// merchant_connector_id,
// authentication_data,
// encoded_data,
// unified_code,
// unified_message,
// external_three_ds_authentication_attempted,
// authentication_connector,
// authentication_id,
// payment_method_billing_address_id,
// fingerprint_id,
// charge_id,
// client_source,
// client_version,
// customer_acceptance,
// card_network,
// } = PaymentAttemptUpdateInternal::from(self).populate_derived_fields(&source);
// PaymentAttempt {
// net_amount: net_amount.or(source.net_amount),
// status: status.unwrap_or(source.status),
// authentication_type: authentication_type.or(source.authentication_type),
// error_message: error_message.unwrap_or(source.error_message),
// payment_method_id: payment_method_id.or(source.payment_method_id),
// cancellation_reason: cancellation_reason.or(source.cancellation_reason),
// modified_at: common_utils::date_time::now(),
// browser_info: browser_info.or(source.browser_info),
// payment_token: payment_token.or(source.payment_token),
// error_code: error_code.unwrap_or(source.error_code),
// connector_metadata: connector_metadata.or(source.connector_metadata),
// payment_method_data: payment_method_data.or(source.payment_method_data),
// payment_experience: payment_experience.or(source.payment_experience),
// straight_through_algorithm: straight_through_algorithm
// .or(source.straight_through_algorithm),
// preprocessing_step_id: preprocessing_step_id.or(source.preprocessing_step_id),
// error_reason: error_reason.unwrap_or(source.error_reason),
// connector_response_reference_id: connector_response_reference_id
// .or(source.connector_response_reference_id),
// multiple_capture_count: multiple_capture_count.or(source.multiple_capture_count),
// surcharge_amount: surcharge_amount.or(source.surcharge_amount),
// tax_amount: tax_amount.or(source.tax_amount),
// amount_capturable: amount_capturable.unwrap_or(source.amount_capturable),
// updated_by,
// merchant_connector_id: merchant_connector_id.unwrap_or(source.merchant_connector_id),
// authentication_data: authentication_data.or(source.authentication_data),
// encoded_data: encoded_data.or(source.encoded_data),
// unified_code: unified_code.unwrap_or(source.unified_code),
// unified_message: unified_message.unwrap_or(source.unified_message),
// external_three_ds_authentication_attempted: external_three_ds_authentication_attempted
// .or(source.external_three_ds_authentication_attempted),
// authentication_connector: authentication_connector.or(source.authentication_connector),
// authentication_id: authentication_id.or(source.authentication_id),
// payment_method_billing_address_id: payment_method_billing_address_id
// .or(source.payment_method_billing_address_id),
// fingerprint_id: fingerprint_id.or(source.fingerprint_id),
// charge_id: charge_id.or(source.charge_id),
// client_source: client_source.or(source.client_source),
// client_version: client_version.or(source.client_version),
// customer_acceptance: customer_acceptance.or(source.customer_acceptance),
// card_network: card_network.or(source.card_network),
// ..source
// }
}
}
#[cfg(feature = "v1")]
impl PaymentAttemptUpdate {
pub fn apply_changeset(self, source: PaymentAttempt) -> PaymentAttempt {
let PaymentAttemptUpdateInternal {
amount,
net_amount,
currency,
status,
connector_transaction_id,
amount_to_capture,
connector,
authentication_type,
payment_method,
error_message,
payment_method_id,
cancellation_reason,
modified_at: _,
mandate_id,
browser_info,
payment_token,
error_code,
connector_metadata,
payment_method_data,
payment_method_type,
payment_experience,
business_sub_label,
straight_through_algorithm,
preprocessing_step_id,
error_reason,
capture_method,
connector_response_reference_id,
multiple_capture_count,
surcharge_amount,
tax_amount,
amount_capturable,
updated_by,
merchant_connector_id,
authentication_data,
encoded_data,
unified_code,
unified_message,
external_three_ds_authentication_attempted,
authentication_connector,
authentication_id,
payment_method_billing_address_id,
fingerprint_id,
client_source,
client_version,
customer_acceptance,
card_network,
shipping_cost,
order_tax_amount,
processor_transaction_data,
connector_mandate_detail,
capture_before,
extended_authorization_applied,
card_discovery,
charges,
issuer_error_code,
issuer_error_message,
} = PaymentAttemptUpdateInternal::from(self).populate_derived_fields(&source);
PaymentAttempt {
amount: amount.unwrap_or(source.amount),
net_amount: net_amount.or(source.net_amount),
currency: currency.or(source.currency),
status: status.unwrap_or(source.status),
connector_transaction_id: connector_transaction_id.or(source.connector_transaction_id),
amount_to_capture: amount_to_capture.or(source.amount_to_capture),
connector: connector.unwrap_or(source.connector),
authentication_type: authentication_type.or(source.authentication_type),
payment_method: payment_method.or(source.payment_method),
error_message: error_message.unwrap_or(source.error_message),
payment_method_id: payment_method_id.or(source.payment_method_id),
cancellation_reason: cancellation_reason.or(source.cancellation_reason),
modified_at: common_utils::date_time::now(),
mandate_id: mandate_id.or(source.mandate_id),
browser_info: browser_info.or(source.browser_info),
payment_token: payment_token.or(source.payment_token),
error_code: error_code.unwrap_or(source.error_code),
connector_metadata: connector_metadata.or(source.connector_metadata),
payment_method_data: payment_method_data.or(source.payment_method_data),
payment_method_type: payment_method_type.or(source.payment_method_type),
payment_experience: payment_experience.or(source.payment_experience),
business_sub_label: business_sub_label.or(source.business_sub_label),
straight_through_algorithm: straight_through_algorithm
.or(source.straight_through_algorithm),
preprocessing_step_id: preprocessing_step_id.or(source.preprocessing_step_id),
error_reason: error_reason.unwrap_or(source.error_reason),
capture_method: capture_method.or(source.capture_method),
connector_response_reference_id: connector_response_reference_id
.or(source.connector_response_reference_id),
multiple_capture_count: multiple_capture_count.or(source.multiple_capture_count),
surcharge_amount: surcharge_amount.or(source.surcharge_amount),
tax_amount: tax_amount.or(source.tax_amount),
amount_capturable: amount_capturable.unwrap_or(source.amount_capturable),
updated_by,
merchant_connector_id: merchant_connector_id.unwrap_or(source.merchant_connector_id),
authentication_data: authentication_data.or(source.authentication_data),
encoded_data: encoded_data.or(source.encoded_data),
unified_code: unified_code.unwrap_or(source.unified_code),
unified_message: unified_message.unwrap_or(source.unified_message),
external_three_ds_authentication_attempted: external_three_ds_authentication_attempted
.or(source.external_three_ds_authentication_attempted),
authentication_connector: authentication_connector.or(source.authentication_connector),
authentication_id: authentication_id.or(source.authentication_id),
payment_method_billing_address_id: payment_method_billing_address_id
.or(source.payment_method_billing_address_id),
fingerprint_id: fingerprint_id.or(source.fingerprint_id),
client_source: client_source.or(source.client_source),
client_version: client_version.or(source.client_version),
customer_acceptance: customer_acceptance.or(source.customer_acceptance),
card_network: card_network.or(source.card_network),
shipping_cost: shipping_cost.or(source.shipping_cost),
order_tax_amount: order_tax_amount.or(source.order_tax_amount),
processor_transaction_data: processor_transaction_data
.or(source.processor_transaction_data),
connector_mandate_detail: connector_mandate_detail.or(source.connector_mandate_detail),
capture_before: capture_before.or(source.capture_before),
extended_authorization_applied: extended_authorization_applied
.or(source.extended_authorization_applied),
card_discovery: card_discovery.or(source.card_discovery),
charges: charges.or(source.charges),
issuer_error_code: issuer_error_code.or(source.issuer_error_code),
issuer_error_message: issuer_error_message.or(source.issuer_error_message),
..source
}
}
}
#[cfg(feature = "v2")]
impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
fn from(payment_attempt_update: PaymentAttemptUpdate) -> Self {
todo!()
// match payment_attempt_update {
// PaymentAttemptUpdate::Update {
// amount,
// currency,
// status,
// // connector_transaction_id,
// authentication_type,
// payment_method,
// payment_token,
// payment_method_data,
// payment_method_type,
// payment_experience,
// business_sub_label,
// amount_to_capture,
// capture_method,
// surcharge_amount,
// tax_amount,
// fingerprint_id,
// updated_by,
// payment_method_billing_address_id,
// } => Self {
// status: Some(status),
// // connector_transaction_id,
// authentication_type,
// payment_token,
// modified_at: common_utils::date_time::now(),
// payment_method_data,
// payment_experience,
// surcharge_amount,
// tax_amount,
// fingerprint_id,
// payment_method_billing_address_id,
// updated_by,
// net_amount: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// error_code: None,
// connector_metadata: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::AuthenticationTypeUpdate {
// authentication_type,
// updated_by,
// } => Self {
// authentication_type: Some(authentication_type),
// modified_at: common_utils::date_time::now(),
// updated_by,
// net_amount: None,
// status: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::ConfirmUpdate {
// amount,
// currency,
// authentication_type,
// capture_method,
// status,
// payment_method,
// browser_info,
// connector,
// payment_token,
// payment_method_data,
// payment_method_type,
// payment_experience,
// business_sub_label,
// straight_through_algorithm,
// error_code,
// error_message,
// amount_capturable,
// updated_by,
// merchant_connector_id,
// surcharge_amount,
// tax_amount,
// external_three_ds_authentication_attempted,
// authentication_connector,
// authentication_id,
// payment_method_billing_address_id,
// fingerprint_id,
// payment_method_id,
// client_source,
// client_version,
// customer_acceptance,
// } => Self {
// authentication_type,
// status: Some(status),
// modified_at: common_utils::date_time::now(),
// browser_info,
// payment_token,
// payment_method_data,
// payment_experience,
// straight_through_algorithm,
// error_code,
// error_message,
// amount_capturable,
// updated_by,
// merchant_connector_id: merchant_connector_id.map(Some),
// surcharge_amount,
// tax_amount,
// external_three_ds_authentication_attempted,
// authentication_connector,
// authentication_id,
// payment_method_billing_address_id,
// fingerprint_id,
// payment_method_id,
// client_source,
// client_version,
// customer_acceptance,
// net_amount: None,
// cancellation_reason: None,
// connector_metadata: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// charge_id: None,
// card_network: None,
// },
// PaymentAttemptUpdate::VoidUpdate {
// status,
// cancellation_reason,
// updated_by,
// } => Self {
// status: Some(status),
// cancellation_reason,
// modified_at: common_utils::date_time::now(),
// updated_by,
// net_amount: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::RejectUpdate {
// status,
// error_code,
// error_message,
// updated_by,
// } => Self {
// status: Some(status),
// modified_at: common_utils::date_time::now(),
// error_code,
// error_message,
// updated_by,
// net_amount: None,
// authentication_type: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::BlocklistUpdate {
// status,
// error_code,
// error_message,
// updated_by,
// } => Self {
// status: Some(status),
// modified_at: common_utils::date_time::now(),
// error_code,
// error_message,
// updated_by,
// merchant_connector_id: Some(None),
// net_amount: None,
// authentication_type: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::ConnectorMandateDetailUpdate {
// connector_mandate_detail,
// updated_by,
// } => Self {
// payment_method_id: None,
// modified_at: common_utils::date_time::now(),
// updated_by,
// amount: None,
// net_amount: None,
// currency: None,
// status: None,
// connector_transaction_id: None,
// amount_to_capture: None,
// connector: None,
// authentication_type: None,
// payment_method: None,
// error_message: None,
// cancellation_reason: None,
// mandate_id: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_method_type: None,
// payment_experience: None,
// business_sub_label: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// capture_method: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// shipping_cost: None,
// order_tax_amount: None,
// processor_transaction_data: None,
// connector_mandate_detail,
// },
// PaymentAttemptUpdate::ConnectorMandateDetailUpdate {
// payment_method_id,
// updated_by,
// } => Self {
// payment_method_id,
// modified_at: common_utils::date_time::now(),
// updated_by,
// net_amount: None,
// status: None,
// authentication_type: None,
// error_message: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::ResponseUpdate {
// status,
// connector,
// connector_transaction_id,
// authentication_type,
// payment_method_id,
// mandate_id,
// connector_metadata,
// payment_token,
// error_code,
// error_message,
// error_reason,
// connector_response_reference_id,
// amount_capturable,
// updated_by,
// authentication_data,
// encoded_data,
// unified_code,
// unified_message,
// payment_method_data,
// charge_id,
// } => Self {
// status: Some(status),
// authentication_type,
// payment_method_id,
// modified_at: common_utils::date_time::now(),
// connector_metadata,
// error_code,
// error_message,
// payment_token,
// error_reason,
// connector_response_reference_id,
// amount_capturable,
// updated_by,
// authentication_data,
// encoded_data,
// unified_code,
// unified_message,
// payment_method_data,
// charge_id,
// net_amount: None,
// cancellation_reason: None,
// browser_info: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// merchant_connector_id: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::ErrorUpdate {
// connector,
// status,
// error_code,
// error_message,
// error_reason,
// amount_capturable,
// updated_by,
// unified_code,
// unified_message,
// connector_transaction_id,
// payment_method_data,
// authentication_type,
// } => Self {
// status: Some(status),
// error_message,
// error_code,
// modified_at: common_utils::date_time::now(),
// error_reason,
// amount_capturable,
// updated_by,
// unified_code,
// unified_message,
// payment_method_data,
// authentication_type,
// net_amount: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// connector_metadata: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::StatusUpdate { status, updated_by } => Self {
// status: Some(status),
// modified_at: common_utils::date_time::now(),
// updated_by,
// net_amount: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::UpdateTrackers {
// payment_token,
// connector,
// straight_through_algorithm,
// amount_capturable,
// surcharge_amount,
// tax_amount,
// updated_by,
// merchant_connector_id,
// } => Self {
// payment_token,
// modified_at: common_utils::date_time::now(),
// straight_through_algorithm,
// amount_capturable,
// surcharge_amount,
// tax_amount,
// updated_by,
// merchant_connector_id: merchant_connector_id.map(Some),
// net_amount: None,
// status: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::UnresolvedResponseUpdate {
// status,
// connector,
// connector_transaction_id,
// payment_method_id,
// error_code,
// error_message,
// error_reason,
// connector_response_reference_id,
// updated_by,
// } => Self {
// status: Some(status),
// payment_method_id,
// modified_at: common_utils::date_time::now(),
// error_code,
// error_message,
// error_reason,
// connector_response_reference_id,
// updated_by,
// net_amount: None,
// authentication_type: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::PreprocessingUpdate {
// status,
// payment_method_id,
// connector_metadata,
// preprocessing_step_id,
// connector_transaction_id,
// connector_response_reference_id,
// updated_by,
// } => Self {
// status: Some(status),
// payment_method_id,
// modified_at: common_utils::date_time::now(),
// connector_metadata,
// preprocessing_step_id,
// connector_response_reference_id,
// updated_by,
// net_amount: None,
// authentication_type: None,
// error_message: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// error_reason: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::CaptureUpdate {
// multiple_capture_count,
// updated_by,
// amount_to_capture,
// } => Self {
// multiple_capture_count,
// modified_at: common_utils::date_time::now(),
// updated_by,
// net_amount: None,
// status: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::AmountToCaptureUpdate {
// status,
// amount_capturable,
// updated_by,
// } => Self {
// status: Some(status),
// modified_at: common_utils::date_time::now(),
// amount_capturable: Some(amount_capturable),
// updated_by,
// net_amount: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::ConnectorResponse {
// authentication_data,
// encoded_data,
// connector_transaction_id,
// connector,
// updated_by,
// charge_id,
// } => Self {
// authentication_data,
// encoded_data,
// modified_at: common_utils::date_time::now(),
// updated_by,
// charge_id,
// net_amount: None,
// status: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::IncrementalAuthorizationAmountUpdate {
// amount,
// amount_capturable,
// } => Self {
// modified_at: common_utils::date_time::now(),
// amount_capturable: Some(amount_capturable),
// net_amount: None,
// status: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// updated_by: String::default(),
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::AuthenticationUpdate {
// status,
// external_three_ds_authentication_attempted,
// authentication_connector,
// authentication_id,
// updated_by,
// } => Self {
// status: Some(status),
// modified_at: common_utils::date_time::now(),
// external_three_ds_authentication_attempted,
// authentication_connector,
// authentication_id,
// updated_by,
// net_amount: None,
// authentication_type: None,
// error_message: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// error_code: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// error_reason: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// unified_code: None,
// unified_message: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// PaymentAttemptUpdate::ManualUpdate {
// status,
// error_code,
// error_message,
// error_reason,
// updated_by,
// unified_code,
// unified_message,
// connector_transaction_id,
// } => Self {
// status,
// error_code: error_code.map(Some),
// modified_at: common_utils::date_time::now(),
// error_message: error_message.map(Some),
// error_reason: error_reason.map(Some),
// updated_by,
// unified_code: unified_code.map(Some),
// unified_message: unified_message.map(Some),
// net_amount: None,
// authentication_type: None,
// payment_method_id: None,
// cancellation_reason: None,
// browser_info: None,
// payment_token: None,
// connector_metadata: None,
// payment_method_data: None,
// payment_experience: None,
// straight_through_algorithm: None,
// preprocessing_step_id: None,
// connector_response_reference_id: None,
// multiple_capture_count: None,
// surcharge_amount: None,
// tax_amount: None,
// amount_capturable: None,
// merchant_connector_id: None,
// authentication_data: None,
// encoded_data: None,
// external_three_ds_authentication_attempted: None,
// authentication_connector: None,
// authentication_id: None,
// fingerprint_id: None,
// payment_method_billing_address_id: None,
// charge_id: None,
// client_source: None,
// client_version: None,
// customer_acceptance: None,
// card_network: None,
// },
// }
}
}
#[cfg(feature = "v1")]
impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
fn from(payment_attempt_update: PaymentAttemptUpdate) -> Self {
match payment_attempt_update {
PaymentAttemptUpdate::Update {
amount,
currency,
status,
// connector_transaction_id,
authentication_type,
payment_method,
payment_token,
payment_method_data,
payment_method_type,
payment_experience,
business_sub_label,
amount_to_capture,
capture_method,
surcharge_amount,
tax_amount,
fingerprint_id,
updated_by,
payment_method_billing_address_id,
} => Self {
amount: Some(amount),
currency: Some(currency),
status: Some(status),
// connector_transaction_id,
authentication_type,
payment_method,
payment_token,
modified_at: common_utils::date_time::now(),
payment_method_data,
payment_method_type,
payment_experience,
business_sub_label,
amount_to_capture,
capture_method,
surcharge_amount,
tax_amount,
fingerprint_id,
payment_method_billing_address_id,
updated_by,
net_amount: None,
connector_transaction_id: None,
connector: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
error_code: None,
connector_metadata: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
connector_response_reference_id: None,
multiple_capture_count: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::AuthenticationTypeUpdate {
authentication_type,
updated_by,
} => Self {
authentication_type: Some(authentication_type),
modified_at: common_utils::date_time::now(),
updated_by,
amount: None,
net_amount: None,
currency: None,
status: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::ConfirmUpdate {
amount,
currency,
authentication_type,
capture_method,
status,
payment_method,
browser_info,
connector,
payment_token,
payment_method_data,
payment_method_type,
payment_experience,
business_sub_label,
straight_through_algorithm,
error_code,
error_message,
amount_capturable,
updated_by,
merchant_connector_id,
surcharge_amount,
tax_amount,
external_three_ds_authentication_attempted,
authentication_connector,
authentication_id,
payment_method_billing_address_id,
fingerprint_id,
payment_method_id,
client_source,
client_version,
customer_acceptance,
shipping_cost,
order_tax_amount,
connector_mandate_detail,
card_discovery,
} => Self {
amount: Some(amount),
currency: Some(currency),
authentication_type,
status: Some(status),
payment_method,
modified_at: common_utils::date_time::now(),
browser_info,
connector: connector.map(Some),
payment_token,
payment_method_data,
payment_method_type,
payment_experience,
business_sub_label,
straight_through_algorithm,
error_code,
error_message,
amount_capturable,
updated_by,
merchant_connector_id: merchant_connector_id.map(Some),
surcharge_amount,
tax_amount,
external_three_ds_authentication_attempted,
authentication_connector,
authentication_id,
payment_method_billing_address_id,
fingerprint_id,
payment_method_id,
capture_method,
client_source,
client_version,
customer_acceptance,
net_amount: None,
connector_transaction_id: None,
amount_to_capture: None,
cancellation_reason: None,
mandate_id: None,
connector_metadata: None,
preprocessing_step_id: None,
error_reason: None,
connector_response_reference_id: None,
multiple_capture_count: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
card_network: None,
shipping_cost,
order_tax_amount,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail,
card_discovery,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::VoidUpdate {
status,
cancellation_reason,
updated_by,
} => Self {
status: Some(status),
cancellation_reason,
modified_at: common_utils::date_time::now(),
updated_by,
amount: None,
net_amount: None,
currency: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::RejectUpdate {
status,
error_code,
error_message,
updated_by,
} => Self {
status: Some(status),
modified_at: common_utils::date_time::now(),
error_code,
error_message,
updated_by,
amount: None,
net_amount: None,
currency: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::BlocklistUpdate {
status,
error_code,
error_message,
updated_by,
} => Self {
status: Some(status),
modified_at: common_utils::date_time::now(),
error_code,
connector: Some(None),
error_message,
updated_by,
merchant_connector_id: Some(None),
amount: None,
net_amount: None,
currency: None,
connector_transaction_id: None,
amount_to_capture: None,
authentication_type: None,
payment_method: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::ConnectorMandateDetailUpdate {
connector_mandate_detail,
updated_by,
} => Self {
payment_method_id: None,
modified_at: common_utils::date_time::now(),
updated_by,
amount: None,
net_amount: None,
currency: None,
status: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::PaymentMethodDetailsUpdate {
payment_method_id,
updated_by,
} => Self {
payment_method_id,
modified_at: common_utils::date_time::now(),
updated_by,
amount: None,
net_amount: None,
currency: None,
status: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::ResponseUpdate {
status,
connector,
connector_transaction_id,
authentication_type,
payment_method_id,
mandate_id,
connector_metadata,
payment_token,
error_code,
error_message,
error_reason,
connector_response_reference_id,
amount_capturable,
updated_by,
authentication_data,
encoded_data,
unified_code,
unified_message,
capture_before,
extended_authorization_applied,
payment_method_data,
connector_mandate_detail,
charges,
} => {
let (connector_transaction_id, processor_transaction_data) =
connector_transaction_id
.map(ConnectorTransactionId::form_id_and_data)
.map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
.unwrap_or((None, None));
Self {
status: Some(status),
connector: connector.map(Some),
connector_transaction_id,
authentication_type,
payment_method_id,
modified_at: common_utils::date_time::now(),
mandate_id,
connector_metadata,
error_code,
error_message,
payment_token,
error_reason,
connector_response_reference_id,
amount_capturable,
updated_by,
authentication_data,
encoded_data,
unified_code,
unified_message,
payment_method_data,
processor_transaction_data,
connector_mandate_detail,
charges,
amount: None,
net_amount: None,
currency: None,
amount_to_capture: None,
payment_method: None,
cancellation_reason: None,
browser_info: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
capture_method: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
merchant_connector_id: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
capture_before,
extended_authorization_applied,
shipping_cost: None,
order_tax_amount: None,
card_discovery: None,
issuer_error_code: None,
issuer_error_message: None,
}
}
PaymentAttemptUpdate::ErrorUpdate {
connector,
status,
error_code,
error_message,
error_reason,
amount_capturable,
updated_by,
unified_code,
unified_message,
connector_transaction_id,
payment_method_data,
authentication_type,
issuer_error_code,
issuer_error_message,
} => {
let (connector_transaction_id, processor_transaction_data) =
connector_transaction_id
.map(ConnectorTransactionId::form_id_and_data)
.map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
.unwrap_or((None, None));
Self {
connector: connector.map(Some),
status: Some(status),
error_message,
error_code,
modified_at: common_utils::date_time::now(),
error_reason,
amount_capturable,
updated_by,
unified_code,
unified_message,
connector_transaction_id,
payment_method_data,
authentication_type,
processor_transaction_data,
issuer_error_code,
issuer_error_message,
amount: None,
net_amount: None,
currency: None,
amount_to_capture: None,
payment_method: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
connector_metadata: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
capture_before: None,
extended_authorization_applied: None,
shipping_cost: None,
order_tax_amount: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
}
}
PaymentAttemptUpdate::StatusUpdate { status, updated_by } => Self {
status: Some(status),
modified_at: common_utils::date_time::now(),
updated_by,
amount: None,
net_amount: None,
currency: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::UpdateTrackers {
payment_token,
connector,
straight_through_algorithm,
amount_capturable,
surcharge_amount,
tax_amount,
updated_by,
merchant_connector_id,
} => Self {
payment_token,
modified_at: common_utils::date_time::now(),
connector: connector.map(Some),
straight_through_algorithm,
amount_capturable,
surcharge_amount,
tax_amount,
updated_by,
merchant_connector_id: merchant_connector_id.map(Some),
amount: None,
net_amount: None,
currency: None,
status: None,
connector_transaction_id: None,
amount_to_capture: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::UnresolvedResponseUpdate {
status,
connector,
connector_transaction_id,
payment_method_id,
error_code,
error_message,
error_reason,
connector_response_reference_id,
updated_by,
} => {
let (connector_transaction_id, processor_transaction_data) =
connector_transaction_id
.map(ConnectorTransactionId::form_id_and_data)
.map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
.unwrap_or((None, None));
Self {
status: Some(status),
connector: connector.map(Some),
connector_transaction_id,
payment_method_id,
modified_at: common_utils::date_time::now(),
error_code,
error_message,
error_reason,
connector_response_reference_id,
updated_by,
processor_transaction_data,
amount: None,
net_amount: None,
currency: None,
amount_to_capture: None,
authentication_type: None,
payment_method: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
capture_method: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
}
}
PaymentAttemptUpdate::PreprocessingUpdate {
status,
payment_method_id,
connector_metadata,
preprocessing_step_id,
connector_transaction_id,
connector_response_reference_id,
updated_by,
} => {
let (connector_transaction_id, processor_transaction_data) =
connector_transaction_id
.map(ConnectorTransactionId::form_id_and_data)
.map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
.unwrap_or((None, None));
Self {
status: Some(status),
payment_method_id,
modified_at: common_utils::date_time::now(),
connector_metadata,
preprocessing_step_id,
connector_transaction_id,
connector_response_reference_id,
updated_by,
processor_transaction_data,
amount: None,
net_amount: None,
currency: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
error_reason: None,
capture_method: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
capture_before: None,
extended_authorization_applied: None,
shipping_cost: None,
order_tax_amount: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
}
}
PaymentAttemptUpdate::CaptureUpdate {
multiple_capture_count,
updated_by,
amount_to_capture,
} => Self {
multiple_capture_count,
modified_at: common_utils::date_time::now(),
updated_by,
amount_to_capture,
amount: None,
net_amount: None,
currency: None,
status: None,
connector_transaction_id: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::AmountToCaptureUpdate {
status,
amount_capturable,
updated_by,
} => Self {
status: Some(status),
modified_at: common_utils::date_time::now(),
amount_capturable: Some(amount_capturable),
updated_by,
amount: None,
net_amount: None,
currency: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::ConnectorResponse {
authentication_data,
encoded_data,
connector_transaction_id,
connector,
updated_by,
charges,
} => {
let (connector_transaction_id, processor_transaction_data) =
connector_transaction_id
.map(ConnectorTransactionId::form_id_and_data)
.map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
.unwrap_or((None, None));
Self {
authentication_data,
encoded_data,
connector_transaction_id,
connector: connector.map(Some),
modified_at: common_utils::date_time::now(),
updated_by,
processor_transaction_data,
charges,
amount: None,
net_amount: None,
currency: None,
status: None,
amount_to_capture: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
connector_mandate_detail: None,
card_discovery: None,
issuer_error_code: None,
issuer_error_message: None,
}
}
PaymentAttemptUpdate::IncrementalAuthorizationAmountUpdate {
amount,
amount_capturable,
} => Self {
amount: Some(amount),
modified_at: common_utils::date_time::now(),
amount_capturable: Some(amount_capturable),
net_amount: None,
currency: None,
status: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
updated_by: String::default(),
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::AuthenticationUpdate {
status,
external_three_ds_authentication_attempted,
authentication_connector,
authentication_id,
updated_by,
} => Self {
status: Some(status),
modified_at: common_utils::date_time::now(),
external_three_ds_authentication_attempted,
authentication_connector,
authentication_id,
updated_by,
amount: None,
net_amount: None,
currency: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
error_message: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
error_reason: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
unified_code: None,
unified_message: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
PaymentAttemptUpdate::ManualUpdate {
status,
error_code,
error_message,
error_reason,
updated_by,
unified_code,
unified_message,
connector_transaction_id,
} => {
let (connector_transaction_id, processor_transaction_data) =
connector_transaction_id
.map(ConnectorTransactionId::form_id_and_data)
.map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
.unwrap_or((None, None));
Self {
status,
error_code: error_code.map(Some),
modified_at: common_utils::date_time::now(),
error_message: error_message.map(Some),
error_reason: error_reason.map(Some),
updated_by,
unified_code: unified_code.map(Some),
unified_message: unified_message.map(Some),
connector_transaction_id,
processor_transaction_data,
amount: None,
net_amount: None,
currency: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
connector_metadata: None,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
}
}
PaymentAttemptUpdate::PostSessionTokensUpdate {
updated_by,
connector_metadata,
} => Self {
status: None,
error_code: None,
modified_at: common_utils::date_time::now(),
error_message: None,
error_reason: None,
updated_by,
unified_code: None,
unified_message: None,
amount: None,
net_amount: None,
currency: None,
connector_transaction_id: None,
amount_to_capture: None,
connector: None,
authentication_type: None,
payment_method: None,
payment_method_id: None,
cancellation_reason: None,
mandate_id: None,
browser_info: None,
payment_token: None,
connector_metadata,
payment_method_data: None,
payment_method_type: None,
payment_experience: None,
business_sub_label: None,
straight_through_algorithm: None,
preprocessing_step_id: None,
capture_method: None,
connector_response_reference_id: None,
multiple_capture_count: None,
surcharge_amount: None,
tax_amount: None,
amount_capturable: None,
merchant_connector_id: None,
authentication_data: None,
encoded_data: None,
external_three_ds_authentication_attempted: None,
authentication_connector: None,
authentication_id: None,
fingerprint_id: None,
payment_method_billing_address_id: None,
client_source: None,
client_version: None,
customer_acceptance: None,
card_network: None,
shipping_cost: None,
order_tax_amount: None,
capture_before: None,
extended_authorization_applied: None,
processor_transaction_data: None,
connector_mandate_detail: None,
card_discovery: None,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
},
}
}
}
#[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub enum RedirectForm {
Form {
endpoint: String,
method: common_utils::request::Method,
form_fields: std::collections::HashMap<String, String>,
},
Html {
html_data: String,
},
BlueSnap {
payment_fields_token: String,
},
CybersourceAuthSetup {
access_token: String,
ddc_url: String,
reference_id: String,
},
CybersourceConsumerAuth {
access_token: String,
step_up_url: String,
},
DeutschebankThreeDSChallengeFlow {
acs_url: String,
creq: String,
},
Payme,
Braintree {
client_token: String,
card_token: String,
bin: String,
acs_url: String,
},
Nmi {
amount: String,
currency: common_enums::Currency,
public_key: masking::Secret<String>,
customer_vault_id: String,
order_id: String,
},
Mifinity {
initialization_token: String,
},
WorldpayDDCForm {
endpoint: common_utils::types::Url,
method: common_utils::request::Method,
form_fields: std::collections::HashMap<String, String>,
collection_id: Option<String>,
},
}
common_utils::impl_to_sql_from_sql_json!(RedirectForm);
#[cfg(feature = "v2")]
#[derive(
Clone, Debug, serde::Deserialize, serde::Serialize, Eq, PartialEq, diesel::AsExpression,
)]
#[diesel(sql_type = diesel::pg::sql_types::Jsonb)]
pub struct PaymentAttemptFeatureMetadata {
pub revenue_recovery: Option<PaymentAttemptRecoveryData>,
}
#[cfg(feature = "v2")]
#[derive(
Clone, Debug, serde::Deserialize, serde::Serialize, Eq, PartialEq, diesel::AsExpression,
)]
#[diesel(sql_type = diesel::pg::sql_types::Jsonb)]
pub struct PaymentAttemptRecoveryData {
pub attempt_triggered_by: common_enums::TriggeredBy,
}
#[cfg(feature = "v2")]
common_utils::impl_to_sql_from_sql_json!(PaymentAttemptFeatureMetadata);
mod tests {
#[test]
fn test_backwards_compatibility() {
let serialized_payment_attempt = r#"{
"payment_id": "PMT123456789",
"merchant_id": "M123456789",
"attempt_id": "ATMPT123456789",
"status": "pending",
"amount": 10000,
"currency": "USD",
"save_to_locker": true,
"connector": "stripe",
"error_message": null,
"offer_amount": 9500,
"surcharge_amount": 500,
"tax_amount": 800,
"payment_method_id": "CRD123456789",
"payment_method": "card",
"connector_transaction_id": "CNTR123456789",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"confirm": false,
"authentication_type": "no_three_ds",
"created_at": "2024-02-26T12:00:00Z",
"modified_at": "2024-02-26T12:00:00Z",
"last_synced": null,
"cancellation_reason": null,
"amount_to_capture": 10000,
"mandate_id": null,
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"error_code": null,
"payment_token": "TOKEN123456789",
"connector_metadata": null,
"payment_experience": "redirect_to_url",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "10",
"card_cvc": "123",
"card_exp_year": "2024",
"card_holder_name": "John Doe"
}
},
"business_sub_label": "Premium",
"straight_through_algorithm": null,
"preprocessing_step_id": null,
"mandate_details": null,
"error_reason": null,
"multiple_capture_count": 0,
"connector_response_reference_id": null,
"amount_capturable": 10000,
"updated_by": "redis_kv",
"merchant_connector_id": "MCN123456789",
"authentication_data": null,
"encoded_data": null,
"unified_code": null,
"unified_message": null,
"net_amount": 10200,
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"single_use": {
"amount": 6540,
"currency": "USD"
}
}
},
"fingerprint_id": null
}"#;
let deserialized =
serde_json::from_str::<super::PaymentAttempt>(serialized_payment_attempt);
assert!(deserialized.is_ok());
}
}
| 29,354 | 829 |
hyperswitch | crates/diesel_models/src/reverse_lookup.rs | .rs | use diesel::{Identifiable, Insertable, Queryable, Selectable};
use crate::schema::reverse_lookup;
/// This reverse lookup table basically looks up id's and get result_id that you want. This is
/// useful for KV where you can't lookup without key
#[derive(
Clone,
Debug,
serde::Serialize,
serde::Deserialize,
Identifiable,
Queryable,
Selectable,
Eq,
PartialEq,
)]
#[diesel(table_name = reverse_lookup, primary_key(lookup_id), check_for_backend(diesel::pg::Pg))]
pub struct ReverseLookup {
/// Primary key. The key id.
pub lookup_id: String,
/// the `field` in KV database. Which is used to differentiate between two same keys
pub sk_id: String,
/// the value id. i.e the id you want to access KV table.
pub pk_id: String,
/// the source of insertion for reference
pub source: String,
pub updated_by: String,
}
#[derive(
Clone,
Debug,
Insertable,
router_derive::DebugAsDisplay,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
)]
#[diesel(table_name = reverse_lookup)]
pub struct ReverseLookupNew {
pub lookup_id: String,
pub pk_id: String,
pub sk_id: String,
pub source: String,
pub updated_by: String,
}
impl From<ReverseLookupNew> for ReverseLookup {
fn from(new: ReverseLookupNew) -> Self {
Self {
lookup_id: new.lookup_id,
sk_id: new.sk_id,
pk_id: new.pk_id,
source: new.source,
updated_by: new.updated_by,
}
}
}
| 372 | 830 |
hyperswitch | crates/diesel_models/src/configs.rs | .rs | use std::convert::From;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};
use crate::schema::configs;
#[derive(Default, Clone, Debug, Insertable, Serialize, Deserialize)]
#[diesel(table_name = configs)]
pub struct ConfigNew {
pub key: String,
pub config: String,
}
#[derive(Default, Clone, Debug, Identifiable, Queryable, Selectable, Deserialize, Serialize)]
#[diesel(table_name = configs, primary_key(key), check_for_backend(diesel::pg::Pg))]
pub struct Config {
pub key: String,
pub config: String,
}
#[derive(Debug)]
pub enum ConfigUpdate {
Update { config: Option<String> },
}
#[derive(Clone, Debug, AsChangeset, Default)]
#[diesel(table_name = configs)]
pub struct ConfigUpdateInternal {
config: Option<String>,
}
impl ConfigUpdateInternal {
pub fn create_config(self, source: Config) -> Config {
Config { ..source }
}
}
impl From<ConfigUpdate> for ConfigUpdateInternal {
fn from(config_update: ConfigUpdate) -> Self {
match config_update {
ConfigUpdate::Update { config } => Self { config },
}
}
}
impl From<ConfigNew> for Config {
fn from(config_new: ConfigNew) -> Self {
Self {
key: config_new.key,
config: config_new.config,
}
}
}
| 310 | 831 |
hyperswitch | crates/diesel_models/src/business_profile.rs | .rs | use std::collections::{HashMap, HashSet};
use common_enums::{AuthenticationConnectors, UIWidgetFormLayout};
use common_types::primitive_wrappers;
use common_utils::{encryption::Encryption, pii};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use masking::Secret;
#[cfg(feature = "v1")]
use crate::schema::business_profile;
#[cfg(feature = "v2")]
use crate::schema_v2::business_profile;
/// Note: The order of fields in the struct is important.
/// This should be in the same order as the fields in the schema.rs file, otherwise the code will
/// not compile
/// If two adjacent columns have the same type, then the compiler will not throw any error, but the
/// fields read / written will be interchanged
#[cfg(feature = "v1")]
#[derive(Clone, Debug, Identifiable, Queryable, Selectable, router_derive::DebugAsDisplay)]
#[diesel(table_name = business_profile, primary_key(profile_id), check_for_backend(diesel::pg::Pg))]
pub struct Profile {
pub profile_id: common_utils::id_type::ProfileId,
pub merchant_id: common_utils::id_type::MerchantId,
pub profile_name: String,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub return_url: Option<String>,
pub enable_payment_response_hash: bool,
pub payment_response_hash_key: Option<String>,
pub redirect_to_merchant_with_http_post: bool,
pub webhook_details: Option<WebhookDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub routing_algorithm: Option<serde_json::Value>,
pub intent_fulfillment_time: Option<i64>,
pub frm_routing_algorithm: Option<serde_json::Value>,
pub payout_routing_algorithm: Option<serde_json::Value>,
pub is_recon_enabled: bool,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub payment_link_config: Option<BusinessPaymentLinkConfig>,
pub session_expiry: Option<i64>,
pub authentication_connector_details: Option<AuthenticationConnectorDetails>,
pub payout_link_config: Option<BusinessPayoutLinkConfig>,
pub is_extended_card_info_enabled: Option<bool>,
pub extended_card_info_config: Option<pii::SecretSerdeValue>,
pub is_connector_agnostic_mit_enabled: Option<bool>,
pub use_billing_as_payment_method_billing: Option<bool>,
pub collect_shipping_details_from_wallet_connector: Option<bool>,
pub collect_billing_details_from_wallet_connector: Option<bool>,
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub version: common_enums::ApiVersion,
pub dynamic_routing_algorithm: Option<serde_json::Value>,
pub is_network_tokenization_enabled: bool,
pub is_auto_retries_enabled: Option<bool>,
pub max_auto_retries_enabled: Option<i16>,
pub always_request_extended_authorization:
Option<primitive_wrappers::AlwaysRequestExtendedAuthorization>,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub card_testing_guard_config: Option<CardTestingGuardConfig>,
pub card_testing_secret_key: Option<Encryption>,
pub is_clear_pan_retries_enabled: bool,
pub force_3ds_challenge: Option<bool>,
pub is_debit_routing_enabled: bool,
pub merchant_business_country: Option<common_enums::CountryAlpha2>,
pub id: Option<common_utils::id_type::ProfileId>,
}
#[cfg(feature = "v1")]
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = business_profile, primary_key(profile_id))]
pub struct ProfileNew {
pub profile_id: common_utils::id_type::ProfileId,
pub merchant_id: common_utils::id_type::MerchantId,
pub profile_name: String,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub return_url: Option<String>,
pub enable_payment_response_hash: bool,
pub payment_response_hash_key: Option<String>,
pub redirect_to_merchant_with_http_post: bool,
pub webhook_details: Option<WebhookDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub routing_algorithm: Option<serde_json::Value>,
pub intent_fulfillment_time: Option<i64>,
pub frm_routing_algorithm: Option<serde_json::Value>,
pub payout_routing_algorithm: Option<serde_json::Value>,
pub is_recon_enabled: bool,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub payment_link_config: Option<BusinessPaymentLinkConfig>,
pub session_expiry: Option<i64>,
pub authentication_connector_details: Option<AuthenticationConnectorDetails>,
pub payout_link_config: Option<BusinessPayoutLinkConfig>,
pub is_extended_card_info_enabled: Option<bool>,
pub extended_card_info_config: Option<pii::SecretSerdeValue>,
pub is_connector_agnostic_mit_enabled: Option<bool>,
pub use_billing_as_payment_method_billing: Option<bool>,
pub collect_shipping_details_from_wallet_connector: Option<bool>,
pub collect_billing_details_from_wallet_connector: Option<bool>,
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub version: common_enums::ApiVersion,
pub is_network_tokenization_enabled: bool,
pub is_auto_retries_enabled: Option<bool>,
pub max_auto_retries_enabled: Option<i16>,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub card_testing_guard_config: Option<CardTestingGuardConfig>,
pub card_testing_secret_key: Option<Encryption>,
pub is_clear_pan_retries_enabled: bool,
pub force_3ds_challenge: Option<bool>,
pub is_debit_routing_enabled: bool,
pub merchant_business_country: Option<common_enums::CountryAlpha2>,
pub id: Option<common_utils::id_type::ProfileId>,
}
#[cfg(feature = "v1")]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = business_profile)]
pub struct ProfileUpdateInternal {
pub profile_name: Option<String>,
pub modified_at: time::PrimitiveDateTime,
pub return_url: Option<String>,
pub enable_payment_response_hash: Option<bool>,
pub payment_response_hash_key: Option<String>,
pub redirect_to_merchant_with_http_post: Option<bool>,
pub webhook_details: Option<WebhookDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub routing_algorithm: Option<serde_json::Value>,
pub intent_fulfillment_time: Option<i64>,
pub frm_routing_algorithm: Option<serde_json::Value>,
pub payout_routing_algorithm: Option<serde_json::Value>,
pub is_recon_enabled: Option<bool>,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub payment_link_config: Option<BusinessPaymentLinkConfig>,
pub session_expiry: Option<i64>,
pub authentication_connector_details: Option<AuthenticationConnectorDetails>,
pub payout_link_config: Option<BusinessPayoutLinkConfig>,
pub is_extended_card_info_enabled: Option<bool>,
pub extended_card_info_config: Option<pii::SecretSerdeValue>,
pub is_connector_agnostic_mit_enabled: Option<bool>,
pub use_billing_as_payment_method_billing: Option<bool>,
pub collect_shipping_details_from_wallet_connector: Option<bool>,
pub collect_billing_details_from_wallet_connector: Option<bool>,
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub dynamic_routing_algorithm: Option<serde_json::Value>,
pub is_network_tokenization_enabled: Option<bool>,
pub is_auto_retries_enabled: Option<bool>,
pub max_auto_retries_enabled: Option<i16>,
pub always_request_extended_authorization:
Option<primitive_wrappers::AlwaysRequestExtendedAuthorization>,
pub is_click_to_pay_enabled: Option<bool>,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub card_testing_guard_config: Option<CardTestingGuardConfig>,
pub card_testing_secret_key: Option<Encryption>,
pub is_clear_pan_retries_enabled: Option<bool>,
pub force_3ds_challenge: Option<bool>,
pub is_debit_routing_enabled: bool,
pub merchant_business_country: Option<common_enums::CountryAlpha2>,
}
#[cfg(feature = "v1")]
impl ProfileUpdateInternal {
pub fn apply_changeset(self, source: Profile) -> Profile {
let Self {
profile_name,
modified_at,
return_url,
enable_payment_response_hash,
payment_response_hash_key,
redirect_to_merchant_with_http_post,
webhook_details,
metadata,
routing_algorithm,
intent_fulfillment_time,
frm_routing_algorithm,
payout_routing_algorithm,
is_recon_enabled,
applepay_verified_domains,
payment_link_config,
session_expiry,
authentication_connector_details,
payout_link_config,
is_extended_card_info_enabled,
extended_card_info_config,
is_connector_agnostic_mit_enabled,
use_billing_as_payment_method_billing,
collect_shipping_details_from_wallet_connector,
collect_billing_details_from_wallet_connector,
outgoing_webhook_custom_http_headers,
always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector,
tax_connector_id,
is_tax_connector_enabled,
dynamic_routing_algorithm,
is_network_tokenization_enabled,
is_auto_retries_enabled,
max_auto_retries_enabled,
always_request_extended_authorization,
is_click_to_pay_enabled,
authentication_product_ids,
card_testing_guard_config,
card_testing_secret_key,
is_clear_pan_retries_enabled,
force_3ds_challenge,
is_debit_routing_enabled,
merchant_business_country,
} = self;
Profile {
profile_id: source.profile_id,
merchant_id: source.merchant_id,
profile_name: profile_name.unwrap_or(source.profile_name),
created_at: source.created_at,
modified_at,
return_url: return_url.or(source.return_url),
enable_payment_response_hash: enable_payment_response_hash
.unwrap_or(source.enable_payment_response_hash),
payment_response_hash_key: payment_response_hash_key
.or(source.payment_response_hash_key),
redirect_to_merchant_with_http_post: redirect_to_merchant_with_http_post
.unwrap_or(source.redirect_to_merchant_with_http_post),
webhook_details: webhook_details.or(source.webhook_details),
metadata: metadata.or(source.metadata),
routing_algorithm: routing_algorithm.or(source.routing_algorithm),
intent_fulfillment_time: intent_fulfillment_time.or(source.intent_fulfillment_time),
frm_routing_algorithm: frm_routing_algorithm.or(source.frm_routing_algorithm),
payout_routing_algorithm: payout_routing_algorithm.or(source.payout_routing_algorithm),
is_recon_enabled: is_recon_enabled.unwrap_or(source.is_recon_enabled),
applepay_verified_domains: applepay_verified_domains
.or(source.applepay_verified_domains),
payment_link_config: payment_link_config.or(source.payment_link_config),
session_expiry: session_expiry.or(source.session_expiry),
authentication_connector_details: authentication_connector_details
.or(source.authentication_connector_details),
payout_link_config: payout_link_config.or(source.payout_link_config),
is_extended_card_info_enabled: is_extended_card_info_enabled
.or(source.is_extended_card_info_enabled),
is_connector_agnostic_mit_enabled: is_connector_agnostic_mit_enabled
.or(source.is_connector_agnostic_mit_enabled),
extended_card_info_config: extended_card_info_config
.or(source.extended_card_info_config),
use_billing_as_payment_method_billing: use_billing_as_payment_method_billing
.or(source.use_billing_as_payment_method_billing),
collect_shipping_details_from_wallet_connector:
collect_shipping_details_from_wallet_connector
.or(source.collect_shipping_details_from_wallet_connector),
collect_billing_details_from_wallet_connector:
collect_billing_details_from_wallet_connector
.or(source.collect_billing_details_from_wallet_connector),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.or(source.outgoing_webhook_custom_http_headers),
always_collect_billing_details_from_wallet_connector:
always_collect_billing_details_from_wallet_connector
.or(source.always_collect_billing_details_from_wallet_connector),
always_collect_shipping_details_from_wallet_connector:
always_collect_shipping_details_from_wallet_connector
.or(source.always_collect_shipping_details_from_wallet_connector),
tax_connector_id: tax_connector_id.or(source.tax_connector_id),
is_tax_connector_enabled: is_tax_connector_enabled.or(source.is_tax_connector_enabled),
version: source.version,
dynamic_routing_algorithm: dynamic_routing_algorithm
.or(source.dynamic_routing_algorithm),
is_network_tokenization_enabled: is_network_tokenization_enabled
.unwrap_or(source.is_network_tokenization_enabled),
is_auto_retries_enabled: is_auto_retries_enabled.or(source.is_auto_retries_enabled),
max_auto_retries_enabled: max_auto_retries_enabled.or(source.max_auto_retries_enabled),
always_request_extended_authorization: always_request_extended_authorization
.or(source.always_request_extended_authorization),
is_click_to_pay_enabled: is_click_to_pay_enabled
.unwrap_or(source.is_click_to_pay_enabled),
authentication_product_ids: authentication_product_ids
.or(source.authentication_product_ids),
card_testing_guard_config: card_testing_guard_config
.or(source.card_testing_guard_config),
card_testing_secret_key,
is_clear_pan_retries_enabled: is_clear_pan_retries_enabled
.unwrap_or(source.is_clear_pan_retries_enabled),
force_3ds_challenge,
id: source.id,
is_debit_routing_enabled,
merchant_business_country: merchant_business_country
.or(source.merchant_business_country),
}
}
}
/// Note: The order of fields in the struct is important.
/// This should be in the same order as the fields in the schema.rs file, otherwise the code will
/// not compile
/// If two adjacent columns have the same type, then the compiler will not throw any error, but the
/// fields read / written will be interchanged
#[cfg(feature = "v2")]
#[derive(Clone, Debug, Identifiable, Queryable, Selectable, router_derive::DebugAsDisplay)]
#[diesel(table_name = business_profile, primary_key(id), check_for_backend(diesel::pg::Pg))]
pub struct Profile {
pub merchant_id: common_utils::id_type::MerchantId,
pub profile_name: String,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub return_url: Option<common_utils::types::Url>,
pub enable_payment_response_hash: bool,
pub payment_response_hash_key: Option<String>,
pub redirect_to_merchant_with_http_post: bool,
pub webhook_details: Option<WebhookDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub is_recon_enabled: bool,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub payment_link_config: Option<BusinessPaymentLinkConfig>,
pub session_expiry: Option<i64>,
pub authentication_connector_details: Option<AuthenticationConnectorDetails>,
pub payout_link_config: Option<BusinessPayoutLinkConfig>,
pub is_extended_card_info_enabled: Option<bool>,
pub extended_card_info_config: Option<pii::SecretSerdeValue>,
pub is_connector_agnostic_mit_enabled: Option<bool>,
pub use_billing_as_payment_method_billing: Option<bool>,
pub collect_shipping_details_from_wallet_connector: Option<bool>,
pub collect_billing_details_from_wallet_connector: Option<bool>,
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub version: common_enums::ApiVersion,
pub dynamic_routing_algorithm: Option<serde_json::Value>,
pub is_network_tokenization_enabled: bool,
pub is_auto_retries_enabled: Option<bool>,
pub max_auto_retries_enabled: Option<i16>,
pub always_request_extended_authorization:
Option<primitive_wrappers::AlwaysRequestExtendedAuthorization>,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub card_testing_guard_config: Option<CardTestingGuardConfig>,
pub card_testing_secret_key: Option<Encryption>,
pub is_clear_pan_retries_enabled: bool,
pub force_3ds_challenge: Option<bool>,
pub is_debit_routing_enabled: bool,
pub merchant_business_country: Option<common_enums::CountryAlpha2>,
pub id: common_utils::id_type::ProfileId,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
pub three_ds_decision_manager_config: Option<common_types::payments::DecisionManagerRecord>,
pub should_collect_cvv_during_payment:
Option<primitive_wrappers::ShouldCollectCvvDuringPayment>,
}
impl Profile {
#[cfg(feature = "v1")]
pub fn get_id(&self) -> &common_utils::id_type::ProfileId {
&self.profile_id
}
#[cfg(feature = "v2")]
pub fn get_id(&self) -> &common_utils::id_type::ProfileId {
&self.id
}
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = business_profile, primary_key(profile_id))]
pub struct ProfileNew {
pub merchant_id: common_utils::id_type::MerchantId,
pub profile_name: String,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
pub return_url: Option<common_utils::types::Url>,
pub enable_payment_response_hash: bool,
pub payment_response_hash_key: Option<String>,
pub redirect_to_merchant_with_http_post: bool,
pub webhook_details: Option<WebhookDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub is_recon_enabled: bool,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub payment_link_config: Option<BusinessPaymentLinkConfig>,
pub session_expiry: Option<i64>,
pub authentication_connector_details: Option<AuthenticationConnectorDetails>,
pub payout_link_config: Option<BusinessPayoutLinkConfig>,
pub is_extended_card_info_enabled: Option<bool>,
pub extended_card_info_config: Option<pii::SecretSerdeValue>,
pub is_connector_agnostic_mit_enabled: Option<bool>,
pub use_billing_as_payment_method_billing: Option<bool>,
pub collect_shipping_details_from_wallet_connector: Option<bool>,
pub collect_billing_details_from_wallet_connector: Option<bool>,
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub version: common_enums::ApiVersion,
pub is_network_tokenization_enabled: bool,
pub is_auto_retries_enabled: Option<bool>,
pub max_auto_retries_enabled: Option<i16>,
pub is_click_to_pay_enabled: bool,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub card_testing_guard_config: Option<CardTestingGuardConfig>,
pub card_testing_secret_key: Option<Encryption>,
pub is_clear_pan_retries_enabled: Option<bool>,
pub is_debit_routing_enabled: bool,
pub merchant_business_country: Option<common_enums::CountryAlpha2>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
pub three_ds_decision_manager_config: Option<common_types::payments::DecisionManagerRecord>,
pub should_collect_cvv_during_payment:
Option<primitive_wrappers::ShouldCollectCvvDuringPayment>,
pub id: common_utils::id_type::ProfileId,
}
#[cfg(feature = "v2")]
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = business_profile)]
pub struct ProfileUpdateInternal {
pub profile_name: Option<String>,
pub modified_at: time::PrimitiveDateTime,
pub return_url: Option<common_utils::types::Url>,
pub enable_payment_response_hash: Option<bool>,
pub payment_response_hash_key: Option<String>,
pub redirect_to_merchant_with_http_post: Option<bool>,
pub webhook_details: Option<WebhookDetails>,
pub metadata: Option<pii::SecretSerdeValue>,
pub is_recon_enabled: Option<bool>,
#[diesel(deserialize_as = super::OptionalDieselArray<String>)]
pub applepay_verified_domains: Option<Vec<String>>,
pub payment_link_config: Option<BusinessPaymentLinkConfig>,
pub session_expiry: Option<i64>,
pub authentication_connector_details: Option<AuthenticationConnectorDetails>,
pub payout_link_config: Option<BusinessPayoutLinkConfig>,
pub is_extended_card_info_enabled: Option<bool>,
pub extended_card_info_config: Option<pii::SecretSerdeValue>,
pub is_connector_agnostic_mit_enabled: Option<bool>,
pub use_billing_as_payment_method_billing: Option<bool>,
pub collect_shipping_details_from_wallet_connector: Option<bool>,
pub collect_billing_details_from_wallet_connector: Option<bool>,
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub is_tax_connector_enabled: Option<bool>,
pub is_network_tokenization_enabled: Option<bool>,
pub is_auto_retries_enabled: Option<bool>,
pub max_auto_retries_enabled: Option<i16>,
pub is_click_to_pay_enabled: Option<bool>,
pub authentication_product_ids:
Option<common_types::payments::AuthenticationConnectorAccountMap>,
pub card_testing_guard_config: Option<CardTestingGuardConfig>,
pub card_testing_secret_key: Option<Encryption>,
pub is_clear_pan_retries_enabled: Option<bool>,
pub is_debit_routing_enabled: bool,
pub merchant_business_country: Option<common_enums::CountryAlpha2>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
pub three_ds_decision_manager_config: Option<common_types::payments::DecisionManagerRecord>,
pub should_collect_cvv_during_payment:
Option<primitive_wrappers::ShouldCollectCvvDuringPayment>,
}
#[cfg(feature = "v2")]
impl ProfileUpdateInternal {
pub fn apply_changeset(self, source: Profile) -> Profile {
let Self {
profile_name,
modified_at,
return_url,
enable_payment_response_hash,
payment_response_hash_key,
redirect_to_merchant_with_http_post,
webhook_details,
metadata,
is_recon_enabled,
applepay_verified_domains,
payment_link_config,
session_expiry,
authentication_connector_details,
payout_link_config,
is_extended_card_info_enabled,
extended_card_info_config,
is_connector_agnostic_mit_enabled,
use_billing_as_payment_method_billing,
collect_shipping_details_from_wallet_connector,
collect_billing_details_from_wallet_connector,
outgoing_webhook_custom_http_headers,
always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector,
tax_connector_id,
is_tax_connector_enabled,
routing_algorithm_id,
order_fulfillment_time,
order_fulfillment_time_origin,
frm_routing_algorithm_id,
payout_routing_algorithm_id,
default_fallback_routing,
should_collect_cvv_during_payment,
is_network_tokenization_enabled,
is_auto_retries_enabled,
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
three_ds_decision_manager_config,
card_testing_guard_config,
card_testing_secret_key,
is_clear_pan_retries_enabled,
is_debit_routing_enabled,
merchant_business_country,
} = self;
Profile {
id: source.id,
merchant_id: source.merchant_id,
profile_name: profile_name.unwrap_or(source.profile_name),
created_at: source.created_at,
modified_at,
return_url: return_url.or(source.return_url),
enable_payment_response_hash: enable_payment_response_hash
.unwrap_or(source.enable_payment_response_hash),
payment_response_hash_key: payment_response_hash_key
.or(source.payment_response_hash_key),
redirect_to_merchant_with_http_post: redirect_to_merchant_with_http_post
.unwrap_or(source.redirect_to_merchant_with_http_post),
webhook_details: webhook_details.or(source.webhook_details),
metadata: metadata.or(source.metadata),
is_recon_enabled: is_recon_enabled.unwrap_or(source.is_recon_enabled),
applepay_verified_domains: applepay_verified_domains
.or(source.applepay_verified_domains),
payment_link_config: payment_link_config.or(source.payment_link_config),
session_expiry: session_expiry.or(source.session_expiry),
authentication_connector_details: authentication_connector_details
.or(source.authentication_connector_details),
payout_link_config: payout_link_config.or(source.payout_link_config),
is_extended_card_info_enabled: is_extended_card_info_enabled
.or(source.is_extended_card_info_enabled),
is_connector_agnostic_mit_enabled: is_connector_agnostic_mit_enabled
.or(source.is_connector_agnostic_mit_enabled),
extended_card_info_config: extended_card_info_config
.or(source.extended_card_info_config),
use_billing_as_payment_method_billing: use_billing_as_payment_method_billing
.or(source.use_billing_as_payment_method_billing),
collect_shipping_details_from_wallet_connector:
collect_shipping_details_from_wallet_connector
.or(source.collect_shipping_details_from_wallet_connector),
collect_billing_details_from_wallet_connector:
collect_billing_details_from_wallet_connector
.or(source.collect_billing_details_from_wallet_connector),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.or(source.outgoing_webhook_custom_http_headers),
always_collect_billing_details_from_wallet_connector:
always_collect_billing_details_from_wallet_connector
.or(always_collect_billing_details_from_wallet_connector),
always_collect_shipping_details_from_wallet_connector:
always_collect_shipping_details_from_wallet_connector
.or(always_collect_shipping_details_from_wallet_connector),
tax_connector_id: tax_connector_id.or(source.tax_connector_id),
is_tax_connector_enabled: is_tax_connector_enabled.or(source.is_tax_connector_enabled),
routing_algorithm_id: routing_algorithm_id.or(source.routing_algorithm_id),
order_fulfillment_time: order_fulfillment_time.or(source.order_fulfillment_time),
order_fulfillment_time_origin: order_fulfillment_time_origin
.or(source.order_fulfillment_time_origin),
frm_routing_algorithm_id: frm_routing_algorithm_id.or(source.frm_routing_algorithm_id),
payout_routing_algorithm_id: payout_routing_algorithm_id
.or(source.payout_routing_algorithm_id),
default_fallback_routing: default_fallback_routing.or(source.default_fallback_routing),
should_collect_cvv_during_payment: should_collect_cvv_during_payment
.or(source.should_collect_cvv_during_payment),
version: source.version,
dynamic_routing_algorithm: None,
is_network_tokenization_enabled: is_network_tokenization_enabled
.unwrap_or(source.is_network_tokenization_enabled),
is_auto_retries_enabled: is_auto_retries_enabled.or(source.is_auto_retries_enabled),
max_auto_retries_enabled: max_auto_retries_enabled.or(source.max_auto_retries_enabled),
always_request_extended_authorization: None,
is_click_to_pay_enabled: is_click_to_pay_enabled
.unwrap_or(source.is_click_to_pay_enabled),
authentication_product_ids: authentication_product_ids
.or(source.authentication_product_ids),
three_ds_decision_manager_config: three_ds_decision_manager_config
.or(source.three_ds_decision_manager_config),
card_testing_guard_config: card_testing_guard_config
.or(source.card_testing_guard_config),
card_testing_secret_key: card_testing_secret_key.or(source.card_testing_secret_key),
is_clear_pan_retries_enabled: is_clear_pan_retries_enabled
.unwrap_or(source.is_clear_pan_retries_enabled),
force_3ds_challenge: None,
is_debit_routing_enabled,
merchant_business_country: merchant_business_country
.or(source.merchant_business_country),
}
}
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct AuthenticationConnectorDetails {
pub authentication_connectors: Vec<AuthenticationConnectors>,
pub three_ds_requestor_url: String,
pub three_ds_requestor_app_url: Option<String>,
}
common_utils::impl_to_sql_from_sql_json!(AuthenticationConnectorDetails);
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct CardTestingGuardConfig {
pub is_card_ip_blocking_enabled: bool,
pub card_ip_blocking_threshold: i32,
pub is_guest_user_card_blocking_enabled: bool,
pub guest_user_card_blocking_threshold: i32,
pub is_customer_id_blocking_enabled: bool,
pub customer_id_blocking_threshold: i32,
pub card_testing_guard_expiry: i32,
}
common_utils::impl_to_sql_from_sql_json!(CardTestingGuardConfig);
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Json)]
pub struct WebhookDetails {
pub webhook_version: Option<String>,
pub webhook_username: Option<String>,
pub webhook_password: Option<Secret<String>>,
pub webhook_url: Option<Secret<String>>,
pub payment_created_enabled: Option<bool>,
pub payment_succeeded_enabled: Option<bool>,
pub payment_failed_enabled: Option<bool>,
}
common_utils::impl_to_sql_from_sql_json!(WebhookDetails);
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct BusinessPaymentLinkConfig {
pub domain_name: Option<String>,
#[serde(flatten)]
pub default_config: Option<PaymentLinkConfigRequest>,
pub business_specific_configs: Option<HashMap<String, PaymentLinkConfigRequest>>,
pub allowed_domains: Option<HashSet<String>>,
pub branding_visibility: Option<bool>,
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct PaymentLinkConfigRequest {
pub theme: Option<String>,
pub logo: Option<String>,
pub seller_name: Option<String>,
pub sdk_layout: Option<String>,
pub display_sdk_only: Option<bool>,
pub enabled_saved_payment_method: Option<bool>,
pub hide_card_nickname_field: Option<bool>,
pub show_card_form_by_default: Option<bool>,
pub background_image: Option<PaymentLinkBackgroundImageConfig>,
pub details_layout: Option<common_enums::PaymentLinkDetailsLayout>,
pub payment_button_text: Option<String>,
pub custom_message_for_card_terms: Option<String>,
pub payment_button_colour: Option<String>,
pub skip_status_screen: Option<bool>,
pub payment_button_text_colour: Option<String>,
pub background_colour: Option<String>,
pub sdk_ui_rules: Option<HashMap<String, HashMap<String, String>>>,
pub payment_link_ui_rules: Option<HashMap<String, HashMap<String, String>>>,
pub enable_button_only_on_form_ready: Option<bool>,
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, PartialEq)]
pub struct PaymentLinkBackgroundImageConfig {
pub url: common_utils::types::Url,
pub position: Option<common_enums::ElementPosition>,
pub size: Option<common_enums::ElementSize>,
}
common_utils::impl_to_sql_from_sql_json!(BusinessPaymentLinkConfig);
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, diesel::AsExpression)]
#[diesel(sql_type = diesel::sql_types::Jsonb)]
pub struct BusinessPayoutLinkConfig {
#[serde(flatten)]
pub config: BusinessGenericLinkConfig,
pub form_layout: Option<UIWidgetFormLayout>,
pub payout_test_mode: Option<bool>,
}
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct BusinessGenericLinkConfig {
pub domain_name: Option<String>,
pub allowed_domains: HashSet<String>,
#[serde(flatten)]
pub ui_config: common_utils::link_utils::GenericLinkUiConfig,
}
common_utils::impl_to_sql_from_sql_json!(BusinessPayoutLinkConfig);
| 7,404 | 832 |
hyperswitch | crates/diesel_models/src/blocklist.rs | .rs | use diesel::{Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};
use crate::schema::blocklist;
#[derive(Clone, Debug, Eq, Insertable, PartialEq, Serialize, Deserialize)]
#[diesel(table_name = blocklist)]
pub struct BlocklistNew {
pub merchant_id: common_utils::id_type::MerchantId,
pub fingerprint_id: String,
pub data_kind: common_enums::BlocklistDataKind,
pub metadata: Option<serde_json::Value>,
pub created_at: time::PrimitiveDateTime,
}
#[derive(
Clone, Debug, Eq, PartialEq, Identifiable, Queryable, Selectable, Deserialize, Serialize,
)]
#[diesel(table_name = blocklist, primary_key(merchant_id, fingerprint_id), check_for_backend(diesel::pg::Pg))]
pub struct Blocklist {
pub merchant_id: common_utils::id_type::MerchantId,
pub fingerprint_id: String,
pub data_kind: common_enums::BlocklistDataKind,
pub metadata: Option<serde_json::Value>,
pub created_at: time::PrimitiveDateTime,
}
| 235 | 833 |
hyperswitch | crates/diesel_models/src/cards_info.rs | .rs | use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::{enums as storage_enums, schema::cards_info};
#[derive(
Clone,
Debug,
Queryable,
Identifiable,
Selectable,
serde::Deserialize,
serde::Serialize,
Insertable,
)]
#[diesel(table_name = cards_info, primary_key(card_iin), check_for_backend(diesel::pg::Pg))]
pub struct CardInfo {
pub card_iin: String,
pub card_issuer: Option<String>,
pub card_network: Option<storage_enums::CardNetwork>,
pub card_type: Option<String>,
pub card_subtype: Option<String>,
pub card_issuing_country: Option<String>,
pub bank_code_id: Option<String>,
pub bank_code: Option<String>,
pub country_code: Option<String>,
pub date_created: PrimitiveDateTime,
pub last_updated: Option<PrimitiveDateTime>,
pub last_updated_provider: Option<String>,
}
#[derive(
Clone, Debug, PartialEq, Eq, AsChangeset, router_derive::DebugAsDisplay, serde::Deserialize,
)]
#[diesel(table_name = cards_info)]
pub struct UpdateCardInfo {
pub card_issuer: Option<String>,
pub card_network: Option<storage_enums::CardNetwork>,
pub card_type: Option<String>,
pub card_subtype: Option<String>,
pub card_issuing_country: Option<String>,
pub bank_code_id: Option<String>,
pub bank_code: Option<String>,
pub country_code: Option<String>,
pub last_updated: Option<PrimitiveDateTime>,
pub last_updated_provider: Option<String>,
}
| 355 | 834 |
hyperswitch | crates/diesel_models/src/role.rs | .rs | use common_utils::id_type;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::{enums, schema::roles};
#[derive(Clone, Debug, Identifiable, Queryable, Selectable)]
#[diesel(table_name = roles, primary_key(role_id), check_for_backend(diesel::pg::Pg))]
pub struct Role {
pub role_name: String,
pub role_id: String,
pub merchant_id: id_type::MerchantId,
pub org_id: id_type::OrganizationId,
#[diesel(deserialize_as = super::DieselArray<enums::PermissionGroup>)]
pub groups: Vec<enums::PermissionGroup>,
pub scope: enums::RoleScope,
pub created_at: PrimitiveDateTime,
pub created_by: String,
pub last_modified_at: PrimitiveDateTime,
pub last_modified_by: String,
pub entity_type: enums::EntityType,
pub profile_id: Option<id_type::ProfileId>,
pub tenant_id: id_type::TenantId,
}
#[derive(router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = roles)]
pub struct RoleNew {
pub role_name: String,
pub role_id: String,
pub merchant_id: id_type::MerchantId,
pub org_id: id_type::OrganizationId,
#[diesel(deserialize_as = super::DieselArray<enums::PermissionGroup>)]
pub groups: Vec<enums::PermissionGroup>,
pub scope: enums::RoleScope,
pub created_at: PrimitiveDateTime,
pub created_by: String,
pub last_modified_at: PrimitiveDateTime,
pub last_modified_by: String,
pub entity_type: enums::EntityType,
pub profile_id: Option<id_type::ProfileId>,
pub tenant_id: id_type::TenantId,
}
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = roles)]
pub struct RoleUpdateInternal {
groups: Option<Vec<enums::PermissionGroup>>,
role_name: Option<String>,
last_modified_by: String,
last_modified_at: PrimitiveDateTime,
}
pub enum RoleUpdate {
UpdateDetails {
groups: Option<Vec<enums::PermissionGroup>>,
role_name: Option<String>,
last_modified_at: PrimitiveDateTime,
last_modified_by: String,
},
}
impl From<RoleUpdate> for RoleUpdateInternal {
fn from(value: RoleUpdate) -> Self {
match value {
RoleUpdate::UpdateDetails {
groups,
role_name,
last_modified_by,
last_modified_at,
} => Self {
groups,
role_name,
last_modified_at,
last_modified_by,
},
}
}
}
#[derive(Clone, Debug)]
pub enum ListRolesByEntityPayload {
Profile(id_type::MerchantId, id_type::ProfileId),
Merchant(id_type::MerchantId),
Organization,
}
| 632 | 835 |
hyperswitch | crates/diesel_models/src/query/payment_link.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
payment_link::{PaymentLink, PaymentLinkNew},
schema::payment_link::dsl,
PgPooledConn, StorageResult,
};
impl PaymentLinkNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PaymentLink> {
generics::generic_insert(conn, self).await
}
}
impl PaymentLink {
pub async fn find_link_by_payment_link_id(
conn: &PgPooledConn,
payment_link_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::payment_link_id.eq(payment_link_id.to_owned()),
)
.await
}
}
| 176 | 836 |
hyperswitch | crates/diesel_models/src/query/merchant_account.rs | .rs | use common_types::consts::API_VERSION;
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use super::generics;
#[cfg(feature = "v1")]
use crate::schema::merchant_account::dsl;
#[cfg(feature = "v2")]
use crate::schema_v2::merchant_account::dsl;
use crate::{
errors,
merchant_account::{MerchantAccount, MerchantAccountNew, MerchantAccountUpdateInternal},
PgPooledConn, StorageResult,
};
impl MerchantAccountNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<MerchantAccount> {
generics::generic_insert(conn, self).await
}
}
#[cfg(feature = "v1")]
impl MerchantAccount {
pub async fn update(
self,
conn: &PgPooledConn,
merchant_account: MerchantAccountUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.get_id().to_owned(),
merchant_account,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn update_with_specific_fields(
conn: &PgPooledConn,
identifier: &common_utils::id_type::MerchantId,
merchant_account: MerchantAccountUpdateInternal,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id.eq(identifier.to_owned()),
merchant_account,
)
.await
}
pub async fn delete_by_merchant_id(
conn: &PgPooledConn,
identifier: &common_utils::id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id.eq(identifier.to_owned()),
)
.await
}
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
identifier: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id.eq(identifier.to_owned()),
)
.await
}
pub async fn find_by_publishable_key(
conn: &PgPooledConn,
publishable_key: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::publishable_key.eq(publishable_key.to_owned()),
)
.await
}
pub async fn list_by_organization_id(
conn: &PgPooledConn,
organization_id: &common_utils::id_type::OrganizationId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::organization_id
.eq(organization_id.to_owned())
.and(dsl::version.eq(API_VERSION)),
None,
None,
None,
)
.await
}
pub async fn list_multiple_merchant_accounts(
conn: &PgPooledConn,
merchant_ids: Vec<common_utils::id_type::MerchantId>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.eq_any(merchant_ids.clone()),
None,
None,
None,
)
.await
}
pub async fn list_all_merchant_accounts(
conn: &PgPooledConn,
limit: u32,
offset: Option<u32>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.ne_all(vec![""]),
Some(i64::from(limit)),
offset.map(i64::from),
None,
)
.await
}
pub async fn update_all_merchant_accounts(
conn: &PgPooledConn,
merchant_account: MerchantAccountUpdateInternal,
) -> StorageResult<Vec<Self>> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.ne_all(vec![""]),
merchant_account,
)
.await
}
}
#[cfg(feature = "v2")]
impl MerchantAccount {
pub async fn update(
self,
conn: &PgPooledConn,
merchant_account: MerchantAccountUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.get_id().to_owned(),
merchant_account,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn update_with_specific_fields(
conn: &PgPooledConn,
identifier: &common_utils::id_type::MerchantId,
merchant_account: MerchantAccountUpdateInternal,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(conn, dsl::id.eq(identifier.to_owned()), merchant_account)
.await
}
pub async fn delete_by_merchant_id(
conn: &PgPooledConn,
identifier: &common_utils::id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::id.eq(identifier.to_owned()),
)
.await
}
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
identifier: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq(identifier.to_owned()),
)
.await
}
pub async fn find_by_publishable_key(
conn: &PgPooledConn,
publishable_key: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::publishable_key.eq(publishable_key.to_owned()),
)
.await
}
pub async fn list_by_organization_id(
conn: &PgPooledConn,
organization_id: &common_utils::id_type::OrganizationId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::organization_id.eq(organization_id.to_owned()),
None,
None,
None,
)
.await
}
pub async fn list_multiple_merchant_accounts(
conn: &PgPooledConn,
merchant_ids: Vec<common_utils::id_type::MerchantId>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(conn, dsl::id.eq_any(merchant_ids), None, None, None)
.await
}
pub async fn list_all_merchant_accounts(
conn: &PgPooledConn,
limit: u32,
offset: Option<u32>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::id.ne_all(vec![""]),
Some(i64::from(limit)),
offset.map(i64::from),
None,
)
.await
}
pub async fn update_all_merchant_accounts(
conn: &PgPooledConn,
merchant_account: MerchantAccountUpdateInternal,
) -> StorageResult<Vec<Self>> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::id.ne_all(vec![""]),
merchant_account,
)
.await
}
}
| 1,962 | 837 |
hyperswitch | crates/diesel_models/src/query/payment_intent.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
#[cfg(feature = "v1")]
use crate::schema::payment_intent::dsl;
#[cfg(feature = "v2")]
use crate::schema_v2::payment_intent::dsl;
use crate::{
errors,
payment_intent::{self, PaymentIntent, PaymentIntentNew},
PgPooledConn, StorageResult,
};
impl PaymentIntentNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PaymentIntent> {
generics::generic_insert(conn, self).await
}
}
impl PaymentIntent {
#[cfg(feature = "v2")]
pub async fn update(
self,
conn: &PgPooledConn,
payment_intent_update: payment_intent::PaymentIntentUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.id.to_owned(),
payment_intent_update,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
Ok(payment_intent) => Ok(payment_intent),
}
}
#[cfg(feature = "v2")]
pub async fn find_by_global_id(
conn: &PgPooledConn,
id: &common_utils::id_type::GlobalPaymentId,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await
}
#[cfg(feature = "v1")]
pub async fn update(
self,
conn: &PgPooledConn,
payment_intent: payment_intent::PaymentIntentUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::payment_id
.eq(self.payment_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
payment_intent::PaymentIntentUpdateInternal::from(payment_intent),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
Ok(mut payment_intents) => payment_intents
.pop()
.ok_or(error_stack::report!(errors::DatabaseError::NotFound)),
}
}
#[cfg(feature = "v2")]
pub async fn find_by_merchant_reference_id_merchant_id(
conn: &PgPooledConn,
merchant_reference_id: &str,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
// This query should be removed in the future because direct queries to the intent table without an intent ID are not allowed.
// In an active-active setup, a lookup table should be implemented, and the merchant reference ID will serve as the idempotency key.
#[cfg(feature = "v2")]
pub async fn find_by_merchant_reference_id_profile_id(
conn: &PgPooledConn,
merchant_reference_id: &common_utils::id_type::PaymentReferenceId,
profile_id: &common_utils::id_type::ProfileId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
)
.await
}
#[cfg(feature = "v2")]
pub async fn find_optional_by_merchant_reference_id_merchant_id(
conn: &PgPooledConn,
merchant_reference_id: &str,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_optional_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
)
.await
}
}
| 1,231 | 838 |
hyperswitch | crates/diesel_models/src/query/refund.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use super::generics;
use crate::{
errors,
refund::{RefundUpdate, RefundUpdateInternal},
PgPooledConn, StorageResult,
};
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "refunds_v2")))]
use crate::{
refund::{Refund, RefundNew},
schema::refund::dsl,
};
#[cfg(all(feature = "v2", feature = "refunds_v2"))]
use crate::{
refund::{Refund, RefundNew},
schema_v2::refund::dsl,
};
impl RefundNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Refund> {
generics::generic_insert(conn, self).await
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "refunds_v2")))]
impl Refund {
pub async fn update(self, conn: &PgPooledConn, refund: RefundUpdate) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::refund_id
.eq(self.refund_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
RefundUpdateInternal::from(refund),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
// This is required to be changed for KV.
pub async fn find_by_merchant_id_refund_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
refund_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::refund_id.eq(refund_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_connector_refund_id_connector(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_refund_id: &str,
connector: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_refund_id.eq(connector_refund_id.to_owned()))
.and(dsl::connector.eq(connector.to_owned())),
)
.await
}
pub async fn find_by_internal_reference_id_merchant_id(
conn: &PgPooledConn,
internal_reference_id: &str,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::internal_reference_id.eq(internal_reference_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_connector_transaction_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_transaction_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_transaction_id.eq(connector_transaction_id.to_owned())),
None,
None,
None,
)
.await
}
pub async fn find_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
None,
None,
None,
)
.await
}
}
#[cfg(all(feature = "v2", feature = "refunds_v2"))]
impl Refund {
pub async fn update_with_id(
self,
conn: &PgPooledConn,
refund: RefundUpdate,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.id.to_owned(),
RefundUpdateInternal::from(refund),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn find_by_global_id(
conn: &PgPooledConn,
id: &common_utils::id_type::GlobalRefundId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq(id.to_owned()),
)
.await
}
}
| 1,259 | 839 |
hyperswitch | crates/diesel_models/src/query/organization.rs | .rs | use common_utils::id_type;
use diesel::{associations::HasTable, ExpressionMethods};
#[cfg(feature = "v1")]
use crate::schema::organization::dsl::org_id as dsl_identifier;
#[cfg(feature = "v2")]
use crate::schema_v2::organization::dsl::id as dsl_identifier;
use crate::{organization::*, query::generics, PgPooledConn, StorageResult};
impl OrganizationNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Organization> {
generics::generic_insert(conn, self).await
}
}
impl Organization {
pub async fn find_by_org_id(
conn: &PgPooledConn,
org_id: id_type::OrganizationId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl_identifier.eq(org_id),
)
.await
}
pub async fn update_by_org_id(
conn: &PgPooledConn,
org_id: id_type::OrganizationId,
update: OrganizationUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl_identifier.eq(org_id),
OrganizationUpdateInternal::from(update),
)
.await
}
}
| 306 | 840 |
hyperswitch | crates/diesel_models/src/query/capture.rs | .rs | use common_utils::types::ConnectorTransactionIdTrait;
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
capture::{Capture, CaptureNew, CaptureUpdate, CaptureUpdateInternal},
errors,
schema::captures::dsl,
PgPooledConn, StorageResult,
};
impl CaptureNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Capture> {
generics::generic_insert(conn, self).await
}
}
impl Capture {
pub async fn find_by_capture_id(conn: &PgPooledConn, capture_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::capture_id.eq(capture_id.to_owned()),
)
.await
}
pub async fn update_with_capture_id(
self,
conn: &PgPooledConn,
capture: CaptureUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::capture_id.eq(self.capture_id.to_owned()),
CaptureUpdateInternal::from(capture),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn find_all_by_merchant_id_payment_id_authorized_attempt_id(
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
authorized_attempt_id: &str,
conn: &PgPooledConn,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::authorized_attempt_id
.eq(authorized_attempt_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::payment_id.eq(payment_id.to_owned())),
None,
None,
Some(dsl::created_at.asc()),
)
.await
}
}
impl ConnectorTransactionIdTrait for Capture {
fn get_optional_connector_transaction_id(&self) -> Option<&String> {
match self
.connector_capture_id
.as_ref()
.map(|capture_id| capture_id.get_txn_id(self.processor_capture_data.as_ref()))
.transpose()
{
Ok(capture_id) => capture_id,
// In case hashed data is missing from DB, use the hashed ID as connector transaction ID
Err(_) => self
.connector_capture_id
.as_ref()
.map(|txn_id| txn_id.get_id()),
}
}
}
| 618 | 841 |
hyperswitch | crates/diesel_models/src/query/connector_response.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use router_env::{instrument, logger, tracing};
use super::generics;
use crate::{
connector_response::{
ConnectorResponse, ConnectorResponseNew, ConnectorResponseUpdate,
ConnectorResponseUpdateInternal,
},
errors,
payment_attempt::{PaymentAttempt, PaymentAttemptUpdate, PaymentAttemptUpdateInternal},
schema::{connector_response::dsl, payment_attempt::dsl as pa_dsl},
PgPooledConn, StorageResult,
};
impl ConnectorResponseNew {
#[instrument(skip(conn))]
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<ConnectorResponse> {
let payment_attempt_update = PaymentAttemptUpdate::ConnectorResponse {
authentication_data: self.authentication_data.clone(),
encoded_data: self.encoded_data.clone(),
connector_transaction_id: self.connector_transaction_id.clone(),
connector: self.connector_name.clone(),
updated_by: self.updated_by.clone(),
charge_id: self.charge_id.clone(),
};
let _payment_attempt: Result<PaymentAttempt, _> =
generics::generic_update_with_unique_predicate_get_result::<
<PaymentAttempt as HasTable>::Table,
_,
_,
_,
>(
conn,
pa_dsl::attempt_id
.eq(self.attempt_id.to_owned())
.and(pa_dsl::merchant_id.eq(self.merchant_id.to_owned())),
PaymentAttemptUpdateInternal::from(payment_attempt_update),
)
.await
.inspect_err(|err| {
logger::error!(
"Error while updating payment attempt in connector_response flow {:?}",
err
);
});
generics::generic_insert(conn, self).await
}
}
impl ConnectorResponse {
#[instrument(skip(conn))]
pub async fn update(
self,
conn: &PgPooledConn,
connector_response: ConnectorResponseUpdate,
) -> StorageResult<Self> {
let payment_attempt_update = match connector_response.clone() {
ConnectorResponseUpdate::ResponseUpdate {
connector_transaction_id,
authentication_data,
encoded_data,
connector_name,
charge_id,
updated_by,
} => PaymentAttemptUpdate::ConnectorResponse {
authentication_data,
encoded_data,
connector_transaction_id,
connector: connector_name,
charge_id,
updated_by,
},
ConnectorResponseUpdate::ErrorUpdate {
connector_name,
updated_by,
} => PaymentAttemptUpdate::ConnectorResponse {
authentication_data: None,
encoded_data: None,
connector_transaction_id: None,
connector: connector_name,
charge_id: None,
updated_by,
},
};
let _payment_attempt: Result<PaymentAttempt, _> =
generics::generic_update_with_unique_predicate_get_result::<
<PaymentAttempt as HasTable>::Table,
_,
_,
_,
>(
conn,
pa_dsl::attempt_id
.eq(self.attempt_id.to_owned())
.and(pa_dsl::merchant_id.eq(self.merchant_id.to_owned())),
PaymentAttemptUpdateInternal::from(payment_attempt_update),
)
.await
.inspect_err(|err| {
logger::error!(
"Error while updating payment attempt in connector_response flow {:?}",
err
);
});
let connector_response_result =
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(self.merchant_id.clone())
.and(dsl::payment_id.eq(self.payment_id.clone()))
.and(dsl::attempt_id.eq(self.attempt_id.clone())),
ConnectorResponseUpdateInternal::from(connector_response),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
};
connector_response_result
}
#[instrument(skip(conn))]
pub async fn find_by_payment_id_merchant_id_attempt_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
attempt_id: &str,
) -> StorageResult<Self> {
let connector_response: Self =
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()).and(
dsl::payment_id
.eq(payment_id.to_owned())
.and(dsl::attempt_id.eq(attempt_id.to_owned())),
),
)
.await?;
match generics::generic_find_one::<<PaymentAttempt as HasTable>::Table, _, _>(
conn,
pa_dsl::payment_id.eq(payment_id.to_owned()).and(
pa_dsl::merchant_id
.eq(merchant_id.to_owned())
.and(pa_dsl::attempt_id.eq(attempt_id.to_owned())),
),
)
.await
{
Ok::<PaymentAttempt, _>(payment_attempt) => {
if payment_attempt.authentication_data != connector_response.authentication_data {
logger::error!(
"Not Equal pa_authentication_data : {:?}, cr_authentication_data: {:?} ",
payment_attempt.authentication_data,
connector_response.authentication_data
);
}
if payment_attempt.encoded_data != connector_response.encoded_data {
logger::error!(
"Not Equal pa_encoded_data : {:?}, cr_encoded_data: {:?} ",
payment_attempt.encoded_data,
connector_response.encoded_data
);
}
if payment_attempt.connector_transaction_id
!= connector_response.connector_transaction_id
{
logger::error!(
"Not Equal pa_connector_transaction_id : {:?}, cr_connector_transaction_id: {:?} ",
payment_attempt.connector_transaction_id,
connector_response.connector_transaction_id
);
}
if payment_attempt.connector != connector_response.connector_name {
logger::error!(
"Not Equal pa_connector : {:?}, cr_connector_name: {:?} ",
payment_attempt.connector,
connector_response.connector_name
);
}
}
Err(err) => {
logger::error!(
"Error while finding payment attempt in connector_response flow {:?}",
err
);
}
}
Ok(connector_response)
}
}
| 1,356 | 842 |
hyperswitch | crates/diesel_models/src/query/authorization.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
authorization::{
Authorization, AuthorizationNew, AuthorizationUpdate, AuthorizationUpdateInternal,
},
errors,
schema::incremental_authorization::dsl,
PgPooledConn, StorageResult,
};
impl AuthorizationNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Authorization> {
generics::generic_insert(conn, self).await
}
}
impl Authorization {
pub async fn update_by_merchant_id_authorization_id(
conn: &PgPooledConn,
merchant_id: common_utils::id_type::MerchantId,
authorization_id: String,
authorization_update: AuthorizationUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authorization_id.eq(authorization_id.to_owned())),
AuthorizationUpdateInternal::from(authorization_update),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NotFound => Err(error.attach_printable(
"Authorization with the given Authorization ID does not exist",
)),
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authorization_id.eq(authorization_id.to_owned())),
)
.await
}
_ => Err(error),
},
result => result,
}
}
pub async fn find_by_merchant_id_payment_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
None,
None,
Some(dsl::created_at.asc()),
)
.await
}
}
| 511 | 843 |
hyperswitch | crates/diesel_models/src/query/file.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
errors,
file::{FileMetadata, FileMetadataNew, FileMetadataUpdate, FileMetadataUpdateInternal},
schema::file_metadata::dsl,
PgPooledConn, StorageResult,
};
impl FileMetadataNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<FileMetadata> {
generics::generic_insert(conn, self).await
}
}
impl FileMetadata {
pub async fn find_by_merchant_id_file_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
file_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::file_id.eq(file_id.to_owned())),
)
.await
}
pub async fn delete_by_merchant_id_file_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
file_id: &str,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::file_id.eq(file_id.to_owned())),
)
.await
}
pub async fn update(
self,
conn: &PgPooledConn,
file_metadata: FileMetadataUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::file_id.eq(self.file_id.to_owned()),
FileMetadataUpdateInternal::from(file_metadata),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
}
| 470 | 844 |
hyperswitch | crates/diesel_models/src/query/authentication.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
authentication::{
Authentication, AuthenticationNew, AuthenticationUpdate, AuthenticationUpdateInternal,
},
errors,
schema::authentication::dsl,
PgPooledConn, StorageResult,
};
impl AuthenticationNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Authentication> {
generics::generic_insert(conn, self).await
}
}
impl Authentication {
pub async fn update_by_merchant_id_authentication_id(
conn: &PgPooledConn,
merchant_id: common_utils::id_type::MerchantId,
authentication_id: String,
authorization_update: AuthenticationUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authentication_id.eq(authentication_id.to_owned())),
AuthenticationUpdateInternal::from(authorization_update),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NotFound => Err(error.attach_printable(
"Authentication with the given Authentication ID does not exist",
)),
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authentication_id.eq(authentication_id.to_owned())),
)
.await
}
_ => Err(error),
},
result => result,
}
}
pub async fn find_by_merchant_id_authentication_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
authentication_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::authentication_id.eq(authentication_id.to_owned())),
)
.await
}
pub async fn find_authentication_by_merchant_id_connector_authentication_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_authentication_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_authentication_id.eq(connector_authentication_id.to_owned())),
)
.await
}
}
| 600 | 845 |
hyperswitch | crates/diesel_models/src/query/unified_translations.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use error_stack::report;
use crate::{
errors,
query::generics,
schema::unified_translations::dsl,
unified_translations::{UnifiedTranslationsUpdateInternal, *},
PgPooledConn, StorageResult,
};
impl UnifiedTranslationsNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<UnifiedTranslations> {
generics::generic_insert(conn, self).await
}
}
impl UnifiedTranslations {
pub async fn find_by_unified_code_unified_message_locale(
conn: &PgPooledConn,
unified_code: String,
unified_message: String,
locale: String,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::unified_code
.eq(unified_code)
.and(dsl::unified_message.eq(unified_message))
.and(dsl::locale.eq(locale)),
)
.await
}
pub async fn update_by_unified_code_unified_message_locale(
conn: &PgPooledConn,
unified_code: String,
unified_message: String,
locale: String,
data: UnifiedTranslationsUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<
<Self as HasTable>::Table,
UnifiedTranslationsUpdateInternal,
_,
_,
>(
conn,
dsl::unified_code
.eq(unified_code)
.and(dsl::unified_message.eq(unified_message))
.and(dsl::locale.eq(locale)),
data.into(),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Error while updating unified_translations entry")
})
}
pub async fn delete_by_unified_code_unified_message_locale(
conn: &PgPooledConn,
unified_code: String,
unified_message: String,
locale: String,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::unified_code
.eq(unified_code)
.and(dsl::unified_message.eq(unified_message))
.and(dsl::locale.eq(locale)),
)
.await
}
}
| 527 | 846 |
hyperswitch | crates/diesel_models/src/query/api_keys.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
api_keys::{ApiKey, ApiKeyNew, ApiKeyUpdate, ApiKeyUpdateInternal, HashedApiKey},
errors,
schema::api_keys::dsl,
PgPooledConn, StorageResult,
};
impl ApiKeyNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<ApiKey> {
generics::generic_insert(conn, self).await
}
}
impl ApiKey {
pub async fn update_by_merchant_id_key_id(
conn: &PgPooledConn,
merchant_id: common_utils::id_type::MerchantId,
key_id: common_utils::id_type::ApiKeyId,
api_key_update: ApiKeyUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::key_id.eq(key_id.to_owned())),
ApiKeyUpdateInternal::from(api_key_update),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NotFound => {
Err(error.attach_printable("API key with the given key ID does not exist"))
}
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::key_id.eq(key_id.to_owned())),
)
.await
}
_ => Err(error),
},
result => result,
}
}
pub async fn revoke_by_merchant_id_key_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
key_id: &common_utils::id_type::ApiKeyId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::key_id.eq(key_id.to_owned())),
)
.await
}
pub async fn find_optional_by_merchant_id_key_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
key_id: &common_utils::id_type::ApiKeyId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::key_id.eq(key_id.to_owned())),
)
.await
}
pub async fn find_optional_by_hashed_api_key(
conn: &PgPooledConn,
hashed_api_key: HashedApiKey,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::hashed_api_key.eq(hashed_api_key),
)
.await
}
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
limit: Option<i64>,
offset: Option<i64>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
limit,
offset,
Some(dsl::created_at.asc()),
)
.await
}
}
| 822 | 847 |
hyperswitch | crates/diesel_models/src/query/relay.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
errors,
relay::{Relay, RelayNew, RelayUpdateInternal},
schema::relay::dsl,
PgPooledConn, StorageResult,
};
impl RelayNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Relay> {
generics::generic_insert(conn, self).await
}
}
impl Relay {
pub async fn update(
self,
conn: &PgPooledConn,
relay: RelayUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(conn, dsl::id.eq(self.id.to_owned()), relay)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn find_by_id(
conn: &PgPooledConn,
id: &common_utils::id_type::RelayId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq(id.to_owned()),
)
.await
}
pub async fn find_by_profile_id_connector_reference_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
connector_reference_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::connector_reference_id.eq(connector_reference_id.to_owned())),
)
.await
}
}
| 420 | 848 |
hyperswitch | crates/diesel_models/src/query/user.rs | .rs | use common_utils::pii;
use diesel::{associations::HasTable, ExpressionMethods};
pub mod sample_data;
pub mod theme;
use crate::{
query::generics, schema::users::dsl as users_dsl, user::*, PgPooledConn, StorageResult,
};
impl UserNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<User> {
generics::generic_insert(conn, self).await
}
}
impl User {
pub async fn find_by_user_email(
conn: &PgPooledConn,
user_email: &pii::Email,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
users_dsl::email.eq(user_email.to_owned()),
)
.await
}
pub async fn find_by_user_id(conn: &PgPooledConn, user_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
users_dsl::user_id.eq(user_id.to_owned()),
)
.await
}
pub async fn update_by_user_id(
conn: &PgPooledConn,
user_id: &str,
user_update: UserUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
users_dsl::user_id.eq(user_id.to_owned()),
UserUpdateInternal::from(user_update),
)
.await
}
pub async fn update_by_user_email(
conn: &PgPooledConn,
user_email: &pii::Email,
user_update: UserUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
users_dsl::email.eq(user_email.to_owned()),
UserUpdateInternal::from(user_update),
)
.await
}
pub async fn delete_by_user_id(conn: &PgPooledConn, user_id: &str) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
users_dsl::user_id.eq(user_id.to_owned()),
)
.await
}
pub async fn find_users_by_user_ids(
conn: &PgPooledConn,
user_ids: Vec<String>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as diesel::Table>::PrimaryKey,
_,
>(conn, users_dsl::user_id.eq_any(user_ids), None, None, None)
.await
}
}
| 627 | 849 |
hyperswitch | crates/diesel_models/src/query/address.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
address::{Address, AddressNew, AddressUpdateInternal},
errors,
schema::address::dsl,
PgPooledConn, StorageResult,
};
impl AddressNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Address> {
generics::generic_insert(conn, self).await
}
}
impl Address {
pub async fn find_by_address_id(conn: &PgPooledConn, address_id: &str) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, address_id.to_owned())
.await
}
pub async fn update_by_address_id(
conn: &PgPooledConn,
address_id: String,
address: AddressUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
address_id.clone(),
address,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NotFound => {
Err(error.attach_printable("Address with the given ID doesn't exist"))
}
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(
conn,
address_id.clone(),
)
.await
}
_ => Err(error),
},
result => result,
}
}
pub async fn update(
self,
conn: &PgPooledConn,
address_update_internal: AddressUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::address_id.eq(self.address_id.clone()),
address_update_internal,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn delete_by_address_id(
conn: &PgPooledConn,
address_id: &str,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::address_id.eq(address_id.to_owned()),
)
.await
}
pub async fn update_by_merchant_id_customer_id(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::CustomerId,
merchant_id: &common_utils::id_type::MerchantId,
address: AddressUpdateInternal,
) -> StorageResult<Vec<Self>> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::customer_id.eq(customer_id.to_owned())),
address,
)
.await
}
pub async fn find_by_merchant_id_payment_id_address_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
address_id: &str,
) -> StorageResult<Self> {
match generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::payment_id
.eq(payment_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::address_id.eq(address_id.to_owned())),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NotFound => {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(
conn,
address_id.to_owned(),
)
.await
}
_ => Err(error),
},
result => result,
}
}
pub async fn find_optional_by_address_id(
conn: &PgPooledConn,
address_id: &str,
) -> StorageResult<Option<Self>> {
generics::generic_find_by_id_optional::<<Self as HasTable>::Table, _, _>(
conn,
address_id.to_owned(),
)
.await
}
}
| 963 | 850 |
hyperswitch | crates/diesel_models/src/query/callback_mapper.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
callback_mapper::CallbackMapper, schema::callback_mapper::dsl, PgPooledConn, StorageResult,
};
impl CallbackMapper {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Self> {
generics::generic_insert(conn, self).await
}
pub async fn find_by_id(conn: &PgPooledConn, id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq(id.to_owned()),
)
.await
}
}
| 148 | 851 |
hyperswitch | crates/diesel_models/src/query/locker_mock_up.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
locker_mock_up::{LockerMockUp, LockerMockUpNew},
schema::locker_mock_up::dsl,
PgPooledConn, StorageResult,
};
impl LockerMockUpNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<LockerMockUp> {
generics::generic_insert(conn, self).await
}
}
impl LockerMockUp {
pub async fn find_by_card_id(conn: &PgPooledConn, card_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::card_id.eq(card_id.to_owned()),
)
.await
}
pub async fn delete_by_card_id(conn: &PgPooledConn, card_id: &str) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::card_id.eq(card_id.to_owned()),
)
.await
}
}
| 244 | 852 |
hyperswitch | crates/diesel_models/src/query/routing_algorithm.rs | .rs | use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, QueryDsl};
use error_stack::{report, ResultExt};
use time::PrimitiveDateTime;
use crate::{
enums,
errors::DatabaseError,
query::generics,
routing_algorithm::{RoutingAlgorithm, RoutingProfileMetadata},
schema::routing_algorithm::dsl,
PgPooledConn, StorageResult,
};
impl RoutingAlgorithm {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Self> {
generics::generic_insert(conn, self).await
}
pub async fn find_by_algorithm_id_merchant_id(
conn: &PgPooledConn,
algorithm_id: &common_utils::id_type::RoutingId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::algorithm_id
.eq(algorithm_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.await
}
pub async fn find_by_algorithm_id_profile_id(
conn: &PgPooledConn,
algorithm_id: &common_utils::id_type::RoutingId,
profile_id: &common_utils::id_type::ProfileId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::algorithm_id
.eq(algorithm_id.to_owned())
.and(dsl::profile_id.eq(profile_id.to_owned())),
)
.await
}
pub async fn find_metadata_by_algorithm_id_profile_id(
conn: &PgPooledConn,
algorithm_id: &common_utils::id_type::RoutingId,
profile_id: &common_utils::id_type::ProfileId,
) -> StorageResult<RoutingProfileMetadata> {
Self::table()
.select((
dsl::profile_id,
dsl::algorithm_id,
dsl::name,
dsl::description,
dsl::kind,
dsl::created_at,
dsl::modified_at,
dsl::algorithm_for,
))
.filter(
dsl::algorithm_id
.eq(algorithm_id.to_owned())
.and(dsl::profile_id.eq(profile_id.to_owned())),
)
.limit(1)
.load_async::<(
common_utils::id_type::ProfileId,
common_utils::id_type::RoutingId,
String,
Option<String>,
enums::RoutingAlgorithmKind,
PrimitiveDateTime,
PrimitiveDateTime,
enums::TransactionType,
)>(conn)
.await
.change_context(DatabaseError::Others)?
.into_iter()
.next()
.ok_or(report!(DatabaseError::NotFound))
.map(
|(
profile_id,
algorithm_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
)| {
RoutingProfileMetadata {
profile_id,
algorithm_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
}
},
)
}
pub async fn list_metadata_by_profile_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
limit: i64,
offset: i64,
) -> StorageResult<Vec<RoutingProfileMetadata>> {
Ok(Self::table()
.select((
dsl::algorithm_id,
dsl::profile_id,
dsl::name,
dsl::description,
dsl::kind,
dsl::created_at,
dsl::modified_at,
dsl::algorithm_for,
))
.filter(dsl::profile_id.eq(profile_id.to_owned()))
.limit(limit)
.offset(offset)
.load_async::<(
common_utils::id_type::RoutingId,
common_utils::id_type::ProfileId,
String,
Option<String>,
enums::RoutingAlgorithmKind,
PrimitiveDateTime,
PrimitiveDateTime,
enums::TransactionType,
)>(conn)
.await
.change_context(DatabaseError::Others)?
.into_iter()
.map(
|(
algorithm_id,
profile_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
)| {
RoutingProfileMetadata {
algorithm_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
profile_id,
}
},
)
.collect())
}
pub async fn list_metadata_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
limit: i64,
offset: i64,
) -> StorageResult<Vec<RoutingProfileMetadata>> {
Ok(Self::table()
.select((
dsl::profile_id,
dsl::algorithm_id,
dsl::name,
dsl::description,
dsl::kind,
dsl::created_at,
dsl::modified_at,
dsl::algorithm_for,
))
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.limit(limit)
.offset(offset)
.order(dsl::modified_at.desc())
.load_async::<(
common_utils::id_type::ProfileId,
common_utils::id_type::RoutingId,
String,
Option<String>,
enums::RoutingAlgorithmKind,
PrimitiveDateTime,
PrimitiveDateTime,
enums::TransactionType,
)>(conn)
.await
.change_context(DatabaseError::Others)?
.into_iter()
.map(
|(
profile_id,
algorithm_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
)| {
RoutingProfileMetadata {
profile_id,
algorithm_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
}
},
)
.collect())
}
pub async fn list_metadata_by_merchant_id_transaction_type(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
transaction_type: &enums::TransactionType,
limit: i64,
offset: i64,
) -> StorageResult<Vec<RoutingProfileMetadata>> {
Ok(Self::table()
.select((
dsl::profile_id,
dsl::algorithm_id,
dsl::name,
dsl::description,
dsl::kind,
dsl::created_at,
dsl::modified_at,
dsl::algorithm_for,
))
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dsl::algorithm_for.eq(transaction_type.to_owned()))
.limit(limit)
.offset(offset)
.order(dsl::modified_at.desc())
.load_async::<(
common_utils::id_type::ProfileId,
common_utils::id_type::RoutingId,
String,
Option<String>,
enums::RoutingAlgorithmKind,
PrimitiveDateTime,
PrimitiveDateTime,
enums::TransactionType,
)>(conn)
.await
.change_context(DatabaseError::Others)?
.into_iter()
.map(
|(
profile_id,
algorithm_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
)| {
RoutingProfileMetadata {
profile_id,
algorithm_id,
name,
description,
kind,
created_at,
modified_at,
algorithm_for,
}
},
)
.collect())
}
}
| 1,689 | 853 |
hyperswitch | crates/diesel_models/src/query/dynamic_routing_stats.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use error_stack::report;
use super::generics;
use crate::{
dynamic_routing_stats::{
DynamicRoutingStats, DynamicRoutingStatsNew, DynamicRoutingStatsUpdate,
},
errors,
schema::dynamic_routing_stats::dsl,
PgPooledConn, StorageResult,
};
impl DynamicRoutingStatsNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<DynamicRoutingStats> {
generics::generic_insert(conn, self).await
}
}
impl DynamicRoutingStats {
pub async fn find_optional_by_attempt_id_merchant_id(
conn: &PgPooledConn,
attempt_id: String,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::attempt_id.eq(attempt_id.to_owned())),
)
.await
}
pub async fn update(
conn: &PgPooledConn,
attempt_id: String,
merchant_id: &common_utils::id_type::MerchantId,
dynamic_routing_stat: DynamicRoutingStatsUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<
<Self as HasTable>::Table,
DynamicRoutingStatsUpdate,
_,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::attempt_id.eq(attempt_id.to_owned())),
dynamic_routing_stat,
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Error while updating dynamic_routing_stats entry")
})
}
}
| 412 | 854 |
hyperswitch | crates/diesel_models/src/query/process_tracker.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use router_env::{instrument, tracing};
use time::PrimitiveDateTime;
use super::generics;
use crate::{
enums, errors,
process_tracker::{
ProcessTracker, ProcessTrackerNew, ProcessTrackerUpdate, ProcessTrackerUpdateInternal,
},
schema::process_tracker::dsl,
PgPooledConn, StorageResult,
};
impl ProcessTrackerNew {
#[instrument(skip(conn))]
pub async fn insert_process(self, conn: &PgPooledConn) -> StorageResult<ProcessTracker> {
generics::generic_insert(conn, self).await
}
}
impl ProcessTracker {
#[instrument(skip(conn))]
pub async fn update(
self,
conn: &PgPooledConn,
process: ProcessTrackerUpdate,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.id.clone(),
ProcessTrackerUpdateInternal::from(process),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
#[instrument(skip(conn))]
pub async fn update_process_status_by_ids(
conn: &PgPooledConn,
task_ids: Vec<String>,
task_update: ProcessTrackerUpdate,
) -> StorageResult<usize> {
generics::generic_update::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq_any(task_ids),
ProcessTrackerUpdateInternal::from(task_update),
)
.await
}
#[instrument(skip(conn))]
pub async fn find_process_by_id(conn: &PgPooledConn, id: &str) -> StorageResult<Option<Self>> {
generics::generic_find_by_id_optional::<<Self as HasTable>::Table, _, _>(
conn,
id.to_owned(),
)
.await
}
#[instrument(skip(conn))]
pub async fn find_processes_by_time_status(
conn: &PgPooledConn,
time_lower_limit: PrimitiveDateTime,
time_upper_limit: PrimitiveDateTime,
status: enums::ProcessTrackerStatus,
limit: Option<i64>,
version: enums::ApiVersion,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::schedule_time
.between(time_lower_limit, time_upper_limit)
.and(dsl::status.eq(status))
.and(dsl::version.eq(version)),
limit,
None,
None,
)
.await
}
#[instrument(skip(conn))]
pub async fn find_processes_to_clean(
conn: &PgPooledConn,
time_lower_limit: PrimitiveDateTime,
time_upper_limit: PrimitiveDateTime,
runner: &str,
limit: usize,
) -> StorageResult<Vec<Self>> {
let mut x: Vec<Self> = generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::schedule_time
.between(time_lower_limit, time_upper_limit)
.and(dsl::status.eq(enums::ProcessTrackerStatus::ProcessStarted))
.and(dsl::runner.eq(runner.to_owned())),
None,
None,
None,
)
.await?;
x.sort_by(|a, b| a.schedule_time.cmp(&b.schedule_time));
x.truncate(limit);
Ok(x)
}
#[instrument(skip(conn))]
pub async fn reinitialize_limbo_processes(
conn: &PgPooledConn,
ids: Vec<String>,
schedule_time: PrimitiveDateTime,
) -> StorageResult<usize> {
generics::generic_update::<<Self as HasTable>::Table, _, _>(
conn,
dsl::status
.eq(enums::ProcessTrackerStatus::ProcessStarted)
.and(dsl::id.eq_any(ids)),
(
dsl::status.eq(enums::ProcessTrackerStatus::Processing),
dsl::schedule_time.eq(schedule_time),
),
)
.await
}
}
| 941 | 855 |
hyperswitch | crates/diesel_models/src/query/dispute.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use super::generics;
use crate::{
dispute::{Dispute, DisputeNew, DisputeUpdate, DisputeUpdateInternal},
errors,
schema::dispute::dsl,
PgPooledConn, StorageResult,
};
impl DisputeNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Dispute> {
generics::generic_insert(conn, self).await
}
}
impl Dispute {
pub async fn find_by_merchant_id_payment_id_connector_dispute_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
connector_dispute_id: &str,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned()))
.and(dsl::connector_dispute_id.eq(connector_dispute_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_dispute_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
dispute_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::dispute_id.eq(dispute_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_payment_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
None,
None,
None,
)
.await
}
pub async fn update(self, conn: &PgPooledConn, dispute: DisputeUpdate) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::dispute_id.eq(self.dispute_id.to_owned()),
DisputeUpdateInternal::from(dispute),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
}
| 660 | 856 |
hyperswitch | crates/diesel_models/src/query/generic_link.rs | .rs | use common_utils::{errors, ext_traits::ValueExt, link_utils::GenericLinkStatus};
use diesel::{associations::HasTable, ExpressionMethods};
use error_stack::{report, Report, ResultExt};
use super::generics;
use crate::{
errors as db_errors,
generic_link::{
GenericLink, GenericLinkData, GenericLinkNew, GenericLinkState, GenericLinkUpdateInternal,
PaymentMethodCollectLink, PayoutLink, PayoutLinkUpdate,
},
schema::generic_link::dsl,
PgPooledConn, StorageResult,
};
impl GenericLinkNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<GenericLinkState> {
generics::generic_insert(conn, self)
.await
.and_then(|res: GenericLink| {
GenericLinkState::try_from(res)
.change_context(db_errors::DatabaseError::Others)
.attach_printable("failed to parse generic link data from DB")
})
}
pub async fn insert_pm_collect_link(
self,
conn: &PgPooledConn,
) -> StorageResult<PaymentMethodCollectLink> {
generics::generic_insert(conn, self)
.await
.and_then(|res: GenericLink| {
PaymentMethodCollectLink::try_from(res)
.change_context(db_errors::DatabaseError::Others)
.attach_printable("failed to parse payment method collect link data from DB")
})
}
pub async fn insert_payout_link(self, conn: &PgPooledConn) -> StorageResult<PayoutLink> {
generics::generic_insert(conn, self)
.await
.and_then(|res: GenericLink| {
PayoutLink::try_from(res)
.change_context(db_errors::DatabaseError::Others)
.attach_printable("failed to parse payout link data from DB")
})
}
}
impl GenericLink {
pub async fn find_generic_link_by_link_id(
conn: &PgPooledConn,
link_id: &str,
) -> StorageResult<GenericLinkState> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::link_id.eq(link_id.to_owned()),
)
.await
.and_then(|res: Self| {
GenericLinkState::try_from(res)
.change_context(db_errors::DatabaseError::Others)
.attach_printable("failed to parse generic link data from DB")
})
}
pub async fn find_pm_collect_link_by_link_id(
conn: &PgPooledConn,
link_id: &str,
) -> StorageResult<PaymentMethodCollectLink> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::link_id.eq(link_id.to_owned()),
)
.await
.and_then(|res: Self| {
PaymentMethodCollectLink::try_from(res)
.change_context(db_errors::DatabaseError::Others)
.attach_printable("failed to parse payment method collect link data from DB")
})
}
pub async fn find_payout_link_by_link_id(
conn: &PgPooledConn,
link_id: &str,
) -> StorageResult<PayoutLink> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::link_id.eq(link_id.to_owned()),
)
.await
.and_then(|res: Self| {
PayoutLink::try_from(res)
.change_context(db_errors::DatabaseError::Others)
.attach_printable("failed to parse payout link data from DB")
})
}
}
impl PayoutLink {
pub async fn update_payout_link(
self,
conn: &PgPooledConn,
payout_link_update: PayoutLinkUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::link_id.eq(self.link_id.to_owned()),
GenericLinkUpdateInternal::from(payout_link_update),
)
.await
.and_then(|mut payout_links| {
payout_links
.pop()
.ok_or(error_stack::report!(db_errors::DatabaseError::NotFound))
})
.or_else(|error| match error.current_context() {
db_errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
})
}
}
impl TryFrom<GenericLink> for GenericLinkState {
type Error = Report<errors::ParsingError>;
fn try_from(db_val: GenericLink) -> Result<Self, Self::Error> {
let link_data = match db_val.link_type {
common_enums::GenericLinkType::PaymentMethodCollect => {
let link_data = db_val
.link_data
.parse_value("PaymentMethodCollectLinkData")?;
GenericLinkData::PaymentMethodCollect(link_data)
}
common_enums::GenericLinkType::PayoutLink => {
let link_data = db_val.link_data.parse_value("PayoutLinkData")?;
GenericLinkData::PayoutLink(link_data)
}
};
Ok(Self {
link_id: db_val.link_id,
primary_reference: db_val.primary_reference,
merchant_id: db_val.merchant_id,
created_at: db_val.created_at,
last_modified_at: db_val.last_modified_at,
expiry: db_val.expiry,
link_data,
link_status: db_val.link_status,
link_type: db_val.link_type,
url: db_val.url,
return_url: db_val.return_url,
})
}
}
impl TryFrom<GenericLink> for PaymentMethodCollectLink {
type Error = Report<errors::ParsingError>;
fn try_from(db_val: GenericLink) -> Result<Self, Self::Error> {
let (link_data, link_status) = match db_val.link_type {
common_enums::GenericLinkType::PaymentMethodCollect => {
let link_data = db_val
.link_data
.parse_value("PaymentMethodCollectLinkData")?;
let link_status = match db_val.link_status {
GenericLinkStatus::PaymentMethodCollect(status) => Ok(status),
_ => Err(report!(errors::ParsingError::EnumParseFailure(
"GenericLinkStatus"
)))
.attach_printable_lazy(|| {
format!(
"Invalid status for PaymentMethodCollectLink - {:?}",
db_val.link_status
)
}),
}?;
(link_data, link_status)
}
_ => Err(report!(errors::ParsingError::UnknownError)).attach_printable_lazy(|| {
format!(
"Invalid link_type for PaymentMethodCollectLink - {}",
db_val.link_type
)
})?,
};
Ok(Self {
link_id: db_val.link_id,
primary_reference: db_val.primary_reference,
merchant_id: db_val.merchant_id,
created_at: db_val.created_at,
last_modified_at: db_val.last_modified_at,
expiry: db_val.expiry,
link_data,
link_status,
link_type: db_val.link_type,
url: db_val.url,
return_url: db_val.return_url,
})
}
}
impl TryFrom<GenericLink> for PayoutLink {
type Error = Report<errors::ParsingError>;
fn try_from(db_val: GenericLink) -> Result<Self, Self::Error> {
let (link_data, link_status) = match db_val.link_type {
common_enums::GenericLinkType::PayoutLink => {
let link_data = db_val.link_data.parse_value("PayoutLinkData")?;
let link_status = match db_val.link_status {
GenericLinkStatus::PayoutLink(status) => Ok(status),
_ => Err(report!(errors::ParsingError::EnumParseFailure(
"GenericLinkStatus"
)))
.attach_printable_lazy(|| {
format!("Invalid status for PayoutLink - {:?}", db_val.link_status)
}),
}?;
(link_data, link_status)
}
_ => Err(report!(errors::ParsingError::UnknownError)).attach_printable_lazy(|| {
format!("Invalid link_type for PayoutLink - {}", db_val.link_type)
})?,
};
Ok(Self {
link_id: db_val.link_id,
primary_reference: db_val.primary_reference,
merchant_id: db_val.merchant_id,
created_at: db_val.created_at,
last_modified_at: db_val.last_modified_at,
expiry: db_val.expiry,
link_data,
link_status,
link_type: db_val.link_type,
url: db_val.url,
return_url: db_val.return_url,
})
}
}
| 1,879 | 857 |
hyperswitch | crates/diesel_models/src/query/user_authentication_method.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use crate::{
query::generics, schema::user_authentication_methods::dsl, user_authentication_method::*,
PgPooledConn, StorageResult,
};
impl UserAuthenticationMethodNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<UserAuthenticationMethod> {
generics::generic_insert(conn, self).await
}
}
impl UserAuthenticationMethod {
pub async fn get_user_authentication_method_by_id(
conn: &PgPooledConn,
id: &str,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await
}
pub async fn list_user_authentication_methods_for_auth_id(
conn: &PgPooledConn,
auth_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::auth_id.eq(auth_id.to_owned()),
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
pub async fn list_user_authentication_methods_for_owner_id(
conn: &PgPooledConn,
owner_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::owner_id.eq(owner_id.to_owned()),
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
pub async fn update_user_authentication_method(
conn: &PgPooledConn,
id: &str,
user_authentication_method_update: UserAuthenticationMethodUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::id.eq(id.to_owned()),
OrgAuthenticationMethodUpdateInternal::from(user_authentication_method_update),
)
.await
}
pub async fn list_user_authentication_methods_for_email_domain(
conn: &PgPooledConn,
email_domain: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::email_domain.eq(email_domain.to_owned()),
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
}
| 548 | 858 |
hyperswitch | crates/diesel_models/src/query/user_key_store.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
schema::user_key_store::dsl,
user_key_store::{UserKeyStore, UserKeyStoreNew},
PgPooledConn, StorageResult,
};
impl UserKeyStoreNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<UserKeyStore> {
generics::generic_insert(conn, self).await
}
}
impl UserKeyStore {
pub async fn get_all_user_key_stores(
conn: &PgPooledConn,
from: u32,
limit: u32,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as diesel::Table>::PrimaryKey,
_,
>(
conn,
dsl::user_id.ne_all(vec!["".to_string()]),
Some(limit.into()),
Some(from.into()),
None,
)
.await
}
pub async fn find_by_user_id(conn: &PgPooledConn, user_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::user_id.eq(user_id.to_owned()),
)
.await
}
}
| 295 | 859 |
hyperswitch | crates/diesel_models/src/query/customers.rs | .rs | use common_utils::id_type;
#[cfg(all(feature = "v2", feature = "customer_v2"))]
use diesel::BoolExpressionMethods;
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
use diesel::BoolExpressionMethods;
use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
// #[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
use crate::errors;
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
use crate::schema::customers::dsl;
#[cfg(all(feature = "v2", feature = "customer_v2"))]
use crate::schema_v2::customers::dsl;
use crate::{
customers::{Customer, CustomerNew, CustomerUpdateInternal},
PgPooledConn, StorageResult,
};
impl CustomerNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Customer> {
generics::generic_insert(conn, self).await
}
}
pub struct CustomerListConstraints {
pub limit: i64,
pub offset: Option<i64>,
}
// #[cfg(all(feature = "v2", feature = "customer_v2"))]
impl Customer {
#[cfg(all(feature = "v2", feature = "customer_v2"))]
pub async fn update_by_id(
conn: &PgPooledConn,
id: id_type::GlobalCustomerId,
customer: CustomerUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
id.clone(),
customer,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id).await
}
_ => Err(error),
},
result => result,
}
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
pub async fn find_by_global_id(
conn: &PgPooledConn,
id: &id_type::GlobalCustomerId,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await
}
pub async fn list_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &id_type::MerchantId,
constraints: CustomerListConstraints,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
Some(constraints.limit),
constraints.offset,
Some(dsl::created_at),
)
.await
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
pub async fn find_optional_by_merchant_id_merchant_reference_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(customer_id.to_owned())),
)
.await
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
pub async fn find_optional_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_by_id_optional::<<Self as HasTable>::Table, _, _>(
conn,
(customer_id.to_owned(), merchant_id.to_owned()),
)
.await
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
pub async fn update_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: id_type::CustomerId,
merchant_id: id_type::MerchantId,
customer: CustomerUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
(customer_id.clone(), merchant_id.clone()),
customer,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(
conn,
(customer_id, merchant_id),
)
.await
}
_ => Err(error),
},
result => result,
}
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
pub async fn delete_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::customer_id
.eq(customer_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.await
}
#[cfg(all(feature = "v2", feature = "customer_v2"))]
pub async fn find_by_merchant_reference_id_merchant_id(
conn: &PgPooledConn,
merchant_reference_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_reference_id.eq(merchant_reference_id.to_owned())),
)
.await
}
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
pub async fn find_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(
conn,
(customer_id.to_owned(), merchant_id.to_owned()),
)
.await
}
}
| 1,478 | 860 |
hyperswitch | crates/diesel_models/src/query/payout_attempt.rs | .rs | use std::collections::HashSet;
use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{
associations::HasTable,
query_dsl::methods::{DistinctDsl, FilterDsl, SelectDsl},
BoolExpressionMethods, ExpressionMethods,
};
use error_stack::{report, ResultExt};
use super::generics;
use crate::{
enums,
errors::DatabaseError,
payout_attempt::{
PayoutAttempt, PayoutAttemptNew, PayoutAttemptUpdate, PayoutAttemptUpdateInternal,
},
schema::{payout_attempt::dsl, payouts as payout_dsl},
Payouts, PgPooledConn, StorageResult,
};
impl PayoutAttemptNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PayoutAttempt> {
generics::generic_insert(conn, self).await
}
}
impl PayoutAttempt {
pub async fn update_with_attempt_id(
self,
conn: &PgPooledConn,
payout_attempt_update: PayoutAttemptUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::payout_attempt_id
.eq(self.payout_attempt_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
PayoutAttemptUpdateInternal::from(payout_attempt_update),
)
.await
{
Err(error) => match error.current_context() {
DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn find_by_merchant_id_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_id.eq(payout_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_payout_attempt_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_attempt_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_attempt_id.eq(payout_attempt_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_connector_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_payout_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_payout_id.eq(connector_payout_id.to_owned())),
)
.await
}
pub async fn update_by_merchant_id_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &str,
payout: PayoutAttemptUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_id.eq(payout_id.to_owned())),
PayoutAttemptUpdateInternal::from(payout),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(DatabaseError::NotFound).attach_printable("Error while updating payout")
})
}
pub async fn update_by_merchant_id_payout_attempt_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_attempt_id: &str,
payout: PayoutAttemptUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_attempt_id.eq(payout_attempt_id.to_owned())),
PayoutAttemptUpdateInternal::from(payout),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(DatabaseError::NotFound).attach_printable("Error while updating payout")
})
}
pub async fn get_filters_for_payouts(
conn: &PgPooledConn,
payouts: &[Payouts],
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<(
Vec<String>,
Vec<enums::Currency>,
Vec<enums::PayoutStatus>,
Vec<enums::PayoutType>,
)> {
let active_attempt_ids = payouts
.iter()
.map(|payout| {
format!(
"{}_{}",
payout.payout_id.clone(),
payout.attempt_count.clone()
)
})
.collect::<Vec<String>>();
let active_payout_ids = payouts
.iter()
.map(|payout| payout.payout_id.clone())
.collect::<Vec<String>>();
let filter = <Self as HasTable>::table()
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dsl::payout_attempt_id.eq_any(active_attempt_ids));
let payouts_filter = <Payouts as HasTable>::table()
.filter(payout_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(payout_dsl::payout_id.eq_any(active_payout_ids));
let payout_status: Vec<enums::PayoutStatus> = payouts
.iter()
.map(|payout| payout.status)
.collect::<HashSet<enums::PayoutStatus>>()
.into_iter()
.collect();
let filter_connector = filter
.clone()
.select(dsl::connector)
.distinct()
.get_results_async::<Option<String>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by connector")?
.into_iter()
.flatten()
.collect::<Vec<String>>();
let filter_currency = payouts_filter
.clone()
.select(payout_dsl::destination_currency)
.distinct()
.get_results_async::<enums::Currency>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by currency")?
.into_iter()
.collect::<Vec<enums::Currency>>();
let filter_payout_method = payouts_filter
.clone()
.select(payout_dsl::payout_type)
.distinct()
.get_results_async::<Option<enums::PayoutType>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by payout type")?
.into_iter()
.flatten()
.collect::<Vec<enums::PayoutType>>();
Ok((
filter_connector,
filter_currency,
payout_status,
filter_payout_method,
))
}
}
| 1,635 | 861 |
hyperswitch | crates/diesel_models/src/query/payment_method.rs | .rs | use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{
associations::HasTable, debug_query, pg::Pg, BoolExpressionMethods, ExpressionMethods,
QueryDsl, Table,
};
use error_stack::ResultExt;
use super::generics;
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
use crate::schema::payment_methods::dsl;
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
use crate::schema_v2::payment_methods::dsl::{self, id as pm_id};
use crate::{
enums as storage_enums, errors,
payment_method::{self, PaymentMethod, PaymentMethodNew},
PgPooledConn, StorageResult,
};
impl PaymentMethodNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PaymentMethod> {
generics::generic_insert(conn, self).await
}
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "payment_methods_v2")
))]
impl PaymentMethod {
pub async fn delete_by_payment_method_id(
conn: &PgPooledConn,
payment_method_id: String,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, Self>(
conn,
dsl::payment_method_id.eq(payment_method_id),
)
.await
}
pub async fn delete_by_merchant_id_payment_method_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payment_method_id: &str,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, Self>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_method_id.eq(payment_method_id.to_owned())),
)
.await
}
pub async fn find_by_locker_id(conn: &PgPooledConn, locker_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::locker_id.eq(locker_id.to_owned()),
)
.await
}
pub async fn find_by_payment_method_id(
conn: &PgPooledConn,
payment_method_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::payment_method_id.eq(payment_method_id.to_owned()),
)
.await
}
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
None,
None,
None,
)
.await
}
pub async fn find_by_customer_id_merchant_id(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::CustomerId,
merchant_id: &common_utils::id_type::MerchantId,
limit: Option<i64>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::customer_id
.eq(customer_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
limit,
None,
Some(dsl::last_used_at.desc()),
)
.await
}
pub async fn get_count_by_customer_id_merchant_id_status(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::CustomerId,
merchant_id: &common_utils::id_type::MerchantId,
status: common_enums::PaymentMethodStatus,
) -> StorageResult<i64> {
let filter = <Self as HasTable>::table()
.count()
.filter(
dsl::customer_id
.eq(customer_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::status.eq(status.to_owned())),
)
.into_boxed();
router_env::logger::debug!(query = %debug_query::<Pg, _>(&filter).to_string());
generics::db_metrics::track_database_call::<<Self as HasTable>::Table, _, _>(
filter.get_result_async::<i64>(conn),
generics::db_metrics::DatabaseOperation::Count,
)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Failed to get a count of payment methods")
}
pub async fn get_count_by_merchant_id_status(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
status: common_enums::PaymentMethodStatus,
) -> StorageResult<i64> {
let query = <Self as HasTable>::table().count().filter(
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::status.eq(status.to_owned())),
);
router_env::logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
generics::db_metrics::track_database_call::<<Self as HasTable>::Table, _, _>(
query.get_result_async::<i64>(conn),
generics::db_metrics::DatabaseOperation::Count,
)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Failed to get a count of payment methods")
}
pub async fn find_by_customer_id_merchant_id_status(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::CustomerId,
merchant_id: &common_utils::id_type::MerchantId,
status: storage_enums::PaymentMethodStatus,
limit: Option<i64>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::customer_id
.eq(customer_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::status.eq(status)),
limit,
None,
Some(dsl::last_used_at.desc()),
)
.await
}
pub async fn update_with_payment_method_id(
self,
conn: &PgPooledConn,
payment_method: payment_method::PaymentMethodUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::payment_method_id.eq(self.payment_method_id.to_owned()),
payment_method,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
impl PaymentMethod {
pub async fn find_by_id(
conn: &PgPooledConn,
id: &common_utils::id_type::GlobalPaymentMethodId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(conn, pm_id.eq(id.to_owned()))
.await
}
pub async fn find_by_global_customer_id_merchant_id_status(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::GlobalCustomerId,
merchant_id: &common_utils::id_type::MerchantId,
status: storage_enums::PaymentMethodStatus,
limit: Option<i64>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::customer_id
.eq(customer_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::status.eq(status)),
limit,
None,
Some(dsl::last_used_at.desc()),
)
.await
}
pub async fn find_by_global_customer_id(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::GlobalCustomerId,
limit: Option<i64>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::customer_id.eq(customer_id.to_owned()),
limit,
None,
Some(dsl::last_used_at.desc()),
)
.await
}
pub async fn update_with_id(
self,
conn: &PgPooledConn,
payment_method: payment_method::PaymentMethodUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(conn, pm_id.eq(self.id.to_owned()), payment_method)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn find_by_fingerprint_id(
conn: &PgPooledConn,
fingerprint_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::locker_fingerprint_id.eq(fingerprint_id.to_owned()),
)
.await
}
pub async fn get_count_by_merchant_id_status(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
status: common_enums::PaymentMethodStatus,
) -> StorageResult<i64> {
let query = <Self as HasTable>::table().count().filter(
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::status.eq(status.to_owned())),
);
router_env::logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
generics::db_metrics::track_database_call::<<Self as HasTable>::Table, _, _>(
query.get_result_async::<i64>(conn),
generics::db_metrics::DatabaseOperation::Count,
)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Failed to get a count of payment methods")
}
}
| 2,373 | 862 |
hyperswitch | crates/diesel_models/src/query/dashboard_metadata.rs | .rs | use common_utils::id_type;
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use crate::{
enums,
query::generics,
schema::dashboard_metadata::dsl,
user::dashboard_metadata::{
DashboardMetadata, DashboardMetadataNew, DashboardMetadataUpdate,
DashboardMetadataUpdateInternal,
},
PgPooledConn, StorageResult,
};
impl DashboardMetadataNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<DashboardMetadata> {
generics::generic_insert(conn, self).await
}
}
impl DashboardMetadata {
pub async fn update(
conn: &PgPooledConn,
user_id: Option<String>,
merchant_id: id_type::MerchantId,
org_id: id_type::OrganizationId,
data_key: enums::DashboardMetadata,
dashboard_metadata_update: DashboardMetadataUpdate,
) -> StorageResult<Self> {
let predicate = dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::org_id.eq(org_id.to_owned()))
.and(dsl::data_key.eq(data_key.to_owned()));
if let Some(uid) = user_id {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
predicate.and(dsl::user_id.eq(uid)),
DashboardMetadataUpdateInternal::from(dashboard_metadata_update),
)
.await
} else {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
predicate.and(dsl::user_id.is_null()),
DashboardMetadataUpdateInternal::from(dashboard_metadata_update),
)
.await
}
}
pub async fn find_user_scoped_dashboard_metadata(
conn: &PgPooledConn,
user_id: String,
merchant_id: id_type::MerchantId,
org_id: id_type::OrganizationId,
data_types: Vec<enums::DashboardMetadata>,
) -> StorageResult<Vec<Self>> {
let predicate = dsl::user_id
.eq(user_id)
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::org_id.eq(org_id))
.and(dsl::data_key.eq_any(data_types));
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
predicate,
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
pub async fn find_merchant_scoped_dashboard_metadata(
conn: &PgPooledConn,
merchant_id: id_type::MerchantId,
org_id: id_type::OrganizationId,
data_types: Vec<enums::DashboardMetadata>,
) -> StorageResult<Vec<Self>> {
let predicate = dsl::merchant_id
.eq(merchant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::data_key.eq_any(data_types));
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
predicate,
None,
None,
Some(dsl::last_modified_at.asc()),
)
.await
}
pub async fn delete_all_user_scoped_dashboard_metadata_by_merchant_id(
conn: &PgPooledConn,
user_id: String,
merchant_id: id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::user_id
.eq(user_id)
.and(dsl::merchant_id.eq(merchant_id)),
)
.await
}
pub async fn delete_user_scoped_dashboard_metadata_by_merchant_id_data_key(
conn: &PgPooledConn,
user_id: String,
merchant_id: id_type::MerchantId,
data_key: enums::DashboardMetadata,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::user_id
.eq(user_id)
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::data_key.eq(data_key)),
)
.await
}
}
| 938 | 863 |
hyperswitch | crates/diesel_models/src/query/generics.rs | .rs | use std::fmt::Debug;
use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{
associations::HasTable,
debug_query,
dsl::{Find, Limit},
helper_types::{Filter, IntoBoxed},
insertable::CanInsertInSingleQuery,
pg::{Pg, PgConnection},
query_builder::{
AsChangeset, AsQuery, DeleteStatement, InsertStatement, IntoUpdateTarget, QueryFragment,
QueryId, UpdateStatement,
},
query_dsl::{
methods::{BoxedDsl, FilterDsl, FindDsl, LimitDsl, OffsetDsl, OrderDsl},
LoadQuery, RunQueryDsl,
},
result::Error as DieselError,
Expression, Insertable, QueryDsl, QuerySource, Table,
};
use error_stack::{report, ResultExt};
use router_env::logger;
use crate::{errors, PgPooledConn, StorageResult};
pub mod db_metrics {
#[derive(Debug)]
pub enum DatabaseOperation {
FindOne,
Filter,
Update,
Insert,
Delete,
DeleteWithResult,
UpdateWithResults,
UpdateOne,
Count,
}
#[inline]
pub async fn track_database_call<T, Fut, U>(future: Fut, operation: DatabaseOperation) -> U
where
Fut: std::future::Future<Output = U>,
{
let start = std::time::Instant::now();
let output = future.await;
let time_elapsed = start.elapsed();
let table_name = std::any::type_name::<T>().rsplit("::").nth(1);
let attributes = router_env::metric_attributes!(
("table", table_name.unwrap_or("undefined")),
("operation", format!("{:?}", operation))
);
crate::metrics::DATABASE_CALLS_COUNT.add(1, attributes);
crate::metrics::DATABASE_CALL_TIME.record(time_elapsed.as_secs_f64(), attributes);
output
}
}
use db_metrics::*;
pub async fn generic_insert<T, V, R>(conn: &PgPooledConn, values: V) -> StorageResult<R>
where
T: HasTable<Table = T> + Table + 'static + Debug,
V: Debug + Insertable<T>,
<T as QuerySource>::FromClause: QueryFragment<Pg> + Debug,
<V as Insertable<T>>::Values: CanInsertInSingleQuery<Pg> + QueryFragment<Pg> + 'static,
InsertStatement<T, <V as Insertable<T>>::Values>:
AsQuery + LoadQuery<'static, PgConnection, R> + Send,
R: Send + 'static,
{
let debug_values = format!("{values:?}");
let query = diesel::insert_into(<T as HasTable>::table()).values(values);
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
match track_database_call::<T, _, _>(query.get_result_async(conn), DatabaseOperation::Insert)
.await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::DatabaseError(diesel::result::DatabaseErrorKind::UniqueViolation, _) => {
Err(report!(err)).change_context(errors::DatabaseError::UniqueViolation)
}
_ => Err(report!(err)).change_context(errors::DatabaseError::Others),
},
}
.attach_printable_lazy(|| format!("Error while inserting {debug_values}"))
}
pub async fn generic_update<T, V, P>(
conn: &PgPooledConn,
predicate: P,
values: V,
) -> StorageResult<usize>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
V: AsChangeset<Target = <Filter<T, P> as HasTable>::Table> + Debug,
Filter<T, P>: IntoUpdateTarget,
UpdateStatement<
<Filter<T, P> as HasTable>::Table,
<Filter<T, P> as IntoUpdateTarget>::WhereClause,
<V as AsChangeset>::Changeset,
>: AsQuery + QueryFragment<Pg> + QueryId + Send + 'static,
{
let debug_values = format!("{values:?}");
let query = diesel::update(<T as HasTable>::table().filter(predicate)).set(values);
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<T, _, _>(query.execute_async(conn), DatabaseOperation::Update)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable_lazy(|| format!("Error while updating {debug_values}"))
}
pub async fn generic_update_with_results<T, V, P, R>(
conn: &PgPooledConn,
predicate: P,
values: V,
) -> StorageResult<Vec<R>>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
V: AsChangeset<Target = <Filter<T, P> as HasTable>::Table> + Debug + 'static,
Filter<T, P>: IntoUpdateTarget + 'static,
UpdateStatement<
<Filter<T, P> as HasTable>::Table,
<Filter<T, P> as IntoUpdateTarget>::WhereClause,
<V as AsChangeset>::Changeset,
>: AsQuery + LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send + Clone,
R: Send + 'static,
// For cloning query (UpdateStatement)
<Filter<T, P> as HasTable>::Table: Clone,
<Filter<T, P> as IntoUpdateTarget>::WhereClause: Clone,
<V as AsChangeset>::Changeset: Clone,
<<Filter<T, P> as HasTable>::Table as QuerySource>::FromClause: Clone,
{
let debug_values = format!("{values:?}");
let query = diesel::update(<T as HasTable>::table().filter(predicate)).set(values);
match track_database_call::<T, _, _>(
query.to_owned().get_results_async(conn),
DatabaseOperation::UpdateWithResults,
)
.await
{
Ok(result) => {
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
Ok(result)
}
Err(DieselError::QueryBuilderError(_)) => {
Err(report!(errors::DatabaseError::NoFieldsToUpdate))
.attach_printable_lazy(|| format!("Error while updating {debug_values}"))
}
Err(DieselError::NotFound) => Err(report!(errors::DatabaseError::NotFound))
.attach_printable_lazy(|| format!("Error while updating {debug_values}")),
Err(error) => Err(error)
.change_context(errors::DatabaseError::Others)
.attach_printable_lazy(|| format!("Error while updating {debug_values}")),
}
}
pub async fn generic_update_with_unique_predicate_get_result<T, V, P, R>(
conn: &PgPooledConn,
predicate: P,
values: V,
) -> StorageResult<R>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
V: AsChangeset<Target = <Filter<T, P> as HasTable>::Table> + Debug + 'static,
Filter<T, P>: IntoUpdateTarget + 'static,
UpdateStatement<
<Filter<T, P> as HasTable>::Table,
<Filter<T, P> as IntoUpdateTarget>::WhereClause,
<V as AsChangeset>::Changeset,
>: AsQuery + LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send,
R: Send + 'static,
// For cloning query (UpdateStatement)
<Filter<T, P> as HasTable>::Table: Clone,
<Filter<T, P> as IntoUpdateTarget>::WhereClause: Clone,
<V as AsChangeset>::Changeset: Clone,
<<Filter<T, P> as HasTable>::Table as QuerySource>::FromClause: Clone,
{
generic_update_with_results::<<T as HasTable>::Table, _, _, _>(conn, predicate, values)
.await
.map(|mut vec_r| {
if vec_r.is_empty() {
Err(errors::DatabaseError::NotFound)
} else if vec_r.len() != 1 {
Err(errors::DatabaseError::Others)
} else {
vec_r.pop().ok_or(errors::DatabaseError::Others)
}
.attach_printable("Maybe not queried using a unique key")
})?
}
pub async fn generic_update_by_id<T, V, Pk, R>(
conn: &PgPooledConn,
id: Pk,
values: V,
) -> StorageResult<R>
where
T: FindDsl<Pk> + HasTable<Table = T> + LimitDsl + Table + 'static,
V: AsChangeset<Target = <Find<T, Pk> as HasTable>::Table> + Debug,
Find<T, Pk>: IntoUpdateTarget + QueryFragment<Pg> + RunQueryDsl<PgConnection> + Send + 'static,
UpdateStatement<
<Find<T, Pk> as HasTable>::Table,
<Find<T, Pk> as IntoUpdateTarget>::WhereClause,
<V as AsChangeset>::Changeset,
>: AsQuery + LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send + 'static,
Find<T, Pk>: LimitDsl,
Limit<Find<T, Pk>>: LoadQuery<'static, PgConnection, R>,
R: Send + 'static,
Pk: Clone + Debug,
// For cloning query (UpdateStatement)
<Find<T, Pk> as HasTable>::Table: Clone,
<Find<T, Pk> as IntoUpdateTarget>::WhereClause: Clone,
<V as AsChangeset>::Changeset: Clone,
<<Find<T, Pk> as HasTable>::Table as QuerySource>::FromClause: Clone,
{
let debug_values = format!("{values:?}");
let query = diesel::update(<T as HasTable>::table().find(id.to_owned())).set(values);
match track_database_call::<T, _, _>(
query.to_owned().get_result_async(conn),
DatabaseOperation::UpdateOne,
)
.await
{
Ok(result) => {
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
Ok(result)
}
Err(DieselError::QueryBuilderError(_)) => {
Err(report!(errors::DatabaseError::NoFieldsToUpdate))
.attach_printable_lazy(|| format!("Error while updating by ID {debug_values}"))
}
Err(DieselError::NotFound) => Err(report!(errors::DatabaseError::NotFound))
.attach_printable_lazy(|| format!("Error while updating by ID {debug_values}")),
Err(error) => Err(error)
.change_context(errors::DatabaseError::Others)
.attach_printable_lazy(|| format!("Error while updating by ID {debug_values}")),
}
}
pub async fn generic_delete<T, P>(conn: &PgPooledConn, predicate: P) -> StorageResult<bool>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
Filter<T, P>: IntoUpdateTarget,
DeleteStatement<
<Filter<T, P> as HasTable>::Table,
<Filter<T, P> as IntoUpdateTarget>::WhereClause,
>: AsQuery + QueryFragment<Pg> + QueryId + Send + 'static,
{
let query = diesel::delete(<T as HasTable>::table().filter(predicate));
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<T, _, _>(query.execute_async(conn), DatabaseOperation::Delete)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while deleting")
.and_then(|result| match result {
n if n > 0 => {
logger::debug!("{n} records deleted");
Ok(true)
}
0 => {
Err(report!(errors::DatabaseError::NotFound).attach_printable("No records deleted"))
}
_ => Ok(true), // n is usize, rustc requires this for exhaustive check
})
}
pub async fn generic_delete_one_with_result<T, P, R>(
conn: &PgPooledConn,
predicate: P,
) -> StorageResult<R>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
Filter<T, P>: IntoUpdateTarget,
DeleteStatement<
<Filter<T, P> as HasTable>::Table,
<Filter<T, P> as IntoUpdateTarget>::WhereClause,
>: AsQuery + LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send + 'static,
R: Send + Clone + 'static,
{
let query = diesel::delete(<T as HasTable>::table().filter(predicate));
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<T, _, _>(
query.get_results_async(conn),
DatabaseOperation::DeleteWithResult,
)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while deleting")
.and_then(|result| {
result.first().cloned().ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Object to be deleted does not exist")
})
})
}
async fn generic_find_by_id_core<T, Pk, R>(conn: &PgPooledConn, id: Pk) -> StorageResult<R>
where
T: FindDsl<Pk> + HasTable<Table = T> + LimitDsl + Table + 'static,
Find<T, Pk>: LimitDsl + QueryFragment<Pg> + RunQueryDsl<PgConnection> + Send + 'static,
Limit<Find<T, Pk>>: LoadQuery<'static, PgConnection, R>,
Pk: Clone + Debug,
R: Send + 'static,
{
let query = <T as HasTable>::table().find(id.to_owned());
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
match track_database_call::<T, _, _>(query.first_async(conn), DatabaseOperation::FindOne).await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::NotFound => {
Err(report!(err)).change_context(errors::DatabaseError::NotFound)
}
_ => Err(report!(err)).change_context(errors::DatabaseError::Others),
},
}
.attach_printable_lazy(|| format!("Error finding record by primary key: {id:?}"))
}
pub async fn generic_find_by_id<T, Pk, R>(conn: &PgPooledConn, id: Pk) -> StorageResult<R>
where
T: FindDsl<Pk> + HasTable<Table = T> + LimitDsl + Table + 'static,
Find<T, Pk>: LimitDsl + QueryFragment<Pg> + RunQueryDsl<PgConnection> + Send + 'static,
Limit<Find<T, Pk>>: LoadQuery<'static, PgConnection, R>,
Pk: Clone + Debug,
R: Send + 'static,
{
generic_find_by_id_core::<T, _, _>(conn, id).await
}
pub async fn generic_find_by_id_optional<T, Pk, R>(
conn: &PgPooledConn,
id: Pk,
) -> StorageResult<Option<R>>
where
T: FindDsl<Pk> + HasTable<Table = T> + LimitDsl + Table + 'static,
<T as HasTable>::Table: FindDsl<Pk>,
Find<T, Pk>: LimitDsl + QueryFragment<Pg> + RunQueryDsl<PgConnection> + Send + 'static,
Limit<Find<T, Pk>>: LoadQuery<'static, PgConnection, R>,
Pk: Clone + Debug,
R: Send + 'static,
{
to_optional(generic_find_by_id_core::<T, _, _>(conn, id).await)
}
async fn generic_find_one_core<T, P, R>(conn: &PgPooledConn, predicate: P) -> StorageResult<R>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
Filter<T, P>: LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send + 'static,
R: Send + 'static,
{
let query = <T as HasTable>::table().filter(predicate);
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<T, _, _>(query.get_result_async(conn), DatabaseOperation::FindOne)
.await
.map_err(|err| match err {
DieselError::NotFound => report!(err).change_context(errors::DatabaseError::NotFound),
_ => report!(err).change_context(errors::DatabaseError::Others),
})
.attach_printable("Error finding record by predicate")
}
pub async fn generic_find_one<T, P, R>(conn: &PgPooledConn, predicate: P) -> StorageResult<R>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
Filter<T, P>: LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send + 'static,
R: Send + 'static,
{
generic_find_one_core::<T, _, _>(conn, predicate).await
}
pub async fn generic_find_one_optional<T, P, R>(
conn: &PgPooledConn,
predicate: P,
) -> StorageResult<Option<R>>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
Filter<T, P>: LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send + 'static,
R: Send + 'static,
{
to_optional(generic_find_one_core::<T, _, _>(conn, predicate).await)
}
pub async fn generic_filter<T, P, O, R>(
conn: &PgPooledConn,
predicate: P,
limit: Option<i64>,
offset: Option<i64>,
order: Option<O>,
) -> StorageResult<Vec<R>>
where
T: HasTable<Table = T> + Table + BoxedDsl<'static, Pg> + 'static,
IntoBoxed<'static, T, Pg>: FilterDsl<P, Output = IntoBoxed<'static, T, Pg>>
+ LimitDsl<Output = IntoBoxed<'static, T, Pg>>
+ OffsetDsl<Output = IntoBoxed<'static, T, Pg>>
+ OrderDsl<O, Output = IntoBoxed<'static, T, Pg>>
+ LoadQuery<'static, PgConnection, R>
+ QueryFragment<Pg>
+ Send,
O: Expression,
R: Send + 'static,
{
let mut query = T::table().into_boxed();
query = query.filter(predicate);
if let Some(limit) = limit {
query = query.limit(limit);
}
if let Some(offset) = offset {
query = query.offset(offset);
}
if let Some(order) = order {
query = query.order(order);
}
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<T, _, _>(query.get_results_async(conn), DatabaseOperation::Filter)
.await
.change_context(errors::DatabaseError::NotFound)
.attach_printable("Error filtering records by predicate")
}
fn to_optional<T>(arg: StorageResult<T>) -> StorageResult<Option<T>> {
match arg {
Ok(value) => Ok(Some(value)),
Err(err) => match err.current_context() {
errors::DatabaseError::NotFound => Ok(None),
_ => Err(err),
},
}
}
| 4,400 | 864 |
hyperswitch | crates/diesel_models/src/query/fraud_check.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use crate::{
errors, fraud_check::*, query::generics, schema::fraud_check::dsl, PgPooledConn, StorageResult,
};
impl FraudCheckNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<FraudCheck> {
generics::generic_insert(conn, self).await
}
}
impl FraudCheck {
pub async fn update_with_attempt_id(
self,
conn: &PgPooledConn,
fraud_check: FraudCheckUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::attempt_id
.eq(self.attempt_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
FraudCheckUpdateInternal::from(fraud_check),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn get_with_payment_id(
conn: &PgPooledConn,
payment_id: common_utils::id_type::PaymentId,
merchant_id: common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::payment_id
.eq(payment_id)
.and(dsl::merchant_id.eq(merchant_id)),
)
.await
}
pub async fn get_with_payment_id_if_present(
conn: &PgPooledConn,
payment_id: common_utils::id_type::PaymentId,
merchant_id: common_utils::id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::payment_id
.eq(payment_id)
.and(dsl::merchant_id.eq(merchant_id)),
)
.await
}
}
| 480 | 865 |
hyperswitch | crates/diesel_models/src/query/mandate.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use error_stack::report;
use super::generics;
use crate::{errors, mandate::*, schema::mandate::dsl, PgPooledConn, StorageResult};
impl MandateNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Mandate> {
generics::generic_insert(conn, self).await
}
}
impl Mandate {
pub async fn find_by_merchant_id_mandate_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
mandate_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::mandate_id.eq(mandate_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_connector_mandate_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_mandate_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_mandate_id.eq(connector_mandate_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_customer_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
customer_id: &common_utils::id_type::CustomerId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::customer_id.eq(customer_id.to_owned())),
None,
None,
None,
)
.await
}
//Fix this function once V2 mandate is schema is being built
#[cfg(all(feature = "v2", feature = "customer_v2"))]
pub async fn find_by_global_customer_id(
conn: &PgPooledConn,
customer_id: &common_utils::id_type::GlobalCustomerId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::customer_id.eq(customer_id.to_owned()),
None,
None,
None,
)
.await
}
pub async fn update_by_merchant_id_mandate_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
mandate_id: &str,
mandate: MandateUpdateInternal,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::mandate_id.eq(mandate_id.to_owned())),
mandate,
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Error while updating mandate")
})
}
}
| 792 | 866 |
hyperswitch | crates/diesel_models/src/query/gsm.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use error_stack::report;
use crate::{
errors, gsm::*, query::generics, schema::gateway_status_map::dsl, PgPooledConn, StorageResult,
};
impl GatewayStatusMappingNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<GatewayStatusMap> {
generics::generic_insert(conn, self).await
}
}
impl GatewayStatusMap {
pub async fn find(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::connector
.eq(connector)
.and(dsl::flow.eq(flow))
.and(dsl::sub_flow.eq(sub_flow))
.and(dsl::code.eq(code))
.and(dsl::message.eq(message)),
)
.await
}
pub async fn retrieve_decision(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> StorageResult<String> {
Self::find(conn, connector, flow, sub_flow, code, message)
.await
.map(|item| item.decision)
}
pub async fn update(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
gsm: GatewayStatusMappingUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<
<Self as HasTable>::Table,
GatewayStatusMapperUpdateInternal,
_,
_,
>(
conn,
dsl::connector
.eq(connector)
.and(dsl::flow.eq(flow))
.and(dsl::sub_flow.eq(sub_flow))
.and(dsl::code.eq(code))
.and(dsl::message.eq(message)),
gsm.into(),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Error while updating gsm entry")
})
}
pub async fn delete(
conn: &PgPooledConn,
connector: String,
flow: String,
sub_flow: String,
code: String,
message: String,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::connector
.eq(connector)
.and(dsl::flow.eq(flow))
.and(dsl::sub_flow.eq(sub_flow))
.and(dsl::code.eq(code))
.and(dsl::message.eq(message)),
)
.await
}
}
| 652 | 867 |
hyperswitch | crates/diesel_models/src/query/merchant_key_store.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
merchant_key_store::{MerchantKeyStore, MerchantKeyStoreNew},
schema::merchant_key_store::dsl,
PgPooledConn, StorageResult,
};
impl MerchantKeyStoreNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<MerchantKeyStore> {
generics::generic_insert(conn, self).await
}
}
impl MerchantKeyStore {
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
)
.await
}
pub async fn delete_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
)
.await
}
pub async fn list_multiple_key_stores(
conn: &PgPooledConn,
merchant_ids: Vec<common_utils::id_type::MerchantId>,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as diesel::Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.eq_any(merchant_ids),
None,
None,
None,
)
.await
}
pub async fn list_all_key_stores(
conn: &PgPooledConn,
from: u32,
limit: u32,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as diesel::Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.ne_all(vec!["".to_string()]),
Some(limit.into()),
Some(from.into()),
None,
)
.await
}
}
| 505 | 868 |
hyperswitch | crates/diesel_models/src/query/blocklist_fingerprint.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
blocklist_fingerprint::{BlocklistFingerprint, BlocklistFingerprintNew},
schema::blocklist_fingerprint::dsl,
PgPooledConn, StorageResult,
};
impl BlocklistFingerprintNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<BlocklistFingerprint> {
generics::generic_insert(conn, self).await
}
}
impl BlocklistFingerprint {
pub async fn find_by_merchant_id_fingerprint_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
fingerprint_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::fingerprint_id.eq(fingerprint_id.to_owned())),
)
.await
}
}
| 226 | 869 |
hyperswitch | crates/diesel_models/src/query/payouts.rs | .rs | use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{
associations::HasTable, debug_query, pg::Pg, BoolExpressionMethods, ExpressionMethods,
JoinOnDsl, QueryDsl,
};
use error_stack::{report, ResultExt};
use super::generics;
use crate::{
enums, errors,
payouts::{Payouts, PayoutsNew, PayoutsUpdate, PayoutsUpdateInternal},
query::generics::db_metrics,
schema::{payout_attempt, payouts::dsl},
PgPooledConn, StorageResult,
};
impl PayoutsNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Payouts> {
generics::generic_insert(conn, self).await
}
}
impl Payouts {
pub async fn update(
self,
conn: &PgPooledConn,
payout_update: PayoutsUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::payout_id
.eq(self.payout_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
PayoutsUpdateInternal::from(payout_update),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
Ok(mut payouts) => payouts
.pop()
.ok_or(error_stack::report!(errors::DatabaseError::NotFound)),
}
}
pub async fn find_by_merchant_id_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_id.eq(payout_id.to_owned())),
)
.await
}
pub async fn update_by_merchant_id_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &str,
payout: PayoutsUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_id.eq(payout_id.to_owned())),
PayoutsUpdateInternal::from(payout),
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound).attach_printable("Error while updating payout")
})
}
pub async fn find_optional_by_merchant_id_payout_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &str,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payout_id.eq(payout_id.to_owned())),
)
.await
}
pub async fn get_total_count_of_payouts(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
active_payout_ids: &[String],
connector: Option<Vec<String>>,
currency: Option<Vec<enums::Currency>>,
status: Option<Vec<enums::PayoutStatus>>,
payout_type: Option<Vec<enums::PayoutType>>,
) -> StorageResult<i64> {
let mut filter = <Self as HasTable>::table()
.inner_join(payout_attempt::table.on(payout_attempt::dsl::payout_id.eq(dsl::payout_id)))
.count()
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dsl::payout_id.eq_any(active_payout_ids.to_owned()))
.into_boxed();
if let Some(connector) = connector {
filter = filter.filter(payout_attempt::dsl::connector.eq_any(connector));
}
if let Some(currency) = currency {
filter = filter.filter(dsl::destination_currency.eq_any(currency));
}
if let Some(status) = status {
filter = filter.filter(dsl::status.eq_any(status));
}
if let Some(payout_type) = payout_type {
filter = filter.filter(dsl::payout_type.eq_any(payout_type));
}
router_env::logger::debug!(query = %debug_query::<Pg, _>(&filter).to_string());
db_metrics::track_database_call::<<Self as HasTable>::Table, _, _>(
filter.get_result_async::<i64>(conn),
db_metrics::DatabaseOperation::Filter,
)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error filtering count of payouts")
}
}
| 1,128 | 870 |
hyperswitch | crates/diesel_models/src/query/blocklist_lookup.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
blocklist_lookup::{BlocklistLookup, BlocklistLookupNew},
schema::blocklist_lookup::dsl,
PgPooledConn, StorageResult,
};
impl BlocklistLookupNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<BlocklistLookup> {
generics::generic_insert(conn, self).await
}
}
impl BlocklistLookup {
pub async fn find_by_merchant_id_fingerprint(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
fingerprint: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::fingerprint.eq(fingerprint.to_owned())),
)
.await
}
pub async fn delete_by_merchant_id_fingerprint(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
fingerprint: &str,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::fingerprint.eq(fingerprint.to_owned())),
)
.await
}
}
| 325 | 871 |
hyperswitch | crates/diesel_models/src/query/merchant_connector_account.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use super::generics;
#[cfg(feature = "v1")]
use crate::schema::merchant_connector_account::dsl;
#[cfg(feature = "v2")]
use crate::schema_v2::merchant_connector_account::dsl;
use crate::{
errors,
merchant_connector_account::{
MerchantConnectorAccount, MerchantConnectorAccountNew,
MerchantConnectorAccountUpdateInternal,
},
PgPooledConn, StorageResult,
};
impl MerchantConnectorAccountNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<MerchantConnectorAccount> {
generics::generic_insert(conn, self).await
}
}
#[cfg(feature = "v1")]
impl MerchantConnectorAccount {
pub async fn update(
self,
conn: &PgPooledConn,
merchant_connector_account: MerchantConnectorAccountUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.merchant_connector_id.to_owned(),
merchant_connector_account,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn delete_by_merchant_id_merchant_connector_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
merchant_connector_id: &common_utils::id_type::MerchantConnectorAccountId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_connector_id.eq(merchant_connector_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_connector(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_label: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_label.eq(connector_label.to_owned())),
)
.await
}
pub async fn find_by_profile_id_connector_name(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
connector_name: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::connector_name.eq(connector_name.to_owned())),
)
.await
}
pub async fn find_by_merchant_id_connector_name(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_name: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_name.eq(connector_name.to_owned())),
None,
None,
None,
)
.await
}
pub async fn find_by_merchant_id_merchant_connector_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
merchant_connector_id: &common_utils::id_type::MerchantConnectorAccountId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::merchant_connector_id.eq(merchant_connector_id.to_owned())),
)
.await
}
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
get_disabled: bool,
) -> StorageResult<Vec<Self>> {
if get_disabled {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
None,
None,
Some(dsl::created_at.asc()),
)
.await
} else {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::disabled.eq(false)),
None,
None,
None,
)
.await
}
}
}
#[cfg(feature = "v2")]
impl MerchantConnectorAccount {
pub async fn update(
self,
conn: &PgPooledConn,
merchant_connector_account: MerchantConnectorAccountUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.id.to_owned(),
merchant_connector_account,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn delete_by_id(
conn: &PgPooledConn,
id: &common_utils::id_type::MerchantConnectorAccountId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(conn, dsl::id.eq(id.to_owned()))
.await
}
pub async fn find_by_id(
conn: &PgPooledConn,
id: &common_utils::id_type::MerchantConnectorAccountId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq(id.to_owned()),
)
.await
}
pub async fn find_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
get_disabled: bool,
) -> StorageResult<Vec<Self>> {
if get_disabled {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
None,
None,
Some(dsl::created_at.asc()),
)
.await
} else {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::disabled.eq(false)),
None,
None,
None,
)
.await
}
}
pub async fn list_by_profile_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::profile_id.eq(profile_id.to_owned()),
None,
None,
Some(dsl::created_at.asc()),
)
.await
}
pub async fn list_enabled_by_profile_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
connector_type: common_enums::ConnectorType,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::disabled.eq(false))
.and(dsl::connector_type.eq(connector_type)),
None,
None,
Some(dsl::created_at.asc()),
)
.await
}
}
| 1,800 | 872 |
hyperswitch | crates/diesel_models/src/query/user_role.rs | .rs | use async_bb8_diesel::AsyncRunQueryDsl;
use common_utils::id_type;
use diesel::{
associations::HasTable,
debug_query,
pg::Pg,
result::Error as DieselError,
sql_types::{Bool, Nullable},
BoolExpressionMethods, ExpressionMethods, QueryDsl,
};
use error_stack::{report, ResultExt};
use crate::{
enums::{UserRoleVersion, UserStatus},
errors,
query::generics,
schema::user_roles::dsl,
user_role::*,
PgPooledConn, StorageResult,
};
impl UserRoleNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<UserRole> {
generics::generic_insert(conn, self).await
}
}
impl UserRole {
fn check_user_in_lineage(
tenant_id: id_type::TenantId,
org_id: Option<id_type::OrganizationId>,
merchant_id: Option<id_type::MerchantId>,
profile_id: Option<id_type::ProfileId>,
) -> Box<
dyn diesel::BoxableExpression<<Self as HasTable>::Table, Pg, SqlType = Nullable<Bool>>
+ 'static,
> {
// Checking in user roles, for a user in token hierarchy, only one of the relations will be true:
// either tenant level, org level, merchant level, or profile level
// Tenant-level: (tenant_id = ? && org_id = null && merchant_id = null && profile_id = null)
// Org-level: (org_id = ? && merchant_id = null && profile_id = null)
// Merchant-level: (org_id = ? && merchant_id = ? && profile_id = null)
// Profile-level: (org_id = ? && merchant_id = ? && profile_id = ?)
Box::new(
// Tenant-level condition
dsl::tenant_id
.eq(tenant_id.clone())
.and(dsl::org_id.is_null())
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null())
.or(
// Org-level condition
dsl::tenant_id
.eq(tenant_id.clone())
.and(dsl::org_id.eq(org_id.clone()))
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null()),
)
.or(
// Merchant-level condition
dsl::tenant_id
.eq(tenant_id.clone())
.and(dsl::org_id.eq(org_id.clone()))
.and(dsl::merchant_id.eq(merchant_id.clone()))
.and(dsl::profile_id.is_null()),
)
.or(
// Profile-level condition
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::profile_id.eq(profile_id)),
),
)
}
pub async fn find_by_user_id_tenant_id_org_id_merchant_id_profile_id(
conn: &PgPooledConn,
user_id: String,
tenant_id: id_type::TenantId,
org_id: id_type::OrganizationId,
merchant_id: id_type::MerchantId,
profile_id: id_type::ProfileId,
version: UserRoleVersion,
) -> StorageResult<Self> {
let check_lineage = Self::check_user_in_lineage(
tenant_id,
Some(org_id),
Some(merchant_id),
Some(profile_id),
);
let predicate = dsl::user_id
.eq(user_id)
.and(check_lineage)
.and(dsl::version.eq(version));
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(conn, predicate).await
}
#[allow(clippy::too_many_arguments)]
pub async fn update_by_user_id_tenant_id_org_id_merchant_id_profile_id(
conn: &PgPooledConn,
user_id: String,
tenant_id: id_type::TenantId,
org_id: id_type::OrganizationId,
merchant_id: Option<id_type::MerchantId>,
profile_id: Option<id_type::ProfileId>,
update: UserRoleUpdate,
version: UserRoleVersion,
) -> StorageResult<Self> {
let check_lineage = dsl::tenant_id
.eq(tenant_id.clone())
.and(dsl::org_id.is_null())
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null())
.or(
// Org-level condition
dsl::tenant_id
.eq(tenant_id.clone())
.and(dsl::org_id.eq(org_id.clone()))
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null()),
)
.or(
// Merchant-level condition
dsl::tenant_id
.eq(tenant_id.clone())
.and(dsl::org_id.eq(org_id.clone()))
.and(dsl::merchant_id.eq(merchant_id.clone()))
.and(dsl::profile_id.is_null()),
)
.or(
// Profile-level condition
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::profile_id.eq(profile_id)),
);
let predicate = dsl::user_id
.eq(user_id)
.and(check_lineage)
.and(dsl::version.eq(version));
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
UserRoleUpdateInternal,
_,
_,
>(conn, predicate, update.into())
.await
}
pub async fn delete_by_user_id_tenant_id_org_id_merchant_id_profile_id(
conn: &PgPooledConn,
user_id: String,
tenant_id: id_type::TenantId,
org_id: id_type::OrganizationId,
merchant_id: id_type::MerchantId,
profile_id: id_type::ProfileId,
version: UserRoleVersion,
) -> StorageResult<Self> {
let check_lineage = Self::check_user_in_lineage(
tenant_id,
Some(org_id),
Some(merchant_id),
Some(profile_id),
);
let predicate = dsl::user_id
.eq(user_id)
.and(check_lineage)
.and(dsl::version.eq(version));
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(conn, predicate)
.await
}
#[allow(clippy::too_many_arguments)]
pub async fn generic_user_roles_list_for_user(
conn: &PgPooledConn,
user_id: String,
tenant_id: id_type::TenantId,
org_id: Option<id_type::OrganizationId>,
merchant_id: Option<id_type::MerchantId>,
profile_id: Option<id_type::ProfileId>,
entity_id: Option<String>,
status: Option<UserStatus>,
version: Option<UserRoleVersion>,
limit: Option<u32>,
) -> StorageResult<Vec<Self>> {
let mut query = <Self as HasTable>::table()
.filter(dsl::user_id.eq(user_id).and(dsl::tenant_id.eq(tenant_id)))
.into_boxed();
if let Some(org_id) = org_id {
query = query.filter(dsl::org_id.eq(org_id));
}
if let Some(merchant_id) = merchant_id {
query = query.filter(dsl::merchant_id.eq(merchant_id));
}
if let Some(profile_id) = profile_id {
query = query.filter(dsl::profile_id.eq(profile_id));
}
if let Some(entity_id) = entity_id {
query = query.filter(dsl::entity_id.eq(entity_id));
}
if let Some(version) = version {
query = query.filter(dsl::version.eq(version));
}
if let Some(status) = status {
query = query.filter(dsl::status.eq(status));
}
if let Some(limit) = limit {
query = query.limit(limit.into());
}
router_env::logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
match generics::db_metrics::track_database_call::<Self, _, _>(
query.get_results_async(conn),
generics::db_metrics::DatabaseOperation::Filter,
)
.await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::NotFound => {
Err(report!(err)).change_context(errors::DatabaseError::NotFound)
}
_ => Err(report!(err)).change_context(errors::DatabaseError::Others),
},
}
}
#[allow(clippy::too_many_arguments)]
pub async fn generic_user_roles_list_for_org_and_extra(
conn: &PgPooledConn,
user_id: Option<String>,
tenant_id: id_type::TenantId,
org_id: id_type::OrganizationId,
merchant_id: Option<id_type::MerchantId>,
profile_id: Option<id_type::ProfileId>,
version: Option<UserRoleVersion>,
limit: Option<u32>,
) -> StorageResult<Vec<Self>> {
let mut query = <Self as HasTable>::table()
.filter(dsl::org_id.eq(org_id).and(dsl::tenant_id.eq(tenant_id)))
.into_boxed();
if let Some(user_id) = user_id {
query = query.filter(dsl::user_id.eq(user_id));
}
if let Some(merchant_id) = merchant_id {
query = query.filter(dsl::merchant_id.eq(merchant_id));
}
if let Some(profile_id) = profile_id {
query = query.filter(dsl::profile_id.eq(profile_id));
}
if let Some(version) = version {
query = query.filter(dsl::version.eq(version));
}
if let Some(limit) = limit {
query = query.limit(limit.into());
}
router_env::logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
match generics::db_metrics::track_database_call::<Self, _, _>(
query.get_results_async(conn),
generics::db_metrics::DatabaseOperation::Filter,
)
.await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::NotFound => {
Err(report!(err)).change_context(errors::DatabaseError::NotFound)
}
_ => Err(report!(err)).change_context(errors::DatabaseError::Others),
},
}
}
pub async fn list_user_roles_by_user_id_across_tenants(
conn: &PgPooledConn,
user_id: String,
limit: Option<u32>,
) -> StorageResult<Vec<Self>> {
let mut query = <Self as HasTable>::table()
.filter(dsl::user_id.eq(user_id))
.into_boxed();
if let Some(limit) = limit {
query = query.limit(limit.into());
}
router_env::logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
match generics::db_metrics::track_database_call::<Self, _, _>(
query.get_results_async(conn),
generics::db_metrics::DatabaseOperation::Filter,
)
.await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::NotFound => {
Err(report!(err)).change_context(errors::DatabaseError::NotFound)
}
_ => Err(report!(err)).change_context(errors::DatabaseError::Others),
},
}
}
}
| 2,528 | 873 |
hyperswitch | crates/diesel_models/src/query/events.rs | .rs | use diesel::{
associations::HasTable, BoolExpressionMethods, ExpressionMethods, NullableExpressionMethods,
};
use super::generics;
use crate::{
events::{Event, EventNew, EventUpdateInternal},
schema::events::dsl,
PgPooledConn, StorageResult,
};
impl EventNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Event> {
generics::generic_insert(conn, self).await
}
}
impl Event {
pub async fn find_by_merchant_id_event_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
event_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::event_id.eq(event_id.to_owned())),
)
.await
}
pub async fn list_initial_attempts_by_merchant_id_primary_object_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
primary_object_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::event_id
.nullable()
.eq(dsl::initial_attempt_id) // Filter initial attempts only
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::primary_object_id.eq(primary_object_id.to_owned())),
None,
None,
Some(dsl::created_at.desc()),
)
.await
}
pub async fn list_initial_attempts_by_merchant_id_constraints(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
created_after: time::PrimitiveDateTime,
created_before: time::PrimitiveDateTime,
limit: Option<i64>,
offset: Option<i64>,
is_delivered: Option<bool>,
) -> StorageResult<Vec<Self>> {
use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{debug_query, pg::Pg, QueryDsl};
use error_stack::ResultExt;
use router_env::logger;
use super::generics::db_metrics::{track_database_call, DatabaseOperation};
use crate::errors::DatabaseError;
let mut query = Self::table()
.filter(
dsl::event_id
.nullable()
.eq(dsl::initial_attempt_id) // Filter initial attempts only
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.order(dsl::created_at.desc())
.into_boxed();
query = Self::apply_filters(
query,
None,
(dsl::created_at, created_after, created_before),
limit,
offset,
is_delivered,
);
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<Self, _, _>(query.get_results_async(conn), DatabaseOperation::Filter)
.await
.change_context(DatabaseError::Others) // Query returns empty Vec when no records are found
.attach_printable("Error filtering events by constraints")
}
pub async fn list_by_merchant_id_initial_attempt_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
initial_attempt_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::initial_attempt_id.eq(initial_attempt_id.to_owned())),
None,
None,
Some(dsl::created_at.desc()),
)
.await
}
pub async fn list_initial_attempts_by_profile_id_primary_object_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
primary_object_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::event_id
.nullable()
.eq(dsl::initial_attempt_id) // Filter initial attempts only
.and(dsl::business_profile_id.eq(profile_id.to_owned()))
.and(dsl::primary_object_id.eq(primary_object_id.to_owned())),
None,
None,
Some(dsl::created_at.desc()),
)
.await
}
pub async fn list_initial_attempts_by_profile_id_constraints(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
created_after: time::PrimitiveDateTime,
created_before: time::PrimitiveDateTime,
limit: Option<i64>,
offset: Option<i64>,
is_delivered: Option<bool>,
) -> StorageResult<Vec<Self>> {
use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{debug_query, pg::Pg, QueryDsl};
use error_stack::ResultExt;
use router_env::logger;
use super::generics::db_metrics::{track_database_call, DatabaseOperation};
use crate::errors::DatabaseError;
let mut query = Self::table()
.filter(
dsl::event_id
.nullable()
.eq(dsl::initial_attempt_id) // Filter initial attempts only
.and(dsl::business_profile_id.eq(profile_id.to_owned())),
)
.order(dsl::created_at.desc())
.into_boxed();
query = Self::apply_filters(
query,
None,
(dsl::created_at, created_after, created_before),
limit,
offset,
is_delivered,
);
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<Self, _, _>(query.get_results_async(conn), DatabaseOperation::Filter)
.await
.change_context(DatabaseError::Others) // Query returns empty Vec when no records are found
.attach_printable("Error filtering events by constraints")
}
pub async fn list_by_profile_id_initial_attempt_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
initial_attempt_id: &str,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::business_profile_id
.eq(profile_id.to_owned())
.and(dsl::initial_attempt_id.eq(initial_attempt_id.to_owned())),
None,
None,
Some(dsl::created_at.desc()),
)
.await
}
pub async fn update_by_merchant_id_event_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
event_id: &str,
event: EventUpdateInternal,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::event_id.eq(event_id.to_owned())),
event,
)
.await
}
fn apply_filters<T>(
mut query: T,
profile_id: Option<common_utils::id_type::ProfileId>,
(column, created_after, created_before): (
dsl::created_at,
time::PrimitiveDateTime,
time::PrimitiveDateTime,
),
limit: Option<i64>,
offset: Option<i64>,
is_delivered: Option<bool>,
) -> T
where
T: diesel::query_dsl::methods::LimitDsl<Output = T>
+ diesel::query_dsl::methods::OffsetDsl<Output = T>,
T: diesel::query_dsl::methods::FilterDsl<
diesel::dsl::GtEq<dsl::created_at, time::PrimitiveDateTime>,
Output = T,
>,
T: diesel::query_dsl::methods::FilterDsl<
diesel::dsl::LtEq<dsl::created_at, time::PrimitiveDateTime>,
Output = T,
>,
T: diesel::query_dsl::methods::FilterDsl<
diesel::dsl::Eq<dsl::business_profile_id, common_utils::id_type::ProfileId>,
Output = T,
>,
T: diesel::query_dsl::methods::FilterDsl<
diesel::dsl::Eq<dsl::is_overall_delivery_successful, bool>,
Output = T,
>,
{
if let Some(profile_id) = profile_id {
query = query.filter(dsl::business_profile_id.eq(profile_id));
}
query = query
.filter(column.ge(created_after))
.filter(column.le(created_before));
if let Some(limit) = limit {
query = query.limit(limit);
}
if let Some(offset) = offset {
query = query.offset(offset);
}
if let Some(is_delivered) = is_delivered {
query = query.filter(dsl::is_overall_delivery_successful.eq(is_delivered));
}
query
}
pub async fn count_initial_attempts_by_constraints(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
profile_id: Option<common_utils::id_type::ProfileId>,
created_after: time::PrimitiveDateTime,
created_before: time::PrimitiveDateTime,
is_delivered: Option<bool>,
) -> StorageResult<i64> {
use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{debug_query, pg::Pg, QueryDsl};
use error_stack::ResultExt;
use router_env::logger;
use super::generics::db_metrics::{track_database_call, DatabaseOperation};
use crate::errors::DatabaseError;
let mut query = Self::table()
.count()
.filter(
dsl::event_id
.nullable()
.eq(dsl::initial_attempt_id) // Filter initial attempts only
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.into_boxed();
query = Self::apply_filters(
query,
profile_id,
(dsl::created_at, created_after, created_before),
None,
None,
is_delivered,
);
logger::debug!(query = %debug_query::<Pg, _>(&query).to_string());
track_database_call::<Self, _, _>(
query.get_result_async::<i64>(conn),
DatabaseOperation::Count,
)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error counting events by constraints")
}
}
| 2,372 | 874 |
hyperswitch | crates/diesel_models/src/query/payment_attempt.rs | .rs | use std::collections::HashSet;
use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{
associations::HasTable, debug_query, pg::Pg, BoolExpressionMethods, ExpressionMethods,
QueryDsl, Table,
};
use error_stack::{report, ResultExt};
use super::generics;
#[cfg(feature = "v1")]
use crate::schema::payment_attempt::dsl;
#[cfg(feature = "v2")]
use crate::schema_v2::payment_attempt::dsl;
use crate::{
enums::{self, IntentStatus},
errors::DatabaseError,
payment_attempt::{
PaymentAttempt, PaymentAttemptNew, PaymentAttemptUpdate, PaymentAttemptUpdateInternal,
},
query::generics::db_metrics,
PaymentIntent, PgPooledConn, StorageResult,
};
impl PaymentAttemptNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<PaymentAttempt> {
generics::generic_insert(conn, self).await
}
}
impl PaymentAttempt {
#[cfg(feature = "v1")]
pub async fn update_with_attempt_id(
self,
conn: &PgPooledConn,
payment_attempt: PaymentAttemptUpdate,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::attempt_id
.eq(self.attempt_id.to_owned())
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())),
PaymentAttemptUpdateInternal::from(payment_attempt).populate_derived_fields(&self),
)
.await
{
Err(error) => match error.current_context() {
DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
#[cfg(feature = "v2")]
pub async fn update_with_attempt_id(
self,
conn: &PgPooledConn,
payment_attempt: PaymentAttemptUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(conn, dsl::id.eq(self.id.to_owned()), payment_attempt)
.await
{
Err(error) => match error.current_context() {
DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
#[cfg(feature = "v1")]
pub async fn find_optional_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Option<Self>> {
generics::generic_find_one_optional::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_by_connector_transaction_id_payment_id_merchant_id(
conn: &PgPooledConn,
connector_transaction_id: &common_utils::types::ConnectorTransactionId,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::connector_transaction_id
.eq(connector_transaction_id.get_id().to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned()))
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_last_successful_attempt_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
// perform ordering on the application level instead of database level
generics::generic_filter::<<Self as HasTable>::Table, _, _, Self>(
conn,
dsl::payment_id
.eq(payment_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(dsl::status.eq(enums::AttemptStatus::Charged)),
Some(1),
None,
Some(dsl::modified_at.desc()),
)
.await?
.into_iter()
.nth(0)
.ok_or(report!(DatabaseError::NotFound))
}
#[cfg(feature = "v1")]
pub async fn find_last_successful_or_partially_captured_attempt_by_payment_id_merchant_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
// perform ordering on the application level instead of database level
generics::generic_filter::<<Self as HasTable>::Table, _, _, Self>(
conn,
dsl::payment_id
.eq(payment_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned()))
.and(
dsl::status
.eq(enums::AttemptStatus::Charged)
.or(dsl::status.eq(enums::AttemptStatus::PartialCharged)),
),
Some(1),
None,
Some(dsl::modified_at.desc()),
)
.await?
.into_iter()
.nth(0)
.ok_or(report!(DatabaseError::NotFound))
}
#[cfg(feature = "v1")]
pub async fn find_by_merchant_id_connector_txn_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
connector_txn_id: &str,
) -> StorageResult<Self> {
let (txn_id, txn_data) = common_utils::types::ConnectorTransactionId::form_id_and_data(
connector_txn_id.to_string(),
);
let connector_transaction_id = txn_id
.get_txn_id(txn_data.as_ref())
.change_context(DatabaseError::Others)
.attach_printable_lazy(|| {
format!(
"Failed to retrieve txn_id for ({:?}, {:?})",
txn_id, txn_data
)
})?;
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::connector_transaction_id.eq(connector_transaction_id.to_owned())),
)
.await
}
#[cfg(feature = "v2")]
pub async fn find_by_profile_id_connector_transaction_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
connector_txn_id: &str,
) -> StorageResult<Self> {
let (txn_id, txn_data) = common_utils::types::ConnectorTransactionId::form_id_and_data(
connector_txn_id.to_string(),
);
let connector_transaction_id = txn_id
.get_txn_id(txn_data.as_ref())
.change_context(DatabaseError::Others)
.attach_printable_lazy(|| {
format!(
"Failed to retrieve txn_id for ({:?}, {:?})",
txn_id, txn_data
)
})?;
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::connector_payment_id.eq(connector_transaction_id.to_owned())),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_by_merchant_id_attempt_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
attempt_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::attempt_id.eq(attempt_id.to_owned())),
)
.await
}
#[cfg(feature = "v2")]
pub async fn find_by_id(
conn: &PgPooledConn,
id: &common_utils::id_type::GlobalAttemptId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::id.eq(id.to_owned()),
)
.await
}
#[cfg(feature = "v2")]
pub async fn find_by_payment_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::GlobalPaymentId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::payment_id.eq(payment_id.to_owned()),
None,
None,
Some(dsl::created_at.asc()),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_by_merchant_id_preprocessing_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
preprocessing_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::preprocessing_step_id.eq(preprocessing_id.to_owned())),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_by_payment_id_merchant_id_attempt_id(
conn: &PgPooledConn,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
attempt_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::payment_id.eq(payment_id.to_owned()).and(
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::attempt_id.eq(attempt_id.to_owned())),
),
)
.await
}
#[cfg(feature = "v1")]
pub async fn find_by_merchant_id_payment_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::payment_id.eq(payment_id.to_owned())),
None,
None,
None,
)
.await
}
#[cfg(feature = "v1")]
pub async fn get_filters_for_payments(
conn: &PgPooledConn,
pi: &[PaymentIntent],
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<(
Vec<String>,
Vec<enums::Currency>,
Vec<IntentStatus>,
Vec<enums::PaymentMethod>,
Vec<enums::PaymentMethodType>,
Vec<enums::AuthenticationType>,
)> {
let active_attempts: Vec<String> = pi
.iter()
.map(|payment_intent| payment_intent.clone().active_attempt_id)
.collect();
let filter = <Self as HasTable>::table()
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dsl::attempt_id.eq_any(active_attempts));
let intent_status: Vec<IntentStatus> = pi
.iter()
.map(|payment_intent| payment_intent.status)
.collect::<HashSet<IntentStatus>>()
.into_iter()
.collect();
let filter_connector = filter
.clone()
.select(dsl::connector)
.distinct()
.get_results_async::<Option<String>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by connector")?
.into_iter()
.flatten()
.collect::<Vec<String>>();
let filter_currency = filter
.clone()
.select(dsl::currency)
.distinct()
.get_results_async::<Option<enums::Currency>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by currency")?
.into_iter()
.flatten()
.collect::<Vec<enums::Currency>>();
let filter_payment_method = filter
.clone()
.select(dsl::payment_method)
.distinct()
.get_results_async::<Option<enums::PaymentMethod>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by payment method")?
.into_iter()
.flatten()
.collect::<Vec<enums::PaymentMethod>>();
let filter_payment_method_type = filter
.clone()
.select(dsl::payment_method_type)
.distinct()
.get_results_async::<Option<enums::PaymentMethodType>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by payment method type")?
.into_iter()
.flatten()
.collect::<Vec<enums::PaymentMethodType>>();
let filter_authentication_type = filter
.clone()
.select(dsl::authentication_type)
.distinct()
.get_results_async::<Option<enums::AuthenticationType>>(conn)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering records by authentication type")?
.into_iter()
.flatten()
.collect::<Vec<enums::AuthenticationType>>();
Ok((
filter_connector,
filter_currency,
intent_status,
filter_payment_method,
filter_payment_method_type,
filter_authentication_type,
))
}
#[cfg(feature = "v2")]
#[allow(clippy::too_many_arguments)]
pub async fn get_total_count_of_attempts(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
active_attempt_ids: &[String],
connector: Option<String>,
payment_method_type: Option<enums::PaymentMethod>,
payment_method_subtype: Option<enums::PaymentMethodType>,
authentication_type: Option<enums::AuthenticationType>,
merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
card_network: Option<enums::CardNetwork>,
) -> StorageResult<i64> {
let mut filter = <Self as HasTable>::table()
.count()
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dsl::id.eq_any(active_attempt_ids.to_owned()))
.into_boxed();
if let Some(connector) = connector {
filter = filter.filter(dsl::connector.eq(connector));
}
if let Some(payment_method_type) = payment_method_type {
filter = filter.filter(dsl::payment_method_type_v2.eq(payment_method_type));
}
if let Some(payment_method_subtype) = payment_method_subtype {
filter = filter.filter(dsl::payment_method_subtype.eq(payment_method_subtype));
}
if let Some(authentication_type) = authentication_type {
filter = filter.filter(dsl::authentication_type.eq(authentication_type));
}
if let Some(merchant_connector_id) = merchant_connector_id {
filter = filter.filter(dsl::merchant_connector_id.eq(merchant_connector_id))
}
if let Some(card_network) = card_network {
filter = filter.filter(dsl::card_network.eq(card_network))
}
router_env::logger::debug!(query = %debug_query::<Pg, _>(&filter).to_string());
// TODO: Remove these logs after debugging the issue for delay in count query
let start_time = std::time::Instant::now();
router_env::logger::debug!("Executing count query start_time: {:?}", start_time);
let result = db_metrics::track_database_call::<<Self as HasTable>::Table, _, _>(
filter.get_result_async::<i64>(conn),
db_metrics::DatabaseOperation::Filter,
)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering count of payments");
let duration = start_time.elapsed();
router_env::logger::debug!("Completed count query in {:?}", duration);
result
}
#[cfg(feature = "v1")]
#[allow(clippy::too_many_arguments)]
pub async fn get_total_count_of_attempts(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
active_attempt_ids: &[String],
connector: Option<Vec<String>>,
payment_method: Option<Vec<enums::PaymentMethod>>,
payment_method_type: Option<Vec<enums::PaymentMethodType>>,
authentication_type: Option<Vec<enums::AuthenticationType>>,
merchant_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
card_network: Option<Vec<enums::CardNetwork>>,
card_discovery: Option<Vec<enums::CardDiscovery>>,
) -> StorageResult<i64> {
let mut filter = <Self as HasTable>::table()
.count()
.filter(dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dsl::attempt_id.eq_any(active_attempt_ids.to_owned()))
.into_boxed();
if let Some(connector) = connector {
filter = filter.filter(dsl::connector.eq_any(connector));
}
if let Some(payment_method) = payment_method {
filter = filter.filter(dsl::payment_method.eq_any(payment_method));
}
if let Some(payment_method_type) = payment_method_type {
filter = filter.filter(dsl::payment_method_type.eq_any(payment_method_type));
}
if let Some(authentication_type) = authentication_type {
filter = filter.filter(dsl::authentication_type.eq_any(authentication_type));
}
if let Some(merchant_connector_id) = merchant_connector_id {
filter = filter.filter(dsl::merchant_connector_id.eq_any(merchant_connector_id))
}
if let Some(card_network) = card_network {
filter = filter.filter(dsl::card_network.eq_any(card_network))
}
if let Some(card_discovery) = card_discovery {
filter = filter.filter(dsl::card_discovery.eq_any(card_discovery))
}
router_env::logger::debug!(query = %debug_query::<Pg, _>(&filter).to_string());
// TODO: Remove these logs after debugging the issue for delay in count query
let start_time = std::time::Instant::now();
router_env::logger::debug!("Executing count query start_time: {:?}", start_time);
let result = db_metrics::track_database_call::<<Self as HasTable>::Table, _, _>(
filter.get_result_async::<i64>(conn),
db_metrics::DatabaseOperation::Filter,
)
.await
.change_context(DatabaseError::Others)
.attach_printable("Error filtering count of payments");
let duration = start_time.elapsed();
router_env::logger::debug!("Completed count query in {:?}", duration);
result
}
}
| 4,245 | 875 |
hyperswitch | crates/diesel_models/src/query/reverse_lookup.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
reverse_lookup::{ReverseLookup, ReverseLookupNew},
schema::reverse_lookup::dsl,
PgPooledConn, StorageResult,
};
impl ReverseLookupNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<ReverseLookup> {
generics::generic_insert(conn, self).await
}
pub async fn batch_insert(
reverse_lookups: Vec<Self>,
conn: &PgPooledConn,
) -> StorageResult<()> {
generics::generic_insert::<_, _, ReverseLookup>(conn, reverse_lookups).await?;
Ok(())
}
}
impl ReverseLookup {
pub async fn find_by_lookup_id(lookup_id: &str, conn: &PgPooledConn) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::lookup_id.eq(lookup_id.to_owned()),
)
.await
}
}
| 223 | 876 |
hyperswitch | crates/diesel_models/src/query/configs.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
configs::{Config, ConfigNew, ConfigUpdate, ConfigUpdateInternal},
errors,
schema::configs::dsl,
PgPooledConn, StorageResult,
};
impl ConfigNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Config> {
generics::generic_insert(conn, self).await
}
}
impl Config {
pub async fn find_by_key(conn: &PgPooledConn, key: &str) -> StorageResult<Self> {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, key.to_owned()).await
}
pub async fn update_by_key(
conn: &PgPooledConn,
key: &str,
config_update: ConfigUpdate,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
key.to_owned(),
ConfigUpdateInternal::from(config_update),
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(
conn,
key.to_owned(),
)
.await
}
_ => Err(error),
},
result => result,
}
}
pub async fn delete_by_key(conn: &PgPooledConn, key: &str) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::key.eq(key.to_owned()),
)
.await
}
}
| 380 | 877 |
hyperswitch | crates/diesel_models/src/query/business_profile.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods, Table};
use super::generics;
#[cfg(feature = "v1")]
use crate::schema::business_profile::dsl::{self, profile_id as dsl_identifier};
#[cfg(feature = "v2")]
use crate::schema_v2::business_profile::dsl::{self, id as dsl_identifier};
use crate::{
business_profile::{Profile, ProfileNew, ProfileUpdateInternal},
errors, PgPooledConn, StorageResult,
};
impl ProfileNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Profile> {
generics::generic_insert(conn, self).await
}
}
impl Profile {
pub async fn update_by_profile_id(
self,
conn: &PgPooledConn,
business_profile: ProfileUpdateInternal,
) -> StorageResult<Self> {
match generics::generic_update_by_id::<<Self as HasTable>::Table, _, _, _>(
conn,
self.get_id().to_owned(),
business_profile,
)
.await
{
Err(error) => match error.current_context() {
errors::DatabaseError::NoFieldsToUpdate => Ok(self),
_ => Err(error),
},
result => result,
}
}
pub async fn find_by_profile_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl_identifier.eq(profile_id.to_owned()),
)
.await
}
pub async fn find_by_merchant_id_profile_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
profile_id: &common_utils::id_type::ProfileId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl_identifier.eq(profile_id.to_owned())),
)
.await
}
pub async fn find_by_profile_name_merchant_id(
conn: &PgPooledConn,
profile_name: &str,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::profile_name
.eq(profile_name.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.await
}
pub async fn list_profile_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<
<Self as HasTable>::Table,
_,
<<Self as HasTable>::Table as Table>::PrimaryKey,
_,
>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
None,
None,
None,
)
.await
}
pub async fn delete_by_profile_id_merchant_id(
conn: &PgPooledConn,
profile_id: &common_utils::id_type::ProfileId,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<bool> {
generics::generic_delete::<<Self as HasTable>::Table, _>(
conn,
dsl_identifier
.eq(profile_id.to_owned())
.and(dsl::merchant_id.eq(merchant_id.to_owned())),
)
.await
}
}
| 801 | 878 |
hyperswitch | crates/diesel_models/src/query/blocklist.rs | .rs | use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
blocklist::{Blocklist, BlocklistNew},
schema::blocklist::dsl,
PgPooledConn, StorageResult,
};
impl BlocklistNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Blocklist> {
generics::generic_insert(conn, self).await
}
}
impl Blocklist {
pub async fn find_by_merchant_id_fingerprint_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
fingerprint_id: &str,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::fingerprint_id.eq(fingerprint_id.to_owned())),
)
.await
}
pub async fn list_by_merchant_id_data_kind(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
data_kind: common_enums::BlocklistDataKind,
limit: i64,
offset: i64,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::data_kind.eq(data_kind.to_owned())),
Some(limit),
Some(offset),
Some(dsl::created_at.desc()),
)
.await
}
pub async fn list_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<Self>> {
generics::generic_filter::<<Self as HasTable>::Table, _, _, _>(
conn,
dsl::merchant_id.eq(merchant_id.to_owned()),
None,
None,
Some(dsl::created_at.desc()),
)
.await
}
pub async fn delete_by_merchant_id_fingerprint_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
fingerprint_id: &str,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::fingerprint_id.eq(fingerprint_id.to_owned())),
)
.await
}
}
| 572 | 879 |
hyperswitch | crates/diesel_models/src/query/cards_info.rs | .rs | use diesel::{associations::HasTable, ExpressionMethods};
use error_stack::report;
use crate::{
cards_info::{CardInfo, UpdateCardInfo},
errors,
query::generics,
schema::cards_info::dsl,
PgPooledConn, StorageResult,
};
impl CardInfo {
pub async fn find_by_iin(conn: &PgPooledConn, card_iin: &str) -> StorageResult<Option<Self>> {
generics::generic_find_by_id_optional::<<Self as HasTable>::Table, _, _>(
conn,
card_iin.to_owned(),
)
.await
}
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Self> {
generics::generic_insert(conn, self).await
}
pub async fn update(
conn: &PgPooledConn,
card_iin: String,
data: UpdateCardInfo,
) -> StorageResult<Self> {
generics::generic_update_with_results::<<Self as HasTable>::Table, UpdateCardInfo, _, _>(
conn,
dsl::card_iin.eq(card_iin),
data,
)
.await?
.first()
.cloned()
.ok_or_else(|| {
report!(errors::DatabaseError::NotFound)
.attach_printable("Error while updating card_info entry")
})
}
}
| 293 | 880 |
hyperswitch | crates/diesel_models/src/query/role.rs | .rs | use async_bb8_diesel::AsyncRunQueryDsl;
use common_enums::EntityType;
use common_utils::id_type;
use diesel::{
associations::HasTable, debug_query, pg::Pg, result::Error as DieselError,
BoolExpressionMethods, ExpressionMethods, QueryDsl,
};
use error_stack::{report, ResultExt};
use strum::IntoEnumIterator;
use crate::{
enums::RoleScope, errors, query::generics, role::*, schema::roles::dsl, PgPooledConn,
StorageResult,
};
impl RoleNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Role> {
generics::generic_insert(conn, self).await
}
}
impl Role {
fn get_entity_list(
current_entity: EntityType,
is_lineage_data_required: bool,
) -> Vec<EntityType> {
is_lineage_data_required
.then(|| {
EntityType::iter()
.filter(|variant| *variant <= current_entity)
.collect()
})
.unwrap_or(vec![current_entity])
}
pub async fn find_by_role_id(conn: &PgPooledConn, role_id: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::role_id.eq(role_id.to_owned()),
)
.await
}
pub async fn find_by_role_id_in_lineage(
conn: &PgPooledConn,
role_id: &str,
merchant_id: &id_type::MerchantId,
org_id: &id_type::OrganizationId,
profile_id: &id_type::ProfileId,
tenant_id: &id_type::TenantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::role_id
.eq(role_id.to_owned())
.and(dsl::tenant_id.eq(tenant_id.to_owned()))
.and(dsl::org_id.eq(org_id.to_owned()))
.and(
dsl::scope
.eq(RoleScope::Organization)
.or(dsl::merchant_id
.eq(merchant_id.to_owned())
.and(dsl::scope.eq(RoleScope::Merchant)))
.or(dsl::profile_id
.eq(profile_id.to_owned())
.and(dsl::scope.eq(RoleScope::Profile))),
),
)
.await
}
pub async fn find_by_role_id_org_id_tenant_id(
conn: &PgPooledConn,
role_id: &str,
org_id: &id_type::OrganizationId,
tenant_id: &id_type::TenantId,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::role_id
.eq(role_id.to_owned())
.and(dsl::tenant_id.eq(tenant_id.to_owned()))
.and(dsl::org_id.eq(org_id.to_owned())),
)
.await
}
pub async fn update_by_role_id(
conn: &PgPooledConn,
role_id: &str,
role_update: RoleUpdate,
) -> StorageResult<Self> {
generics::generic_update_with_unique_predicate_get_result::<
<Self as HasTable>::Table,
_,
_,
_,
>(
conn,
dsl::role_id.eq(role_id.to_owned()),
RoleUpdateInternal::from(role_update),
)
.await
}
pub async fn delete_by_role_id(conn: &PgPooledConn, role_id: &str) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::role_id.eq(role_id.to_owned()),
)
.await
}
//TODO: Remove once generic_list_roles_by_entity_type is stable
pub async fn generic_roles_list_for_org(
conn: &PgPooledConn,
tenant_id: id_type::TenantId,
org_id: id_type::OrganizationId,
merchant_id: Option<id_type::MerchantId>,
entity_type: Option<EntityType>,
limit: Option<u32>,
) -> StorageResult<Vec<Self>> {
let mut query = <Self as HasTable>::table()
.filter(dsl::tenant_id.eq(tenant_id).and(dsl::org_id.eq(org_id)))
.into_boxed();
if let Some(merchant_id) = merchant_id {
query = query.filter(
(dsl::merchant_id
.eq(merchant_id)
.and(dsl::scope.eq(RoleScope::Merchant)))
.or(dsl::scope.eq(RoleScope::Organization)),
);
}
if let Some(entity_type) = entity_type {
query = query.filter(dsl::entity_type.eq(entity_type))
}
if let Some(limit) = limit {
query = query.limit(limit.into());
}
router_env::logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
match generics::db_metrics::track_database_call::<Self, _, _>(
query.get_results_async(conn),
generics::db_metrics::DatabaseOperation::Filter,
)
.await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::NotFound => {
Err(report!(err)).change_context(errors::DatabaseError::NotFound)
}
_ => Err(report!(err)).change_context(errors::DatabaseError::Others),
},
}
}
pub async fn generic_list_roles_by_entity_type(
conn: &PgPooledConn,
payload: ListRolesByEntityPayload,
is_lineage_data_required: bool,
tenant_id: id_type::TenantId,
org_id: id_type::OrganizationId,
) -> StorageResult<Vec<Self>> {
let mut query = <Self as HasTable>::table()
.into_boxed()
.filter(dsl::tenant_id.eq(tenant_id))
.filter(dsl::org_id.eq(org_id));
match payload {
ListRolesByEntityPayload::Organization => {
let entity_in_vec =
Self::get_entity_list(EntityType::Organization, is_lineage_data_required);
query = query.filter(dsl::entity_type.eq_any(entity_in_vec))
}
ListRolesByEntityPayload::Merchant(merchant_id) => {
let entity_in_vec =
Self::get_entity_list(EntityType::Merchant, is_lineage_data_required);
query = query
.filter(
dsl::scope
.eq(RoleScope::Organization)
.or(dsl::merchant_id.eq(merchant_id)),
)
.filter(dsl::entity_type.eq_any(entity_in_vec))
}
ListRolesByEntityPayload::Profile(merchant_id, profile_id) => {
let entity_in_vec =
Self::get_entity_list(EntityType::Profile, is_lineage_data_required);
query = query
.filter(
dsl::scope
.eq(RoleScope::Organization)
.or(dsl::scope
.eq(RoleScope::Merchant)
.and(dsl::merchant_id.eq(merchant_id.clone())))
.or(dsl::profile_id.eq(profile_id)),
)
.filter(dsl::entity_type.eq_any(entity_in_vec))
}
};
router_env::logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
match generics::db_metrics::track_database_call::<Self, _, _>(
query.get_results_async(conn),
generics::db_metrics::DatabaseOperation::Filter,
)
.await
{
Ok(value) => Ok(value),
Err(err) => Err(report!(err)).change_context(errors::DatabaseError::Others),
}
}
}
| 1,690 | 881 |
hyperswitch | crates/diesel_models/src/query/user/sample_data.rs | .rs | use async_bb8_diesel::AsyncRunQueryDsl;
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use error_stack::ResultExt;
use router_env::logger;
#[cfg(feature = "v1")]
use crate::schema::{
payment_attempt::dsl as payment_attempt_dsl, payment_intent::dsl as payment_intent_dsl,
refund::dsl as refund_dsl,
};
#[cfg(feature = "v2")]
use crate::schema_v2::{
payment_attempt::dsl as payment_attempt_dsl, payment_intent::dsl as payment_intent_dsl,
refund::dsl as refund_dsl,
};
use crate::{
errors, schema::dispute::dsl as dispute_dsl, user, Dispute, DisputeNew, PaymentAttempt,
PaymentIntent, PaymentIntentNew, PgPooledConn, Refund, RefundNew, StorageResult,
};
#[cfg(feature = "v1")]
pub async fn insert_payment_intents(
conn: &PgPooledConn,
batch: Vec<PaymentIntentNew>,
) -> StorageResult<Vec<PaymentIntent>> {
let query = diesel::insert_into(<PaymentIntent>::table()).values(batch);
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while inserting payment intents")
}
#[cfg(feature = "v1")]
pub async fn insert_payment_attempts(
conn: &PgPooledConn,
batch: Vec<user::sample_data::PaymentAttemptBatchNew>,
) -> StorageResult<Vec<PaymentAttempt>> {
let query = diesel::insert_into(<PaymentAttempt>::table()).values(batch);
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while inserting payment attempts")
}
pub async fn insert_refunds(
conn: &PgPooledConn,
batch: Vec<RefundNew>,
) -> StorageResult<Vec<Refund>> {
let query = diesel::insert_into(<Refund>::table()).values(batch);
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while inserting refunds")
}
pub async fn insert_disputes(
conn: &PgPooledConn,
batch: Vec<DisputeNew>,
) -> StorageResult<Vec<Dispute>> {
let query = diesel::insert_into(<Dispute>::table()).values(batch);
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while inserting disputes")
}
#[cfg(feature = "v1")]
pub async fn delete_payment_intents(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<PaymentIntent>> {
let query = diesel::delete(<PaymentIntent>::table())
.filter(payment_intent_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(payment_intent_dsl::payment_id.like("test_%"));
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while deleting payment intents")
.and_then(|result| match result.len() {
n if n > 0 => {
logger::debug!("{n} records deleted");
Ok(result)
}
0 => Err(error_stack::report!(errors::DatabaseError::NotFound)
.attach_printable("No records deleted")),
_ => Ok(result),
})
}
#[cfg(feature = "v2")]
pub async fn delete_payment_intents(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<PaymentIntent>> {
let query = diesel::delete(<PaymentIntent>::table())
.filter(payment_intent_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(payment_intent_dsl::merchant_reference_id.like("test_%"));
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while deleting payment intents")
.and_then(|result| match result.len() {
n if n > 0 => {
logger::debug!("{n} records deleted");
Ok(result)
}
0 => Err(error_stack::report!(errors::DatabaseError::NotFound)
.attach_printable("No records deleted")),
_ => Ok(result),
})
}
pub async fn delete_payment_attempts(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<PaymentAttempt>> {
let query = diesel::delete(<PaymentAttempt>::table())
.filter(payment_attempt_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(payment_attempt_dsl::payment_id.like("test_%"));
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while deleting payment attempts")
.and_then(|result| match result.len() {
n if n > 0 => {
logger::debug!("{n} records deleted");
Ok(result)
}
0 => Err(error_stack::report!(errors::DatabaseError::NotFound)
.attach_printable("No records deleted")),
_ => Ok(result),
})
}
pub async fn delete_refunds(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<Refund>> {
let query = diesel::delete(<Refund>::table())
.filter(refund_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(refund_dsl::payment_id.like("test_%"));
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while deleting refunds")
.and_then(|result| match result.len() {
n if n > 0 => {
logger::debug!("{n} records deleted");
Ok(result)
}
0 => Err(error_stack::report!(errors::DatabaseError::NotFound)
.attach_printable("No records deleted")),
_ => Ok(result),
})
}
pub async fn delete_disputes(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
) -> StorageResult<Vec<Dispute>> {
let query = diesel::delete(<Dispute>::table())
.filter(dispute_dsl::merchant_id.eq(merchant_id.to_owned()))
.filter(dispute_dsl::dispute_id.like("test_%"));
logger::debug!(query = %debug_query::<diesel::pg::Pg,_>(&query).to_string());
query
.get_results_async(conn)
.await
.change_context(errors::DatabaseError::Others)
.attach_printable("Error while deleting disputes")
.and_then(|result| match result.len() {
n if n > 0 => {
logger::debug!("{n} records deleted");
Ok(result)
}
0 => Err(error_stack::report!(errors::DatabaseError::NotFound)
.attach_printable("No records deleted")),
_ => Ok(result),
})
}
| 1,780 | 882 |
hyperswitch | crates/diesel_models/src/query/user/theme.rs | .rs | use async_bb8_diesel::AsyncRunQueryDsl;
use common_utils::types::theme::ThemeLineage;
use diesel::{
associations::HasTable,
debug_query,
pg::Pg,
result::Error as DieselError,
sql_types::{Bool, Nullable},
BoolExpressionMethods, ExpressionMethods, NullableExpressionMethods, QueryDsl,
};
use error_stack::{report, ResultExt};
use router_env::logger;
use crate::{
errors::DatabaseError,
query::generics::{
self,
db_metrics::{track_database_call, DatabaseOperation},
},
schema::themes::dsl,
user::theme::{Theme, ThemeNew},
PgPooledConn, StorageResult,
};
impl ThemeNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<Theme> {
generics::generic_insert(conn, self).await
}
}
impl Theme {
fn lineage_filter(
lineage: ThemeLineage,
) -> Box<
dyn diesel::BoxableExpression<<Self as HasTable>::Table, Pg, SqlType = Nullable<Bool>>
+ 'static,
> {
match lineage {
ThemeLineage::Tenant { tenant_id } => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.is_null())
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null())
.nullable(),
),
ThemeLineage::Organization { tenant_id, org_id } => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.is_null())
.and(dsl::profile_id.is_null()),
),
ThemeLineage::Merchant {
tenant_id,
org_id,
merchant_id,
} => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::profile_id.is_null()),
),
ThemeLineage::Profile {
tenant_id,
org_id,
merchant_id,
profile_id,
} => Box::new(
dsl::tenant_id
.eq(tenant_id)
.and(dsl::org_id.eq(org_id))
.and(dsl::merchant_id.eq(merchant_id))
.and(dsl::profile_id.eq(profile_id)),
),
}
}
pub async fn find_by_theme_id(conn: &PgPooledConn, theme_id: String) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::theme_id.eq(theme_id),
)
.await
}
pub async fn find_most_specific_theme_in_lineage(
conn: &PgPooledConn,
lineage: ThemeLineage,
) -> StorageResult<Self> {
let query = <Self as HasTable>::table().into_boxed();
let query =
lineage
.get_same_and_higher_lineages()
.into_iter()
.fold(query, |mut query, lineage| {
query = query.or_filter(Self::lineage_filter(lineage));
query
});
logger::debug!(query = %debug_query::<Pg,_>(&query).to_string());
let data: Vec<Self> = match track_database_call::<Self, _, _>(
query.get_results_async(conn),
DatabaseOperation::Filter,
)
.await
{
Ok(value) => Ok(value),
Err(err) => match err {
DieselError::NotFound => Err(report!(err)).change_context(DatabaseError::NotFound),
_ => Err(report!(err)).change_context(DatabaseError::Others),
},
}?;
data.into_iter()
.min_by_key(|theme| theme.entity_type)
.ok_or(report!(DatabaseError::NotFound))
}
pub async fn find_by_lineage(
conn: &PgPooledConn,
lineage: ThemeLineage,
) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
Self::lineage_filter(lineage),
)
.await
}
pub async fn delete_by_theme_id_and_lineage(
conn: &PgPooledConn,
theme_id: String,
lineage: ThemeLineage,
) -> StorageResult<Self> {
generics::generic_delete_one_with_result::<<Self as HasTable>::Table, _, _>(
conn,
dsl::theme_id
.eq(theme_id)
.and(Self::lineage_filter(lineage)),
)
.await
}
}
| 1,028 | 883 |
hyperswitch | crates/diesel_models/src/user/sample_data.rs | .rs | use common_enums::{
AttemptStatus, AuthenticationType, CaptureMethod, Currency, PaymentExperience, PaymentMethod,
PaymentMethodType,
};
use common_types::primitive_wrappers::{
ExtendedAuthorizationAppliedBool, RequestExtendedAuthorizationBool,
};
use common_utils::types::{ConnectorTransactionId, MinorUnit};
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
#[cfg(feature = "v1")]
use crate::schema::payment_attempt;
#[cfg(feature = "v2")]
use crate::schema_v2::payment_attempt;
use crate::{
enums::{MandateDataType, MandateDetails},
ConnectorMandateReferenceId, PaymentAttemptNew,
};
// #[cfg(feature = "v2")]
// #[derive(
// Clone, Debug, diesel::Insertable, router_derive::DebugAsDisplay, Serialize, Deserialize,
// )]
// #[diesel(table_name = payment_attempt)]
// pub struct PaymentAttemptBatchNew {
// pub payment_id: common_utils::id_type::PaymentId,
// pub merchant_id: common_utils::id_type::MerchantId,
// pub status: AttemptStatus,
// pub error_message: Option<String>,
// pub surcharge_amount: Option<i64>,
// pub tax_on_surcharge: Option<i64>,
// pub payment_method_id: Option<String>,
// pub authentication_type: Option<AuthenticationType>,
// #[serde(with = "common_utils::custom_serde::iso8601")]
// pub created_at: PrimitiveDateTime,
// #[serde(with = "common_utils::custom_serde::iso8601")]
// pub modified_at: PrimitiveDateTime,
// #[serde(default, with = "common_utils::custom_serde::iso8601::option")]
// pub last_synced: Option<PrimitiveDateTime>,
// pub cancellation_reason: Option<String>,
// pub browser_info: Option<serde_json::Value>,
// pub payment_token: Option<String>,
// pub error_code: Option<String>,
// pub connector_metadata: Option<serde_json::Value>,
// pub payment_experience: Option<PaymentExperience>,
// pub payment_method_data: Option<serde_json::Value>,
// pub preprocessing_step_id: Option<String>,
// pub error_reason: Option<String>,
// pub connector_response_reference_id: Option<String>,
// pub multiple_capture_count: Option<i16>,
// pub amount_capturable: i64,
// pub updated_by: String,
// pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
// pub authentication_data: Option<serde_json::Value>,
// pub encoded_data: Option<String>,
// pub unified_code: Option<String>,
// pub unified_message: Option<String>,
// pub net_amount: Option<i64>,
// pub external_three_ds_authentication_attempted: Option<bool>,
// pub authentication_connector: Option<String>,
// pub authentication_id: Option<String>,
// pub fingerprint_id: Option<String>,
// pub charge_id: Option<String>,
// pub client_source: Option<String>,
// pub client_version: Option<String>,
// pub customer_acceptance: Option<common_utils::pii::SecretSerdeValue>,
// pub profile_id: common_utils::id_type::ProfileId,
// pub organization_id: common_utils::id_type::OrganizationId,
// }
// #[cfg(feature = "v2")]
// #[allow(dead_code)]
// impl PaymentAttemptBatchNew {
// // Used to verify compatibility with PaymentAttemptTable
// fn convert_into_normal_attempt_insert(self) -> PaymentAttemptNew {
// // PaymentAttemptNew {
// // payment_id: self.payment_id,
// // merchant_id: self.merchant_id,
// // status: self.status,
// // error_message: self.error_message,
// // surcharge_amount: self.surcharge_amount,
// // tax_amount: self.tax_amount,
// // payment_method_id: self.payment_method_id,
// // confirm: self.confirm,
// // authentication_type: self.authentication_type,
// // created_at: self.created_at,
// // modified_at: self.modified_at,
// // last_synced: self.last_synced,
// // cancellation_reason: self.cancellation_reason,
// // browser_info: self.browser_info,
// // payment_token: self.payment_token,
// // error_code: self.error_code,
// // connector_metadata: self.connector_metadata,
// // payment_experience: self.payment_experience,
// // card_network: self
// // .payment_method_data
// // .as_ref()
// // .and_then(|data| data.as_object())
// // .and_then(|card| card.get("card"))
// // .and_then(|v| v.as_object())
// // .and_then(|v| v.get("card_network"))
// // .and_then(|network| network.as_str())
// // .map(|network| network.to_string()),
// // payment_method_data: self.payment_method_data,
// // straight_through_algorithm: self.straight_through_algorithm,
// // preprocessing_step_id: self.preprocessing_step_id,
// // error_reason: self.error_reason,
// // multiple_capture_count: self.multiple_capture_count,
// // connector_response_reference_id: self.connector_response_reference_id,
// // amount_capturable: self.amount_capturable,
// // updated_by: self.updated_by,
// // merchant_connector_id: self.merchant_connector_id,
// // authentication_data: self.authentication_data,
// // encoded_data: self.encoded_data,
// // unified_code: self.unified_code,
// // unified_message: self.unified_message,
// // net_amount: self.net_amount,
// // external_three_ds_authentication_attempted: self
// // .external_three_ds_authentication_attempted,
// // authentication_connector: self.authentication_connector,
// // authentication_id: self.authentication_id,
// // payment_method_billing_address_id: self.payment_method_billing_address_id,
// // fingerprint_id: self.fingerprint_id,
// // charge_id: self.charge_id,
// // client_source: self.client_source,
// // client_version: self.client_version,
// // customer_acceptance: self.customer_acceptance,
// // profile_id: self.profile_id,
// // organization_id: self.organization_id,
// // }
// todo!()
// }
// }
#[cfg(feature = "v1")]
#[derive(
Clone, Debug, diesel::Insertable, router_derive::DebugAsDisplay, Serialize, Deserialize,
)]
#[diesel(table_name = payment_attempt)]
pub struct PaymentAttemptBatchNew {
pub payment_id: common_utils::id_type::PaymentId,
pub merchant_id: common_utils::id_type::MerchantId,
pub attempt_id: String,
pub status: AttemptStatus,
pub amount: MinorUnit,
pub currency: Option<Currency>,
pub save_to_locker: Option<bool>,
pub connector: Option<String>,
pub error_message: Option<String>,
pub offer_amount: Option<MinorUnit>,
pub surcharge_amount: Option<MinorUnit>,
pub tax_amount: Option<MinorUnit>,
pub payment_method_id: Option<String>,
pub payment_method: Option<PaymentMethod>,
pub capture_method: Option<CaptureMethod>,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub capture_on: Option<PrimitiveDateTime>,
pub confirm: bool,
pub authentication_type: Option<AuthenticationType>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub modified_at: PrimitiveDateTime,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub last_synced: Option<PrimitiveDateTime>,
pub cancellation_reason: Option<String>,
pub amount_to_capture: Option<MinorUnit>,
pub mandate_id: Option<String>,
pub browser_info: Option<serde_json::Value>,
pub payment_token: Option<String>,
pub error_code: Option<String>,
pub connector_metadata: Option<serde_json::Value>,
pub payment_experience: Option<PaymentExperience>,
pub payment_method_type: Option<PaymentMethodType>,
pub payment_method_data: Option<serde_json::Value>,
pub business_sub_label: Option<String>,
pub straight_through_algorithm: Option<serde_json::Value>,
pub preprocessing_step_id: Option<String>,
pub mandate_details: Option<MandateDataType>,
pub error_reason: Option<String>,
pub connector_response_reference_id: Option<String>,
pub connector_transaction_id: Option<ConnectorTransactionId>,
pub multiple_capture_count: Option<i16>,
pub amount_capturable: MinorUnit,
pub updated_by: String,
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
pub authentication_data: Option<serde_json::Value>,
pub encoded_data: Option<String>,
pub unified_code: Option<String>,
pub unified_message: Option<String>,
pub net_amount: Option<MinorUnit>,
pub external_three_ds_authentication_attempted: Option<bool>,
pub authentication_connector: Option<String>,
pub authentication_id: Option<String>,
pub mandate_data: Option<MandateDetails>,
pub payment_method_billing_address_id: Option<String>,
pub fingerprint_id: Option<String>,
pub charge_id: Option<String>,
pub client_source: Option<String>,
pub client_version: Option<String>,
pub customer_acceptance: Option<common_utils::pii::SecretSerdeValue>,
pub profile_id: common_utils::id_type::ProfileId,
pub organization_id: common_utils::id_type::OrganizationId,
pub shipping_cost: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
pub processor_transaction_data: Option<String>,
pub connector_mandate_detail: Option<ConnectorMandateReferenceId>,
pub request_extended_authorization: Option<RequestExtendedAuthorizationBool>,
pub extended_authorization_applied: Option<ExtendedAuthorizationAppliedBool>,
pub capture_before: Option<PrimitiveDateTime>,
pub card_discovery: Option<common_enums::CardDiscovery>,
}
#[cfg(feature = "v1")]
#[allow(dead_code)]
impl PaymentAttemptBatchNew {
// Used to verify compatibility with PaymentAttemptTable
fn convert_into_normal_attempt_insert(self) -> PaymentAttemptNew {
PaymentAttemptNew {
payment_id: self.payment_id,
merchant_id: self.merchant_id,
attempt_id: self.attempt_id,
status: self.status,
amount: self.amount,
currency: self.currency,
save_to_locker: self.save_to_locker,
connector: self.connector,
error_message: self.error_message,
offer_amount: self.offer_amount,
surcharge_amount: self.surcharge_amount,
tax_amount: self.tax_amount,
payment_method_id: self.payment_method_id,
payment_method: self.payment_method,
capture_method: self.capture_method,
capture_on: self.capture_on,
confirm: self.confirm,
authentication_type: self.authentication_type,
created_at: self.created_at,
modified_at: self.modified_at,
last_synced: self.last_synced,
cancellation_reason: self.cancellation_reason,
amount_to_capture: self.amount_to_capture,
mandate_id: self.mandate_id,
browser_info: self.browser_info,
payment_token: self.payment_token,
error_code: self.error_code,
connector_metadata: self.connector_metadata,
payment_experience: self.payment_experience,
payment_method_type: self.payment_method_type,
card_network: self
.payment_method_data
.as_ref()
.and_then(|data| data.as_object())
.and_then(|card| card.get("card"))
.and_then(|v| v.as_object())
.and_then(|v| v.get("card_network"))
.and_then(|network| network.as_str())
.map(|network| network.to_string()),
payment_method_data: self.payment_method_data,
business_sub_label: self.business_sub_label,
straight_through_algorithm: self.straight_through_algorithm,
preprocessing_step_id: self.preprocessing_step_id,
mandate_details: self.mandate_details,
error_reason: self.error_reason,
multiple_capture_count: self.multiple_capture_count,
connector_response_reference_id: self.connector_response_reference_id,
amount_capturable: self.amount_capturable,
updated_by: self.updated_by,
merchant_connector_id: self.merchant_connector_id,
authentication_data: self.authentication_data,
encoded_data: self.encoded_data,
unified_code: self.unified_code,
unified_message: self.unified_message,
net_amount: self.net_amount,
external_three_ds_authentication_attempted: self
.external_three_ds_authentication_attempted,
authentication_connector: self.authentication_connector,
authentication_id: self.authentication_id,
mandate_data: self.mandate_data,
payment_method_billing_address_id: self.payment_method_billing_address_id,
fingerprint_id: self.fingerprint_id,
client_source: self.client_source,
client_version: self.client_version,
customer_acceptance: self.customer_acceptance,
profile_id: self.profile_id,
organization_id: self.organization_id,
shipping_cost: self.shipping_cost,
order_tax_amount: self.order_tax_amount,
connector_mandate_detail: self.connector_mandate_detail,
request_extended_authorization: self.request_extended_authorization,
extended_authorization_applied: self.extended_authorization_applied,
capture_before: self.capture_before,
card_discovery: self.card_discovery,
}
}
}
| 2,974 | 884 |
hyperswitch | crates/diesel_models/src/user/dashboard_metadata.rs | .rs | use common_utils::id_type;
use diesel::{query_builder::AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use masking::Secret;
use time::PrimitiveDateTime;
use crate::{enums, schema::dashboard_metadata};
#[derive(Clone, Debug, Identifiable, Queryable, Selectable)]
#[diesel(table_name = dashboard_metadata, check_for_backend(diesel::pg::Pg))]
pub struct DashboardMetadata {
pub id: i32,
pub user_id: Option<String>,
pub merchant_id: id_type::MerchantId,
pub org_id: id_type::OrganizationId,
pub data_key: enums::DashboardMetadata,
pub data_value: Secret<serde_json::Value>,
pub created_by: String,
pub created_at: PrimitiveDateTime,
pub last_modified_by: String,
pub last_modified_at: PrimitiveDateTime,
}
#[derive(
router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay, AsChangeset,
)]
#[diesel(table_name = dashboard_metadata)]
pub struct DashboardMetadataNew {
pub user_id: Option<String>,
pub merchant_id: id_type::MerchantId,
pub org_id: id_type::OrganizationId,
pub data_key: enums::DashboardMetadata,
pub data_value: Secret<serde_json::Value>,
pub created_by: String,
pub created_at: PrimitiveDateTime,
pub last_modified_by: String,
pub last_modified_at: PrimitiveDateTime,
}
#[derive(
router_derive::Setter, Clone, Debug, Insertable, router_derive::DebugAsDisplay, AsChangeset,
)]
#[diesel(table_name = dashboard_metadata)]
pub struct DashboardMetadataUpdateInternal {
pub data_key: enums::DashboardMetadata,
pub data_value: Secret<serde_json::Value>,
pub last_modified_by: String,
pub last_modified_at: PrimitiveDateTime,
}
#[derive(Debug)]
pub enum DashboardMetadataUpdate {
UpdateData {
data_key: enums::DashboardMetadata,
data_value: Secret<serde_json::Value>,
last_modified_by: String,
},
}
impl From<DashboardMetadataUpdate> for DashboardMetadataUpdateInternal {
fn from(metadata_update: DashboardMetadataUpdate) -> Self {
let last_modified_at = common_utils::date_time::now();
match metadata_update {
DashboardMetadataUpdate::UpdateData {
data_key,
data_value,
last_modified_by,
} => Self {
data_key,
data_value,
last_modified_by,
last_modified_at,
},
}
}
}
| 538 | 885 |
hyperswitch | crates/diesel_models/src/user/theme.rs | .rs | use common_enums::EntityType;
use common_utils::{
date_time, id_type,
types::theme::{EmailThemeConfig, ThemeLineage},
};
use diesel::{Identifiable, Insertable, Queryable, Selectable};
use time::PrimitiveDateTime;
use crate::schema::themes;
#[derive(Clone, Debug, Identifiable, Queryable, Selectable)]
#[diesel(table_name = themes, primary_key(theme_id), check_for_backend(diesel::pg::Pg))]
pub struct Theme {
pub theme_id: String,
pub tenant_id: id_type::TenantId,
pub org_id: Option<id_type::OrganizationId>,
pub merchant_id: Option<id_type::MerchantId>,
pub profile_id: Option<id_type::ProfileId>,
pub created_at: PrimitiveDateTime,
pub last_modified_at: PrimitiveDateTime,
pub entity_type: EntityType,
pub theme_name: String,
pub email_primary_color: String,
pub email_foreground_color: String,
pub email_background_color: String,
pub email_entity_name: String,
pub email_entity_logo_url: String,
}
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = themes)]
pub struct ThemeNew {
pub theme_id: String,
pub tenant_id: id_type::TenantId,
pub org_id: Option<id_type::OrganizationId>,
pub merchant_id: Option<id_type::MerchantId>,
pub profile_id: Option<id_type::ProfileId>,
pub created_at: PrimitiveDateTime,
pub last_modified_at: PrimitiveDateTime,
pub entity_type: EntityType,
pub theme_name: String,
pub email_primary_color: String,
pub email_foreground_color: String,
pub email_background_color: String,
pub email_entity_name: String,
pub email_entity_logo_url: String,
}
impl ThemeNew {
pub fn new(
theme_id: String,
theme_name: String,
lineage: ThemeLineage,
email_config: EmailThemeConfig,
) -> Self {
let now = date_time::now();
Self {
theme_id,
theme_name,
tenant_id: lineage.tenant_id().to_owned(),
org_id: lineage.org_id().cloned(),
merchant_id: lineage.merchant_id().cloned(),
profile_id: lineage.profile_id().cloned(),
entity_type: lineage.entity_type(),
created_at: now,
last_modified_at: now,
email_primary_color: email_config.primary_color,
email_foreground_color: email_config.foreground_color,
email_background_color: email_config.background_color,
email_entity_name: email_config.entity_name,
email_entity_logo_url: email_config.entity_logo_url,
}
}
}
impl Theme {
pub fn email_config(&self) -> EmailThemeConfig {
EmailThemeConfig {
primary_color: self.email_primary_color.clone(),
foreground_color: self.email_foreground_color.clone(),
background_color: self.email_background_color.clone(),
entity_name: self.email_entity_name.clone(),
entity_logo_url: self.email_entity_logo_url.clone(),
}
}
}
| 660 | 886 |
hyperswitch | crates/currency_conversion/Cargo.toml | .toml | [package]
name = "currency_conversion"
description = "Currency conversion for cost based routing"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[dependencies]
# First party crates
common_enums = { version = "0.1.0", path = "../common_enums", package = "common_enums" }
# Third party crates
rust_decimal = "1.35"
rusty-money = { git = "https://github.com/varunsrin/rusty_money", rev = "bbc0150742a0fff905225ff11ee09388e9babdcc", features = ["iso", "crypto"] }
serde = { version = "1.0.197", features = ["derive"] }
thiserror = "1.0.58"
[lints]
workspace = true
| 196 | 887 |
hyperswitch | crates/currency_conversion/src/conversion.rs | .rs | use common_enums::Currency;
use rust_decimal::Decimal;
use rusty_money::Money;
use crate::{
error::CurrencyConversionError,
types::{currency_match, ExchangeRates},
};
pub fn convert(
ex_rates: &ExchangeRates,
from_currency: Currency,
to_currency: Currency,
amount: i64,
) -> Result<Decimal, CurrencyConversionError> {
let money_minor = Money::from_minor(amount, currency_match(from_currency));
let base_currency = ex_rates.base_currency;
if to_currency == base_currency {
ex_rates.forward_conversion(*money_minor.amount(), from_currency)
} else if from_currency == base_currency {
ex_rates.backward_conversion(*money_minor.amount(), to_currency)
} else {
let base_conversion_amt =
ex_rates.forward_conversion(*money_minor.amount(), from_currency)?;
ex_rates.backward_conversion(base_conversion_amt, to_currency)
}
}
#[cfg(test)]
mod tests {
#![allow(clippy::expect_used, clippy::print_stdout)]
use std::collections::HashMap;
use crate::types::CurrencyFactors;
#[test]
fn currency_to_currency_conversion() {
use super::*;
let mut conversion: HashMap<Currency, CurrencyFactors> = HashMap::new();
let inr_conversion_rates =
CurrencyFactors::new(Decimal::new(823173, 4), Decimal::new(1214, 5));
let szl_conversion_rates =
CurrencyFactors::new(Decimal::new(194423, 4), Decimal::new(514, 4));
let convert_from = Currency::SZL;
let convert_to = Currency::INR;
let amount = 2000;
let base_currency = Currency::USD;
conversion.insert(convert_from, inr_conversion_rates);
conversion.insert(convert_to, szl_conversion_rates);
let sample_rate = ExchangeRates::new(base_currency, conversion);
let res =
convert(&sample_rate, convert_from, convert_to, amount).expect("converted_currency");
println!(
"The conversion from {} {} to {} is {:?}",
amount, convert_from, convert_to, res
);
}
#[test]
fn currency_to_base_conversion() {
use super::*;
let mut conversion: HashMap<Currency, CurrencyFactors> = HashMap::new();
let inr_conversion_rates =
CurrencyFactors::new(Decimal::new(823173, 4), Decimal::new(1214, 5));
let usd_conversion_rates = CurrencyFactors::new(Decimal::new(1, 0), Decimal::new(1, 0));
let convert_from = Currency::INR;
let convert_to = Currency::USD;
let amount = 2000;
let base_currency = Currency::USD;
conversion.insert(convert_from, inr_conversion_rates);
conversion.insert(convert_to, usd_conversion_rates);
let sample_rate = ExchangeRates::new(base_currency, conversion);
let res =
convert(&sample_rate, convert_from, convert_to, amount).expect("converted_currency");
println!(
"The conversion from {} {} to {} is {:?}",
amount, convert_from, convert_to, res
);
}
#[test]
fn base_to_currency_conversion() {
use super::*;
let mut conversion: HashMap<Currency, CurrencyFactors> = HashMap::new();
let inr_conversion_rates =
CurrencyFactors::new(Decimal::new(823173, 4), Decimal::new(1214, 5));
let usd_conversion_rates = CurrencyFactors::new(Decimal::new(1, 0), Decimal::new(1, 0));
let convert_from = Currency::USD;
let convert_to = Currency::INR;
let amount = 2000;
let base_currency = Currency::USD;
conversion.insert(convert_from, usd_conversion_rates);
conversion.insert(convert_to, inr_conversion_rates);
let sample_rate = ExchangeRates::new(base_currency, conversion);
let res =
convert(&sample_rate, convert_from, convert_to, amount).expect("converted_currency");
println!(
"The conversion from {} {} to {} is {:?}",
amount, convert_from, convert_to, res
);
}
}
| 929 | 888 |
hyperswitch | crates/currency_conversion/src/types.rs | .rs | use std::collections::HashMap;
use common_enums::Currency;
use rust_decimal::Decimal;
use rusty_money::iso;
use crate::error::CurrencyConversionError;
/// Cached currency store of base currency
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExchangeRates {
pub base_currency: Currency,
pub conversion: HashMap<Currency, CurrencyFactors>,
}
/// Stores the multiplicative factor for conversion between currency to base and vice versa
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct CurrencyFactors {
/// The factor that will be multiplied to provide Currency output
pub to_factor: Decimal,
/// The factor that will be multiplied to provide for the base output
pub from_factor: Decimal,
}
impl CurrencyFactors {
pub fn new(to_factor: Decimal, from_factor: Decimal) -> Self {
Self {
to_factor,
from_factor,
}
}
}
impl ExchangeRates {
pub fn new(base_currency: Currency, conversion: HashMap<Currency, CurrencyFactors>) -> Self {
Self {
base_currency,
conversion,
}
}
/// The flow here is from_currency -> base_currency -> to_currency
/// from to_currency -> base currency
pub fn forward_conversion(
&self,
amt: Decimal,
from_currency: Currency,
) -> Result<Decimal, CurrencyConversionError> {
let from_factor = self
.conversion
.get(&from_currency)
.ok_or_else(|| {
CurrencyConversionError::ConversionNotSupported(from_currency.to_string())
})?
.from_factor;
amt.checked_mul(from_factor)
.ok_or(CurrencyConversionError::DecimalMultiplicationFailed)
}
/// from base_currency -> to_currency
pub fn backward_conversion(
&self,
amt: Decimal,
to_currency: Currency,
) -> Result<Decimal, CurrencyConversionError> {
let to_factor = self
.conversion
.get(&to_currency)
.ok_or_else(|| {
CurrencyConversionError::ConversionNotSupported(to_currency.to_string())
})?
.to_factor;
amt.checked_mul(to_factor)
.ok_or(CurrencyConversionError::DecimalMultiplicationFailed)
}
}
pub fn currency_match(currency: Currency) -> &'static iso::Currency {
match currency {
Currency::AED => iso::AED,
Currency::AFN => iso::AFN,
Currency::ALL => iso::ALL,
Currency::AMD => iso::AMD,
Currency::ANG => iso::ANG,
Currency::AOA => iso::AOA,
Currency::ARS => iso::ARS,
Currency::AUD => iso::AUD,
Currency::AWG => iso::AWG,
Currency::AZN => iso::AZN,
Currency::BAM => iso::BAM,
Currency::BBD => iso::BBD,
Currency::BDT => iso::BDT,
Currency::BGN => iso::BGN,
Currency::BHD => iso::BHD,
Currency::BIF => iso::BIF,
Currency::BMD => iso::BMD,
Currency::BND => iso::BND,
Currency::BOB => iso::BOB,
Currency::BRL => iso::BRL,
Currency::BSD => iso::BSD,
Currency::BTN => iso::BTN,
Currency::BWP => iso::BWP,
Currency::BYN => iso::BYN,
Currency::BZD => iso::BZD,
Currency::CAD => iso::CAD,
Currency::CDF => iso::CDF,
Currency::CHF => iso::CHF,
Currency::CLF => iso::CLF,
Currency::CLP => iso::CLP,
Currency::CNY => iso::CNY,
Currency::COP => iso::COP,
Currency::CRC => iso::CRC,
Currency::CUC => iso::CUC,
Currency::CUP => iso::CUP,
Currency::CVE => iso::CVE,
Currency::CZK => iso::CZK,
Currency::DJF => iso::DJF,
Currency::DKK => iso::DKK,
Currency::DOP => iso::DOP,
Currency::DZD => iso::DZD,
Currency::EGP => iso::EGP,
Currency::ERN => iso::ERN,
Currency::ETB => iso::ETB,
Currency::EUR => iso::EUR,
Currency::FJD => iso::FJD,
Currency::FKP => iso::FKP,
Currency::GBP => iso::GBP,
Currency::GEL => iso::GEL,
Currency::GHS => iso::GHS,
Currency::GIP => iso::GIP,
Currency::GMD => iso::GMD,
Currency::GNF => iso::GNF,
Currency::GTQ => iso::GTQ,
Currency::GYD => iso::GYD,
Currency::HKD => iso::HKD,
Currency::HNL => iso::HNL,
Currency::HRK => iso::HRK,
Currency::HTG => iso::HTG,
Currency::HUF => iso::HUF,
Currency::IDR => iso::IDR,
Currency::ILS => iso::ILS,
Currency::INR => iso::INR,
Currency::IQD => iso::IQD,
Currency::IRR => iso::IRR,
Currency::ISK => iso::ISK,
Currency::JMD => iso::JMD,
Currency::JOD => iso::JOD,
Currency::JPY => iso::JPY,
Currency::KES => iso::KES,
Currency::KGS => iso::KGS,
Currency::KHR => iso::KHR,
Currency::KMF => iso::KMF,
Currency::KPW => iso::KPW,
Currency::KRW => iso::KRW,
Currency::KWD => iso::KWD,
Currency::KYD => iso::KYD,
Currency::KZT => iso::KZT,
Currency::LAK => iso::LAK,
Currency::LBP => iso::LBP,
Currency::LKR => iso::LKR,
Currency::LRD => iso::LRD,
Currency::LSL => iso::LSL,
Currency::LYD => iso::LYD,
Currency::MAD => iso::MAD,
Currency::MDL => iso::MDL,
Currency::MGA => iso::MGA,
Currency::MKD => iso::MKD,
Currency::MMK => iso::MMK,
Currency::MNT => iso::MNT,
Currency::MOP => iso::MOP,
Currency::MRU => iso::MRU,
Currency::MUR => iso::MUR,
Currency::MVR => iso::MVR,
Currency::MWK => iso::MWK,
Currency::MXN => iso::MXN,
Currency::MYR => iso::MYR,
Currency::MZN => iso::MZN,
Currency::NAD => iso::NAD,
Currency::NGN => iso::NGN,
Currency::NIO => iso::NIO,
Currency::NOK => iso::NOK,
Currency::NPR => iso::NPR,
Currency::NZD => iso::NZD,
Currency::OMR => iso::OMR,
Currency::PAB => iso::PAB,
Currency::PEN => iso::PEN,
Currency::PGK => iso::PGK,
Currency::PHP => iso::PHP,
Currency::PKR => iso::PKR,
Currency::PLN => iso::PLN,
Currency::PYG => iso::PYG,
Currency::QAR => iso::QAR,
Currency::RON => iso::RON,
Currency::RSD => iso::RSD,
Currency::RUB => iso::RUB,
Currency::RWF => iso::RWF,
Currency::SAR => iso::SAR,
Currency::SBD => iso::SBD,
Currency::SCR => iso::SCR,
Currency::SDG => iso::SDG,
Currency::SEK => iso::SEK,
Currency::SGD => iso::SGD,
Currency::SHP => iso::SHP,
Currency::SLE => iso::SLE,
Currency::SLL => iso::SLL,
Currency::SOS => iso::SOS,
Currency::SRD => iso::SRD,
Currency::SSP => iso::SSP,
Currency::STD => iso::STD,
Currency::STN => iso::STN,
Currency::SVC => iso::SVC,
Currency::SYP => iso::SYP,
Currency::SZL => iso::SZL,
Currency::THB => iso::THB,
Currency::TJS => iso::TJS,
Currency::TND => iso::TND,
Currency::TMT => iso::TMT,
Currency::TOP => iso::TOP,
Currency::TTD => iso::TTD,
Currency::TRY => iso::TRY,
Currency::TWD => iso::TWD,
Currency::TZS => iso::TZS,
Currency::UAH => iso::UAH,
Currency::UGX => iso::UGX,
Currency::USD => iso::USD,
Currency::UYU => iso::UYU,
Currency::UZS => iso::UZS,
Currency::VES => iso::VES,
Currency::VND => iso::VND,
Currency::VUV => iso::VUV,
Currency::WST => iso::WST,
Currency::XAF => iso::XAF,
Currency::XCD => iso::XCD,
Currency::XOF => iso::XOF,
Currency::XPF => iso::XPF,
Currency::YER => iso::YER,
Currency::ZAR => iso::ZAR,
Currency::ZMW => iso::ZMW,
Currency::ZWL => iso::ZWL,
}
}
| 2,216 | 889 |
hyperswitch | crates/currency_conversion/src/lib.rs | .rs | pub mod conversion;
pub mod error;
pub mod types;
| 12 | 890 |
hyperswitch | crates/currency_conversion/src/error.rs | .rs | #[derive(Debug, thiserror::Error, serde::Serialize)]
#[serde(tag = "type", content = "info", rename_all = "snake_case")]
pub enum CurrencyConversionError {
#[error("Currency Conversion isn't possible")]
DecimalMultiplicationFailed,
#[error("Currency not supported: '{0}'")]
ConversionNotSupported(String),
}
| 73 | 891 |
hyperswitch | crates/connector_configs/Cargo.toml | .toml | [package]
name = "connector_configs"
description = "Connector Integration Dashboard"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[features]
default = ["payouts", "dummy_connector"]
production = []
sandbox = []
dummy_connector = ["api_models/dummy_connector"]
payouts = ["api_models/payouts"]
v1 = ["api_models/v1", "common_utils/v1"]
[dependencies]
# First party crates
api_models = { version = "0.1.0", path = "../api_models", package = "api_models" }
common_utils = { version = "0.1.0", path = "../common_utils" }
# Third party crates
serde = { version = "1.0.197", features = ["derive"] }
serde_with = "3.7.0"
toml = "0.8.12"
utoipa = { version = "4.2.0", features = ["preserve_order", "preserve_path_order"] }
[lints]
workspace = true
| 230 | 892 |
hyperswitch | crates/connector_configs/toml/development.toml | .toml | [aci]
[[aci.credit]]
payment_method_type = "Mastercard"
[[aci.credit]]
payment_method_type = "Visa"
[[aci.credit]]
payment_method_type = "Interac"
[[aci.credit]]
payment_method_type = "AmericanExpress"
[[aci.credit]]
payment_method_type = "JCB"
[[aci.credit]]
payment_method_type = "DinersClub"
[[aci.credit]]
payment_method_type = "Discover"
[[aci.credit]]
payment_method_type = "CartesBancaires"
[[aci.credit]]
payment_method_type = "UnionPay"
[[aci.debit]]
payment_method_type = "Mastercard"
[[aci.debit]]
payment_method_type = "Visa"
[[aci.debit]]
payment_method_type = "Interac"
[[aci.debit]]
payment_method_type = "AmericanExpress"
[[aci.debit]]
payment_method_type = "JCB"
[[aci.debit]]
payment_method_type = "DinersClub"
[[aci.debit]]
payment_method_type = "Discover"
[[aci.debit]]
payment_method_type = "CartesBancaires"
[[aci.debit]]
payment_method_type = "UnionPay"
[[aci.wallet]]
payment_method_type = "ali_pay"
[[aci.wallet]]
payment_method_type = "mb_way"
[[aci.bank_redirect]]
payment_method_type = "ideal"
[[aci.bank_redirect]]
payment_method_type = "giropay"
[[aci.bank_redirect]]
payment_method_type = "sofort"
[[aci.bank_redirect]]
payment_method_type = "eps"
[[aci.bank_redirect]]
payment_method_type = "przelewy24"
[[aci.bank_redirect]]
payment_method_type = "trustly"
[[aci.bank_redirect]]
payment_method_type = "interac"
[aci.connector_auth.BodyKey]
api_key="API Key"
key1="Entity ID"
[aci.connector_webhook_details]
merchant_secret="Source verification key"
[adyen]
[[adyen.credit]]
payment_method_type = "Mastercard"
[[adyen.credit]]
payment_method_type = "Visa"
[[adyen.credit]]
payment_method_type = "Interac"
[[adyen.credit]]
payment_method_type = "AmericanExpress"
[[adyen.credit]]
payment_method_type = "JCB"
[[adyen.credit]]
payment_method_type = "DinersClub"
[[adyen.credit]]
payment_method_type = "Discover"
[[adyen.credit]]
payment_method_type = "CartesBancaires"
[[adyen.credit]]
payment_method_type = "UnionPay"
[[adyen.debit]]
payment_method_type = "Mastercard"
[[adyen.debit]]
payment_method_type = "Visa"
[[adyen.debit]]
payment_method_type = "Interac"
[[adyen.debit]]
payment_method_type = "AmericanExpress"
[[adyen.debit]]
payment_method_type = "JCB"
[[adyen.debit]]
payment_method_type = "DinersClub"
[[adyen.debit]]
payment_method_type = "Discover"
[[adyen.debit]]
payment_method_type = "CartesBancaires"
[[adyen.debit]]
payment_method_type = "UnionPay"
[[adyen.pay_later]]
payment_method_type = "klarna"
[[adyen.pay_later]]
payment_method_type = "affirm"
[[adyen.pay_later]]
payment_method_type = "afterpay_clearpay"
[[adyen.pay_later]]
payment_method_type = "pay_bright"
[[adyen.pay_later]]
payment_method_type = "walley"
[[adyen.pay_later]]
payment_method_type = "alma"
[[adyen.pay_later]]
payment_method_type = "atome"
[[adyen.bank_debit]]
payment_method_type = "ach"
[[adyen.bank_debit]]
payment_method_type = "bacs"
[[adyen.bank_debit]]
payment_method_type = "sepa"
[[adyen.bank_redirect]]
payment_method_type = "ideal"
[[adyen.bank_redirect]]
payment_method_type = "eps"
[[adyen.bank_redirect]]
payment_method_type = "blik"
[[adyen.bank_redirect]]
payment_method_type = "trustly"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_czech_republic"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_finland"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_poland"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_slovakia"
[[adyen.bank_redirect]]
payment_method_type = "bancontact_card"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_fpx"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_thailand"
[[adyen.bank_redirect]]
payment_method_type = "bizum"
[[adyen.bank_redirect]]
payment_method_type = "open_banking_uk"
[[adyen.bank_transfer]]
payment_method_type = "permata_bank_transfer"
[[adyen.bank_transfer]]
payment_method_type = "bca_bank_transfer"
[[adyen.bank_transfer]]
payment_method_type = "bni_va"
[[adyen.bank_transfer]]
payment_method_type = "bri_va"
[[adyen.bank_transfer]]
payment_method_type = "cimb_va"
[[adyen.bank_transfer]]
payment_method_type = "danamon_va"
[[adyen.bank_transfer]]
payment_method_type = "mandiri_va"
[[adyen.bank_transfer]]
payment_method_type = "pix"
[[adyen.wallet]]
payment_method_type = "apple_pay"
[[adyen.wallet]]
payment_method_type = "google_pay"
[[adyen.wallet]]
payment_method_type = "paypal"
[[adyen.wallet]]
payment_method_type = "we_chat_pay"
[[adyen.wallet]]
payment_method_type = "ali_pay"
[[adyen.wallet]]
payment_method_type = "mb_way"
[[adyen.wallet]]
payment_method_type = "ali_pay_hk"
[[adyen.wallet]]
payment_method_type = "go_pay"
[[adyen.wallet]]
payment_method_type = "kakao_pay"
[[adyen.wallet]]
payment_method_type = "twint"
[[adyen.wallet]]
payment_method_type = "gcash"
[[adyen.wallet]]
payment_method_type = "vipps"
[[adyen.wallet]]
payment_method_type = "dana"
[[adyen.wallet]]
payment_method_type = "momo"
[[adyen.wallet]]
payment_method_type = "swish"
payment_experience = "display_qr_code"
[[adyen.wallet]]
payment_method_type = "touch_n_go"
[[adyen.voucher]]
payment_method_type = "boleto"
[[adyen.voucher]]
payment_method_type = "alfamart"
[[adyen.voucher]]
payment_method_type = "indomaret"
[[adyen.voucher]]
payment_method_type = "oxxo"
[[adyen.voucher]]
payment_method_type = "seven_eleven"
[[adyen.voucher]]
payment_method_type = "lawson"
[[adyen.voucher]]
payment_method_type = "mini_stop"
[[adyen.voucher]]
payment_method_type = "family_mart"
[[adyen.voucher]]
payment_method_type = "seicomart"
[[adyen.voucher]]
payment_method_type = "pay_easy"
[[adyen.gift_card]]
payment_method_type = "pay_safe_card"
[[adyen.gift_card]]
payment_method_type = "givex"
[[adyen.card_redirect]]
payment_method_type = "benefit"
[[adyen.card_redirect]]
payment_method_type = "knet"
[[adyen.card_redirect]]
payment_method_type = "momo_atm"
[adyen.connector_auth.BodyKey]
api_key="Adyen API Key"
key1="Adyen Account Id"
[adyen.connector_webhook_details]
merchant_secret="Source verification key"
[[adyen.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[adyen.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[adyen.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[adyen.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[adyen.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[adyen.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="Enter Live endpoint prefix"
required=true
type="Text"
[adyenplatform_payout]
[[adyenplatform_payout.bank_transfer]]
payment_method_type = "sepa"
[adyenplatform_payout.connector_auth.HeaderKey]
api_key="Adyen platform's API Key"
[adyenplatform_payout.metadata.source_balance_account]
name="source_balance_account"
label="Source balance account ID"
placeholder="Enter Source balance account ID"
required=true
type="Text"
[adyenplatform_payout.connector_webhook_details]
merchant_secret="Source verification key"
[airwallex]
[[airwallex.credit]]
payment_method_type = "Mastercard"
[[airwallex.credit]]
payment_method_type = "Visa"
[[airwallex.credit]]
payment_method_type = "Interac"
[[airwallex.credit]]
payment_method_type = "AmericanExpress"
[[airwallex.credit]]
payment_method_type = "JCB"
[[airwallex.credit]]
payment_method_type = "DinersClub"
[[airwallex.credit]]
payment_method_type = "Discover"
[[airwallex.credit]]
payment_method_type = "CartesBancaires"
[[airwallex.credit]]
payment_method_type = "UnionPay"
[[airwallex.debit]]
payment_method_type = "Mastercard"
[[airwallex.debit]]
payment_method_type = "Visa"
[[airwallex.debit]]
payment_method_type = "Interac"
[[airwallex.debit]]
payment_method_type = "AmericanExpress"
[[airwallex.debit]]
payment_method_type = "JCB"
[[airwallex.debit]]
payment_method_type = "DinersClub"
[[airwallex.debit]]
payment_method_type = "Discover"
[[airwallex.debit]]
payment_method_type = "CartesBancaires"
[[airwallex.debit]]
payment_method_type = "UnionPay"
[[airwallex.wallet]]
payment_method_type = "google_pay"
[airwallex.connector_auth.BodyKey]
api_key="API Key"
key1="Client ID"
[airwallex.connector_webhook_details]
merchant_secret="Source verification key"
[[airwallex.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[airwallex.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[airwallex.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[airwallex.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[airwallex.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[authorizedotnet]
[[authorizedotnet.credit]]
payment_method_type = "Mastercard"
[[authorizedotnet.credit]]
payment_method_type = "Visa"
[[authorizedotnet.credit]]
payment_method_type = "Interac"
[[authorizedotnet.credit]]
payment_method_type = "AmericanExpress"
[[authorizedotnet.credit]]
payment_method_type = "JCB"
[[authorizedotnet.credit]]
payment_method_type = "DinersClub"
[[authorizedotnet.credit]]
payment_method_type = "Discover"
[[authorizedotnet.credit]]
payment_method_type = "CartesBancaires"
[[authorizedotnet.credit]]
payment_method_type = "UnionPay"
[[authorizedotnet.debit]]
payment_method_type = "Mastercard"
[[authorizedotnet.debit]]
payment_method_type = "Visa"
[[authorizedotnet.debit]]
payment_method_type = "Interac"
[[authorizedotnet.debit]]
payment_method_type = "AmericanExpress"
[[authorizedotnet.debit]]
payment_method_type = "JCB"
[[authorizedotnet.debit]]
payment_method_type = "DinersClub"
[[authorizedotnet.debit]]
payment_method_type = "Discover"
[[authorizedotnet.debit]]
payment_method_type = "CartesBancaires"
[[authorizedotnet.debit]]
payment_method_type = "UnionPay"
[[authorizedotnet.wallet]]
payment_method_type = "apple_pay"
[[authorizedotnet.wallet]]
payment_method_type = "google_pay"
[[authorizedotnet.wallet]]
payment_method_type = "paypal"
[authorizedotnet.connector_auth.BodyKey]
api_key="API Login ID"
key1="Transaction Key"
[[authorizedotnet.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[authorizedotnet.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[authorizedotnet.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[authorizedotnet.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[authorizedotnet.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[bambora]
[[bambora.credit]]
payment_method_type = "Mastercard"
[[bambora.credit]]
payment_method_type = "Visa"
[[bambora.credit]]
payment_method_type = "Interac"
[[bambora.credit]]
payment_method_type = "AmericanExpress"
[[bambora.credit]]
payment_method_type = "JCB"
[[bambora.credit]]
payment_method_type = "DinersClub"
[[bambora.credit]]
payment_method_type = "Discover"
[[bambora.credit]]
payment_method_type = "CartesBancaires"
[[bambora.credit]]
payment_method_type = "UnionPay"
[[bambora.debit]]
payment_method_type = "Mastercard"
[[bambora.debit]]
payment_method_type = "Visa"
[[bambora.debit]]
payment_method_type = "Interac"
[[bambora.debit]]
payment_method_type = "AmericanExpress"
[[bambora.debit]]
payment_method_type = "JCB"
[[bambora.debit]]
payment_method_type = "DinersClub"
[[bambora.debit]]
payment_method_type = "Discover"
[[bambora.debit]]
payment_method_type = "CartesBancaires"
[[bambora.debit]]
payment_method_type = "UnionPay"
[bambora.connector_auth.BodyKey]
api_key="Passcode"
key1="Merchant Id"
[bamboraapac]
[[bamboraapac.credit]]
payment_method_type = "Mastercard"
[[bamboraapac.credit]]
payment_method_type = "Visa"
[[bamboraapac.credit]]
payment_method_type = "Interac"
[[bamboraapac.credit]]
payment_method_type = "AmericanExpress"
[[bamboraapac.credit]]
payment_method_type = "JCB"
[[bamboraapac.credit]]
payment_method_type = "DinersClub"
[[bamboraapac.credit]]
payment_method_type = "Discover"
[[bamboraapac.credit]]
payment_method_type = "CartesBancaires"
[[bamboraapac.credit]]
payment_method_type = "UnionPay"
[[bamboraapac.debit]]
payment_method_type = "Mastercard"
[[bamboraapac.debit]]
payment_method_type = "Visa"
[[bamboraapac.debit]]
payment_method_type = "Interac"
[[bamboraapac.debit]]
payment_method_type = "AmericanExpress"
[[bamboraapac.debit]]
payment_method_type = "JCB"
[[bamboraapac.debit]]
payment_method_type = "DinersClub"
[[bamboraapac.debit]]
payment_method_type = "Discover"
[[bamboraapac.debit]]
payment_method_type = "CartesBancaires"
[[bamboraapac.debit]]
payment_method_type = "UnionPay"
[bamboraapac.connector_auth.SignatureKey]
api_key="Username"
key1="Account Number"
api_secret="Password"
[bankofamerica]
[[bankofamerica.credit]]
payment_method_type = "Mastercard"
[[bankofamerica.credit]]
payment_method_type = "Visa"
[[bankofamerica.credit]]
payment_method_type = "Interac"
[[bankofamerica.credit]]
payment_method_type = "AmericanExpress"
[[bankofamerica.credit]]
payment_method_type = "JCB"
[[bankofamerica.credit]]
payment_method_type = "DinersClub"
[[bankofamerica.credit]]
payment_method_type = "Discover"
[[bankofamerica.credit]]
payment_method_type = "CartesBancaires"
[[bankofamerica.credit]]
payment_method_type = "UnionPay"
[[bankofamerica.debit]]
payment_method_type = "Mastercard"
[[bankofamerica.debit]]
payment_method_type = "Visa"
[[bankofamerica.debit]]
payment_method_type = "Interac"
[[bankofamerica.debit]]
payment_method_type = "AmericanExpress"
[[bankofamerica.debit]]
payment_method_type = "JCB"
[[bankofamerica.debit]]
payment_method_type = "DinersClub"
[[bankofamerica.debit]]
payment_method_type = "Discover"
[[bankofamerica.debit]]
payment_method_type = "CartesBancaires"
[[bankofamerica.debit]]
payment_method_type = "UnionPay"
[[bankofamerica.wallet]]
payment_method_type = "apple_pay"
[[bankofamerica.wallet]]
payment_method_type = "google_pay"
[[bankofamerica.wallet]]
payment_method_type = "samsung_pay"
[bankofamerica.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[bankofamerica.connector_webhook_details]
merchant_secret="Source verification key"
[[bankofamerica.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[bankofamerica.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bankofamerica.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[bankofamerica.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bankofamerica.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="service_id"
label="Samsung Pay Service Id"
placeholder="Enter Samsung Pay Service Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="merchant_display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="allowed_brands"
label="Allowed Brands"
placeholder="Enter Allowed Brands"
required=true
type="MultiSelect"
options=["visa","masterCard","amex","discover"]
[bitpay]
[[bitpay.crypto]]
payment_method_type = "crypto_currency"
[bitpay.connector_auth.HeaderKey]
api_key="API Key"
[bitpay.connector_webhook_details]
merchant_secret="Source verification key"
[bluesnap]
[[bluesnap.credit]]
payment_method_type = "Mastercard"
[[bluesnap.credit]]
payment_method_type = "Visa"
[[bluesnap.credit]]
payment_method_type = "Interac"
[[bluesnap.credit]]
payment_method_type = "AmericanExpress"
[[bluesnap.credit]]
payment_method_type = "JCB"
[[bluesnap.credit]]
payment_method_type = "DinersClub"
[[bluesnap.credit]]
payment_method_type = "Discover"
[[bluesnap.credit]]
payment_method_type = "CartesBancaires"
[[bluesnap.credit]]
payment_method_type = "UnionPay"
[[bluesnap.debit]]
payment_method_type = "Mastercard"
[[bluesnap.debit]]
payment_method_type = "Visa"
[[bluesnap.debit]]
payment_method_type = "Interac"
[[bluesnap.debit]]
payment_method_type = "AmericanExpress"
[[bluesnap.debit]]
payment_method_type = "JCB"
[[bluesnap.debit]]
payment_method_type = "DinersClub"
[[bluesnap.debit]]
payment_method_type = "Discover"
[[bluesnap.debit]]
payment_method_type = "CartesBancaires"
[[bluesnap.debit]]
payment_method_type = "UnionPay"
[[bluesnap.wallet]]
payment_method_type = "google_pay"
[[bluesnap.wallet]]
payment_method_type = "apple_pay"
[bluesnap.connector_auth.BodyKey]
api_key="Password"
key1="Username"
[bluesnap.connector_webhook_details]
merchant_secret="Source verification key"
[[bluesnap.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[bluesnap.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bluesnap.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[bluesnap.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bluesnap.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[bluesnap.metadata.merchant_id]
name="merchant_id"
label="Merchant Id"
placeholder="Enter Merchant Id"
required=false
type="Text"
[boku]
[[boku.wallet]]
payment_method_type = "dana"
[[boku.wallet]]
payment_method_type = "gcash"
[[boku.wallet]]
payment_method_type = "go_pay"
[[boku.wallet]]
payment_method_type = "kakao_pay"
[[boku.wallet]]
payment_method_type = "momo"
[boku.connector_auth.BodyKey]
api_key="API KEY"
key1= "MERCHANT ID"
[boku.connector_webhook_details]
merchant_secret="Source verification key"
[braintree]
[[braintree.credit]]
payment_method_type = "Mastercard"
[[braintree.credit]]
payment_method_type = "Visa"
[[braintree.credit]]
payment_method_type = "Interac"
[[braintree.credit]]
payment_method_type = "AmericanExpress"
[[braintree.credit]]
payment_method_type = "JCB"
[[braintree.credit]]
payment_method_type = "DinersClub"
[[braintree.credit]]
payment_method_type = "Discover"
[[braintree.credit]]
payment_method_type = "CartesBancaires"
[[braintree.credit]]
payment_method_type = "UnionPay"
[[braintree.debit]]
payment_method_type = "Mastercard"
[[braintree.debit]]
payment_method_type = "Visa"
[[braintree.debit]]
payment_method_type = "Interac"
[[braintree.debit]]
payment_method_type = "AmericanExpress"
[[braintree.debit]]
payment_method_type = "JCB"
[[braintree.debit]]
payment_method_type = "DinersClub"
[[braintree.debit]]
payment_method_type = "Discover"
[[braintree.debit]]
payment_method_type = "CartesBancaires"
[[braintree.debit]]
payment_method_type = "UnionPay"
[[braintree.debit]]
payment_method_type = "UnionPay"
[braintree.connector_webhook_details]
merchant_secret="Source verification key"
[braintree.connector_auth.SignatureKey]
api_key="Public Key"
key1="Merchant Id"
api_secret="Private Key"
[braintree.metadata.merchant_account_id]
name="merchant_account_id"
label="Merchant Account Id"
placeholder="Enter Merchant Account Id"
required=true
type="Text"
[braintree.metadata.merchant_config_currency]
name="merchant_config_currency"
label="Currency"
placeholder="Enter Currency"
required=true
type="Select"
options=[]
[cashtocode]
[[cashtocode.reward]]
payment_method_type = "classic"
[[cashtocode.reward]]
payment_method_type = "evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.EUR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.EUR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.GBP.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.GBP.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.USD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.USD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CAD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CAD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CHF.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CHF.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.AUD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.AUD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.INR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.INR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.JPY.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.JPY.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.NZD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.NZD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.ZAR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.ZAR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CNY.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CNY.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_webhook_details]
merchant_secret="Source verification key"
[checkout]
[[checkout.credit]]
payment_method_type = "Mastercard"
[[checkout.credit]]
payment_method_type = "Visa"
[[checkout.credit]]
payment_method_type = "Interac"
[[checkout.credit]]
payment_method_type = "AmericanExpress"
[[checkout.credit]]
payment_method_type = "JCB"
[[checkout.credit]]
payment_method_type = "DinersClub"
[[checkout.credit]]
payment_method_type = "Discover"
[[checkout.credit]]
payment_method_type = "CartesBancaires"
[[checkout.credit]]
payment_method_type = "UnionPay"
[[checkout.debit]]
payment_method_type = "Mastercard"
[[checkout.debit]]
payment_method_type = "Visa"
[[checkout.debit]]
payment_method_type = "Interac"
[[checkout.debit]]
payment_method_type = "AmericanExpress"
[[checkout.debit]]
payment_method_type = "JCB"
[[checkout.debit]]
payment_method_type = "DinersClub"
[[checkout.debit]]
payment_method_type = "Discover"
[[checkout.debit]]
payment_method_type = "CartesBancaires"
[[checkout.debit]]
payment_method_type = "UnionPay"
[[checkout.wallet]]
payment_method_type = "apple_pay"
[[checkout.wallet]]
payment_method_type = "google_pay"
[checkout.connector_auth.SignatureKey]
api_key="Checkout API Public Key"
key1="Processing Channel ID"
api_secret="Checkout API Secret Key"
[checkout.connector_webhook_details]
merchant_secret="Source verification key"
[[checkout.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[checkout.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[checkout.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[checkout.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[checkout.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[checkout.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[checkout.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[checkout.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[coinbase]
[[coinbase.crypto]]
payment_method_type = "crypto_currency"
[coinbase.connector_auth.HeaderKey]
api_key="API Key"
[coinbase.connector_webhook_details]
merchant_secret="Source verification key"
[coingate]
[[coingate.crypto]]
payment_method_type = "crypto_currency"
[coingate.connector_auth.BodyKey]
api_key="API Key"
key1 ="Merchant Token"
[coingate.metadata.currency_id]
name="currency_id"
label="ID of the currency in which the refund will be issued"
placeholder="Enter ID of the currency in which the refund will be issued"
required=true
type="Number"
[coingate.metadata.platform_id]
name="platform_id"
label="Platform ID of the currency in which the refund will be issued"
placeholder="Enter Platform ID of the currency in which the refund will be issued"
required=true
type="Number"
[coingate.metadata.ledger_account_id]
name="ledger_account_id"
label="ID of the trader balance associated with the currency in which the refund will be issued"
placeholder="Enter ID of the trader balance associated with the currency in which the refund will be issued"
required=true
type="Text"
[cryptopay]
[[cryptopay.crypto]]
payment_method_type = "crypto_currency"
[cryptopay.connector_auth.BodyKey]
api_key="API Key"
key1="Secret Key"
[cryptopay.connector_webhook_details]
merchant_secret="Source verification key"
[cybersource]
[[cybersource.credit]]
payment_method_type = "Mastercard"
[[cybersource.credit]]
payment_method_type = "Visa"
[[cybersource.credit]]
payment_method_type = "Interac"
[[cybersource.credit]]
payment_method_type = "AmericanExpress"
[[cybersource.credit]]
payment_method_type = "JCB"
[[cybersource.credit]]
payment_method_type = "DinersClub"
[[cybersource.credit]]
payment_method_type = "Discover"
[[cybersource.credit]]
payment_method_type = "CartesBancaires"
[[cybersource.credit]]
payment_method_type = "UnionPay"
[[cybersource.debit]]
payment_method_type = "Mastercard"
[[cybersource.debit]]
payment_method_type = "Visa"
[[cybersource.debit]]
payment_method_type = "Interac"
[[cybersource.debit]]
payment_method_type = "AmericanExpress"
[[cybersource.debit]]
payment_method_type = "JCB"
[[cybersource.debit]]
payment_method_type = "DinersClub"
[[cybersource.debit]]
payment_method_type = "Discover"
[[cybersource.debit]]
payment_method_type = "CartesBancaires"
[[cybersource.debit]]
payment_method_type = "UnionPay"
[[cybersource.wallet]]
payment_method_type = "apple_pay"
[[cybersource.wallet]]
payment_method_type = "google_pay"
[[cybersource.wallet]]
payment_method_type = "paze"
[[cybersource.wallet]]
payment_method_type = "samsung_pay"
[cybersource.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[cybersource.connector_webhook_details]
merchant_secret="Source verification key"
[cybersource.metadata]
disable_avs = "Disable AVS check"
disable_cvn = "Disable CVN check"
[[cybersource.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[cybersource.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[cybersource.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[cybersource.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[cybersource.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[cybersource.connector_wallets_details.samsung_pay]]
name="service_id"
label="Samsung Pay Service Id"
placeholder="Enter Samsung Pay Service Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.samsung_pay]]
name="merchant_display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[cybersource.connector_wallets_details.samsung_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[cybersource.connector_wallets_details.samsung_pay]]
name="allowed_brands"
label="Allowed Brands"
placeholder="Enter Allowed Brands"
required=true
type="MultiSelect"
options=["visa","masterCard","amex","discover"]
[[cybersource.connector_wallets_details.paze]]
name="client_id"
label="Client Id"
placeholder="Enter paze Client Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.paze]]
name="client_profile_id"
label="Client Profile Id"
placeholder="Enter Client Profile Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.paze]]
name="client_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[cybersource.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[cybersource.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[cybersource.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[cybersource_payout]
[[cybersource_payout.credit]]
payment_method_type = "Mastercard"
[[cybersource_payout.credit]]
payment_method_type = "Visa"
[[cybersource_payout.credit]]
payment_method_type = "Interac"
[[cybersource_payout.credit]]
payment_method_type = "AmericanExpress"
[[cybersource_payout.credit]]
payment_method_type = "JCB"
[[cybersource_payout.credit]]
payment_method_type = "DinersClub"
[[cybersource_payout.credit]]
payment_method_type = "Discover"
[[cybersource_payout.credit]]
payment_method_type = "CartesBancaires"
[[cybersource_payout.credit]]
payment_method_type = "UnionPay"
[[cybersource_payout.debit]]
payment_method_type = "Mastercard"
[[cybersource_payout.debit]]
payment_method_type = "Visa"
[[cybersource_payout.debit]]
payment_method_type = "Interac"
[[cybersource_payout.debit]]
payment_method_type = "AmericanExpress"
[[cybersource_payout.debit]]
payment_method_type = "JCB"
[[cybersource_payout.debit]]
payment_method_type = "DinersClub"
[[cybersource_payout.debit]]
payment_method_type = "Discover"
[[cybersource_payout.debit]]
payment_method_type = "CartesBancaires"
[[cybersource_payout.debit]]
payment_method_type = "UnionPay"
[cybersource_payout.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[deutschebank]
[[deutschebank.bank_debit]]
payment_method_type = "sepa"
[[deutschebank.credit]]
payment_method_type = "Visa"
[[deutschebank.credit]]
payment_method_type = "Mastercard"
[[deutschebank.debit]]
payment_method_type = "Visa"
[[deutschebank.debit]]
payment_method_type = "Mastercard"
[deutschebank.connector_auth.SignatureKey]
api_key="Client ID"
key1="Merchant ID"
api_secret="Client Key"
[digitalvirgo]
[[digitalvirgo.mobile_payment]]
payment_method_type = "direct_carrier_billing"
[digitalvirgo.connector_auth.BodyKey]
api_key="Password"
key1="Username"
[dlocal]
[[dlocal.credit]]
payment_method_type = "Mastercard"
[[dlocal.credit]]
payment_method_type = "Visa"
[[dlocal.credit]]
payment_method_type = "Interac"
[[dlocal.credit]]
payment_method_type = "AmericanExpress"
[[dlocal.credit]]
payment_method_type = "JCB"
[[dlocal.credit]]
payment_method_type = "DinersClub"
[[dlocal.credit]]
payment_method_type = "Discover"
[[dlocal.credit]]
payment_method_type = "CartesBancaires"
[[dlocal.credit]]
payment_method_type = "UnionPay"
[[dlocal.debit]]
payment_method_type = "Mastercard"
[[dlocal.debit]]
payment_method_type = "Visa"
[[dlocal.debit]]
payment_method_type = "Interac"
[[dlocal.debit]]
payment_method_type = "AmericanExpress"
[[dlocal.debit]]
payment_method_type = "JCB"
[[dlocal.debit]]
payment_method_type = "DinersClub"
[[dlocal.debit]]
payment_method_type = "Discover"
[[dlocal.debit]]
payment_method_type = "CartesBancaires"
[[dlocal.debit]]
payment_method_type = "UnionPay"
[dlocal.connector_auth.SignatureKey]
api_key="X Login"
key1="X Trans Key"
api_secret="Secret Key"
[dlocal.connector_webhook_details]
merchant_secret="Source verification key"
[ebanx_payout]
[[ebanx_payout.bank_transfer]]
payment_method_type = "pix"
[ebanx_payout.connector_auth.HeaderKey]
api_key = "Integration Key"
[fiserv]
[[fiserv.credit]]
payment_method_type = "Mastercard"
[[fiserv.credit]]
payment_method_type = "Visa"
[[fiserv.credit]]
payment_method_type = "Interac"
[[fiserv.credit]]
payment_method_type = "AmericanExpress"
[[fiserv.credit]]
payment_method_type = "JCB"
[[fiserv.credit]]
payment_method_type = "DinersClub"
[[fiserv.credit]]
payment_method_type = "Discover"
[[fiserv.credit]]
payment_method_type = "CartesBancaires"
[[fiserv.credit]]
payment_method_type = "UnionPay"
[[fiserv.debit]]
payment_method_type = "Mastercard"
[[fiserv.debit]]
payment_method_type = "Visa"
[[fiserv.debit]]
payment_method_type = "Interac"
[[fiserv.debit]]
payment_method_type = "AmericanExpress"
[[fiserv.debit]]
payment_method_type = "JCB"
[[fiserv.debit]]
payment_method_type = "DinersClub"
[[fiserv.debit]]
payment_method_type = "Discover"
[[fiserv.debit]]
payment_method_type = "CartesBancaires"
[[fiserv.debit]]
payment_method_type = "UnionPay"
[fiserv.connector_auth.SignatureKey]
api_key="API Key"
key1="Merchant ID"
api_secret="API Secret"
[fiserv.metadata.terminal_id]
name="terminal_id"
label="Terminal ID"
placeholder="Enter Terminal ID"
required=true
type="Text"
[fiserv.connector_webhook_details]
merchant_secret="Source verification key"
[fiservemea]
[[fiservemea.credit]]
payment_method_type = "Mastercard"
[[fiservemea.credit]]
payment_method_type = "Visa"
[[fiservemea.credit]]
payment_method_type = "Interac"
[[fiservemea.credit]]
payment_method_type = "AmericanExpress"
[[fiservemea.credit]]
payment_method_type = "JCB"
[[fiservemea.credit]]
payment_method_type = "DinersClub"
[[fiservemea.credit]]
payment_method_type = "Discover"
[[fiservemea.credit]]
payment_method_type = "CartesBancaires"
[[fiservemea.credit]]
payment_method_type = "UnionPay"
[[fiservemea.debit]]
payment_method_type = "Mastercard"
[[fiservemea.debit]]
payment_method_type = "Visa"
[[fiservemea.debit]]
payment_method_type = "Interac"
[[fiservemea.debit]]
payment_method_type = "AmericanExpress"
[[fiservemea.debit]]
payment_method_type = "JCB"
[[fiservemea.debit]]
payment_method_type = "DinersClub"
[[fiservemea.debit]]
payment_method_type = "Discover"
[[fiservemea.debit]]
payment_method_type = "CartesBancaires"
[[fiservemea.debit]]
payment_method_type = "UnionPay"
[fiservemea.connector_auth.BodyKey]
api_key="API Key"
key1="Secret Key"
[forte]
[[forte.credit]]
payment_method_type = "Mastercard"
[[forte.credit]]
payment_method_type = "Visa"
[[forte.credit]]
payment_method_type = "Interac"
[[forte.credit]]
payment_method_type = "AmericanExpress"
[[forte.credit]]
payment_method_type = "JCB"
[[forte.credit]]
payment_method_type = "DinersClub"
[[forte.credit]]
payment_method_type = "Discover"
[[forte.credit]]
payment_method_type = "CartesBancaires"
[[forte.credit]]
payment_method_type = "UnionPay"
[[forte.debit]]
payment_method_type = "Mastercard"
[[forte.debit]]
payment_method_type = "Visa"
[[forte.debit]]
payment_method_type = "Interac"
[[forte.debit]]
payment_method_type = "AmericanExpress"
[[forte.debit]]
payment_method_type = "JCB"
[[forte.debit]]
payment_method_type = "DinersClub"
[[forte.debit]]
payment_method_type = "Discover"
[[forte.debit]]
payment_method_type = "CartesBancaires"
[[forte.debit]]
payment_method_type = "UnionPay"
[forte.connector_auth.MultiAuthKey]
api_key="API Access ID"
key1="Organization ID"
api_secret="API Secure Key"
key2="Location ID"
[forte.connector_webhook_details]
merchant_secret="Source verification key"
[getnet]
[[getnet.credit]]
payment_method_type = "Mastercard"
[[getnet.credit]]
payment_method_type = "Visa"
[[getnet.credit]]
payment_method_type = "Interac"
[[getnet.credit]]
payment_method_type = "AmericanExpress"
[[getnet.credit]]
payment_method_type = "JCB"
[[getnet.credit]]
payment_method_type = "DinersClub"
[[getnet.credit]]
payment_method_type = "Discover"
[[getnet.credit]]
payment_method_type = "CartesBancaires"
[[getnet.credit]]
payment_method_type = "UnionPay"
[[getnet.credit]]
payment_method_type = "RuPay"
[[getnet.credit]]
payment_method_type = "Maestro"
[globalpay]
[[globalpay.credit]]
payment_method_type = "Mastercard"
[[globalpay.credit]]
payment_method_type = "Visa"
[[globalpay.credit]]
payment_method_type = "Interac"
[[globalpay.credit]]
payment_method_type = "AmericanExpress"
[[globalpay.credit]]
payment_method_type = "JCB"
[[globalpay.credit]]
payment_method_type = "DinersClub"
[[globalpay.credit]]
payment_method_type = "Discover"
[[globalpay.credit]]
payment_method_type = "CartesBancaires"
[[globalpay.credit]]
payment_method_type = "UnionPay"
[[globalpay.debit]]
payment_method_type = "Mastercard"
[[globalpay.debit]]
payment_method_type = "Visa"
[[globalpay.debit]]
payment_method_type = "Interac"
[[globalpay.debit]]
payment_method_type = "AmericanExpress"
[[globalpay.debit]]
payment_method_type = "JCB"
[[globalpay.debit]]
payment_method_type = "DinersClub"
[[globalpay.debit]]
payment_method_type = "Discover"
[[globalpay.debit]]
payment_method_type = "CartesBancaires"
[[globalpay.debit]]
payment_method_type = "UnionPay"
[[globalpay.bank_redirect]]
payment_method_type = "ideal"
[[globalpay.bank_redirect]]
payment_method_type = "giropay"
[[globalpay.bank_redirect]]
payment_method_type = "sofort"
[[globalpay.bank_redirect]]
payment_method_type = "eps"
[[globalpay.wallet]]
payment_method_type = "google_pay"
[[globalpay.wallet]]
payment_method_type = "paypal"
[globalpay.connector_auth.BodyKey]
api_key="Global App Key"
key1="Global App ID"
[globalpay.connector_webhook_details]
merchant_secret="Source verification key"
[[globalpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[globalpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[globalpay.metadata.account_name]
name="account_name"
label="Account Name"
placeholder="Enter Account Name"
required=true
type="Text"
[globepay]
[[globepay.wallet]]
payment_method_type = "we_chat_pay"
[[globepay.wallet]]
payment_method_type = "ali_pay"
[globepay.connector_auth.BodyKey]
api_key="Partner Code"
key1="Credential Code"
[globepay.connector_webhook_details]
merchant_secret="Source verification key"
[gocardless]
[[gocardless.bank_debit]]
payment_method_type = "ach"
[[gocardless.bank_debit]]
payment_method_type = "becs"
[[gocardless.bank_debit]]
payment_method_type = "sepa"
[gocardless.connector_auth.HeaderKey]
api_key="Access Token"
[gocardless.connector_webhook_details]
merchant_secret="Source verification key"
[iatapay]
[[iatapay.upi]]
payment_method_type = "upi_collect"
[iatapay.connector_auth.SignatureKey]
api_key="Client ID"
key1="Airline ID"
api_secret="Client Secret"
[iatapay.connector_webhook_details]
merchant_secret="Source verification key"
[itaubank]
[[itaubank.bank_transfer]]
payment_method_type = "pix"
[itaubank.connector_auth.MultiAuthKey]
key1="Client Id"
api_key="Client Secret"
api_secret="Certificates"
key2="Certificate Key"
[jpmorgan]
[[jpmorgan.credit]]
payment_method_type = "AmericanExpress"
[[jpmorgan.credit]]
payment_method_type = "DinersClub"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "JCB"
[[jpmorgan.credit]]
payment_method_type = "Mastercard"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "UnionPay"
[[jpmorgan.credit]]
payment_method_type = "Visa"
[[jpmorgan.debit]]
payment_method_type = "AmericanExpress"
[[jpmorgan.debit]]
payment_method_type = "DinersClub"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "JCB"
[[jpmorgan.debit]]
payment_method_type = "Mastercard"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "UnionPay"
[[jpmorgan.debit]]
payment_method_type = "Visa"
[jpmorgan.connector_auth.BodyKey]
api_key="Client ID"
key1="Client Secret"
[klarna]
[[klarna.pay_later]]
payment_method_type = "klarna"
payment_experience = "invoke_sdk_client"
[[klarna.pay_later]]
payment_method_type = "klarna"
payment_experience = "redirect_to_url"
[klarna.connector_auth.BodyKey]
key1="Klarna Merchant Username"
api_key="Klarna Merchant ID Password"
[klarna.metadata.klarna_region]
name="klarna_region"
label="Region of your Klarna Merchant Account"
placeholder="Enter Region of your Klarna Merchant Account"
required=true
type="Select"
options=["Europe","NorthAmerica","Oceania"]
[mifinity]
[[mifinity.wallet]]
payment_method_type = "mifinity"
[mifinity.connector_auth.HeaderKey]
api_key="key"
[mifinity.metadata.brand_id]
name="brand_id"
label="Merchant Brand ID"
placeholder="Enter Brand ID"
required=true
type="Text"
[mifinity.metadata.destination_account_number]
name="destination_account_number"
label="Destination Account Number"
placeholder="Enter Destination Account Number"
required=true
type="Text"
[razorpay]
[[razorpay.upi]]
payment_method_type = "upi_collect"
[razorpay.connector_auth.BodyKey]
api_key="Razorpay Id"
key1 = "Razorpay Secret"
[mollie]
[[mollie.credit]]
payment_method_type = "Mastercard"
[[mollie.credit]]
payment_method_type = "Visa"
[[mollie.credit]]
payment_method_type = "Interac"
[[mollie.credit]]
payment_method_type = "AmericanExpress"
[[mollie.credit]]
payment_method_type = "JCB"
[[mollie.credit]]
payment_method_type = "DinersClub"
[[mollie.credit]]
payment_method_type = "Discover"
[[mollie.credit]]
payment_method_type = "CartesBancaires"
[[mollie.credit]]
payment_method_type = "UnionPay"
[[mollie.debit]]
payment_method_type = "Mastercard"
[[mollie.debit]]
payment_method_type = "Visa"
[[mollie.debit]]
payment_method_type = "Interac"
[[mollie.debit]]
payment_method_type = "AmericanExpress"
[[mollie.debit]]
payment_method_type = "JCB"
[[mollie.debit]]
payment_method_type = "DinersClub"
[[mollie.debit]]
payment_method_type = "Discover"
[[mollie.debit]]
payment_method_type = "CartesBancaires"
[[mollie.debit]]
payment_method_type = "UnionPay"
[[mollie.bank_redirect]]
payment_method_type = "ideal"
[[mollie.bank_redirect]]
payment_method_type = "giropay"
[[mollie.bank_redirect]]
payment_method_type = "sofort"
[[mollie.bank_redirect]]
payment_method_type = "eps"
[[mollie.bank_redirect]]
payment_method_type = "przelewy24"
[[mollie.bank_redirect]]
payment_method_type = "bancontact_card"
[[mollie.wallet]]
payment_method_type = "paypal"
[mollie.connector_auth.BodyKey]
api_key="API Key"
key1="Profile Token"
[mollie.connector_webhook_details]
merchant_secret="Source verification key"
[moneris]
[[moneris.credit]]
payment_method_type = "Mastercard"
[[moneris.credit]]
payment_method_type = "Visa"
[[moneris.credit]]
payment_method_type = "Interac"
[[moneris.credit]]
payment_method_type = "AmericanExpress"
[[moneris.credit]]
payment_method_type = "JCB"
[[moneris.credit]]
payment_method_type = "DinersClub"
[[moneris.credit]]
payment_method_type = "Discover"
[[moneris.credit]]
payment_method_type = "CartesBancaires"
[[moneris.credit]]
payment_method_type = "UnionPay"
[[moneris.debit]]
payment_method_type = "Mastercard"
[[moneris.debit]]
payment_method_type = "Visa"
[[moneris.debit]]
payment_method_type = "Interac"
[[moneris.debit]]
payment_method_type = "AmericanExpress"
[[moneris.debit]]
payment_method_type = "JCB"
[[moneris.debit]]
payment_method_type = "DinersClub"
[[moneris.debit]]
payment_method_type = "Discover"
[[moneris.debit]]
payment_method_type = "CartesBancaires"
[[moneris.debit]]
payment_method_type = "UnionPay"
[moneris.connector_auth.SignatureKey]
api_key="Client Secret"
key1="Client Id"
api_secret="Merchant Id"
[multisafepay]
[[multisafepay.credit]]
payment_method_type = "Mastercard"
[[multisafepay.credit]]
payment_method_type = "Visa"
[[multisafepay.credit]]
payment_method_type = "Interac"
[[multisafepay.credit]]
payment_method_type = "AmericanExpress"
[[multisafepay.credit]]
payment_method_type = "JCB"
[[multisafepay.credit]]
payment_method_type = "DinersClub"
[[multisafepay.credit]]
payment_method_type = "Discover"
[[multisafepay.credit]]
payment_method_type = "CartesBancaires"
[[multisafepay.credit]]
payment_method_type = "UnionPay"
[[multisafepay.debit]]
payment_method_type = "Mastercard"
[[multisafepay.debit]]
payment_method_type = "Visa"
[[multisafepay.debit]]
payment_method_type = "Interac"
[[multisafepay.debit]]
payment_method_type = "AmericanExpress"
[[multisafepay.debit]]
payment_method_type = "JCB"
[[multisafepay.debit]]
payment_method_type = "DinersClub"
[[multisafepay.debit]]
payment_method_type = "Discover"
[[multisafepay.debit]]
payment_method_type = "CartesBancaires"
[[multisafepay.debit]]
payment_method_type = "UnionPay"
[[multisafepay.wallet]]
payment_method_type = "google_pay"
[[multisafepay.wallet]]
payment_method_type = "paypal"
[multisafepay.connector_auth.HeaderKey]
api_key="Enter API Key"
[multisafepay.connector_webhook_details]
merchant_secret="Source verification key"
[[multisafepay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[multisafepay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[multisafepay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[multisafepay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[multisafepay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[nexinets]
[[nexinets.credit]]
payment_method_type = "Mastercard"
[[nexinets.credit]]
payment_method_type = "Visa"
[[nexinets.credit]]
payment_method_type = "Interac"
[[nexinets.credit]]
payment_method_type = "AmericanExpress"
[[nexinets.credit]]
payment_method_type = "JCB"
[[nexinets.credit]]
payment_method_type = "DinersClub"
[[nexinets.credit]]
payment_method_type = "Discover"
[[nexinets.credit]]
payment_method_type = "CartesBancaires"
[[nexinets.credit]]
payment_method_type = "UnionPay"
[[nexinets.debit]]
payment_method_type = "Mastercard"
[[nexinets.debit]]
payment_method_type = "Visa"
[[nexinets.debit]]
payment_method_type = "Interac"
[[nexinets.debit]]
payment_method_type = "AmericanExpress"
[[nexinets.debit]]
payment_method_type = "JCB"
[[nexinets.debit]]
payment_method_type = "DinersClub"
[[nexinets.debit]]
payment_method_type = "Discover"
[[nexinets.debit]]
payment_method_type = "CartesBancaires"
[[nexinets.debit]]
payment_method_type = "UnionPay"
[[nexinets.bank_redirect]]
payment_method_type = "ideal"
[[nexinets.bank_redirect]]
payment_method_type = "giropay"
[[nexinets.bank_redirect]]
payment_method_type = "sofort"
[[nexinets.bank_redirect]]
payment_method_type = "eps"
[[nexinets.wallet]]
payment_method_type = "apple_pay"
[[nexinets.wallet]]
payment_method_type = "paypal"
[nexinets.connector_auth.BodyKey]
api_key="API Key"
key1="Merchant ID"
[nexinets.connector_webhook_details]
merchant_secret="Source verification key"
[[nexinets.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[nexinets.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[nexinets.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[nexixpay]
[[nexixpay.credit]]
payment_method_type = "Mastercard"
[[nexixpay.credit]]
payment_method_type = "Visa"
[[nexixpay.credit]]
payment_method_type = "AmericanExpress"
[[nexixpay.credit]]
payment_method_type = "JCB"
[[nexixpay.debit]]
payment_method_type = "Mastercard"
[[nexixpay.debit]]
payment_method_type = "Visa"
[[nexixpay.debit]]
payment_method_type = "AmericanExpress"
[[nexixpay.debit]]
payment_method_type = "JCB"
[nexixpay.connector_auth.HeaderKey]
api_key="API Key"
[nmi]
[[nmi.credit]]
payment_method_type = "Mastercard"
[[nmi.credit]]
payment_method_type = "Visa"
[[nmi.credit]]
payment_method_type = "Interac"
[[nmi.credit]]
payment_method_type = "AmericanExpress"
[[nmi.credit]]
payment_method_type = "JCB"
[[nmi.credit]]
payment_method_type = "DinersClub"
[[nmi.credit]]
payment_method_type = "Discover"
[[nmi.credit]]
payment_method_type = "CartesBancaires"
[[nmi.credit]]
payment_method_type = "UnionPay"
[[nmi.debit]]
payment_method_type = "Mastercard"
[[nmi.debit]]
payment_method_type = "Visa"
[[nmi.debit]]
payment_method_type = "Interac"
[[nmi.debit]]
payment_method_type = "AmericanExpress"
[[nmi.debit]]
payment_method_type = "JCB"
[[nmi.debit]]
payment_method_type = "DinersClub"
[[nmi.debit]]
payment_method_type = "Discover"
[[nmi.debit]]
payment_method_type = "CartesBancaires"
[[nmi.debit]]
payment_method_type = "UnionPay"
[[nmi.bank_redirect]]
payment_method_type = "ideal"
[[nmi.wallet]]
payment_method_type = "apple_pay"
[[nmi.wallet]]
payment_method_type = "google_pay"
[nmi.connector_auth.BodyKey]
api_key="API Key"
key1="Public Key"
[nmi.connector_webhook_details]
merchant_secret="Source verification key"
[[nmi.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[nmi.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[nmi.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[nmi.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nmi.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nmi.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nmi.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[nmi.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[nmi.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[nmi.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[nmi.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[noon]
[[noon.credit]]
payment_method_type = "Mastercard"
[[noon.credit]]
payment_method_type = "Visa"
[[noon.credit]]
payment_method_type = "Interac"
[[noon.credit]]
payment_method_type = "AmericanExpress"
[[noon.credit]]
payment_method_type = "JCB"
[[noon.credit]]
payment_method_type = "DinersClub"
[[noon.credit]]
payment_method_type = "Discover"
[[noon.credit]]
payment_method_type = "CartesBancaires"
[[noon.credit]]
payment_method_type = "UnionPay"
[[noon.debit]]
payment_method_type = "Mastercard"
[[noon.debit]]
payment_method_type = "Visa"
[[noon.debit]]
payment_method_type = "Interac"
[[noon.debit]]
payment_method_type = "AmericanExpress"
[[noon.debit]]
payment_method_type = "JCB"
[[noon.debit]]
payment_method_type = "DinersClub"
[[noon.debit]]
payment_method_type = "Discover"
[[noon.debit]]
payment_method_type = "CartesBancaires"
[[noon.debit]]
payment_method_type = "UnionPay"
[[noon.wallet]]
payment_method_type = "apple_pay"
[[noon.wallet]]
payment_method_type = "google_pay"
[[noon.wallet]]
payment_method_type = "paypal"
[noon.connector_auth.SignatureKey]
api_key="API Key"
key1="Business Identifier"
api_secret="Application Identifier"
[noon.connector_webhook_details]
merchant_secret="Source verification key"
[[noon.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[noon.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[noon.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[noon.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[noon.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[noon.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[noon.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[noon.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[novalnet]
[[novalnet.credit]]
payment_method_type = "Mastercard"
[[novalnet.credit]]
payment_method_type = "Visa"
[[novalnet.credit]]
payment_method_type = "Interac"
[[novalnet.credit]]
payment_method_type = "AmericanExpress"
[[novalnet.credit]]
payment_method_type = "JCB"
[[novalnet.credit]]
payment_method_type = "DinersClub"
[[novalnet.credit]]
payment_method_type = "Discover"
[[novalnet.credit]]
payment_method_type = "CartesBancaires"
[[novalnet.credit]]
payment_method_type = "UnionPay"
[[novalnet.debit]]
payment_method_type = "Mastercard"
[[novalnet.debit]]
payment_method_type = "Visa"
[[novalnet.debit]]
payment_method_type = "Interac"
[[novalnet.debit]]
payment_method_type = "AmericanExpress"
[[novalnet.debit]]
payment_method_type = "JCB"
[[novalnet.debit]]
payment_method_type = "DinersClub"
[[novalnet.debit]]
payment_method_type = "Discover"
[[novalnet.debit]]
payment_method_type = "CartesBancaires"
[[novalnet.debit]]
payment_method_type = "UnionPay"
[[novalnet.wallet]]
payment_method_type = "google_pay"
[[novalnet.wallet]]
payment_method_type = "paypal"
[[novalnet.wallet]]
payment_method_type = "apple_pay"
[novalnet.connector_auth.SignatureKey]
api_key="Product Activation Key"
key1="Payment Access Key"
api_secret="Tariff ID"
[novalnet.connector_webhook_details]
merchant_secret="Source verification key"
[[novalnet.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[novalnet.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[novalnet.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[novalnet.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[novalnet.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[nuvei]
[[nuvei.credit]]
payment_method_type = "Mastercard"
[[nuvei.credit]]
payment_method_type = "Visa"
[[nuvei.credit]]
payment_method_type = "Interac"
[[nuvei.credit]]
payment_method_type = "AmericanExpress"
[[nuvei.credit]]
payment_method_type = "JCB"
[[nuvei.credit]]
payment_method_type = "DinersClub"
[[nuvei.credit]]
payment_method_type = "Discover"
[[nuvei.credit]]
payment_method_type = "CartesBancaires"
[[nuvei.credit]]
payment_method_type = "UnionPay"
[[nuvei.debit]]
payment_method_type = "Mastercard"
[[nuvei.debit]]
payment_method_type = "Visa"
[[nuvei.debit]]
payment_method_type = "Interac"
[[nuvei.debit]]
payment_method_type = "AmericanExpress"
[[nuvei.debit]]
payment_method_type = "JCB"
[[nuvei.debit]]
payment_method_type = "DinersClub"
[[nuvei.debit]]
payment_method_type = "Discover"
[[nuvei.debit]]
payment_method_type = "CartesBancaires"
[[nuvei.debit]]
payment_method_type = "UnionPay"
[[nuvei.pay_later]]
payment_method_type = "klarna"
[[nuvei.pay_later]]
payment_method_type = "afterpay_clearpay"
[[nuvei.bank_redirect]]
payment_method_type = "ideal"
[[nuvei.bank_redirect]]
payment_method_type = "giropay"
[[nuvei.bank_redirect]]
payment_method_type = "sofort"
[[nuvei.bank_redirect]]
payment_method_type = "eps"
[[nuvei.wallet]]
payment_method_type = "apple_pay"
[[nuvei.wallet]]
payment_method_type = "google_pay"
[[nuvei.wallet]]
payment_method_type = "paypal"
[nuvei.connector_auth.SignatureKey]
api_key="Merchant ID"
key1="Merchant Site ID"
api_secret="Merchant Secret"
[nuvei.connector_webhook_details]
merchant_secret="Source verification key"
[[nuvei.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[nuvei.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[nuvei.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[nuvei.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nuvei.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nuvei.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nuvei.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[nuvei.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[opennode]
[[opennode.crypto]]
payment_method_type = "crypto_currency"
[opennode.connector_auth.HeaderKey]
api_key="API Key"
[opennode.connector_webhook_details]
merchant_secret="Source verification key"
[prophetpay]
[[prophetpay.card_redirect]]
payment_method_type = "card_redirect"
[prophetpay.connector_auth.SignatureKey]
api_key="Username"
key1="Token"
api_secret="Profile"
[payme]
[[payme.credit]]
payment_method_type = "Mastercard"
[[payme.credit]]
payment_method_type = "Visa"
[[payme.credit]]
payment_method_type = "Interac"
[[payme.credit]]
payment_method_type = "AmericanExpress"
[[payme.credit]]
payment_method_type = "JCB"
[[payme.credit]]
payment_method_type = "DinersClub"
[[payme.credit]]
payment_method_type = "Discover"
[[payme.credit]]
payment_method_type = "CartesBancaires"
[[payme.credit]]
payment_method_type = "UnionPay"
[[payme.debit]]
payment_method_type = "Mastercard"
[[payme.debit]]
payment_method_type = "Visa"
[[payme.debit]]
payment_method_type = "Interac"
[[payme.debit]]
payment_method_type = "AmericanExpress"
[[payme.debit]]
payment_method_type = "JCB"
[[payme.debit]]
payment_method_type = "DinersClub"
[[payme.debit]]
payment_method_type = "Discover"
[[payme.debit]]
payment_method_type = "CartesBancaires"
[[payme.debit]]
payment_method_type = "UnionPay"
[payme.connector_auth.BodyKey]
api_key="Seller Payme Id"
key1="Payme Public Key"
[payme.connector_webhook_details]
merchant_secret="Payme Client Secret"
additional_secret="Payme Client Key"
[paypal]
[[paypal.credit]]
payment_method_type = "Mastercard"
[[paypal.credit]]
payment_method_type = "Visa"
[[paypal.credit]]
payment_method_type = "Interac"
[[paypal.credit]]
payment_method_type = "AmericanExpress"
[[paypal.credit]]
payment_method_type = "JCB"
[[paypal.credit]]
payment_method_type = "DinersClub"
[[paypal.credit]]
payment_method_type = "Discover"
[[paypal.credit]]
payment_method_type = "CartesBancaires"
[[paypal.credit]]
payment_method_type = "UnionPay"
[[paypal.debit]]
payment_method_type = "Mastercard"
[[paypal.debit]]
payment_method_type = "Visa"
[[paypal.debit]]
payment_method_type = "Interac"
[[paypal.debit]]
payment_method_type = "AmericanExpress"
[[paypal.debit]]
payment_method_type = "JCB"
[[paypal.debit]]
payment_method_type = "DinersClub"
[[paypal.debit]]
payment_method_type = "Discover"
[[paypal.debit]]
payment_method_type = "CartesBancaires"
[[paypal.debit]]
payment_method_type = "UnionPay"
[[paypal.wallet]]
payment_method_type = "paypal"
payment_experience = "invoke_sdk_client"
[[paypal.wallet]]
payment_method_type = "paypal"
payment_experience = "redirect_to_url"
[[paypal.bank_redirect]]
payment_method_type = "ideal"
[[paypal.bank_redirect]]
payment_method_type = "giropay"
[[paypal.bank_redirect]]
payment_method_type = "sofort"
[[paypal.bank_redirect]]
payment_method_type = "eps"
is_verifiable = true
[paypal.connector_auth.BodyKey]
api_key="Client Secret"
key1="Client ID"
[paypal.connector_webhook_details]
merchant_secret="Source verification key"
[paypal.metadata.paypal_sdk]
client_id="Client ID"
[paypal_payout]
[[paypal_payout.wallet]]
payment_method_type = "paypal"
[[paypal_payout.wallet]]
payment_method_type = "venmo"
[paypal_payout.connector_auth.BodyKey]
api_key="Client Secret"
key1="Client ID"
[paystack]
[[paystack.bank_redirect]]
payment_method_type = "eft"
[paystack.connector_auth.HeaderKey]
api_key="API Key"
[paystack.connector_webhook_details]
merchant_secret="API Key"
[payu]
[[payu.credit]]
payment_method_type = "Mastercard"
[[payu.credit]]
payment_method_type = "Visa"
[[payu.credit]]
payment_method_type = "Interac"
[[payu.credit]]
payment_method_type = "AmericanExpress"
[[payu.credit]]
payment_method_type = "JCB"
[[payu.credit]]
payment_method_type = "DinersClub"
[[payu.credit]]
payment_method_type = "Discover"
[[payu.credit]]
payment_method_type = "CartesBancaires"
[[payu.credit]]
payment_method_type = "UnionPay"
[[payu.debit]]
payment_method_type = "Mastercard"
[[payu.debit]]
payment_method_type = "Visa"
[[payu.debit]]
payment_method_type = "Interac"
[[payu.debit]]
payment_method_type = "AmericanExpress"
[[payu.debit]]
payment_method_type = "JCB"
[[payu.debit]]
payment_method_type = "DinersClub"
[[payu.debit]]
payment_method_type = "Discover"
[[payu.debit]]
payment_method_type = "CartesBancaires"
[[payu.debit]]
payment_method_type = "UnionPay"
[[payu.wallet]]
payment_method_type = "google_pay"
[payu.connector_auth.BodyKey]
api_key="API Key"
key1="Merchant POS ID"
[payu.connector_webhook_details]
merchant_secret="Source verification key"
[[payu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[payu.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[placetopay]
[[placetopay.credit]]
payment_method_type = "Mastercard"
[[placetopay.credit]]
payment_method_type = "Visa"
[[placetopay.credit]]
payment_method_type = "Interac"
[[placetopay.credit]]
payment_method_type = "AmericanExpress"
[[placetopay.credit]]
payment_method_type = "JCB"
[[placetopay.credit]]
payment_method_type = "DinersClub"
[[placetopay.credit]]
payment_method_type = "Discover"
[[placetopay.credit]]
payment_method_type = "CartesBancaires"
[[placetopay.credit]]
payment_method_type = "UnionPay"
[[placetopay.debit]]
payment_method_type = "Mastercard"
[[placetopay.debit]]
payment_method_type = "Visa"
[[placetopay.debit]]
payment_method_type = "Interac"
[[placetopay.debit]]
payment_method_type = "AmericanExpress"
[[placetopay.debit]]
payment_method_type = "JCB"
[[placetopay.debit]]
payment_method_type = "DinersClub"
[[placetopay.debit]]
payment_method_type = "Discover"
[[placetopay.debit]]
payment_method_type = "CartesBancaires"
[[placetopay.debit]]
payment_method_type = "UnionPay"
[placetopay.connector_auth.BodyKey]
api_key="Login"
key1="Trankey"
[plaid]
[[plaid.open_banking]]
payment_method_type = "open_banking_pis"
[plaid.connector_auth.BodyKey]
api_key="client_id"
key1="secret"
[plaid.additional_merchant_data.open_banking_recipient_data]
name="open_banking_recipient_data"
label="Open Banking Recipient Data"
placeholder="Enter Open Banking Recipient Data"
required=true
type="Select"
options=["account_data","connector_recipient_id","wallet_id"]
[plaid.additional_merchant_data.account_data]
name="account_data"
label="Bank scheme"
placeholder="Enter account_data"
required=true
type="Select"
options=["iban","bacs"]
[plaid.additional_merchant_data.connector_recipient_id]
name="connector_recipient_id"
label="Connector Recipient Id"
placeholder="Enter connector recipient id"
required=true
type="Text"
[plaid.additional_merchant_data.wallet_id]
name="wallet_id"
label="Wallet Id"
placeholder="Enter wallet id"
required=true
type="Text"
[[plaid.additional_merchant_data.iban]]
name="iban"
label="Iban"
placeholder="Enter iban"
required=true
type="Text"
[[plaid.additional_merchant_data.iban]]
name="iban.name"
label="Name"
placeholder="Enter name"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="sort_code"
label="Sort Code"
placeholder="Enter sort code"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="account_number"
label="Account number"
placeholder="Enter account number"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="bacs.name"
label="Name"
placeholder="Enter name"
required=true
type="Text"
[powertranz]
[[powertranz.credit]]
payment_method_type = "Mastercard"
[[powertranz.credit]]
payment_method_type = "Visa"
[[powertranz.credit]]
payment_method_type = "Interac"
[[powertranz.credit]]
payment_method_type = "AmericanExpress"
[[powertranz.credit]]
payment_method_type = "JCB"
[[powertranz.credit]]
payment_method_type = "DinersClub"
[[powertranz.credit]]
payment_method_type = "Discover"
[[powertranz.credit]]
payment_method_type = "CartesBancaires"
[[powertranz.credit]]
payment_method_type = "UnionPay"
[[powertranz.debit]]
payment_method_type = "Mastercard"
[[powertranz.debit]]
payment_method_type = "Visa"
[[powertranz.debit]]
payment_method_type = "Interac"
[[powertranz.debit]]
payment_method_type = "AmericanExpress"
[[powertranz.debit]]
payment_method_type = "JCB"
[[powertranz.debit]]
payment_method_type = "DinersClub"
[[powertranz.debit]]
payment_method_type = "Discover"
[[powertranz.debit]]
payment_method_type = "CartesBancaires"
[[powertranz.debit]]
payment_method_type = "UnionPay"
[powertranz.connector_auth.BodyKey]
key1 = "PowerTranz Id"
api_key="PowerTranz Password"
[powertranz.connector_webhook_details]
merchant_secret="Source verification key"
[rapyd]
[[rapyd.credit]]
payment_method_type = "Mastercard"
[[rapyd.credit]]
payment_method_type = "Visa"
[[rapyd.credit]]
payment_method_type = "Interac"
[[rapyd.credit]]
payment_method_type = "AmericanExpress"
[[rapyd.credit]]
payment_method_type = "JCB"
[[rapyd.credit]]
payment_method_type = "DinersClub"
[[rapyd.credit]]
payment_method_type = "Discover"
[[rapyd.credit]]
payment_method_type = "CartesBancaires"
[[rapyd.credit]]
payment_method_type = "UnionPay"
[[rapyd.debit]]
payment_method_type = "Mastercard"
[[rapyd.debit]]
payment_method_type = "Visa"
[[rapyd.debit]]
payment_method_type = "Interac"
[[rapyd.debit]]
payment_method_type = "AmericanExpress"
[[rapyd.debit]]
payment_method_type = "JCB"
[[rapyd.debit]]
payment_method_type = "DinersClub"
[[rapyd.debit]]
payment_method_type = "Discover"
[[rapyd.debit]]
payment_method_type = "CartesBancaires"
[[rapyd.debit]]
payment_method_type = "UnionPay"
[[rapyd.wallet]]
payment_method_type = "apple_pay"
[rapyd.connector_auth.BodyKey]
api_key="Access Key"
key1="API Secret"
[rapyd.connector_webhook_details]
merchant_secret="Source verification key"
[[rapyd.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[rapyd.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[rapyd.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[shift4]
[[shift4.credit]]
payment_method_type = "Mastercard"
[[shift4.credit]]
payment_method_type = "Visa"
[[shift4.credit]]
payment_method_type = "Interac"
[[shift4.credit]]
payment_method_type = "AmericanExpress"
[[shift4.credit]]
payment_method_type = "JCB"
[[shift4.credit]]
payment_method_type = "DinersClub"
[[shift4.credit]]
payment_method_type = "Discover"
[[shift4.credit]]
payment_method_type = "CartesBancaires"
[[shift4.credit]]
payment_method_type = "UnionPay"
[[shift4.debit]]
payment_method_type = "Mastercard"
[[shift4.debit]]
payment_method_type = "Visa"
[[shift4.debit]]
payment_method_type = "Interac"
[[shift4.debit]]
payment_method_type = "AmericanExpress"
[[shift4.debit]]
payment_method_type = "JCB"
[[shift4.debit]]
payment_method_type = "DinersClub"
[[shift4.debit]]
payment_method_type = "Discover"
[[shift4.debit]]
payment_method_type = "CartesBancaires"
[[shift4.debit]]
payment_method_type = "UnionPay"
[[shift4.bank_redirect]]
payment_method_type = "ideal"
[[shift4.bank_redirect]]
payment_method_type = "giropay"
[[shift4.bank_redirect]]
payment_method_type = "sofort"
[[shift4.bank_redirect]]
payment_method_type = "eps"
[shift4.connector_auth.HeaderKey]
api_key="API Key"
[shift4.connector_webhook_details]
merchant_secret="Source verification key"
[stripe]
[[stripe.credit]]
payment_method_type = "Mastercard"
[[stripe.credit]]
payment_method_type = "Visa"
[[stripe.credit]]
payment_method_type = "Interac"
[[stripe.credit]]
payment_method_type = "AmericanExpress"
[[stripe.credit]]
payment_method_type = "JCB"
[[stripe.credit]]
payment_method_type = "DinersClub"
[[stripe.credit]]
payment_method_type = "Discover"
[[stripe.credit]]
payment_method_type = "CartesBancaires"
[[stripe.credit]]
payment_method_type = "UnionPay"
[[stripe.debit]]
payment_method_type = "Mastercard"
[[stripe.debit]]
payment_method_type = "Visa"
[[stripe.debit]]
payment_method_type = "Interac"
[[stripe.debit]]
payment_method_type = "AmericanExpress"
[[stripe.debit]]
payment_method_type = "JCB"
[[stripe.debit]]
payment_method_type = "DinersClub"
[[stripe.debit]]
payment_method_type = "Discover"
[[stripe.debit]]
payment_method_type = "CartesBancaires"
[[stripe.debit]]
payment_method_type = "UnionPay"
[[stripe.pay_later]]
payment_method_type = "klarna"
[[stripe.pay_later]]
payment_method_type = "affirm"
[[stripe.pay_later]]
payment_method_type = "afterpay_clearpay"
[[stripe.bank_redirect]]
payment_method_type = "ideal"
[[stripe.bank_redirect]]
payment_method_type = "giropay"
[[stripe.bank_redirect]]
payment_method_type = "sofort"
[[stripe.bank_redirect]]
payment_method_type = "eps"
[[stripe.bank_redirect]]
payment_method_type = "bancontact_card"
[[stripe.bank_redirect]]
payment_method_type = "przelewy24"
[[stripe.bank_debit]]
payment_method_type = "ach"
[[stripe.bank_debit]]
payment_method_type = "bacs"
[[stripe.bank_debit]]
payment_method_type = "becs"
[[stripe.bank_debit]]
payment_method_type = "sepa"
[[stripe.bank_transfer]]
payment_method_type = "ach"
[[stripe.bank_transfer]]
payment_method_type = "bacs"
[[stripe.bank_transfer]]
payment_method_type = "sepa"
[[stripe.bank_transfer]]
payment_method_type = "multibanco"
[[stripe.wallet]]
payment_method_type = "amazon_pay"
[[stripe.wallet]]
payment_method_type = "apple_pay"
[[stripe.wallet]]
payment_method_type = "google_pay"
[[stripe.wallet]]
payment_method_type = "we_chat_pay"
[[stripe.wallet]]
payment_method_type = "ali_pay"
[[stripe.wallet]]
payment_method_type = "cashapp"
payment_experience = "display_qr_code"
is_verifiable = true
[stripe.connector_auth.HeaderKey]
api_key="Secret Key"
[stripe.connector_webhook_details]
merchant_secret="Source verification key"
[[stripe.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[stripe.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[stripe.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[stripe.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="stripe:publishableKey"
label="Stripe Publishable Key"
placeholder="Enter Stripe Publishable Key"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[stripe.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="stripe:publishableKey"
label="Stripe Publishable Key"
placeholder="Enter Stripe Publishable Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[stax]
[[stax.credit]]
payment_method_type = "Mastercard"
[[stax.credit]]
payment_method_type = "Visa"
[[stax.credit]]
payment_method_type = "Interac"
[[stax.credit]]
payment_method_type = "AmericanExpress"
[[stax.credit]]
payment_method_type = "JCB"
[[stax.credit]]
payment_method_type = "DinersClub"
[[stax.credit]]
payment_method_type = "Discover"
[[stax.credit]]
payment_method_type = "CartesBancaires"
[[stax.credit]]
payment_method_type = "UnionPay"
[[stax.debit]]
payment_method_type = "Mastercard"
[[stax.debit]]
payment_method_type = "Visa"
[[stax.debit]]
payment_method_type = "Interac"
[[stax.debit]]
payment_method_type = "AmericanExpress"
[[stax.debit]]
payment_method_type = "JCB"
[[stax.debit]]
payment_method_type = "DinersClub"
[[stax.debit]]
payment_method_type = "Discover"
[[stax.debit]]
payment_method_type = "CartesBancaires"
[[stax.debit]]
payment_method_type = "UnionPay"
[[stax.bank_debit]]
payment_method_type = "ach"
[stax.connector_auth.HeaderKey]
api_key="Api Key"
[stax.connector_webhook_details]
merchant_secret="Source verification key"
[square]
[[square.credit]]
payment_method_type = "Mastercard"
[[square.credit]]
payment_method_type = "Visa"
[[square.credit]]
payment_method_type = "Interac"
[[square.credit]]
payment_method_type = "AmericanExpress"
[[square.credit]]
payment_method_type = "JCB"
[[square.credit]]
payment_method_type = "DinersClub"
[[square.credit]]
payment_method_type = "Discover"
[[square.credit]]
payment_method_type = "CartesBancaires"
[[square.credit]]
payment_method_type = "UnionPay"
[[square.debit]]
payment_method_type = "Mastercard"
[[square.debit]]
payment_method_type = "Visa"
[[square.debit]]
payment_method_type = "Interac"
[[square.debit]]
payment_method_type = "AmericanExpress"
[[square.debit]]
payment_method_type = "JCB"
[[square.debit]]
payment_method_type = "DinersClub"
[[square.debit]]
payment_method_type = "Discover"
[[square.debit]]
payment_method_type = "CartesBancaires"
[[square.debit]]
payment_method_type = "UnionPay"
[square.connector_auth.BodyKey]
api_key = "Square API Key"
key1 = "Square Client Id"
[square.connector_webhook_details]
merchant_secret="Source verification key"
[trustpay]
[[trustpay.credit]]
payment_method_type = "Mastercard"
[[trustpay.credit]]
payment_method_type = "Visa"
[[trustpay.credit]]
payment_method_type = "Interac"
[[trustpay.credit]]
payment_method_type = "AmericanExpress"
[[trustpay.credit]]
payment_method_type = "JCB"
[[trustpay.credit]]
payment_method_type = "DinersClub"
[[trustpay.credit]]
payment_method_type = "Discover"
[[trustpay.credit]]
payment_method_type = "CartesBancaires"
[[trustpay.credit]]
payment_method_type = "UnionPay"
[[trustpay.debit]]
payment_method_type = "Mastercard"
[[trustpay.debit]]
payment_method_type = "Visa"
[[trustpay.debit]]
payment_method_type = "Interac"
[[trustpay.debit]]
payment_method_type = "AmericanExpress"
[[trustpay.debit]]
payment_method_type = "JCB"
[[trustpay.debit]]
payment_method_type = "DinersClub"
[[trustpay.debit]]
payment_method_type = "Discover"
[[trustpay.debit]]
payment_method_type = "CartesBancaires"
[[trustpay.debit]]
payment_method_type = "UnionPay"
[[trustpay.bank_redirect]]
payment_method_type = "ideal"
[[trustpay.bank_redirect]]
payment_method_type = "giropay"
[[trustpay.bank_redirect]]
payment_method_type = "sofort"
[[trustpay.bank_redirect]]
payment_method_type = "eps"
[[trustpay.bank_redirect]]
payment_method_type = "blik"
[[trustpay.wallet]]
payment_method_type = "apple_pay"
[[trustpay.wallet]]
payment_method_type = "google_pay"
[[trustpay.bank_transfer]]
payment_method_type = "sepa_bank_transfer"
[[trustpay.bank_transfer]]
payment_method_type = "instant_bank_transfer"
[trustpay.connector_auth.SignatureKey]
api_key="API Key"
key1="Project ID"
api_secret="Secret Key"
[trustpay.connector_webhook_details]
merchant_secret="Source verification key"
[[trustpay.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[trustpay.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[trustpay.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[trustpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[trustpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[tsys]
[[tsys.credit]]
payment_method_type = "Mastercard"
[[tsys.credit]]
payment_method_type = "Visa"
[[tsys.credit]]
payment_method_type = "Interac"
[[tsys.credit]]
payment_method_type = "AmericanExpress"
[[tsys.credit]]
payment_method_type = "JCB"
[[tsys.credit]]
payment_method_type = "DinersClub"
[[tsys.credit]]
payment_method_type = "Discover"
[[tsys.credit]]
payment_method_type = "CartesBancaires"
[[tsys.credit]]
payment_method_type = "UnionPay"
[[tsys.debit]]
payment_method_type = "Mastercard"
[[tsys.debit]]
payment_method_type = "Visa"
[[tsys.debit]]
payment_method_type = "Interac"
[[tsys.debit]]
payment_method_type = "AmericanExpress"
[[tsys.debit]]
payment_method_type = "JCB"
[[tsys.debit]]
payment_method_type = "DinersClub"
[[tsys.debit]]
payment_method_type = "Discover"
[[tsys.debit]]
payment_method_type = "CartesBancaires"
[[tsys.debit]]
payment_method_type = "UnionPay"
[tsys.connector_auth.SignatureKey]
api_key="Device Id"
key1="Transaction Key"
api_secret="Developer Id"
[tsys.connector_webhook_details]
merchant_secret="Source verification key"
[volt]
[[volt.bank_redirect]]
payment_method_type = "open_banking_uk"
[volt.connector_auth.MultiAuthKey]
api_key = "Username"
api_secret = "Password"
key1 = "Client ID"
key2 = "Client Secret"
[volt.connector_webhook_details]
merchant_secret="Source verification key"
[worldline]
[[worldline.credit]]
payment_method_type = "Mastercard"
[[worldline.credit]]
payment_method_type = "Visa"
[[worldline.credit]]
payment_method_type = "Interac"
[[worldline.credit]]
payment_method_type = "AmericanExpress"
[[worldline.credit]]
payment_method_type = "JCB"
[[worldline.credit]]
payment_method_type = "DinersClub"
[[worldline.credit]]
payment_method_type = "Discover"
[[worldline.credit]]
payment_method_type = "CartesBancaires"
[[worldline.credit]]
payment_method_type = "UnionPay"
[[worldline.debit]]
payment_method_type = "Mastercard"
[[worldline.debit]]
payment_method_type = "Visa"
[[worldline.debit]]
payment_method_type = "Interac"
[[worldline.debit]]
payment_method_type = "AmericanExpress"
[[worldline.debit]]
payment_method_type = "JCB"
[[worldline.debit]]
payment_method_type = "DinersClub"
[[worldline.debit]]
payment_method_type = "Discover"
[[worldline.debit]]
payment_method_type = "CartesBancaires"
[[worldline.debit]]
payment_method_type = "UnionPay"
[[worldline.bank_redirect]]
payment_method_type = "ideal"
[[worldline.bank_redirect]]
payment_method_type = "giropay"
[worldline.connector_auth.SignatureKey]
api_key="API Key ID"
key1="Merchant ID"
api_secret="Secret API Key"
[worldline.connector_webhook_details]
merchant_secret="Source verification key"
[worldpay]
[[worldpay.credit]]
payment_method_type = "Mastercard"
[[worldpay.credit]]
payment_method_type = "Visa"
[[worldpay.credit]]
payment_method_type = "Interac"
[[worldpay.credit]]
payment_method_type = "AmericanExpress"
[[worldpay.credit]]
payment_method_type = "JCB"
[[worldpay.credit]]
payment_method_type = "DinersClub"
[[worldpay.credit]]
payment_method_type = "Discover"
[[worldpay.credit]]
payment_method_type = "CartesBancaires"
[[worldpay.credit]]
payment_method_type = "UnionPay"
[[worldpay.debit]]
payment_method_type = "Mastercard"
[[worldpay.debit]]
payment_method_type = "Visa"
[[worldpay.debit]]
payment_method_type = "Interac"
[[worldpay.debit]]
payment_method_type = "AmericanExpress"
[[worldpay.debit]]
payment_method_type = "JCB"
[[worldpay.debit]]
payment_method_type = "DinersClub"
[[worldpay.debit]]
payment_method_type = "Discover"
[[worldpay.debit]]
payment_method_type = "CartesBancaires"
[[worldpay.debit]]
payment_method_type = "UnionPay"
[[worldpay.wallet]]
payment_method_type = "google_pay"
[[worldpay.wallet]]
payment_method_type = "apple_pay"
[worldpay.connector_auth.SignatureKey]
key1="Username"
api_key="Password"
api_secret="Merchant Identifier"
[worldpay.connector_webhook_details]
merchant_secret="Source verification key"
[worldpay.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant to de displayed during 3DS challenge"
placeholder="Enter Name of the merchant"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[worldpay.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[worldpay.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[worldpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[worldpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[zen]
[[zen.credit]]
payment_method_type = "Mastercard"
[[zen.credit]]
payment_method_type = "Visa"
[[zen.credit]]
payment_method_type = "Interac"
[[zen.credit]]
payment_method_type = "AmericanExpress"
[[zen.credit]]
payment_method_type = "JCB"
[[zen.credit]]
payment_method_type = "DinersClub"
[[zen.credit]]
payment_method_type = "Discover"
[[zen.credit]]
payment_method_type = "CartesBancaires"
[[zen.credit]]
payment_method_type = "UnionPay"
[[zen.debit]]
payment_method_type = "Mastercard"
[[zen.debit]]
payment_method_type = "Visa"
[[zen.debit]]
payment_method_type = "Interac"
[[zen.debit]]
payment_method_type = "AmericanExpress"
[[zen.debit]]
payment_method_type = "JCB"
[[zen.debit]]
payment_method_type = "DinersClub"
[[zen.debit]]
payment_method_type = "Discover"
[[zen.debit]]
payment_method_type = "CartesBancaires"
[[zen.debit]]
payment_method_type = "UnionPay"
[[zen.voucher]]
payment_method_type = "boleto"
[[zen.voucher]]
payment_method_type = "efecty"
[[zen.voucher]]
payment_method_type = "pago_efectivo"
[[zen.voucher]]
payment_method_type = "red_compra"
[[zen.voucher]]
payment_method_type = "red_pagos"
[[zen.bank_transfer]]
payment_method_type = "pix"
[[zen.bank_transfer]]
payment_method_type = "pse"
[[zen.wallet]]
payment_method_type = "apple_pay"
[[zen.wallet]]
payment_method_type = "google_pay"
[zen.connector_auth.HeaderKey]
api_key="API Key"
[zen.connector_webhook_details]
merchant_secret="Source verification key"
[[zen.metadata.apple_pay]]
name="terminal_uuid"
label="Terminal UUID"
placeholder="Enter Terminal UUID"
required=true
type="Text"
[[zen.metadata.apple_pay]]
name="pay_wall_secret"
label="Pay Wall Secret"
placeholder="Enter Pay Wall Secret"
required=true
type="Text"
[[zen.metadata.google_pay]]
name="terminal_uuid"
label="Terminal UUID"
placeholder="Enter Terminal UUID"
required=true
type="Text"
[[zen.metadata.google_pay]]
name="pay_wall_secret"
label="Pay Wall Secret"
placeholder="Enter Pay Wall Secret"
required=true
type="Text"
[zsl]
[[zsl.bank_transfer]]
payment_method_type = "local_bank_transfer"
[zsl.connector_auth.BodyKey]
api_key = "Key"
key1 = "Merchant ID"
[dummy_connector]
[[dummy_connector.credit]]
payment_method_type = "Mastercard"
[[dummy_connector.credit]]
payment_method_type = "Visa"
[[dummy_connector.credit]]
payment_method_type = "Interac"
[[dummy_connector.credit]]
payment_method_type = "AmericanExpress"
[[dummy_connector.credit]]
payment_method_type = "JCB"
[[dummy_connector.credit]]
payment_method_type = "DinersClub"
[[dummy_connector.credit]]
payment_method_type = "Discover"
[[dummy_connector.credit]]
payment_method_type = "CartesBancaires"
[[dummy_connector.credit]]
payment_method_type = "UnionPay"
[[dummy_connector.debit]]
payment_method_type = "Mastercard"
[[dummy_connector.debit]]
payment_method_type = "Visa"
[[dummy_connector.debit]]
payment_method_type = "Interac"
[[dummy_connector.debit]]
payment_method_type = "AmericanExpress"
[[dummy_connector.debit]]
payment_method_type = "JCB"
[[dummy_connector.debit]]
payment_method_type = "DinersClub"
[[dummy_connector.debit]]
payment_method_type = "Discover"
[[dummy_connector.debit]]
payment_method_type = "CartesBancaires"
[[dummy_connector.debit]]
payment_method_type = "UnionPay"
[dummy_connector.connector_auth.HeaderKey]
api_key="Api Key"
[paypal_test]
[[paypal_test.credit]]
payment_method_type = "Mastercard"
[[paypal_test.credit]]
payment_method_type = "Visa"
[[paypal_test.credit]]
payment_method_type = "Interac"
[[paypal_test.credit]]
payment_method_type = "AmericanExpress"
[[paypal_test.credit]]
payment_method_type = "JCB"
[[paypal_test.credit]]
payment_method_type = "DinersClub"
[[paypal_test.credit]]
payment_method_type = "Discover"
[[paypal_test.credit]]
payment_method_type = "CartesBancaires"
[[paypal_test.credit]]
payment_method_type = "UnionPay"
[[paypal_test.debit]]
payment_method_type = "Mastercard"
[[paypal_test.debit]]
payment_method_type = "Visa"
[[paypal_test.debit]]
payment_method_type = "Interac"
[[paypal_test.debit]]
payment_method_type = "AmericanExpress"
[[paypal_test.debit]]
payment_method_type = "JCB"
[[paypal_test.debit]]
payment_method_type = "DinersClub"
[[paypal_test.debit]]
payment_method_type = "Discover"
[[paypal_test.debit]]
payment_method_type = "CartesBancaires"
[[paypal_test.debit]]
payment_method_type = "UnionPay"
[[paypal_test.wallet]]
payment_method_type = "paypal"
[paypal_test.connector_auth.HeaderKey]
api_key="Api Key"
[stripe_test]
[[stripe_test.credit]]
payment_method_type = "Mastercard"
[[stripe_test.credit]]
payment_method_type = "Visa"
[[stripe_test.credit]]
payment_method_type = "Interac"
[[stripe_test.credit]]
payment_method_type = "AmericanExpress"
[[stripe_test.credit]]
payment_method_type = "JCB"
[[stripe_test.credit]]
payment_method_type = "DinersClub"
[[stripe_test.credit]]
payment_method_type = "Discover"
[[stripe_test.credit]]
payment_method_type = "CartesBancaires"
[[stripe_test.credit]]
payment_method_type = "UnionPay"
[[stripe_test.debit]]
payment_method_type = "Mastercard"
[[stripe_test.debit]]
payment_method_type = "Visa"
[[stripe_test.debit]]
payment_method_type = "Interac"
[[stripe_test.debit]]
payment_method_type = "AmericanExpress"
[[stripe_test.debit]]
payment_method_type = "JCB"
[[stripe_test.debit]]
payment_method_type = "DinersClub"
[[stripe_test.debit]]
payment_method_type = "Discover"
[[stripe_test.debit]]
payment_method_type = "CartesBancaires"
[[stripe_test.debit]]
payment_method_type = "UnionPay"
[[stripe_test.wallet]]
payment_method_type = "google_pay"
[[stripe_test.wallet]]
payment_method_type = "ali_pay"
[[stripe_test.wallet]]
payment_method_type = "we_chat_pay"
[[stripe_test.pay_later]]
payment_method_type = "klarna"
[[stripe_test.pay_later]]
payment_method_type = "affirm"
[[stripe_test.pay_later]]
payment_method_type = "afterpay_clearpay"
[stripe_test.connector_auth.HeaderKey]
api_key="Api Key"
[helcim]
[[helcim.credit]]
payment_method_type = "Mastercard"
[[helcim.credit]]
payment_method_type = "Visa"
[[helcim.credit]]
payment_method_type = "Interac"
[[helcim.credit]]
payment_method_type = "AmericanExpress"
[[helcim.credit]]
payment_method_type = "JCB"
[[helcim.credit]]
payment_method_type = "DinersClub"
[[helcim.credit]]
payment_method_type = "Discover"
[[helcim.credit]]
payment_method_type = "CartesBancaires"
[[helcim.credit]]
payment_method_type = "UnionPay"
[[helcim.debit]]
payment_method_type = "Mastercard"
[[helcim.debit]]
payment_method_type = "Visa"
[[helcim.debit]]
payment_method_type = "Interac"
[[helcim.debit]]
payment_method_type = "AmericanExpress"
[[helcim.debit]]
payment_method_type = "JCB"
[[helcim.debit]]
payment_method_type = "DinersClub"
[[helcim.debit]]
payment_method_type = "Discover"
[[helcim.debit]]
payment_method_type = "CartesBancaires"
[[helcim.debit]]
payment_method_type = "UnionPay"
[helcim.connector_auth.HeaderKey]
api_key="Api Key"
[adyen_payout]
[[adyen_payout.credit]]
payment_method_type = "Mastercard"
[[adyen_payout.credit]]
payment_method_type = "Visa"
[[adyen_payout.credit]]
payment_method_type = "Interac"
[[adyen_payout.credit]]
payment_method_type = "AmericanExpress"
[[adyen_payout.credit]]
payment_method_type = "JCB"
[[adyen_payout.credit]]
payment_method_type = "DinersClub"
[[adyen_payout.credit]]
payment_method_type = "Discover"
[[adyen_payout.credit]]
payment_method_type = "CartesBancaires"
[[adyen_payout.credit]]
payment_method_type = "UnionPay"
[[adyen_payout.debit]]
payment_method_type = "Mastercard"
[[adyen_payout.debit]]
payment_method_type = "Visa"
[[adyen_payout.debit]]
payment_method_type = "Interac"
[[adyen_payout.debit]]
payment_method_type = "AmericanExpress"
[[adyen_payout.debit]]
payment_method_type = "JCB"
[[adyen_payout.debit]]
payment_method_type = "DinersClub"
[[adyen_payout.debit]]
payment_method_type = "Discover"
[[adyen_payout.debit]]
payment_method_type = "CartesBancaires"
[[adyen_payout.debit]]
payment_method_type = "UnionPay"
[[adyen_payout.bank_transfer]]
payment_method_type = "sepa"
[[adyen_payout.wallet]]
payment_method_type = "paypal"
[adyen_payout.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="Enter Live endpoint prefix"
required=true
type="Text"
[adyen_payout.connector_auth.SignatureKey]
api_key = "Adyen API Key (Payout creation)"
api_secret = "Adyen Key (Payout submission)"
key1 = "Adyen Account Id"
[stripe_payout]
[[stripe_payout.bank_transfer]]
payment_method_type = "ach"
[stripe_payout.connector_auth.HeaderKey]
api_key = "Stripe API Key"
[nomupay_payout]
[[nomupay_payout.bank_transfer]]
payment_method_type = "sepa"
[nomupay_payout.connector_auth.BodyKey]
api_key = "Nomupay kid"
key1 = "Nomupay eid"
[nomupay_payout.metadata.private_key]
name="Private key for signature generation"
label="Enter your private key"
placeholder="------BEGIN PRIVATE KEY-------"
required=true
type="Text"
[wise_payout]
[[wise_payout.bank_transfer]]
payment_method_type = "ach"
[[wise_payout.bank_transfer]]
payment_method_type = "bacs"
[[wise_payout.bank_transfer]]
payment_method_type = "sepa"
[wise_payout.connector_auth.BodyKey]
api_key = "Wise API Key"
key1 = "Wise Account Id"
[threedsecureio]
[threedsecureio.connector_auth.HeaderKey]
api_key="Api Key"
[threedsecureio.metadata.mcc]
name="mcc"
label="MCC"
placeholder="Enter MCC"
required=true
type="Text"
[threedsecureio.metadata.merchant_country_code]
name="merchant_country_code"
label="3 digit numeric country code"
placeholder="Enter 3 digit numeric country code"
required=true
type="Text"
[threedsecureio.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant"
placeholder="Enter Name of the merchant"
required=true
type="Text"
[threedsecureio.metadata.pull_mechanism_for_external_3ds_enabled]
name="pull_mechanism_for_external_3ds_enabled"
label="Pull Mechanism Enabled"
placeholder="Enter Pull Mechanism Enabled"
required=false
type="Toggle"
[netcetera]
[netcetera.connector_auth.CertificateAuth]
certificate="Base64 encoded PEM formatted certificate chain"
private_key="Base64 encoded PEM formatted private key"
[netcetera.metadata.mcc]
name="mcc"
label="MCC"
placeholder="Enter MCC"
required=false
type="Text"
[netcetera.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="string that will replace '{prefix}' in this base url 'https://{prefix}.3ds-server.prev.netcetera-cloud-payment.ch'"
required=true
type="Text"
[netcetera.metadata.merchant_country_code]
name="merchant_country_code"
label="3 digit numeric country code"
placeholder="Enter 3 digit numeric country code"
required=false
type="Text"
[netcetera.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant"
placeholder="Enter Name of the merchant"
required=false
type="Text"
[netcetera.metadata.three_ds_requestor_name]
name="three_ds_requestor_name"
label="ThreeDS requestor name"
placeholder="Enter ThreeDS requestor name"
required=false
type="Text"
[netcetera.metadata.three_ds_requestor_id]
name="three_ds_requestor_id"
label="ThreeDS request id"
placeholder="Enter ThreeDS request id"
required=false
type="Text"
[netcetera.metadata.merchant_configuration_id]
name="merchant_configuration_id"
label="Merchant Configuration ID"
placeholder="Enter Merchant Configuration ID"
required=false
type="Text"
[taxjar]
[taxjar.connector_auth.HeaderKey]
api_key="Sandbox Token"
[billwerk]
[[billwerk.credit]]
payment_method_type = "Mastercard"
[[billwerk.credit]]
payment_method_type = "Visa"
[[billwerk.credit]]
payment_method_type = "Interac"
[[billwerk.credit]]
payment_method_type = "AmericanExpress"
[[billwerk.credit]]
payment_method_type = "JCB"
[[billwerk.credit]]
payment_method_type = "DinersClub"
[[billwerk.credit]]
payment_method_type = "Discover"
[[billwerk.credit]]
payment_method_type = "CartesBancaires"
[[billwerk.credit]]
payment_method_type = "UnionPay"
[[billwerk.debit]]
payment_method_type = "Mastercard"
[[billwerk.debit]]
payment_method_type = "Visa"
[[billwerk.debit]]
payment_method_type = "Interac"
[[billwerk.debit]]
payment_method_type = "AmericanExpress"
[[billwerk.debit]]
payment_method_type = "JCB"
[[billwerk.debit]]
payment_method_type = "DinersClub"
[[billwerk.debit]]
payment_method_type = "Discover"
[[billwerk.debit]]
payment_method_type = "CartesBancaires"
[[billwerk.debit]]
payment_method_type = "UnionPay"
[billwerk.connector_auth.BodyKey]
api_key="Private Api Key"
key1="Public Api Key"
[datatrans]
[[datatrans.credit]]
payment_method_type = "Mastercard"
[[datatrans.credit]]
payment_method_type = "Visa"
[[datatrans.credit]]
payment_method_type = "Interac"
[[datatrans.credit]]
payment_method_type = "AmericanExpress"
[[datatrans.credit]]
payment_method_type = "JCB"
[[datatrans.credit]]
payment_method_type = "DinersClub"
[[datatrans.credit]]
payment_method_type = "Discover"
[[datatrans.credit]]
payment_method_type = "CartesBancaires"
[[datatrans.credit]]
payment_method_type = "UnionPay"
[[datatrans.debit]]
payment_method_type = "Mastercard"
[[datatrans.debit]]
payment_method_type = "Visa"
[[datatrans.debit]]
payment_method_type = "Interac"
[[datatrans.debit]]
payment_method_type = "AmericanExpress"
[[datatrans.debit]]
payment_method_type = "JCB"
[[datatrans.debit]]
payment_method_type = "DinersClub"
[[datatrans.debit]]
payment_method_type = "Discover"
[[datatrans.debit]]
payment_method_type = "CartesBancaires"
[[datatrans.debit]]
payment_method_type = "UnionPay"
[datatrans.connector_auth.BodyKey]
api_key = "Passcode"
key1 = "datatrans MerchantId"
[datatrans.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[datatrans.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[datatrans.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[paybox]
[[paybox.credit]]
payment_method_type = "Mastercard"
[[paybox.credit]]
payment_method_type = "Visa"
[[paybox.credit]]
payment_method_type = "Interac"
[[paybox.credit]]
payment_method_type = "AmericanExpress"
[[paybox.credit]]
payment_method_type = "JCB"
[[paybox.credit]]
payment_method_type = "DinersClub"
[[paybox.credit]]
payment_method_type = "Discover"
[[paybox.credit]]
payment_method_type = "CartesBancaires"
[[paybox.credit]]
payment_method_type = "UnionPay"
[[paybox.debit]]
payment_method_type = "Mastercard"
[[paybox.debit]]
payment_method_type = "Visa"
[[paybox.debit]]
payment_method_type = "Interac"
[[paybox.debit]]
payment_method_type = "AmericanExpress"
[[paybox.debit]]
payment_method_type = "JCB"
[[paybox.debit]]
payment_method_type = "DinersClub"
[[paybox.debit]]
payment_method_type = "Discover"
[[paybox.debit]]
payment_method_type = "CartesBancaires"
[paybox.connector_auth.MultiAuthKey]
api_key="SITE Key"
key1="Rang Identifier"
api_secret="CLE Secret"
key2 ="Merchant Id"
[wellsfargo]
[[wellsfargo.credit]]
payment_method_type = "Mastercard"
[[wellsfargo.credit]]
payment_method_type = "Visa"
[[wellsfargo.credit]]
payment_method_type = "Interac"
[[wellsfargo.credit]]
payment_method_type = "AmericanExpress"
[[wellsfargo.credit]]
payment_method_type = "JCB"
[[wellsfargo.credit]]
payment_method_type = "DinersClub"
[[wellsfargo.credit]]
payment_method_type = "Discover"
[[wellsfargo.credit]]
payment_method_type = "CartesBancaires"
[[wellsfargo.credit]]
payment_method_type = "UnionPay"
[[wellsfargo.debit]]
payment_method_type = "Mastercard"
[[wellsfargo.debit]]
payment_method_type = "Visa"
[[wellsfargo.debit]]
payment_method_type = "Interac"
[[wellsfargo.debit]]
payment_method_type = "AmericanExpress"
[[wellsfargo.debit]]
payment_method_type = "JCB"
[[wellsfargo.debit]]
payment_method_type = "DinersClub"
[[wellsfargo.debit]]
payment_method_type = "Discover"
[[wellsfargo.debit]]
payment_method_type = "CartesBancaires"
[[wellsfargo.debit]]
payment_method_type = "UnionPay"
[wellsfargo.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[fiuu]
[[fiuu.credit]]
payment_method_type = "Mastercard"
[[fiuu.credit]]
payment_method_type = "Visa"
[[fiuu.credit]]
payment_method_type = "Interac"
[[fiuu.credit]]
payment_method_type = "AmericanExpress"
[[fiuu.credit]]
payment_method_type = "JCB"
[[fiuu.credit]]
payment_method_type = "DinersClub"
[[fiuu.credit]]
payment_method_type = "Discover"
[[fiuu.credit]]
payment_method_type = "CartesBancaires"
[[fiuu.credit]]
payment_method_type = "UnionPay"
[[fiuu.debit]]
payment_method_type = "Mastercard"
[[fiuu.debit]]
payment_method_type = "Visa"
[[fiuu.debit]]
payment_method_type = "Interac"
[[fiuu.debit]]
payment_method_type = "AmericanExpress"
[[fiuu.debit]]
payment_method_type = "JCB"
[[fiuu.debit]]
payment_method_type = "DinersClub"
[[fiuu.debit]]
payment_method_type = "Discover"
[[fiuu.debit]]
payment_method_type = "CartesBancaires"
[[fiuu.debit]]
payment_method_type = "UnionPay"
[[fiuu.real_time_payment]]
payment_method_type = "duit_now"
[[fiuu.wallet]]
payment_method_type = "google_pay"
[[fiuu.wallet]]
payment_method_type = "apple_pay"
[[fiuu.bank_redirect]]
payment_method_type = "online_banking_fpx"
[fiuu.connector_auth.SignatureKey]
api_key="Verify Key"
key1="Merchant ID"
api_secret="Secret Key"
[[fiuu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[fiuu.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[fiuu.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[fiuu.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[fiuu.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Hyperswitch"]
[fiuu.connector_webhook_details]
merchant_secret="Source verification key"
[elavon]
[[elavon.credit]]
payment_method_type = "Mastercard"
[[elavon.credit]]
payment_method_type = "Visa"
[[elavon.credit]]
payment_method_type = "Interac"
[[elavon.credit]]
payment_method_type = "AmericanExpress"
[[elavon.credit]]
payment_method_type = "JCB"
[[elavon.credit]]
payment_method_type = "DinersClub"
[[elavon.credit]]
payment_method_type = "Discover"
[[elavon.credit]]
payment_method_type = "CartesBancaires"
[[elavon.credit]]
payment_method_type = "UnionPay"
[[elavon.debit]]
payment_method_type = "Mastercard"
[[elavon.debit]]
payment_method_type = "Visa"
[[elavon.debit]]
payment_method_type = "Interac"
[[elavon.debit]]
payment_method_type = "AmericanExpress"
[[elavon.debit]]
payment_method_type = "JCB"
[[elavon.debit]]
payment_method_type = "DinersClub"
[[elavon.debit]]
payment_method_type = "Discover"
[[elavon.debit]]
payment_method_type = "CartesBancaires"
[[elavon.debit]]
payment_method_type = "UnionPay"
[elavon.connector_auth.SignatureKey]
api_key="Account Id"
key1="User ID"
api_secret="Pin"
[ctp_mastercard]
[ctp_mastercard.connector_auth.HeaderKey]
api_key="API Key"
[ctp_mastercard.metadata.dpa_id]
name="dpa_id"
label="DPA Id"
placeholder="Enter DPA Id"
required=true
type="Text"
[ctp_mastercard.metadata.dpa_name]
name="dpa_name"
label="DPA Name"
placeholder="Enter DPA Name"
required=true
type="Text"
[ctp_mastercard.metadata.locale]
name="locale"
label="Locale"
placeholder="Enter locale"
required=true
type="Text"
[ctp_mastercard.metadata.card_brands]
name="card_brands"
label="Card Brands"
placeholder="Enter Card Brands"
required=true
type="MultiSelect"
options=["visa","mastercard"]
[ctp_mastercard.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquire Bin"
placeholder="Enter Acquirer Bin"
required=true
type="Text"
[ctp_mastercard.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquire Merchant Id"
placeholder="Enter Acquirer Merchant Id"
required=true
type="Text"
[ctp_mastercard.metadata.merchant_category_code]
name="merchant_category_code"
label="Merchant Category Code"
placeholder="Enter Merchant Category Code"
required=true
type="Text"
[ctp_mastercard.metadata.merchant_country_code]
name="merchant_country_code"
label="Merchant Country Code"
placeholder="Enter Merchant Country Code"
required=true
type="Text"
[xendit]
[[xendit.credit]]
payment_method_type = "Mastercard"
[[xendit.credit]]
payment_method_type = "Visa"
[[xendit.credit]]
payment_method_type = "Interac"
[[xendit.credit]]
payment_method_type = "AmericanExpress"
[[xendit.credit]]
payment_method_type = "JCB"
[[xendit.credit]]
payment_method_type = "DinersClub"
[[xendit.credit]]
payment_method_type = "Discover"
[[xendit.credit]]
payment_method_type = "CartesBancaires"
[[xendit.credit]]
payment_method_type = "UnionPay"
[[xendit.debit]]
payment_method_type = "Mastercard"
[[xendit.debit]]
payment_method_type = "Visa"
[[xendit.debit]]
payment_method_type = "Interac"
[[xendit.debit]]
payment_method_type = "AmericanExpress"
[[xendit.debit]]
payment_method_type = "JCB"
[[xendit.debit]]
payment_method_type = "DinersClub"
[[xendit.debit]]
payment_method_type = "Discover"
[[xendit.debit]]
payment_method_type = "CartesBancaires"
[[xendit.debit]]
payment_method_type = "UnionPay"
[xendit.connector_auth.HeaderKey]
api_key="API Key"
[xendit.connector_webhook_details]
merchant_secret="Webhook Verification Token"
[inespay]
[[inespay.bank_debit]]
payment_method_type = "sepa"
[inespay.connector_auth.BodyKey]
api_key="API Key"
key1="API Token"
[inespay.connector_webhook_details]
merchant_secret="API Key"
[juspaythreedsserver]
[juspaythreedsserver.metadata.mcc]
name="mcc"
label="MCC"
placeholder="Enter MCC"
required=false
type="Text"
[juspaythreedsserver.metadata.merchant_country_code]
name="merchant_country_code"
label="3 digit numeric country code"
placeholder="Enter 3 digit numeric country code"
required=false
type="Text"
[juspaythreedsserver.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant"
placeholder="Enter Name of the merchant"
required=false
type="Text"
[juspaythreedsserver.metadata.three_ds_requestor_name]
name="three_ds_requestor_name"
label="ThreeDS requestor name"
placeholder="Enter ThreeDS requestor name"
required=false
type="Text"
[juspaythreedsserver.metadata.three_ds_requestor_id]
name="three_ds_requestor_id"
label="ThreeDS request id"
placeholder="Enter ThreeDS request id"
required=false
type="Text"
[juspaythreedsserver.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=true
type="Text"
[juspaythreedsserver.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=true
type="Text"
[juspaythreedsserver.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant Id"
placeholder="Enter Acquirer Merchant Id"
required=true
type="Text"
[juspaythreedsserver.connector_auth.HeaderKey]
api_key="API Key"
[hipay]
[[hipay.credit]]
payment_method_type = "Mastercard"
[[hipay.credit]]
payment_method_type = "Visa"
[[hipay.credit]]
payment_method_type = "Interac"
[[hipay.credit]]
payment_method_type = "AmericanExpress"
[[hipay.credit]]
payment_method_type = "JCB"
[[hipay.credit]]
payment_method_type = "DinersClub"
[[hipay.credit]]
payment_method_type = "Discover"
[[hipay.credit]]
payment_method_type = "CartesBancaires"
[[hipay.credit]]
payment_method_type = "UnionPay"
[[hipay.debit]]
payment_method_type = "Mastercard"
[[hipay.debit]]
payment_method_type = "Visa"
[[hipay.debit]]
payment_method_type = "Interac"
[[hipay.debit]]
payment_method_type = "AmericanExpress"
[[hipay.debit]]
payment_method_type = "JCB"
[[hipay.debit]]
payment_method_type = "DinersClub"
[[hipay.debit]]
payment_method_type = "Discover"
[[hipay.debit]]
payment_method_type = "CartesBancaires"
[[hipay.debit]]
payment_method_type = "UnionPay"
[hipay.connector_auth.BodyKey]
api_key="API Login ID"
key1="API password"
[ctp_visa]
[ctp_visa.connector_auth.NoKey]
[ctp_visa.metadata.dpa_id]
name="dpa_id"
label="DPA Id"
placeholder="Enter DPA Id"
required=true
type="Text"
[ctp_visa.metadata.dpa_name]
name="dpa_name"
label="DPA Name"
placeholder="Enter DPA Name"
required=true
type="Text"
[ctp_visa.metadata.locale]
name="locale"
label="Locale"
placeholder="Enter locale"
required=true
type="Text"
[ctp_visa.metadata.card_brands]
name="card_brands"
label="Card Brands"
placeholder="Enter Card Brands"
required=true
type="MultiSelect"
options=["visa","mastercard"]
[ctp_visa.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquire Bin"
placeholder="Enter Acquirer Bin"
required=true
type="Text"
[ctp_visa.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquire Merchant Id"
placeholder="Enter Acquirer Merchant Id"
required=true
type="Text"
[ctp_visa.metadata.merchant_category_code]
name="merchant_category_code"
label="Merchant Category Code"
placeholder="Enter Merchant Category Code"
required=true
type="Text"
[ctp_visa.metadata.merchant_country_code]
name="merchant_country_code"
label="Merchant Country Code"
placeholder="Enter Merchant Country Code"
required=true
type="Text"
[ctp_visa.metadata.dpa_client_id]
name="dpa_client_id"
label="DPA Client ID"
placeholder="Enter DPA Client ID"
type="Text"
[redsys]
[[redsys.credit]]
payment_method_type = "Mastercard"
[[redsys.credit]]
payment_method_type = "Visa"
[[redsys.credit]]
payment_method_type = "AmericanExpress"
[[redsys.credit]]
payment_method_type = "JCB"
[[redsys.credit]]
payment_method_type = "DinersClub"
[[redsys.credit]]
payment_method_type = "UnionPay"
[[redsys.debit]]
payment_method_type = "Mastercard"
[[redsys.debit]]
payment_method_type = "Visa"
[[redsys.debit]]
payment_method_type = "AmericanExpress"
[[redsys.debit]]
payment_method_type = "JCB"
[[redsys.debit]]
payment_method_type = "DinersClub"
[[redsys.debit]]
payment_method_type = "UnionPay"
[redsys.connector_auth.SignatureKey]
api_key="Merchant ID"
key1="Terminal ID"
api_secret="Secret Key"
| 38,936 | 893 |
hyperswitch | crates/connector_configs/toml/production.toml | .toml | [aci]
[[aci.credit]]
payment_method_type = "Mastercard"
[[aci.credit]]
payment_method_type = "Visa"
[[aci.credit]]
payment_method_type = "Interac"
[[aci.credit]]
payment_method_type = "AmericanExpress"
[[aci.credit]]
payment_method_type = "JCB"
[[aci.credit]]
payment_method_type = "DinersClub"
[[aci.credit]]
payment_method_type = "Discover"
[[aci.credit]]
payment_method_type = "CartesBancaires"
[[aci.credit]]
payment_method_type = "UnionPay"
[[aci.debit]]
payment_method_type = "Mastercard"
[[aci.debit]]
payment_method_type = "Visa"
[[aci.debit]]
payment_method_type = "Interac"
[[aci.debit]]
payment_method_type = "AmericanExpress"
[[aci.debit]]
payment_method_type = "JCB"
[[aci.debit]]
payment_method_type = "DinersClub"
[[aci.debit]]
payment_method_type = "Discover"
[[aci.debit]]
payment_method_type = "CartesBancaires"
[[aci.debit]]
payment_method_type = "UnionPay"
[[aci.wallet]]
payment_method_type = "ali_pay"
[[aci.wallet]]
payment_method_type = "mb_way"
[[aci.bank_redirect]]
payment_method_type = "ideal"
[[aci.bank_redirect]]
payment_method_type = "giropay"
[[aci.bank_redirect]]
payment_method_type = "sofort"
[[aci.bank_redirect]]
payment_method_type = "eps"
[[aci.bank_redirect]]
payment_method_type = "przelewy24"
[[aci.bank_redirect]]
payment_method_type = "trustly"
[aci.connector_auth.BodyKey]
api_key="API Key"
key1="Entity ID"
[aci.connector_webhook_details]
merchant_secret="Source verification key"
[adyen]
[[adyen.credit]]
payment_method_type = "Mastercard"
[[adyen.credit]]
payment_method_type = "Visa"
[[adyen.credit]]
payment_method_type = "Interac"
[[adyen.credit]]
payment_method_type = "AmericanExpress"
[[adyen.credit]]
payment_method_type = "JCB"
[[adyen.credit]]
payment_method_type = "DinersClub"
[[adyen.credit]]
payment_method_type = "Discover"
[[adyen.credit]]
payment_method_type = "CartesBancaires"
[[adyen.credit]]
payment_method_type = "UnionPay"
[[adyen.debit]]
payment_method_type = "Mastercard"
[[adyen.debit]]
payment_method_type = "Visa"
[[adyen.debit]]
payment_method_type = "Interac"
[[adyen.debit]]
payment_method_type = "AmericanExpress"
[[adyen.debit]]
payment_method_type = "JCB"
[[adyen.debit]]
payment_method_type = "DinersClub"
[[adyen.debit]]
payment_method_type = "Discover"
[[adyen.debit]]
payment_method_type = "CartesBancaires"
[[adyen.debit]]
payment_method_type = "UnionPay"
[[adyen.pay_later]]
payment_method_type = "klarna"
[[adyen.pay_later]]
payment_method_type = "affirm"
[[adyen.pay_later]]
payment_method_type = "afterpay_clearpay"
[[adyen.bank_debit]]
payment_method_type = "ach"
[[adyen.bank_debit]]
payment_method_type = "bacs"
[[adyen.bank_redirect]]
payment_method_type = "ideal"
[[adyen.bank_redirect]]
payment_method_type = "eps"
[[adyen.wallet]]
payment_method_type = "apple_pay"
[[adyen.wallet]]
payment_method_type = "google_pay"
[[adyen.wallet]]
payment_method_type = "paypal"
[adyen.connector_auth.BodyKey]
api_key="Adyen API Key"
key1="Adyen Account Id"
[adyen.connector_webhook_details]
merchant_secret="Source verification key"
[adyenplatform_payout]
[[adyenplatform_payout.bank_transfer]]
payment_method_type = "sepa"
[adyenplatform_payout.connector_auth.HeaderKey]
api_key = "Adyen platform's API Key"
[adyenplatform_payout.metadata.source_balance_account]
name="source_balance_account"
label="Source balance account ID"
placeholder="Enter Source balance account ID"
required=true
type="Text"
[adyenplatform_payout.connector_webhook_details]
merchant_secret="Source verification key"
[[adyen.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[adyen.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[adyen.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[adyen.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[adyen.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="Enter Live endpoint prefix"
required=true
type="Text"
[airwallex]
[[airwallex.credit]]
payment_method_type = "Mastercard"
[[airwallex.credit]]
payment_method_type = "Visa"
[[airwallex.credit]]
payment_method_type = "Interac"
[[airwallex.credit]]
payment_method_type = "AmericanExpress"
[[airwallex.credit]]
payment_method_type = "JCB"
[[airwallex.credit]]
payment_method_type = "DinersClub"
[[airwallex.credit]]
payment_method_type = "Discover"
[[airwallex.credit]]
payment_method_type = "CartesBancaires"
[[airwallex.credit]]
payment_method_type = "UnionPay"
[[airwallex.debit]]
payment_method_type = "Mastercard"
[[airwallex.debit]]
payment_method_type = "Visa"
[[airwallex.debit]]
payment_method_type = "Interac"
[[airwallex.debit]]
payment_method_type = "AmericanExpress"
[[airwallex.debit]]
payment_method_type = "JCB"
[[airwallex.debit]]
payment_method_type = "DinersClub"
[[airwallex.debit]]
payment_method_type = "Discover"
[[airwallex.debit]]
payment_method_type = "CartesBancaires"
[[airwallex.debit]]
payment_method_type = "UnionPay"
body_type="BodyKey"
[airwallex.connector_auth.BodyKey]
api_key="API Key"
key1="Client ID"
[airwallex.connector_webhook_details]
merchant_secret="Source verification key"
[authorizedotnet]
[[authorizedotnet.credit]]
payment_method_type = "Mastercard"
[[authorizedotnet.credit]]
payment_method_type = "Visa"
[[authorizedotnet.credit]]
payment_method_type = "Interac"
[[authorizedotnet.credit]]
payment_method_type = "AmericanExpress"
[[authorizedotnet.credit]]
payment_method_type = "JCB"
[[authorizedotnet.credit]]
payment_method_type = "DinersClub"
[[authorizedotnet.credit]]
payment_method_type = "Discover"
[[authorizedotnet.credit]]
payment_method_type = "CartesBancaires"
[[authorizedotnet.credit]]
payment_method_type = "UnionPay"
[[authorizedotnet.debit]]
payment_method_type = "Mastercard"
[[authorizedotnet.debit]]
payment_method_type = "Visa"
[[authorizedotnet.debit]]
payment_method_type = "Interac"
[[authorizedotnet.debit]]
payment_method_type = "AmericanExpress"
[[authorizedotnet.debit]]
payment_method_type = "JCB"
[[authorizedotnet.debit]]
payment_method_type = "DinersClub"
[[authorizedotnet.debit]]
payment_method_type = "Discover"
[[authorizedotnet.debit]]
payment_method_type = "CartesBancaires"
[[authorizedotnet.debit]]
payment_method_type = "UnionPay"
[[authorizedotnet.wallet]]
payment_method_type = "apple_pay"
[[authorizedotnet.wallet]]
payment_method_type = "google_pay"
[[authorizedotnet.wallet]]
payment_method_type = "paypal"
body_type="BodyKey"
[authorizedotnet.connector_auth.BodyKey]
api_key="API Login ID"
key1="Transaction Key"
[[authorizedotnet.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[authorizedotnet.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[authorizedotnet.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[authorizedotnet.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[bitpay]
[[bitpay.crypto]]
payment_method_type = "crypto_currency"
[bitpay.connector_auth.HeaderKey]
api_key="API Key"
[bitpay.connector_webhook_details]
merchant_secret="Source verification key"
[bluesnap]
[[bluesnap.credit]]
payment_method_type = "Mastercard"
[[bluesnap.credit]]
payment_method_type = "Visa"
[[bluesnap.credit]]
payment_method_type = "Interac"
[[bluesnap.credit]]
payment_method_type = "AmericanExpress"
[[bluesnap.credit]]
payment_method_type = "JCB"
[[bluesnap.credit]]
payment_method_type = "DinersClub"
[[bluesnap.credit]]
payment_method_type = "Discover"
[[bluesnap.credit]]
payment_method_type = "CartesBancaires"
[[bluesnap.credit]]
payment_method_type = "UnionPay"
[[bluesnap.debit]]
payment_method_type = "Mastercard"
[[bluesnap.debit]]
payment_method_type = "Visa"
[[bluesnap.debit]]
payment_method_type = "Interac"
[[bluesnap.debit]]
payment_method_type = "AmericanExpress"
[[bluesnap.debit]]
payment_method_type = "JCB"
[[bluesnap.debit]]
payment_method_type = "DinersClub"
[[bluesnap.debit]]
payment_method_type = "Discover"
[[bluesnap.debit]]
payment_method_type = "CartesBancaires"
[[bluesnap.debit]]
payment_method_type = "UnionPay"
[[bluesnap.wallet]]
payment_method_type = "google_pay"
[[bluesnap.wallet]]
payment_method_type = "apple_pay"
[bluesnap.connector_auth.BodyKey]
api_key="Password"
key1="Username"
[bluesnap.connector_webhook_details]
merchant_secret="Source verification key"
[[bluesnap.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bluesnap.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[bluesnap.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bluesnap.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[bluesnap.metadata.merchant_id]
name="merchant_id"
label="Merchant Id"
placeholder="Enter Merchant Id"
required=false
type="Text"
[braintree]
[[braintree.credit]]
payment_method_type = "Mastercard"
[[braintree.credit]]
payment_method_type = "Visa"
[[braintree.credit]]
payment_method_type = "Interac"
[[braintree.credit]]
payment_method_type = "AmericanExpress"
[[braintree.credit]]
payment_method_type = "JCB"
[[braintree.credit]]
payment_method_type = "DinersClub"
[[braintree.credit]]
payment_method_type = "Discover"
[[braintree.credit]]
payment_method_type = "CartesBancaires"
[[braintree.credit]]
payment_method_type = "UnionPay"
[[braintree.debit]]
payment_method_type = "Mastercard"
[[braintree.debit]]
payment_method_type = "Visa"
[[braintree.debit]]
payment_method_type = "Interac"
[[braintree.debit]]
payment_method_type = "AmericanExpress"
[[braintree.debit]]
payment_method_type = "JCB"
[[braintree.debit]]
payment_method_type = "DinersClub"
[[braintree.debit]]
payment_method_type = "Discover"
[[braintree.debit]]
payment_method_type = "CartesBancaires"
[[bluesnap.debit]]
payment_method_type = "UnionPay"
[[braintree.debit]]
payment_method_type = "UnionPay"
[braintree.connector_auth.SignatureKey]
api_key="Public Key"
key1="Merchant Id"
api_secret="Private Key"
[braintree.connector_webhook_details]
merchant_secret="Source verification key"
[braintree.metadata.merchant_account_id]
name="merchant_account_id"
label="Merchant Account Id"
placeholder="Enter Merchant Account Id"
required=true
type="Text"
[braintree.metadata.merchant_config_currency]
name="merchant_config_currency"
label="Currency"
placeholder="Enter Currency"
required=true
type="Select"
options=[]
[bambora]
[[bambora.credit]]
payment_method_type = "Mastercard"
[[bambora.credit]]
payment_method_type = "Visa"
[[bambora.credit]]
payment_method_type = "Interac"
[[bambora.credit]]
payment_method_type = "AmericanExpress"
[[bambora.credit]]
payment_method_type = "JCB"
[[bambora.credit]]
payment_method_type = "DinersClub"
[[bambora.credit]]
payment_method_type = "Discover"
[[bambora.credit]]
payment_method_type = "CartesBancaires"
[[bambora.credit]]
payment_method_type = "UnionPay"
[[bambora.debit]]
payment_method_type = "Mastercard"
[[bambora.debit]]
payment_method_type = "Visa"
[[bambora.debit]]
payment_method_type = "Interac"
[[bambora.debit]]
payment_method_type = "AmericanExpress"
[[bambora.debit]]
payment_method_type = "JCB"
[[bambora.debit]]
payment_method_type = "DinersClub"
[[bambora.debit]]
payment_method_type = "Discover"
[[bambora.debit]]
payment_method_type = "CartesBancaires"
[[bambora.debit]]
payment_method_type = "UnionPay"
[bambora.connector_auth.BodyKey]
api_key="Passcode"
key1="Merchant Id"
[bamboraapac]
[[bamboraapac.credit]]
payment_method_type = "Mastercard"
[[bamboraapac.credit]]
payment_method_type = "Visa"
[[bamboraapac.credit]]
payment_method_type = "Interac"
[[bamboraapac.credit]]
payment_method_type = "AmericanExpress"
[[bamboraapac.credit]]
payment_method_type = "JCB"
[[bamboraapac.credit]]
payment_method_type = "DinersClub"
[[bamboraapac.credit]]
payment_method_type = "Discover"
[[bamboraapac.credit]]
payment_method_type = "CartesBancaires"
[[bamboraapac.credit]]
payment_method_type = "UnionPay"
[[bamboraapac.debit]]
payment_method_type = "Mastercard"
[[bamboraapac.debit]]
payment_method_type = "Visa"
[[bamboraapac.debit]]
payment_method_type = "Interac"
[[bamboraapac.debit]]
payment_method_type = "AmericanExpress"
[[bamboraapac.debit]]
payment_method_type = "JCB"
[[bamboraapac.debit]]
payment_method_type = "DinersClub"
[[bamboraapac.debit]]
payment_method_type = "Discover"
[[bamboraapac.debit]]
payment_method_type = "CartesBancaires"
[[bamboraapac.debit]]
payment_method_type = "UnionPay"
[bamboraapac.connector_auth.SignatureKey]
api_key="Username"
key1="Account Number"
api_secret="Password"
[bankofamerica]
[[bankofamerica.credit]]
payment_method_type = "Mastercard"
[[bankofamerica.credit]]
payment_method_type = "Visa"
[[bankofamerica.credit]]
payment_method_type = "Interac"
[[bankofamerica.credit]]
payment_method_type = "AmericanExpress"
[[bankofamerica.credit]]
payment_method_type = "JCB"
[[bankofamerica.credit]]
payment_method_type = "DinersClub"
[[bankofamerica.credit]]
payment_method_type = "Discover"
[[bankofamerica.credit]]
payment_method_type = "CartesBancaires"
[[bankofamerica.credit]]
payment_method_type = "UnionPay"
[[bankofamerica.debit]]
payment_method_type = "Mastercard"
[[bankofamerica.debit]]
payment_method_type = "Visa"
[[bankofamerica.debit]]
payment_method_type = "Interac"
[[bankofamerica.debit]]
payment_method_type = "AmericanExpress"
[[bankofamerica.debit]]
payment_method_type = "JCB"
[[bankofamerica.debit]]
payment_method_type = "DinersClub"
[[bankofamerica.debit]]
payment_method_type = "Discover"
[[bankofamerica.debit]]
payment_method_type = "CartesBancaires"
[[bankofamerica.debit]]
payment_method_type = "UnionPay"
[[bankofamerica.wallet]]
payment_method_type = "apple_pay"
[[bankofamerica.wallet]]
payment_method_type = "google_pay"
[bankofamerica.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[bankofamerica.connector_webhook_details]
merchant_secret="Source verification key"
[[bankofamerica.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bankofamerica.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[bankofamerica.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bankofamerica.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[cashtocode]
[[cashtocode.reward]]
payment_method_type = "classic"
[[cashtocode.reward]]
payment_method_type = "evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.EUR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.EUR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.GBP.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.GBP.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.USD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.USD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CAD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CAD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CHF.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CHF.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.AUD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.AUD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.INR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.INR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.JPY.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.JPY.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.NZD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.NZD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.ZAR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.ZAR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CNY.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CNY.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_webhook_details]
merchant_secret="Source verification key"
[cryptopay]
[[cryptopay.crypto]]
payment_method_type = "crypto_currency"
[cryptopay.connector_auth.BodyKey]
api_key="API Key"
key1="Secret Key"
[cryptopay.connector_webhook_details]
merchant_secret="Source verification key"
[checkout]
[[checkout.credit]]
payment_method_type = "Mastercard"
[[checkout.credit]]
payment_method_type = "Visa"
[[checkout.credit]]
payment_method_type = "Interac"
[[checkout.credit]]
payment_method_type = "AmericanExpress"
[[checkout.credit]]
payment_method_type = "JCB"
[[checkout.credit]]
payment_method_type = "DinersClub"
[[checkout.credit]]
payment_method_type = "Discover"
[[checkout.credit]]
payment_method_type = "CartesBancaires"
[[checkout.credit]]
payment_method_type = "UnionPay"
[[checkout.debit]]
payment_method_type = "Mastercard"
[[checkout.debit]]
payment_method_type = "Visa"
[[checkout.debit]]
payment_method_type = "Interac"
[[checkout.debit]]
payment_method_type = "AmericanExpress"
[[checkout.debit]]
payment_method_type = "JCB"
[[checkout.debit]]
payment_method_type = "DinersClub"
[[checkout.debit]]
payment_method_type = "Discover"
[[checkout.debit]]
payment_method_type = "CartesBancaires"
[[checkout.debit]]
payment_method_type = "UnionPay"
[[checkout.wallet]]
payment_method_type = "apple_pay"
[[checkout.wallet]]
payment_method_type = "google_pay"
[checkout.connector_auth.SignatureKey]
api_key="Checkout API Public Key"
key1="Processing Channel ID"
api_secret="Checkout API Secret Key"
[checkout.connector_webhook_details]
merchant_secret="Source verification key"
[[checkout.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[checkout.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[checkout.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[checkout.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[coinbase]
[[coinbase.crypto]]
payment_method_type = "crypto_currency"
[coinbase.connector_auth.HeaderKey]
api_key="API Key"
[coinbase.connector_webhook_details]
merchant_secret="Source verification key"
[coingate]
[[coingate.crypto]]
payment_method_type = "crypto_currency"
[coingate.connector_auth.BodyKey]
api_key="API Key"
key1 ="Merchant Token"
[coingate.metadata.currency_id]
name="currency_id"
label="ID of the currency in which the refund will be issued"
placeholder="Enter ID of the currency in which the refund will be issued"
required=true
type="Number"
[coingate.metadata.platform_id]
name="platform_id"
label="Platform ID of the currency in which the refund will be issued"
placeholder="Enter Platform ID of the currency in which the refund will be issued"
required=true
type="Number"
[coingate.metadata.ledger_account_id]
name="ledger_account_id"
label="ID of the trader balance associated with the currency in which the refund will be issued"
placeholder="Enter ID of the trader balance associated with the currency in which the refund will be issued"
required=true
type="Text"
[cybersource]
[[cybersource.credit]]
payment_method_type = "Mastercard"
[[cybersource.credit]]
payment_method_type = "Visa"
[[cybersource.credit]]
payment_method_type = "Interac"
[[cybersource.credit]]
payment_method_type = "AmericanExpress"
[[cybersource.credit]]
payment_method_type = "JCB"
[[cybersource.credit]]
payment_method_type = "DinersClub"
[[cybersource.credit]]
payment_method_type = "Discover"
[[cybersource.credit]]
payment_method_type = "CartesBancaires"
[[cybersource.credit]]
payment_method_type = "UnionPay"
[[cybersource.debit]]
payment_method_type = "Mastercard"
[[cybersource.debit]]
payment_method_type = "Visa"
[[cybersource.debit]]
payment_method_type = "Interac"
[[cybersource.debit]]
payment_method_type = "AmericanExpress"
[[cybersource.debit]]
payment_method_type = "JCB"
[[cybersource.debit]]
payment_method_type = "DinersClub"
[[cybersource.debit]]
payment_method_type = "Discover"
[[cybersource.debit]]
payment_method_type = "CartesBancaires"
[[cybersource.debit]]
payment_method_type = "UnionPay"
[[cybersource.wallet]]
payment_method_type = "apple_pay"
[[cybersource.wallet]]
payment_method_type = "google_pay"
[cybersource.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[cybersource.connector_webhook_details]
merchant_secret="Source verification key"
[cybersource.metadata]
disable_avs = "Disable AVS check"
disable_cvn = "Disable CVN check"
[[cybersource.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[cybersource.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[cybersource.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[cybersource.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[cybersource.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[cybersource.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[cybersource.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[deutschebank]
[[deutschebank.bank_debit]]
payment_method_type = "sepa"
[[deutschebank.credit]]
payment_method_type = "Visa"
[[deutschebank.credit]]
payment_method_type = "Mastercard"
[[deutschebank.debit]]
payment_method_type = "Visa"
[[deutschebank.debit]]
payment_method_type = "Mastercard"
[deutschebank.connector_auth.SignatureKey]
api_key="Client ID"
key1="Merchant ID"
api_secret="Client Key"
[dlocal]
[[dlocal.credit]]
payment_method_type = "Mastercard"
[[dlocal.credit]]
payment_method_type = "Visa"
[[dlocal.credit]]
payment_method_type = "Interac"
[[dlocal.credit]]
payment_method_type = "AmericanExpress"
[[dlocal.credit]]
payment_method_type = "JCB"
[[dlocal.credit]]
payment_method_type = "DinersClub"
[[dlocal.credit]]
payment_method_type = "Discover"
[[dlocal.credit]]
payment_method_type = "CartesBancaires"
[[dlocal.credit]]
payment_method_type = "UnionPay"
[[dlocal.debit]]
payment_method_type = "Mastercard"
[[dlocal.debit]]
payment_method_type = "Visa"
[[dlocal.debit]]
payment_method_type = "Interac"
[[dlocal.debit]]
payment_method_type = "AmericanExpress"
[[dlocal.debit]]
payment_method_type = "JCB"
[[dlocal.debit]]
payment_method_type = "DinersClub"
[[dlocal.debit]]
payment_method_type = "Discover"
[[dlocal.debit]]
payment_method_type = "CartesBancaires"
[[dlocal.debit]]
payment_method_type = "UnionPay"
[dlocal.connector_auth.SignatureKey]
api_key="X Login"
key1="X Trans Key"
api_secret="Secret Key"
[dlocal.connector_webhook_details]
merchant_secret="Source verification key"
[fiserv]
[[fiserv.credit]]
payment_method_type = "Mastercard"
[[fiserv.credit]]
payment_method_type = "Visa"
[[fiserv.credit]]
payment_method_type = "Interac"
[[fiserv.credit]]
payment_method_type = "AmericanExpress"
[[fiserv.credit]]
payment_method_type = "JCB"
[[fiserv.credit]]
payment_method_type = "DinersClub"
[[fiserv.credit]]
payment_method_type = "Discover"
[[fiserv.credit]]
payment_method_type = "CartesBancaires"
[[fiserv.credit]]
payment_method_type = "UnionPay"
[[fiserv.debit]]
payment_method_type = "Mastercard"
[[fiserv.debit]]
payment_method_type = "Visa"
[[fiserv.debit]]
payment_method_type = "Interac"
[[fiserv.debit]]
payment_method_type = "AmericanExpress"
[[fiserv.debit]]
payment_method_type = "JCB"
[[fiserv.debit]]
payment_method_type = "DinersClub"
[[fiserv.debit]]
payment_method_type = "Discover"
[[fiserv.debit]]
payment_method_type = "CartesBancaires"
[[fiserv.debit]]
payment_method_type = "UnionPay"
[fiserv.connector_auth.SignatureKey]
api_key="API Key"
key1="Merchant ID"
api_secret="API Secret"
[fiserv.connector_webhook_details]
merchant_secret="Source verification key"
[fiserv.metadata.terminal_id]
name="terminal_id"
label="Terminal ID"
placeholder="Enter Terminal ID"
required=true
type="Text"
[fiservemea]
[[fiservemea.credit]]
payment_method_type = "Mastercard"
[[fiservemea.credit]]
payment_method_type = "Visa"
[[fiservemea.credit]]
payment_method_type = "Interac"
[[fiservemea.credit]]
payment_method_type = "AmericanExpress"
[[fiservemea.credit]]
payment_method_type = "JCB"
[[fiservemea.credit]]
payment_method_type = "DinersClub"
[[fiservemea.credit]]
payment_method_type = "Discover"
[[fiservemea.credit]]
payment_method_type = "CartesBancaires"
[[fiservemea.credit]]
payment_method_type = "UnionPay"
[[fiservemea.debit]]
payment_method_type = "Mastercard"
[[fiservemea.debit]]
payment_method_type = "Visa"
[[fiservemea.debit]]
payment_method_type = "Interac"
[[fiservemea.debit]]
payment_method_type = "AmericanExpress"
[[fiservemea.debit]]
payment_method_type = "JCB"
[[fiservemea.debit]]
payment_method_type = "DinersClub"
[[fiservemea.debit]]
payment_method_type = "Discover"
[[fiservemea.debit]]
payment_method_type = "CartesBancaires"
[[fiservemea.debit]]
payment_method_type = "UnionPay"
[fiservemea.connector_auth.BodyKey]
api_key="API Key"
key1="Secret Key"
[forte]
[[forte.credit]]
payment_method_type = "Mastercard"
[[forte.credit]]
payment_method_type = "Visa"
[[forte.credit]]
payment_method_type = "Interac"
[[forte.credit]]
payment_method_type = "AmericanExpress"
[[forte.credit]]
payment_method_type = "JCB"
[[forte.credit]]
payment_method_type = "DinersClub"
[[forte.credit]]
payment_method_type = "Discover"
[[forte.credit]]
payment_method_type = "CartesBancaires"
[[forte.credit]]
payment_method_type = "UnionPay"
[[forte.debit]]
payment_method_type = "Mastercard"
[[forte.debit]]
payment_method_type = "Visa"
[[forte.debit]]
payment_method_type = "Interac"
[[forte.debit]]
payment_method_type = "AmericanExpress"
[[forte.debit]]
payment_method_type = "JCB"
[[forte.debit]]
payment_method_type = "DinersClub"
[[forte.debit]]
payment_method_type = "Discover"
[[forte.debit]]
payment_method_type = "CartesBancaires"
[[forte.debit]]
payment_method_type = "UnionPay"
[forte.connector_auth.MultiAuthKey]
api_key="API Access ID"
key1="Organization ID"
api_secret="API Secure Key"
key2="Location ID"
[forte.connector_webhook_details]
merchant_secret="Source verification key"
[getnet]
[[getnet.credit]]
payment_method_type = "Mastercard"
[[getnet.credit]]
payment_method_type = "Visa"
[[getnet.credit]]
payment_method_type = "Interac"
[[getnet.credit]]
payment_method_type = "AmericanExpress"
[[getnet.credit]]
payment_method_type = "JCB"
[[getnet.credit]]
payment_method_type = "DinersClub"
[[getnet.credit]]
payment_method_type = "Discover"
[[getnet.credit]]
payment_method_type = "CartesBancaires"
[[getnet.credit]]
payment_method_type = "UnionPay"
[[getnet.credit]]
payment_method_type = "RuPay"
[[getnet.credit]]
payment_method_type = "Maestro"
[globalpay]
[[globalpay.credit]]
payment_method_type = "Mastercard"
[[globalpay.credit]]
payment_method_type = "Visa"
[[globalpay.credit]]
payment_method_type = "Interac"
[[globalpay.credit]]
payment_method_type = "AmericanExpress"
[[globalpay.credit]]
payment_method_type = "JCB"
[[globalpay.credit]]
payment_method_type = "DinersClub"
[[globalpay.credit]]
payment_method_type = "Discover"
[[globalpay.credit]]
payment_method_type = "CartesBancaires"
[[globalpay.credit]]
payment_method_type = "UnionPay"
[[globalpay.debit]]
payment_method_type = "Mastercard"
[[globalpay.debit]]
payment_method_type = "Visa"
[[globalpay.debit]]
payment_method_type = "Interac"
[[globalpay.debit]]
payment_method_type = "AmericanExpress"
[[globalpay.debit]]
payment_method_type = "JCB"
[[globalpay.debit]]
payment_method_type = "DinersClub"
[[globalpay.debit]]
payment_method_type = "Discover"
[[globalpay.debit]]
payment_method_type = "CartesBancaires"
[[globalpay.debit]]
payment_method_type = "UnionPay"
[[globalpay.bank_redirect]]
payment_method_type = "ideal"
[[globalpay.bank_redirect]]
payment_method_type = "giropay"
[[globalpay.bank_redirect]]
payment_method_type = "sofort"
[[globalpay.bank_redirect]]
payment_method_type = "eps"
[[globalpay.wallet]]
payment_method_type = "google_pay"
[[globalpay.wallet]]
payment_method_type = "paypal"
[globalpay.connector_auth.BodyKey]
api_key="Global App Key"
key1="Global App ID"
[globalpay.connector_webhook_details]
merchant_secret="Source verification key"
[[globalpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[globalpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[globalpay.metadata.account_name]
name="account_name"
label="Account Name"
placeholder="Enter Account Name"
required=true
type="Text"
[globepay]
[[globepay.wallet]]
payment_method_type = "we_chat_pay"
[[globepay.wallet]]
payment_method_type = "ali_pay"
[globepay.connector_auth.BodyKey]
api_key="Partner Code"
key1="Credential Code"
[globepay.connector_webhook_details]
merchant_secret="Source verification key"
[iatapay]
[[iatapay.upi]]
payment_method_type = "upi_collect"
[iatapay.connector_auth.SignatureKey]
api_key="Client ID"
key1="Airline ID"
api_secret="Client Secret"
[iatapay.connector_webhook_details]
merchant_secret="Source verification key"
[itaubank]
[[itaubank.bank_transfer]]
payment_method_type = "pix"
[itaubank.connector_auth.MultiAuthKey]
key1="Client Id"
api_key="Client Secret"
api_secret="Certificates"
key2="Certificate Key"
[jpmorgan]
[[jpmorgan.credit]]
payment_method_type = "AmericanExpress"
[[jpmorgan.credit]]
payment_method_type = "DinersClub"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "JCB"
[[jpmorgan.credit]]
payment_method_type = "Mastercard"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "UnionPay"
[[jpmorgan.credit]]
payment_method_type = "Visa"
[[jpmorgan.debit]]
payment_method_type = "AmericanExpress"
[[jpmorgan.debit]]
payment_method_type = "DinersClub"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "JCB"
[[jpmorgan.debit]]
payment_method_type = "Mastercard"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "UnionPay"
[[jpmorgan.debit]]
payment_method_type = "Visa"
[jpmorgan.connector_auth.BodyKey]
api_key="Access Token"
key1="Client Secret"
[klarna]
[[klarna.pay_later]]
payment_method_type = "klarna"
payment_experience = "invoke_sdk_client"
[[klarna.pay_later]]
payment_method_type = "klarna"
payment_experience = "redirect_to_url"
[klarna.connector_auth.BodyKey]
key1="Klarna Merchant Username"
api_key="Klarna Merchant ID Password"
[klarna.metadata.klarna_region]
name="klarna_region"
label="Region of your Klarna Merchant Account"
placeholder="Enter Region of your Klarna Merchant Account"
required=true
type="Select"
options=["Europe","NorthAmerica","Oceania"]
[mifinity]
[[mifinity.wallet]]
payment_method_type = "mifinity"
[mifinity.connector_auth.HeaderKey]
api_key="key"
[mifinity.metadata.brand_id]
name="brand_id"
label="Merchant Brand ID"
placeholder="Enter Brand ID"
required=true
type="Text"
[mifinity.metadata.destination_account_number]
name="destination_account_number"
label="Destination Account Number"
placeholder="Enter Destination Account Number"
required=true
type="Text"
[razorpay]
[[razorpay.upi]]
payment_method_type = "upi_collect"
[razorpay.connector_auth.BodyKey]
api_key="Razorpay Id"
key1 = "Razorpay Secret"
[mollie]
[[mollie.credit]]
payment_method_type = "Mastercard"
[[mollie.credit]]
payment_method_type = "Visa"
[[mollie.credit]]
payment_method_type = "Interac"
[[mollie.credit]]
payment_method_type = "AmericanExpress"
[[mollie.credit]]
payment_method_type = "JCB"
[[mollie.credit]]
payment_method_type = "DinersClub"
[[mollie.credit]]
payment_method_type = "Discover"
[[mollie.credit]]
payment_method_type = "CartesBancaires"
[[mollie.credit]]
payment_method_type = "UnionPay"
[[mollie.debit]]
payment_method_type = "Mastercard"
[[mollie.debit]]
payment_method_type = "Visa"
[[mollie.debit]]
payment_method_type = "Interac"
[[mollie.debit]]
payment_method_type = "AmericanExpress"
[[mollie.debit]]
payment_method_type = "JCB"
[[mollie.debit]]
payment_method_type = "DinersClub"
[[mollie.debit]]
payment_method_type = "Discover"
[[mollie.debit]]
payment_method_type = "CartesBancaires"
[[mollie.debit]]
payment_method_type = "UnionPay"
[[mollie.bank_redirect]]
payment_method_type = "ideal"
[[mollie.bank_redirect]]
payment_method_type = "giropay"
[[mollie.bank_redirect]]
payment_method_type = "sofort"
[[mollie.bank_redirect]]
payment_method_type = "eps"
[[mollie.wallet]]
payment_method_type = "paypal"
[mollie.connector_auth.BodyKey]
api_key="API Key"
key1="Profile Token"
[mollie.connector_webhook_details]
merchant_secret="Source verification key"
[moneris]
[[moneris.credit]]
payment_method_type = "Mastercard"
[[moneris.credit]]
payment_method_type = "Visa"
[[moneris.credit]]
payment_method_type = "Interac"
[[moneris.credit]]
payment_method_type = "AmericanExpress"
[[moneris.credit]]
payment_method_type = "JCB"
[[moneris.credit]]
payment_method_type = "DinersClub"
[[moneris.credit]]
payment_method_type = "Discover"
[[moneris.credit]]
payment_method_type = "CartesBancaires"
[[moneris.credit]]
payment_method_type = "UnionPay"
[[moneris.debit]]
payment_method_type = "Mastercard"
[[moneris.debit]]
payment_method_type = "Visa"
[[moneris.debit]]
payment_method_type = "Interac"
[[moneris.debit]]
payment_method_type = "AmericanExpress"
[[moneris.debit]]
payment_method_type = "JCB"
[[moneris.debit]]
payment_method_type = "DinersClub"
[[moneris.debit]]
payment_method_type = "Discover"
[[moneris.debit]]
payment_method_type = "CartesBancaires"
[[moneris.debit]]
payment_method_type = "UnionPay"
[moneris.connector_auth.SignatureKey]
api_key="Client Secret"
key1="Client Id"
api_secret="Merchant Id"
[multisafepay]
[[multisafepay.credit]]
payment_method_type = "Mastercard"
[[multisafepay.credit]]
payment_method_type = "Visa"
[[multisafepay.credit]]
payment_method_type = "Interac"
[[multisafepay.credit]]
payment_method_type = "AmericanExpress"
[[multisafepay.credit]]
payment_method_type = "JCB"
[[multisafepay.credit]]
payment_method_type = "DinersClub"
[[multisafepay.credit]]
payment_method_type = "Discover"
[[multisafepay.credit]]
payment_method_type = "CartesBancaires"
[[multisafepay.credit]]
payment_method_type = "UnionPay"
[[multisafepay.debit]]
payment_method_type = "Mastercard"
[[multisafepay.debit]]
payment_method_type = "Visa"
[[multisafepay.debit]]
payment_method_type = "Interac"
[[multisafepay.debit]]
payment_method_type = "AmericanExpress"
[[multisafepay.debit]]
payment_method_type = "JCB"
[[multisafepay.debit]]
payment_method_type = "DinersClub"
[[multisafepay.debit]]
payment_method_type = "Discover"
[[multisafepay.debit]]
payment_method_type = "CartesBancaires"
[[multisafepay.debit]]
payment_method_type = "UnionPay"
[multisafepay.connector_auth.HeaderKey]
api_key="Enter API Key"
[multisafepay.connector_webhook_details]
merchant_secret="Source verification key"
[nexinets]
[[nexinets.credit]]
payment_method_type = "Mastercard"
[[nexinets.credit]]
payment_method_type = "Visa"
[[nexinets.credit]]
payment_method_type = "Interac"
[[nexinets.credit]]
payment_method_type = "AmericanExpress"
[[nexinets.credit]]
payment_method_type = "JCB"
[[nexinets.credit]]
payment_method_type = "DinersClub"
[[nexinets.credit]]
payment_method_type = "Discover"
[[nexinets.credit]]
payment_method_type = "CartesBancaires"
[[nexinets.credit]]
payment_method_type = "UnionPay"
[[nexinets.debit]]
payment_method_type = "Mastercard"
[[nexinets.debit]]
payment_method_type = "Visa"
[[nexinets.debit]]
payment_method_type = "Interac"
[[nexinets.debit]]
payment_method_type = "AmericanExpress"
[[nexinets.debit]]
payment_method_type = "JCB"
[[nexinets.debit]]
payment_method_type = "DinersClub"
[[nexinets.debit]]
payment_method_type = "Discover"
[[nexinets.debit]]
payment_method_type = "CartesBancaires"
[[nexinets.debit]]
payment_method_type = "UnionPay"
[[nexinets.bank_redirect]]
payment_method_type = "ideal"
[[nexinets.bank_redirect]]
payment_method_type = "giropay"
[[nexinets.bank_redirect]]
payment_method_type = "sofort"
[[nexinets.bank_redirect]]
payment_method_type = "eps"
[[nexinets.wallet]]
payment_method_type = "apple_pay"
[[nexinets.wallet]]
payment_method_type = "paypal"
[nexinets.connector_auth.BodyKey]
api_key="API Key"
key1="Merchant ID"
[[nexinets.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[nexinets.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[nexixpay]
[[nexixpay.credit]]
payment_method_type = "Mastercard"
[[nexixpay.credit]]
payment_method_type = "Visa"
[[nexixpay.credit]]
payment_method_type = "AmericanExpress"
[[nexixpay.credit]]
payment_method_type = "JCB"
[[nexixpay.debit]]
payment_method_type = "Mastercard"
[[nexixpay.debit]]
payment_method_type = "Visa"
[[nexixpay.debit]]
payment_method_type = "AmericanExpress"
[[nexixpay.debit]]
payment_method_type = "JCB"
[nexixpay.connector_auth.HeaderKey]
api_key="API Key"
[nmi]
[[nmi.credit]]
payment_method_type = "Mastercard"
[[nmi.credit]]
payment_method_type = "Visa"
[[nmi.credit]]
payment_method_type = "Interac"
[[nmi.credit]]
payment_method_type = "AmericanExpress"
[[nmi.credit]]
payment_method_type = "JCB"
[[nmi.credit]]
payment_method_type = "DinersClub"
[[nmi.credit]]
payment_method_type = "Discover"
[[nmi.credit]]
payment_method_type = "CartesBancaires"
[[nmi.credit]]
payment_method_type = "UnionPay"
[[nmi.debit]]
payment_method_type = "Mastercard"
[[nmi.debit]]
payment_method_type = "Visa"
[[nmi.debit]]
payment_method_type = "Interac"
[[nmi.debit]]
payment_method_type = "AmericanExpress"
[[nmi.debit]]
payment_method_type = "JCB"
[[nmi.debit]]
payment_method_type = "DinersClub"
[[nmi.debit]]
payment_method_type = "Discover"
[[nmi.debit]]
payment_method_type = "CartesBancaires"
[[nmi.debit]]
payment_method_type = "UnionPay"
[nmi.connector_auth.BodyKey]
api_key="API Key"
key1="Public Key"
[nmi.connector_webhook_details]
merchant_secret="Source verification key"
[novalnet]
[[novalnet.credit]]
payment_method_type = "Mastercard"
[[novalnet.credit]]
payment_method_type = "Visa"
[[novalnet.credit]]
payment_method_type = "Interac"
[[novalnet.credit]]
payment_method_type = "AmericanExpress"
[[novalnet.credit]]
payment_method_type = "JCB"
[[novalnet.credit]]
payment_method_type = "DinersClub"
[[novalnet.credit]]
payment_method_type = "Discover"
[[novalnet.credit]]
payment_method_type = "CartesBancaires"
[[novalnet.credit]]
payment_method_type = "UnionPay"
[[novalnet.debit]]
payment_method_type = "Mastercard"
[[novalnet.debit]]
payment_method_type = "Visa"
[[novalnet.debit]]
payment_method_type = "Interac"
[[novalnet.debit]]
payment_method_type = "AmericanExpress"
[[novalnet.debit]]
payment_method_type = "JCB"
[[novalnet.debit]]
payment_method_type = "DinersClub"
[[novalnet.debit]]
payment_method_type = "Discover"
[[novalnet.debit]]
payment_method_type = "CartesBancaires"
[[novalnet.debit]]
payment_method_type = "UnionPay"
[[novalnet.wallet]]
payment_method_type = "google_pay"
[[novalnet.wallet]]
payment_method_type = "paypal"
[[novalnet.wallet]]
payment_method_type = "apple_pay"
[novalnet.connector_auth.SignatureKey]
api_key="Product Activation Key"
key1="Payment Access Key"
api_secret="Tariff ID"
[novalnet.connector_webhook_details]
merchant_secret="Source verification key"
[[novalnet.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[novalnet.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[novalnet.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[novalnet.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[novalnet.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[nuvei]
[[nuvei.credit]]
payment_method_type = "Mastercard"
[[nuvei.credit]]
payment_method_type = "Visa"
[[nuvei.credit]]
payment_method_type = "Interac"
[[nuvei.credit]]
payment_method_type = "AmericanExpress"
[[nuvei.credit]]
payment_method_type = "JCB"
[[nuvei.credit]]
payment_method_type = "DinersClub"
[[nuvei.credit]]
payment_method_type = "Discover"
[[nuvei.credit]]
payment_method_type = "CartesBancaires"
[[nuvei.credit]]
payment_method_type = "UnionPay"
[[nuvei.debit]]
payment_method_type = "Mastercard"
[[nuvei.debit]]
payment_method_type = "Visa"
[[nuvei.debit]]
payment_method_type = "Interac"
[[nuvei.debit]]
payment_method_type = "AmericanExpress"
[[nuvei.debit]]
payment_method_type = "JCB"
[[nuvei.debit]]
payment_method_type = "DinersClub"
[[nuvei.debit]]
payment_method_type = "Discover"
[[nuvei.debit]]
payment_method_type = "CartesBancaires"
[[nuvei.debit]]
payment_method_type = "UnionPay"
[nuvei.connector_auth.SignatureKey]
api_key="Merchant ID"
key1="Merchant Site ID"
api_secret="Merchant Secret"
[nuvei.connector_webhook_details]
merchant_secret="Source verification key"
[opennode]
[[opennode.crypto]]
payment_method_type = "crypto_currency"
[opennode.connector_auth.HeaderKey]
api_key="API Key"
[opennode.connector_webhook_details]
merchant_secret="Source verification key"
[paypal]
[[paypal.credit]]
payment_method_type = "Mastercard"
[[paypal.credit]]
payment_method_type = "Visa"
[[paypal.credit]]
payment_method_type = "Interac"
[[paypal.credit]]
payment_method_type = "AmericanExpress"
[[paypal.credit]]
payment_method_type = "JCB"
[[paypal.credit]]
payment_method_type = "DinersClub"
[[paypal.credit]]
payment_method_type = "Discover"
[[paypal.credit]]
payment_method_type = "CartesBancaires"
[[paypal.credit]]
payment_method_type = "UnionPay"
[[paypal.debit]]
payment_method_type = "Mastercard"
[[paypal.debit]]
payment_method_type = "Visa"
[[paypal.debit]]
payment_method_type = "Interac"
[[paypal.debit]]
payment_method_type = "AmericanExpress"
[[paypal.debit]]
payment_method_type = "JCB"
[[paypal.debit]]
payment_method_type = "DinersClub"
[[paypal.debit]]
payment_method_type = "Discover"
[[paypal.debit]]
payment_method_type = "CartesBancaires"
[[paypal.debit]]
payment_method_type = "UnionPay"
[[paypal.wallet]]
payment_method_type = "paypal"
payment_experience = "invoke_sdk_client"
[[paypal.wallet]]
payment_method_type = "paypal"
payment_experience = "redirect_to_url"
is_verifiable = true
[paypal.connector_auth.BodyKey]
api_key="Client Secret"
key1="Client ID"
[paypal.connector_webhook_details]
merchant_secret="Source verification key"
[paypal.metadata.paypal_sdk]
client_id="Client ID"
[paystack]
[[paystack.bank_redirect]]
payment_method_type = "eft"
[paystack.connector_auth.HeaderKey]
api_key="API Key"
[paystack.connector_webhook_details]
merchant_secret="API Key"
[payu]
[[payu.credit]]
payment_method_type = "Mastercard"
[[payu.credit]]
payment_method_type = "Visa"
[[payu.credit]]
payment_method_type = "Interac"
[[payu.credit]]
payment_method_type = "AmericanExpress"
[[payu.credit]]
payment_method_type = "JCB"
[[payu.credit]]
payment_method_type = "DinersClub"
[[payu.credit]]
payment_method_type = "Discover"
[[payu.credit]]
payment_method_type = "CartesBancaires"
[[payu.credit]]
payment_method_type = "UnionPay"
[[payu.debit]]
payment_method_type = "Mastercard"
[[payu.debit]]
payment_method_type = "Visa"
[[payu.debit]]
payment_method_type = "Interac"
[[payu.debit]]
payment_method_type = "AmericanExpress"
[[payu.debit]]
payment_method_type = "JCB"
[[payu.debit]]
payment_method_type = "DinersClub"
[[payu.debit]]
payment_method_type = "Discover"
[[payu.debit]]
payment_method_type = "CartesBancaires"
[[payu.debit]]
payment_method_type = "UnionPay"
[[payu.wallet]]
payment_method_type = "google_pay"
[payu.connector_auth.BodyKey]
api_key="API Key"
key1="Merchant POS ID"
[payu.connector_webhook_details]
merchant_secret="Source verification key"
[[payu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[payu.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[rapyd]
[[rapyd.credit]]
payment_method_type = "Mastercard"
[[rapyd.credit]]
payment_method_type = "Visa"
[[rapyd.credit]]
payment_method_type = "Interac"
[[rapyd.credit]]
payment_method_type = "AmericanExpress"
[[rapyd.credit]]
payment_method_type = "JCB"
[[rapyd.credit]]
payment_method_type = "DinersClub"
[[rapyd.credit]]
payment_method_type = "Discover"
[[rapyd.credit]]
payment_method_type = "CartesBancaires"
[[rapyd.credit]]
payment_method_type = "UnionPay"
[[rapyd.debit]]
payment_method_type = "Mastercard"
[[rapyd.debit]]
payment_method_type = "Visa"
[[rapyd.debit]]
payment_method_type = "Interac"
[[rapyd.debit]]
payment_method_type = "AmericanExpress"
[[rapyd.debit]]
payment_method_type = "JCB"
[[rapyd.debit]]
payment_method_type = "DinersClub"
[[rapyd.debit]]
payment_method_type = "Discover"
[[rapyd.debit]]
payment_method_type = "CartesBancaires"
[[rapyd.debit]]
payment_method_type = "UnionPay"
[[rapyd.wallet]]
payment_method_type = "apple_pay"
[rapyd.connector_auth.BodyKey]
api_key="Access Key"
key1="API Secret"
[rapyd.connector_webhook_details]
merchant_secret="Source verification key"
[[rapyd.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[rapyd.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[shift4]
[[shift4.credit]]
payment_method_type = "Mastercard"
[[shift4.credit]]
payment_method_type = "Visa"
[[shift4.credit]]
payment_method_type = "Interac"
[[shift4.credit]]
payment_method_type = "AmericanExpress"
[[shift4.credit]]
payment_method_type = "JCB"
[[shift4.credit]]
payment_method_type = "DinersClub"
[[shift4.credit]]
payment_method_type = "Discover"
[[shift4.credit]]
payment_method_type = "CartesBancaires"
[[shift4.credit]]
payment_method_type = "UnionPay"
[[shift4.debit]]
payment_method_type = "Mastercard"
[[shift4.debit]]
payment_method_type = "Visa"
[[shift4.debit]]
payment_method_type = "Interac"
[[shift4.debit]]
payment_method_type = "AmericanExpress"
[[shift4.debit]]
payment_method_type = "JCB"
[[shift4.debit]]
payment_method_type = "DinersClub"
[[shift4.debit]]
payment_method_type = "Discover"
[[shift4.debit]]
payment_method_type = "CartesBancaires"
[[shift4.debit]]
payment_method_type = "UnionPay"
[[shift4.bank_redirect]]
payment_method_type = "ideal"
[[shift4.bank_redirect]]
payment_method_type = "giropay"
[[shift4.bank_redirect]]
payment_method_type = "sofort"
[[shift4.bank_redirect]]
payment_method_type = "eps"
[shift4.connector_auth.HeaderKey]
api_key="API Key"
[shift4.connector_webhook_details]
merchant_secret="Source verification key"
[stripe]
[[stripe.credit]]
payment_method_type = "Mastercard"
[[stripe.credit]]
payment_method_type = "Visa"
[[stripe.credit]]
payment_method_type = "Interac"
[[stripe.credit]]
payment_method_type = "AmericanExpress"
[[stripe.credit]]
payment_method_type = "JCB"
[[stripe.credit]]
payment_method_type = "DinersClub"
[[stripe.credit]]
payment_method_type = "Discover"
[[stripe.credit]]
payment_method_type = "CartesBancaires"
[[stripe.credit]]
payment_method_type = "UnionPay"
[[stripe.debit]]
payment_method_type = "Mastercard"
[[stripe.debit]]
payment_method_type = "Visa"
[[stripe.debit]]
payment_method_type = "Interac"
[[stripe.debit]]
payment_method_type = "AmericanExpress"
[[stripe.debit]]
payment_method_type = "JCB"
[[stripe.debit]]
payment_method_type = "DinersClub"
[[stripe.debit]]
payment_method_type = "Discover"
[[stripe.debit]]
payment_method_type = "CartesBancaires"
[[stripe.debit]]
payment_method_type = "UnionPay"
[[stripe.pay_later]]
payment_method_type = "klarna"
[[stripe.pay_later]]
payment_method_type = "affirm"
[[stripe.pay_later]]
payment_method_type = "afterpay_clearpay"
[[stripe.bank_redirect]]
payment_method_type = "ideal"
[[stripe.bank_redirect]]
payment_method_type = "giropay"
[[stripe.bank_redirect]]
payment_method_type = "sofort"
[[stripe.bank_redirect]]
payment_method_type = "eps"
[[stripe.bank_debit]]
payment_method_type = "ach"
[[stripe.bank_debit]]
payment_method_type = "becs"
[[stripe.bank_debit]]
payment_method_type = "sepa"
[[stripe.bank_transfer]]
payment_method_type = "ach"
[[stripe.bank_transfer]]
payment_method_type = "bacs"
[[stripe.bank_transfer]]
payment_method_type = "sepa"
[[stripe.wallet]]
payment_method_type = "amazon_pay"
[[stripe.wallet]]
payment_method_type = "apple_pay"
[[stripe.wallet]]
payment_method_type = "google_pay"
is_verifiable = true
[stripe.connector_auth.HeaderKey]
api_key="Secret Key"
[stripe.connector_webhook_details]
merchant_secret="Source verification key"
[[stripe.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[stripe.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[stripe.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="stripe:publishableKey"
label="Stripe Publishable Key"
placeholder="Enter Stripe Publishable Key"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[stripe.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="stripe:publishableKey"
label="Stripe Publishable Key"
placeholder="Enter Stripe Publishable Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[trustpay]
[[trustpay.credit]]
payment_method_type = "Mastercard"
[[trustpay.credit]]
payment_method_type = "Visa"
[[trustpay.credit]]
payment_method_type = "Interac"
[[trustpay.credit]]
payment_method_type = "AmericanExpress"
[[trustpay.credit]]
payment_method_type = "JCB"
[[trustpay.credit]]
payment_method_type = "DinersClub"
[[trustpay.credit]]
payment_method_type = "Discover"
[[trustpay.credit]]
payment_method_type = "CartesBancaires"
[[trustpay.credit]]
payment_method_type = "UnionPay"
[[trustpay.debit]]
payment_method_type = "Mastercard"
[[trustpay.debit]]
payment_method_type = "Visa"
[[trustpay.debit]]
payment_method_type = "Interac"
[[trustpay.debit]]
payment_method_type = "AmericanExpress"
[[trustpay.debit]]
payment_method_type = "JCB"
[[trustpay.debit]]
payment_method_type = "DinersClub"
[[trustpay.debit]]
payment_method_type = "Discover"
[[trustpay.debit]]
payment_method_type = "CartesBancaires"
[[trustpay.debit]]
payment_method_type = "UnionPay"
[[trustpay.bank_redirect]]
payment_method_type = "ideal"
[[trustpay.bank_redirect]]
payment_method_type = "giropay"
[[trustpay.bank_redirect]]
payment_method_type = "sofort"
[[trustpay.bank_redirect]]
payment_method_type = "eps"
[[trustpay.bank_redirect]]
payment_method_type = "blik"
[[trustpay.wallet]]
payment_method_type = "apple_pay"
[[trustpay.wallet]]
payment_method_type = "google_pay"
[[trustpay.bank_transfer]]
payment_method_type = "sepa_bank_transfer"
[[trustpay.bank_transfer]]
payment_method_type = "instant_bank_transfer"
[trustpay.connector_auth.SignatureKey]
api_key="API Key"
key1="Project ID"
api_secret="Secret Key"
[trustpay.connector_webhook_details]
merchant_secret="Source verification key"
[[trustpay.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[trustpay.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[trustpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[trustpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[worldline]
[[worldline.credit]]
payment_method_type = "Mastercard"
[[worldline.credit]]
payment_method_type = "Visa"
[[worldline.credit]]
payment_method_type = "Interac"
[[worldline.credit]]
payment_method_type = "AmericanExpress"
[[worldline.credit]]
payment_method_type = "JCB"
[[worldline.credit]]
payment_method_type = "DinersClub"
[[worldline.credit]]
payment_method_type = "Discover"
[[worldline.credit]]
payment_method_type = "CartesBancaires"
[[worldline.credit]]
payment_method_type = "UnionPay"
[[worldline.debit]]
payment_method_type = "Mastercard"
[[worldline.debit]]
payment_method_type = "Visa"
[[worldline.debit]]
payment_method_type = "Interac"
[[worldline.debit]]
payment_method_type = "AmericanExpress"
[[worldline.debit]]
payment_method_type = "JCB"
[[worldline.debit]]
payment_method_type = "DinersClub"
[[worldline.debit]]
payment_method_type = "Discover"
[[worldline.debit]]
payment_method_type = "CartesBancaires"
[[worldline.debit]]
payment_method_type = "UnionPay"
[[worldline.bank_redirect]]
payment_method_type = "ideal"
[[worldline.bank_redirect]]
payment_method_type = "giropay"
[worldline.connector_auth.SignatureKey]
api_key="API Key ID"
key1="Merchant ID"
api_secret="Secret API Key"
[worldline.connector_webhook_details]
merchant_secret="Source verification key"
[worldpay]
[[worldpay.credit]]
payment_method_type = "Mastercard"
[[worldpay.credit]]
payment_method_type = "Visa"
[[worldpay.credit]]
payment_method_type = "Interac"
[[worldpay.credit]]
payment_method_type = "AmericanExpress"
[[worldpay.credit]]
payment_method_type = "JCB"
[[worldpay.credit]]
payment_method_type = "DinersClub"
[[worldpay.credit]]
payment_method_type = "Discover"
[[worldpay.credit]]
payment_method_type = "CartesBancaires"
[[worldpay.credit]]
payment_method_type = "UnionPay"
[[worldpay.debit]]
payment_method_type = "Mastercard"
[[worldpay.debit]]
payment_method_type = "Visa"
[[worldpay.debit]]
payment_method_type = "Interac"
[[worldpay.debit]]
payment_method_type = "AmericanExpress"
[[worldpay.debit]]
payment_method_type = "JCB"
[[worldpay.debit]]
payment_method_type = "DinersClub"
[[worldpay.debit]]
payment_method_type = "Discover"
[[worldpay.debit]]
payment_method_type = "CartesBancaires"
[[worldpay.debit]]
payment_method_type = "UnionPay"
[[worldpay.wallet]]
payment_method_type = "google_pay"
[[worldpay.wallet]]
payment_method_type = "apple_pay"
[worldpay.connector_auth.SignatureKey]
key1="Username"
api_key="Password"
api_secret="Merchant Identifier"
[worldpay.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant to de displayed during 3DS challenge"
placeholder="Enter Name of the merchant"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[worldpay.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[worldpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[worldpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[payme]
[[payme.credit]]
payment_method_type = "Mastercard"
[[payme.credit]]
payment_method_type = "Visa"
[[payme.credit]]
payment_method_type = "Interac"
[[payme.credit]]
payment_method_type = "AmericanExpress"
[[payme.credit]]
payment_method_type = "JCB"
[[payme.credit]]
payment_method_type = "DinersClub"
[[payme.credit]]
payment_method_type = "Discover"
[[payme.credit]]
payment_method_type = "CartesBancaires"
[[payme.credit]]
payment_method_type = "UnionPay"
[[payme.debit]]
payment_method_type = "Mastercard"
[[payme.debit]]
payment_method_type = "Visa"
[[payme.debit]]
payment_method_type = "Interac"
[[payme.debit]]
payment_method_type = "AmericanExpress"
[[payme.debit]]
payment_method_type = "JCB"
[[payme.debit]]
payment_method_type = "DinersClub"
[[payme.debit]]
payment_method_type = "Discover"
[[payme.debit]]
payment_method_type = "CartesBancaires"
[[payme.debit]]
payment_method_type = "UnionPay"
[payme.connector_auth.BodyKey]
api_key="Seller Payme Id"
key1="Payme Public Key"
[payme.connector_webhook_details]
merchant_secret="Payme Client Secret"
additional_secret="Payme Client Key"
[plaid]
[[plaid.open_banking]]
payment_method_type = "open_banking_pis"
[plaid.connector_auth.BodyKey]
api_key="client_id"
key1="secret"
[plaid.additional_merchant_data.open_banking_recipient_data]
name="open_banking_recipient_data"
label="Open Banking Recipient Data"
placeholder="Enter Open Banking Recipient Data"
required=true
type="Select"
options=["account_data","connector_recipient_id","wallet_id"]
[plaid.additional_merchant_data.account_data]
name="account_data"
label="Bank scheme"
placeholder="Enter account_data"
required=true
type="Select"
options=["iban","bacs"]
[plaid.additional_merchant_data.connector_recipient_id]
name="connector_recipient_id"
label="Connector Recipient Id"
placeholder="Enter connector recipient id"
required=true
type="Text"
[plaid.additional_merchant_data.wallet_id]
name="wallet_id"
label="Wallet Id"
placeholder="Enter wallet id"
required=true
type="Text"
[[plaid.additional_merchant_data.iban]]
name="iban"
label="Iban"
placeholder="Enter iban"
required=true
type="Text"
[[plaid.additional_merchant_data.iban]]
name="iban.name"
label="Name"
placeholder="Enter name"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="sort_code"
label="Sort Code"
placeholder="Enter sort code"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="account_number"
label="Account number"
placeholder="Enter account number"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="bacs.name"
label="Name"
placeholder="Enter name"
required=true
type="Text"
[powertranz]
[[powertranz.credit]]
payment_method_type = "Mastercard"
[[powertranz.credit]]
payment_method_type = "Visa"
[[powertranz.credit]]
payment_method_type = "Interac"
[[powertranz.credit]]
payment_method_type = "AmericanExpress"
[[powertranz.credit]]
payment_method_type = "JCB"
[[powertranz.credit]]
payment_method_type = "DinersClub"
[[powertranz.credit]]
payment_method_type = "Discover"
[[powertranz.credit]]
payment_method_type = "CartesBancaires"
[[powertranz.credit]]
payment_method_type = "UnionPay"
[[powertranz.debit]]
payment_method_type = "Mastercard"
[[powertranz.debit]]
payment_method_type = "Visa"
[[powertranz.debit]]
payment_method_type = "Interac"
[[powertranz.debit]]
payment_method_type = "AmericanExpress"
[[powertranz.debit]]
payment_method_type = "JCB"
[[powertranz.debit]]
payment_method_type = "DinersClub"
[[powertranz.debit]]
payment_method_type = "Discover"
[[powertranz.debit]]
payment_method_type = "CartesBancaires"
[[powertranz.debit]]
payment_method_type = "UnionPay"
[powertranz.connector_auth.BodyKey]
key1 = "PowerTranz Id"
api_key="PowerTranz Password"
[powertranz.connector_webhook_details]
merchant_secret="Source verification key"
[tsys]
[[tsys.credit]]
payment_method_type = "Mastercard"
[[tsys.credit]]
payment_method_type = "Visa"
[[tsys.credit]]
payment_method_type = "Interac"
[[tsys.credit]]
payment_method_type = "AmericanExpress"
[[tsys.credit]]
payment_method_type = "JCB"
[[tsys.credit]]
payment_method_type = "DinersClub"
[[tsys.credit]]
payment_method_type = "Discover"
[[tsys.credit]]
payment_method_type = "CartesBancaires"
[[tsys.credit]]
payment_method_type = "UnionPay"
[[tsys.debit]]
payment_method_type = "Mastercard"
[[tsys.debit]]
payment_method_type = "Visa"
[[tsys.debit]]
payment_method_type = "Interac"
[[tsys.debit]]
payment_method_type = "AmericanExpress"
[[tsys.debit]]
payment_method_type = "JCB"
[[tsys.debit]]
payment_method_type = "DinersClub"
[[tsys.debit]]
payment_method_type = "Discover"
[[tsys.debit]]
payment_method_type = "CartesBancaires"
[[tsys.debit]]
payment_method_type = "UnionPay"
[tsys.connector_auth.SignatureKey]
api_key="Device Id"
key1="Transaction Key"
api_secret="Developer Id"
[tsys.connector_webhook_details]
merchant_secret="Source verification key"
[volt]
[[volt.bank_redirect]]
payment_method_type = "open_banking_uk"
[volt.connector_auth.MultiAuthKey]
api_key = "Username"
api_secret = "Password"
key1 = "Client ID"
key2 = "Client Secret"
[volt.connector_webhook_details]
merchant_secret="Source verification key"
[zen]
[[zen.credit]]
payment_method_type = "Mastercard"
[[zen.credit]]
payment_method_type = "Visa"
[[zen.credit]]
payment_method_type = "Interac"
[[zen.credit]]
payment_method_type = "AmericanExpress"
[[zen.credit]]
payment_method_type = "JCB"
[[zen.credit]]
payment_method_type = "DinersClub"
[[zen.credit]]
payment_method_type = "Discover"
[[zen.credit]]
payment_method_type = "CartesBancaires"
[[zen.credit]]
payment_method_type = "UnionPay"
[[zen.debit]]
payment_method_type = "Mastercard"
[[zen.debit]]
payment_method_type = "Visa"
[[zen.debit]]
payment_method_type = "Interac"
[[zen.debit]]
payment_method_type = "AmericanExpress"
[[zen.debit]]
payment_method_type = "JCB"
[[zen.debit]]
payment_method_type = "DinersClub"
[[zen.debit]]
payment_method_type = "Discover"
[[zen.debit]]
payment_method_type = "CartesBancaires"
[[zen.debit]]
payment_method_type = "UnionPay"
[[zen.wallet]]
payment_method_type = "apple_pay"
[[zen.wallet]]
payment_method_type = "google_pay"
[[zen.voucher]]
payment_method_type = "boleto"
[[zen.voucher]]
payment_method_type = "efecty"
[[zen.voucher]]
payment_method_type = "pago_efectivo"
[[zen.voucher]]
payment_method_type = "red_compra"
[[zen.voucher]]
payment_method_type = "red_pagos"
[[zen.bank_transfer]]
payment_method_type = "pix"
[[zen.bank_transfer]]
payment_method_type = "pse"
[zen.connector_auth.HeaderKey]
api_key="API Key"
[zen.connector_webhook_details]
merchant_secret="Source verification key"
[[zen.metadata.apple_pay]]
name="terminal_uuid"
label="Terminal UUID"
placeholder="Enter Terminal UUID"
required=true
type="Text"
[[zen.metadata.apple_pay]]
name="pay_wall_secret"
label="Pay Wall Secret"
placeholder="Enter Pay Wall Secret"
required=true
type="Text"
[[zen.metadata.google_pay]]
name="terminal_uuid"
label="Terminal UUID"
placeholder="Enter Terminal UUID"
required=true
type="Text"
[[zen.metadata.google_pay]]
name="pay_wall_secret"
label="Pay Wall Secret"
placeholder="Enter Pay Wall Secret"
required=true
type="Text"
[zsl]
[[zsl.bank_transfer]]
payment_method_type = "local_bank_transfer"
[zsl.connector_auth.BodyKey]
api_key = "Key"
key1 = "Merchant ID"
[netcetera]
[netcetera.connector_auth.CertificateAuth]
certificate="Base64 encoded PEM formatted certificate chain"
private_key="Base64 encoded PEM formatted private key"
[netcetera.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="string that will replace '{prefix}' in this base url 'https://{prefix}.3ds-server.prev.netcetera-cloud-payment.ch'"
required=true
type="Text"
[netcetera.metadata.mcc]
name="mcc"
label="MCC"
placeholder="Enter MCC"
required=false
type="Text"
[netcetera.metadata.merchant_country_code]
name="merchant_country_code"
label="3 digit numeric country code"
placeholder="Enter 3 digit numeric country code"
required=false
type="Text"
[netcetera.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant"
placeholder="Enter Name of the merchant"
required=false
type="Text"
[netcetera.metadata.three_ds_requestor_name]
name="three_ds_requestor_name"
label="ThreeDS requestor name"
placeholder="Enter ThreeDS requestor name"
required=false
type="Text"
[netcetera.metadata.three_ds_requestor_id]
name="three_ds_requestor_id"
label="ThreeDS request id"
placeholder="Enter ThreeDS request id"
required=false
type="Text"
[netcetera.metadata.merchant_configuration_id]
name="merchant_configuration_id"
label="Merchant Configuration ID"
placeholder="Enter Merchant Configuration ID"
required=false
type="Text"
[taxjar]
[taxjar.connector_auth.HeaderKey]
api_key="Live Token"
[billwerk]
[[billwerk.credit]]
payment_method_type = "Mastercard"
[[billwerk.credit]]
payment_method_type = "Visa"
[[billwerk.credit]]
payment_method_type = "Interac"
[[billwerk.credit]]
payment_method_type = "AmericanExpress"
[[billwerk.credit]]
payment_method_type = "JCB"
[[billwerk.credit]]
payment_method_type = "DinersClub"
[[billwerk.credit]]
payment_method_type = "Discover"
[[billwerk.credit]]
payment_method_type = "CartesBancaires"
[[billwerk.credit]]
payment_method_type = "UnionPay"
[[billwerk.debit]]
payment_method_type = "Mastercard"
[[billwerk.debit]]
payment_method_type = "Visa"
[[billwerk.debit]]
payment_method_type = "Interac"
[[billwerk.debit]]
payment_method_type = "AmericanExpress"
[[billwerk.debit]]
payment_method_type = "JCB"
[[billwerk.debit]]
payment_method_type = "DinersClub"
[[billwerk.debit]]
payment_method_type = "Discover"
[[billwerk.debit]]
payment_method_type = "CartesBancaires"
[[billwerk.debit]]
payment_method_type = "UnionPay"
[billwerk.connector_auth.BodyKey]
api_key="Private Api Key"
key1="Public Api Key"
[paybox]
[[paybox.credit]]
payment_method_type = "Mastercard"
[[paybox.credit]]
payment_method_type = "Visa"
[[paybox.credit]]
payment_method_type = "Interac"
[[paybox.credit]]
payment_method_type = "AmericanExpress"
[[paybox.credit]]
payment_method_type = "JCB"
[[paybox.credit]]
payment_method_type = "DinersClub"
[[paybox.credit]]
payment_method_type = "Discover"
[[paybox.credit]]
payment_method_type = "CartesBancaires"
[[paybox.credit]]
payment_method_type = "UnionPay"
[[paybox.debit]]
payment_method_type = "Mastercard"
[[paybox.debit]]
payment_method_type = "Visa"
[[paybox.debit]]
payment_method_type = "Interac"
[[paybox.debit]]
payment_method_type = "AmericanExpress"
[[paybox.debit]]
payment_method_type = "JCB"
[[paybox.debit]]
payment_method_type = "DinersClub"
[[paybox.debit]]
payment_method_type = "Discover"
[[paybox.debit]]
payment_method_type = "CartesBancaires"
[paybox.connector_auth.MultiAuthKey]
api_key="SITE Key"
key1="Rang Identifier"
api_secret="CLE Secret"
key2 ="Merchant Id"
[datatrans]
[[datatrans.credit]]
payment_method_type = "Mastercard"
[[datatrans.credit]]
payment_method_type = "Visa"
[[datatrans.credit]]
payment_method_type = "Interac"
[[datatrans.credit]]
payment_method_type = "AmericanExpress"
[[datatrans.credit]]
payment_method_type = "JCB"
[[datatrans.credit]]
payment_method_type = "DinersClub"
[[datatrans.credit]]
payment_method_type = "Discover"
[[datatrans.credit]]
payment_method_type = "CartesBancaires"
[[datatrans.credit]]
payment_method_type = "UnionPay"
[[datatrans.debit]]
payment_method_type = "Mastercard"
[[datatrans.debit]]
payment_method_type = "Visa"
[[datatrans.debit]]
payment_method_type = "Interac"
[[datatrans.debit]]
payment_method_type = "AmericanExpress"
[[datatrans.debit]]
payment_method_type = "JCB"
[[datatrans.debit]]
payment_method_type = "DinersClub"
[[datatrans.debit]]
payment_method_type = "Discover"
[[datatrans.debit]]
payment_method_type = "CartesBancaires"
[[datatrans.debit]]
payment_method_type = "UnionPay"
[datatrans.connector_auth.BodyKey]
api_key = "Passcode"
key1 = "datatrans MerchantId"
[datatrans.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[datatrans.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[datatrans.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[wellsfargo]
[[wellsfargo.credit]]
payment_method_type = "Mastercard"
[[wellsfargo.credit]]
payment_method_type = "Visa"
[[wellsfargo.credit]]
payment_method_type = "Interac"
[[wellsfargo.credit]]
payment_method_type = "AmericanExpress"
[[wellsfargo.credit]]
payment_method_type = "JCB"
[[wellsfargo.credit]]
payment_method_type = "DinersClub"
[[wellsfargo.credit]]
payment_method_type = "Discover"
[[wellsfargo.credit]]
payment_method_type = "CartesBancaires"
[[wellsfargo.credit]]
payment_method_type = "UnionPay"
[[wellsfargo.debit]]
payment_method_type = "Mastercard"
[[wellsfargo.debit]]
payment_method_type = "Visa"
[[wellsfargo.debit]]
payment_method_type = "Interac"
[[wellsfargo.debit]]
payment_method_type = "AmericanExpress"
[[wellsfargo.debit]]
payment_method_type = "JCB"
[[wellsfargo.debit]]
payment_method_type = "DinersClub"
[[wellsfargo.debit]]
payment_method_type = "Discover"
[[wellsfargo.debit]]
payment_method_type = "CartesBancaires"
[[wellsfargo.debit]]
payment_method_type = "UnionPay"
[wellsfargo.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[fiuu]
[[fiuu.credit]]
payment_method_type = "Mastercard"
[[fiuu.credit]]
payment_method_type = "Visa"
[[fiuu.credit]]
payment_method_type = "Interac"
[[fiuu.credit]]
payment_method_type = "AmericanExpress"
[[fiuu.credit]]
payment_method_type = "JCB"
[[fiuu.credit]]
payment_method_type = "DinersClub"
[[fiuu.credit]]
payment_method_type = "Discover"
[[fiuu.credit]]
payment_method_type = "CartesBancaires"
[[fiuu.credit]]
payment_method_type = "UnionPay"
[[fiuu.debit]]
payment_method_type = "Mastercard"
[[fiuu.debit]]
payment_method_type = "Visa"
[[fiuu.debit]]
payment_method_type = "Interac"
[[fiuu.debit]]
payment_method_type = "AmericanExpress"
[[fiuu.debit]]
payment_method_type = "JCB"
[[fiuu.debit]]
payment_method_type = "DinersClub"
[[fiuu.debit]]
payment_method_type = "Discover"
[[fiuu.debit]]
payment_method_type = "CartesBancaires"
[[fiuu.debit]]
payment_method_type = "UnionPay"
[[fiuu.real_time_payment]]
payment_method_type = "duit_now"
[[fiuu.wallet]]
payment_method_type = "google_pay"
[[fiuu.wallet]]
payment_method_type = "apple_pay"
[[fiuu.bank_redirect]]
payment_method_type = "online_banking_fpx"
[fiuu.connector_auth.SignatureKey]
api_key="Verify Key"
key1="Merchant ID"
api_secret="Secret Key"
[[fiuu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[fiuu.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[fiuu.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[fiuu.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[fiuu.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Hyperswitch"]
[fiuu.connector_webhook_details]
merchant_secret="Source verification key"
[elavon]
[[elavon.credit]]
payment_method_type = "Mastercard"
[[elavon.credit]]
payment_method_type = "Visa"
[[elavon.credit]]
payment_method_type = "Interac"
[[elavon.credit]]
payment_method_type = "AmericanExpress"
[[elavon.credit]]
payment_method_type = "JCB"
[[elavon.credit]]
payment_method_type = "DinersClub"
[[elavon.credit]]
payment_method_type = "Discover"
[[elavon.credit]]
payment_method_type = "CartesBancaires"
[[elavon.credit]]
payment_method_type = "UnionPay"
[[elavon.debit]]
payment_method_type = "Mastercard"
[[elavon.debit]]
payment_method_type = "Visa"
[[elavon.debit]]
payment_method_type = "Interac"
[[elavon.debit]]
payment_method_type = "AmericanExpress"
[[elavon.debit]]
payment_method_type = "JCB"
[[elavon.debit]]
payment_method_type = "DinersClub"
[[elavon.debit]]
payment_method_type = "Discover"
[[elavon.debit]]
payment_method_type = "CartesBancaires"
[[elavon.debit]]
payment_method_type = "UnionPay"
[elavon.connector_auth.SignatureKey]
api_key="Account Id"
key1="User ID"
api_secret="Pin"
[xendit]
[[xendit.credit]]
payment_method_type = "Mastercard"
[[xendit.credit]]
payment_method_type = "Visa"
[[xendit.credit]]
payment_method_type = "Interac"
[[xendit.credit]]
payment_method_type = "AmericanExpress"
[[xendit.credit]]
payment_method_type = "JCB"
[[xendit.credit]]
payment_method_type = "DinersClub"
[[xendit.credit]]
payment_method_type = "Discover"
[[xendit.credit]]
payment_method_type = "CartesBancaires"
[[xendit.credit]]
payment_method_type = "UnionPay"
[[xendit.debit]]
payment_method_type = "Mastercard"
[[xendit.debit]]
payment_method_type = "Visa"
[[xendit.debit]]
payment_method_type = "Interac"
[[xendit.debit]]
payment_method_type = "AmericanExpress"
[[xendit.debit]]
payment_method_type = "JCB"
[[xendit.debit]]
payment_method_type = "DinersClub"
[[xendit.debit]]
payment_method_type = "Discover"
[[xendit.debit]]
payment_method_type = "CartesBancaires"
[[xendit.debit]]
payment_method_type = "UnionPay"
[xendit.connector_auth.HeaderKey]
api_key="API Key"
[xendit.connector_webhook_details]
merchant_secret="Webhook Verification Token"
[inespay]
[[inespay.bank_debit]]
payment_method_type = "sepa"
[inespay.connector_auth.BodyKey]
api_key="API Key"
key1="API Token"
[inespay.connector_webhook_details]
merchant_secret="API Key"
[nomupay_payout]
[[nomupay_payout.bank_transfer]]
payment_method_type = "sepa"
[nomupay_payout.connector_auth.BodyKey]
api_key = "Nomupay kid"
key1 = "Nomupay eid"
[nomupay_payout.metadata.private_key]
name="Private key for signature generation"
label="Enter your private key"
placeholder="------BEGIN PRIVATE KEY-------"
required=true
type="Text"
[hipay]
[[hipay.credit]]
payment_method_type = "Mastercard"
[[hipay.credit]]
payment_method_type = "Visa"
[[hipay.credit]]
payment_method_type = "Interac"
[[hipay.credit]]
payment_method_type = "AmericanExpress"
[[hipay.credit]]
payment_method_type = "JCB"
[[hipay.credit]]
payment_method_type = "DinersClub"
[[hipay.credit]]
payment_method_type = "Discover"
[[hipay.credit]]
payment_method_type = "CartesBancaires"
[[hipay.credit]]
payment_method_type = "UnionPay"
[[hipay.debit]]
payment_method_type = "Mastercard"
[[hipay.debit]]
payment_method_type = "Visa"
[[hipay.debit]]
payment_method_type = "Interac"
[[hipay.debit]]
payment_method_type = "AmericanExpress"
[[hipay.debit]]
payment_method_type = "JCB"
[[hipay.debit]]
payment_method_type = "DinersClub"
[[hipay.debit]]
payment_method_type = "Discover"
[[hipay.debit]]
payment_method_type = "CartesBancaires"
[[hipay.debit]]
payment_method_type = "UnionPay"
[hipay.connector_auth.BodyKey]
api_key="API Login ID"
key1="API password"
[ctp_visa]
[ctp_visa.connector_auth.NoKey]
[ctp_visa.metadata.dpa_id]
name="dpa_id"
label="DPA Id"
placeholder="Enter DPA Id"
required=true
type="Text"
[ctp_visa.metadata.dpa_name]
name="dpa_name"
label="DPA Name"
placeholder="Enter DPA Name"
required=true
type="Text"
[ctp_visa.metadata.locale]
name="locale"
label="Locale"
placeholder="Enter locale"
required=true
type="Text"
[ctp_visa.metadata.card_brands]
name="card_brands"
label="Card Brands"
placeholder="Enter Card Brands"
required=true
type="MultiSelect"
options=["visa","mastercard"]
[ctp_visa.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquire Bin"
placeholder="Enter Acquirer Bin"
required=true
type="Text"
[ctp_visa.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquire Merchant Id"
placeholder="Enter Acquirer Merchant Id"
required=true
type="Text"
[ctp_visa.metadata.merchant_category_code]
name="merchant_category_code"
label="Merchant Category Code"
placeholder="Enter Merchant Category Code"
required=true
type="Text"
[ctp_visa.metadata.merchant_country_code]
name="merchant_country_code"
label="Merchant Country Code"
placeholder="Enter Merchant Country Code"
required=true
type="Text"
[ctp_visa.metadata.dpa_client_id]
name="dpa_client_id"
label="DPA Client ID"
placeholder="Enter DPA Client ID"
required=true
type="Text"
[redsys]
[[redsys.credit]]
payment_method_type = "Mastercard"
[[redsys.credit]]
payment_method_type = "Visa"
[[redsys.credit]]
payment_method_type = "AmericanExpress"
[[redsys.credit]]
payment_method_type = "JCB"
[[redsys.credit]]
payment_method_type = "DinersClub"
[[redsys.credit]]
payment_method_type = "UnionPay"
[[redsys.debit]]
payment_method_type = "Mastercard"
[[redsys.debit]]
payment_method_type = "Visa"
[[redsys.debit]]
payment_method_type = "AmericanExpress"
[[redsys.debit]]
payment_method_type = "JCB"
[[redsys.debit]]
payment_method_type = "DinersClub"
[[redsys.debit]]
payment_method_type = "UnionPay"
[redsys.connector_auth.SignatureKey]
api_key = "Merchant ID"
key1 = "Terminal ID"
api_secret = "Secret Key"
| 29,099 | 894 |
hyperswitch | crates/connector_configs/toml/sandbox.toml | .toml | [aci]
[[aci.credit]]
payment_method_type = "Mastercard"
[[aci.credit]]
payment_method_type = "Visa"
[[aci.credit]]
payment_method_type = "Interac"
[[aci.credit]]
payment_method_type = "AmericanExpress"
[[aci.credit]]
payment_method_type = "JCB"
[[aci.credit]]
payment_method_type = "DinersClub"
[[aci.credit]]
payment_method_type = "Discover"
[[aci.credit]]
payment_method_type = "CartesBancaires"
[[aci.credit]]
payment_method_type = "UnionPay"
[[aci.debit]]
payment_method_type = "Mastercard"
[[aci.debit]]
payment_method_type = "Visa"
[[aci.debit]]
payment_method_type = "Interac"
[[aci.debit]]
payment_method_type = "AmericanExpress"
[[aci.debit]]
payment_method_type = "JCB"
[[aci.debit]]
payment_method_type = "DinersClub"
[[aci.debit]]
payment_method_type = "Discover"
[[aci.debit]]
payment_method_type = "CartesBancaires"
[[aci.debit]]
payment_method_type = "UnionPay"
[[aci.wallet]]
payment_method_type = "ali_pay"
[[aci.wallet]]
payment_method_type = "mb_way"
[[aci.bank_redirect]]
payment_method_type = "ideal"
[[aci.bank_redirect]]
payment_method_type = "giropay"
[[aci.bank_redirect]]
payment_method_type = "sofort"
[[aci.bank_redirect]]
payment_method_type = "eps"
[[aci.bank_redirect]]
payment_method_type = "przelewy24"
[[aci.bank_redirect]]
payment_method_type = "trustly"
[[aci.bank_redirect]]
payment_method_type = "interac"
[aci.connector_auth.BodyKey]
api_key="API Key"
key1="Entity ID"
[aci.connector_webhook_details]
merchant_secret="Source verification key"
[adyen]
[[adyen.credit]]
payment_method_type = "Mastercard"
[[adyen.credit]]
payment_method_type = "Visa"
[[adyen.credit]]
payment_method_type = "Interac"
[[adyen.credit]]
payment_method_type = "AmericanExpress"
[[adyen.credit]]
payment_method_type = "JCB"
[[adyen.credit]]
payment_method_type = "DinersClub"
[[adyen.credit]]
payment_method_type = "Discover"
[[adyen.credit]]
payment_method_type = "CartesBancaires"
[[adyen.credit]]
payment_method_type = "UnionPay"
[[adyen.debit]]
payment_method_type = "Mastercard"
[[adyen.debit]]
payment_method_type = "Visa"
[[adyen.debit]]
payment_method_type = "Interac"
[[adyen.debit]]
payment_method_type = "AmericanExpress"
[[adyen.debit]]
payment_method_type = "JCB"
[[adyen.debit]]
payment_method_type = "DinersClub"
[[adyen.debit]]
payment_method_type = "Discover"
[[adyen.debit]]
payment_method_type = "CartesBancaires"
[[adyen.debit]]
payment_method_type = "UnionPay"
[[adyen.pay_later]]
payment_method_type = "klarna"
[[adyen.pay_later]]
payment_method_type = "affirm"
[[adyen.pay_later]]
payment_method_type = "afterpay_clearpay"
[[adyen.pay_later]]
payment_method_type = "pay_bright"
[[adyen.pay_later]]
payment_method_type = "walley"
[[adyen.pay_later]]
payment_method_type = "alma"
[[adyen.pay_later]]
payment_method_type = "atome"
[[adyen.bank_debit]]
payment_method_type = "ach"
[[adyen.bank_debit]]
payment_method_type = "bacs"
[[adyen.bank_debit]]
payment_method_type = "sepa"
[[adyen.bank_redirect]]
payment_method_type = "ideal"
[[adyen.bank_redirect]]
payment_method_type = "eps"
[[adyen.bank_redirect]]
payment_method_type = "blik"
[[adyen.bank_redirect]]
payment_method_type = "trustly"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_czech_republic"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_finland"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_poland"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_slovakia"
[[adyen.bank_redirect]]
payment_method_type = "bancontact_card"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_fpx"
[[adyen.bank_redirect]]
payment_method_type = "online_banking_thailand"
[[adyen.bank_redirect]]
payment_method_type = "bizum"
[[adyen.bank_redirect]]
payment_method_type = "open_banking_uk"
[[adyen.bank_transfer]]
payment_method_type = "permata_bank_transfer"
[[adyen.bank_transfer]]
payment_method_type = "bca_bank_transfer"
[[adyen.bank_transfer]]
payment_method_type = "bni_va"
[[adyen.bank_transfer]]
payment_method_type = "bri_va"
[[adyen.bank_transfer]]
payment_method_type = "cimb_va"
[[adyen.bank_transfer]]
payment_method_type = "danamon_va"
[[adyen.bank_transfer]]
payment_method_type = "mandiri_va"
[[adyen.bank_transfer]]
payment_method_type = "pix"
[[adyen.wallet]]
payment_method_type = "apple_pay"
[[adyen.wallet]]
payment_method_type = "google_pay"
[[adyen.wallet]]
payment_method_type = "paypal"
[[adyen.wallet]]
payment_method_type = "we_chat_pay"
[[adyen.wallet]]
payment_method_type = "ali_pay"
[[adyen.wallet]]
payment_method_type = "mb_way"
[[adyen.wallet]]
payment_method_type = "ali_pay_hk"
[[adyen.wallet]]
payment_method_type = "go_pay"
[[adyen.wallet]]
payment_method_type = "kakao_pay"
[[adyen.wallet]]
payment_method_type = "twint"
[[adyen.wallet]]
payment_method_type = "gcash"
[[adyen.wallet]]
payment_method_type = "vipps"
[[adyen.wallet]]
payment_method_type = "dana"
[[adyen.wallet]]
payment_method_type = "momo"
[[adyen.wallet]]
payment_method_type = "swish"
[[adyen.wallet]]
payment_method_type = "touch_n_go"
[[adyen.voucher]]
payment_method_type = "boleto"
[[adyen.voucher]]
payment_method_type = "alfamart"
[[adyen.voucher]]
payment_method_type = "indomaret"
[[adyen.voucher]]
payment_method_type = "oxxo"
[[adyen.voucher]]
payment_method_type = "seven_eleven"
[[adyen.voucher]]
payment_method_type = "lawson"
[[adyen.voucher]]
payment_method_type = "mini_stop"
[[adyen.voucher]]
payment_method_type = "family_mart"
[[adyen.voucher]]
payment_method_type = "seicomart"
[[adyen.voucher]]
payment_method_type = "pay_easy"
[[adyen.gift_card]]
payment_method_type = "pay_safe_card"
[[adyen.gift_card]]
payment_method_type = "givex"
[[adyen.card_redirect]]
payment_method_type = "benefit"
[[adyen.card_redirect]]
payment_method_type = "knet"
[[adyen.card_redirect]]
payment_method_type = "momo_atm"
[adyen.connector_auth.BodyKey]
api_key="Adyen API Key"
key1="Adyen Account Id"
[adyen.connector_webhook_details]
merchant_secret="Source verification key"
[[adyen.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[adyen.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[adyen.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[adyen.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[adyen.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[adyen.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[adyen.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[adyen.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="Enter Live endpoint prefix"
required=true
type="Text"
[adyenplatform_payout]
[[adyenplatform_payout.bank_transfer]]
payment_method_type = "sepa"
[adyenplatform_payout.connector_auth.HeaderKey]
api_key = "Adyen platform's API Key"
[adyenplatform_payout.metadata.source_balance_account]
name="source_balance_account"
label="Source balance account ID"
placeholder="Enter Source balance account ID"
required=true
type="Text"
[adyenplatform_payout.connector_webhook_details]
merchant_secret="Source verification key"
[airwallex]
[[airwallex.credit]]
payment_method_type = "Mastercard"
[[airwallex.credit]]
payment_method_type = "Visa"
[[airwallex.credit]]
payment_method_type = "Interac"
[[airwallex.credit]]
payment_method_type = "AmericanExpress"
[[airwallex.credit]]
payment_method_type = "JCB"
[[airwallex.credit]]
payment_method_type = "DinersClub"
[[airwallex.credit]]
payment_method_type = "Discover"
[[airwallex.credit]]
payment_method_type = "CartesBancaires"
[[airwallex.credit]]
payment_method_type = "UnionPay"
[[airwallex.debit]]
payment_method_type = "Mastercard"
[[airwallex.debit]]
payment_method_type = "Visa"
[[airwallex.debit]]
payment_method_type = "Interac"
[[airwallex.debit]]
payment_method_type = "AmericanExpress"
[[airwallex.debit]]
payment_method_type = "JCB"
[[airwallex.debit]]
payment_method_type = "DinersClub"
[[airwallex.debit]]
payment_method_type = "Discover"
[[airwallex.debit]]
payment_method_type = "CartesBancaires"
[[airwallex.debit]]
payment_method_type = "UnionPay"
[[airwallex.wallet]]
payment_method_type = "google_pay"
[airwallex.connector_auth.BodyKey]
api_key="API Key"
key1="Client ID"
[airwallex.connector_webhook_details]
merchant_secret="Source verification key"
[[airwallex.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[airwallex.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[airwallex.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[airwallex.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[airwallex.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[airwallex.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[authorizedotnet]
[[authorizedotnet.credit]]
payment_method_type = "Mastercard"
[[authorizedotnet.credit]]
payment_method_type = "Visa"
[[authorizedotnet.credit]]
payment_method_type = "Interac"
[[authorizedotnet.credit]]
payment_method_type = "AmericanExpress"
[[authorizedotnet.credit]]
payment_method_type = "JCB"
[[authorizedotnet.credit]]
payment_method_type = "DinersClub"
[[authorizedotnet.credit]]
payment_method_type = "Discover"
[[authorizedotnet.credit]]
payment_method_type = "CartesBancaires"
[[authorizedotnet.credit]]
payment_method_type = "UnionPay"
[[authorizedotnet.debit]]
payment_method_type = "Mastercard"
[[authorizedotnet.debit]]
payment_method_type = "Visa"
[[authorizedotnet.debit]]
payment_method_type = "Interac"
[[authorizedotnet.debit]]
payment_method_type = "AmericanExpress"
[[authorizedotnet.debit]]
payment_method_type = "JCB"
[[authorizedotnet.debit]]
payment_method_type = "DinersClub"
[[authorizedotnet.debit]]
payment_method_type = "Discover"
[[authorizedotnet.debit]]
payment_method_type = "CartesBancaires"
[[authorizedotnet.debit]]
payment_method_type = "UnionPay"
[[authorizedotnet.wallet]]
payment_method_type = "apple_pay"
[[authorizedotnet.wallet]]
payment_method_type = "google_pay"
[[authorizedotnet.wallet]]
payment_method_type = "paypal"
[authorizedotnet.connector_auth.BodyKey]
api_key="API Login ID"
key1="Transaction Key"
[authorizedotnet.connector_webhook_details]
merchant_secret="Source verification key"
[[authorizedotnet.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[authorizedotnet.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[authorizedotnet.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[authorizedotnet.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[authorizedotnet.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[authorizedotnet.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[authorizedotnet.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[bambora]
[[bambora.credit]]
payment_method_type = "Mastercard"
[[bambora.credit]]
payment_method_type = "Visa"
[[bambora.credit]]
payment_method_type = "Interac"
[[bambora.credit]]
payment_method_type = "AmericanExpress"
[[bambora.credit]]
payment_method_type = "JCB"
[[bambora.credit]]
payment_method_type = "DinersClub"
[[bambora.credit]]
payment_method_type = "Discover"
[[bambora.credit]]
payment_method_type = "CartesBancaires"
[[bambora.credit]]
payment_method_type = "UnionPay"
[[bambora.debit]]
payment_method_type = "Mastercard"
[[bambora.debit]]
payment_method_type = "Visa"
[[bambora.debit]]
payment_method_type = "Interac"
[[bambora.debit]]
payment_method_type = "AmericanExpress"
[[bambora.debit]]
payment_method_type = "JCB"
[[bambora.debit]]
payment_method_type = "DinersClub"
[[bambora.debit]]
payment_method_type = "Discover"
[[bambora.debit]]
payment_method_type = "CartesBancaires"
[[bambora.debit]]
payment_method_type = "UnionPay"
[bambora.connector_auth.BodyKey]
api_key="Passcode"
key1="Merchant Id"
[bamboraapac]
[[bamboraapac.credit]]
payment_method_type = "Mastercard"
[[bamboraapac.credit]]
payment_method_type = "Visa"
[[bamboraapac.credit]]
payment_method_type = "Interac"
[[bamboraapac.credit]]
payment_method_type = "AmericanExpress"
[[bamboraapac.credit]]
payment_method_type = "JCB"
[[bamboraapac.credit]]
payment_method_type = "DinersClub"
[[bamboraapac.credit]]
payment_method_type = "Discover"
[[bamboraapac.credit]]
payment_method_type = "CartesBancaires"
[[bamboraapac.credit]]
payment_method_type = "UnionPay"
[[bamboraapac.debit]]
payment_method_type = "Mastercard"
[[bamboraapac.debit]]
payment_method_type = "Visa"
[[bamboraapac.debit]]
payment_method_type = "Interac"
[[bamboraapac.debit]]
payment_method_type = "AmericanExpress"
[[bamboraapac.debit]]
payment_method_type = "JCB"
[[bamboraapac.debit]]
payment_method_type = "DinersClub"
[[bamboraapac.debit]]
payment_method_type = "Discover"
[[bamboraapac.debit]]
payment_method_type = "CartesBancaires"
[[bamboraapac.debit]]
payment_method_type = "UnionPay"
[bamboraapac.connector_auth.SignatureKey]
api_key="Username"
key1="Account Number"
api_secret="Password"
[bankofamerica]
[[bankofamerica.credit]]
payment_method_type = "Mastercard"
[[bankofamerica.credit]]
payment_method_type = "Visa"
[[bankofamerica.credit]]
payment_method_type = "Interac"
[[bankofamerica.credit]]
payment_method_type = "AmericanExpress"
[[bankofamerica.credit]]
payment_method_type = "JCB"
[[bankofamerica.credit]]
payment_method_type = "DinersClub"
[[bankofamerica.credit]]
payment_method_type = "Discover"
[[bankofamerica.credit]]
payment_method_type = "CartesBancaires"
[[bankofamerica.credit]]
payment_method_type = "UnionPay"
[[bankofamerica.debit]]
payment_method_type = "Mastercard"
[[bankofamerica.debit]]
payment_method_type = "Visa"
[[bankofamerica.debit]]
payment_method_type = "Interac"
[[bankofamerica.debit]]
payment_method_type = "AmericanExpress"
[[bankofamerica.debit]]
payment_method_type = "JCB"
[[bankofamerica.debit]]
payment_method_type = "DinersClub"
[[bankofamerica.debit]]
payment_method_type = "Discover"
[[bankofamerica.debit]]
payment_method_type = "CartesBancaires"
[[bankofamerica.debit]]
payment_method_type = "UnionPay"
[[bankofamerica.wallet]]
payment_method_type = "apple_pay"
[[bankofamerica.wallet]]
payment_method_type = "google_pay"
[[bankofamerica.wallet]]
payment_method_type = "samsung_pay"
[bankofamerica.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[bankofamerica.connector_webhook_details]
merchant_secret="Source verification key"
[[bankofamerica.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[bankofamerica.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bankofamerica.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[bankofamerica.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bankofamerica.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bankofamerica.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="service_id"
label="Samsung Pay Service Id"
placeholder="Enter Samsung Pay Service Id"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="merchant_display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bankofamerica.connector_wallets_details.samsung_pay]]
name="allowed_brands"
label="Allowed Brands"
placeholder="Enter Allowed Brands"
required=true
type="MultiSelect"
options=["visa","masterCard","amex","discover"]
[bitpay]
[[bitpay.crypto]]
payment_method_type = "crypto_currency"
[bitpay.connector_auth.HeaderKey]
api_key="API Key"
[bitpay.connector_webhook_details]
merchant_secret="Source verification key"
[bluesnap]
[[bluesnap.credit]]
payment_method_type = "Mastercard"
[[bluesnap.credit]]
payment_method_type = "Visa"
[[bluesnap.credit]]
payment_method_type = "Interac"
[[bluesnap.credit]]
payment_method_type = "AmericanExpress"
[[bluesnap.credit]]
payment_method_type = "JCB"
[[bluesnap.credit]]
payment_method_type = "DinersClub"
[[bluesnap.credit]]
payment_method_type = "Discover"
[[bluesnap.credit]]
payment_method_type = "CartesBancaires"
[[bluesnap.credit]]
payment_method_type = "UnionPay"
[[bluesnap.debit]]
payment_method_type = "Mastercard"
[[bluesnap.debit]]
payment_method_type = "Visa"
[[bluesnap.debit]]
payment_method_type = "Interac"
[[bluesnap.debit]]
payment_method_type = "AmericanExpress"
[[bluesnap.debit]]
payment_method_type = "JCB"
[[bluesnap.debit]]
payment_method_type = "DinersClub"
[[bluesnap.debit]]
payment_method_type = "Discover"
[[bluesnap.debit]]
payment_method_type = "CartesBancaires"
[[bluesnap.debit]]
payment_method_type = "UnionPay"
[[bluesnap.wallet]]
payment_method_type = "google_pay"
[[bluesnap.wallet]]
payment_method_type = "apple_pay"
[bluesnap.connector_auth.BodyKey]
api_key="Password"
key1="Username"
[bluesnap.connector_webhook_details]
merchant_secret="Source verification key"
[[bluesnap.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[bluesnap.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[bluesnap.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[bluesnap.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bluesnap.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[bluesnap.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[bluesnap.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[bluesnap.metadata.merchant_id]
name="merchant_id"
label="Merchant Id"
placeholder="Enter Merchant Id"
required=false
type="Text"
[boku]
[[boku.wallet]]
payment_method_type = "dana"
[[boku.wallet]]
payment_method_type = "gcash"
[[boku.wallet]]
payment_method_type = "go_pay"
[[boku.wallet]]
payment_method_type = "kakao_pay"
[[boku.wallet]]
payment_method_type = "momo"
[boku.connector_auth.BodyKey]
api_key="API KEY"
key1= "MERCHANT ID"
[boku.connector_webhook_details]
merchant_secret="Source verification key"
[braintree]
[[braintree.credit]]
payment_method_type = "Mastercard"
[[braintree.credit]]
payment_method_type = "Visa"
[[braintree.credit]]
payment_method_type = "Interac"
[[braintree.credit]]
payment_method_type = "AmericanExpress"
[[braintree.credit]]
payment_method_type = "JCB"
[[braintree.credit]]
payment_method_type = "DinersClub"
[[braintree.credit]]
payment_method_type = "Discover"
[[braintree.credit]]
payment_method_type = "CartesBancaires"
[[braintree.credit]]
payment_method_type = "UnionPay"
[[braintree.debit]]
payment_method_type = "Mastercard"
[[braintree.debit]]
payment_method_type = "Visa"
[[braintree.debit]]
payment_method_type = "Interac"
[[braintree.debit]]
payment_method_type = "AmericanExpress"
[[braintree.debit]]
payment_method_type = "JCB"
[[braintree.debit]]
payment_method_type = "DinersClub"
[[braintree.debit]]
payment_method_type = "Discover"
[[braintree.debit]]
payment_method_type = "CartesBancaires"
[[braintree.debit]]
payment_method_type = "UnionPay"
[[braintree.debit]]
payment_method_type = "UnionPay"
[braintree.connector_webhook_details]
merchant_secret="Source verification key"
[braintree.connector_auth.SignatureKey]
api_key="Public Key"
key1="Merchant Id"
api_secret="Private Key"
[braintree.metadata.merchant_account_id]
name="merchant_account_id"
label="Merchant Account Id"
placeholder="Enter Merchant Account Id"
required=true
type="Text"
[braintree.metadata.merchant_config_currency]
name="merchant_config_currency"
label="Currency"
placeholder="Enter Currency"
required=true
type="Select"
options=[]
[cashtocode]
[[cashtocode.reward]]
payment_method_type = "classic"
[[cashtocode.reward]]
payment_method_type = "evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.EUR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.EUR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.GBP.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.GBP.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.USD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.USD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CAD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CAD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CHF.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CHF.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.AUD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.AUD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.INR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.INR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.JPY.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.JPY.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.NZD.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.NZD.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.ZAR.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.ZAR.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CNY.classic]
password_classic="Password Classic"
username_classic="Username Classic"
merchant_id_classic="MerchantId Classic"
[cashtocode.connector_auth.CurrencyAuthKey.auth_key_map.CNY.evoucher]
password_evoucher="Password Evoucher"
username_evoucher="Username Evoucher"
merchant_id_evoucher="MerchantId Evoucher"
[cashtocode.connector_webhook_details]
merchant_secret="Source verification key"
[checkout]
[[checkout.credit]]
payment_method_type = "Mastercard"
[[checkout.credit]]
payment_method_type = "Visa"
[[checkout.credit]]
payment_method_type = "Interac"
[[checkout.credit]]
payment_method_type = "AmericanExpress"
[[checkout.credit]]
payment_method_type = "JCB"
[[checkout.credit]]
payment_method_type = "DinersClub"
[[checkout.credit]]
payment_method_type = "Discover"
[[checkout.credit]]
payment_method_type = "CartesBancaires"
[[checkout.credit]]
payment_method_type = "UnionPay"
[[checkout.debit]]
payment_method_type = "Mastercard"
[[checkout.debit]]
payment_method_type = "Visa"
[[checkout.debit]]
payment_method_type = "Interac"
[[checkout.debit]]
payment_method_type = "AmericanExpress"
[[checkout.debit]]
payment_method_type = "JCB"
[[checkout.debit]]
payment_method_type = "DinersClub"
[[checkout.debit]]
payment_method_type = "Discover"
[[checkout.debit]]
payment_method_type = "CartesBancaires"
[[checkout.debit]]
payment_method_type = "UnionPay"
[[checkout.wallet]]
payment_method_type = "apple_pay"
[[checkout.wallet]]
payment_method_type = "google_pay"
[checkout.connector_auth.SignatureKey]
api_key="Checkout API Public Key"
key1="Processing Channel ID"
api_secret="Checkout API Secret Key"
[checkout.connector_webhook_details]
merchant_secret="Source verification key"
[[checkout.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[checkout.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[checkout.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[checkout.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[checkout.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[checkout.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[checkout.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[checkout.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[checkout.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[checkout.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[coinbase]
[[coinbase.crypto]]
payment_method_type = "crypto_currency"
[coinbase.connector_auth.HeaderKey]
api_key="API Key"
[coinbase.connector_webhook_details]
merchant_secret="Source verification key"
[coingate]
[[coingate.crypto]]
payment_method_type = "crypto_currency"
[coingate.connector_auth.BodyKey]
api_key="API Key"
key1 ="Merchant Token"
[coingate.metadata.currency_id]
name="currency_id"
label="ID of the currency in which the refund will be issued"
placeholder="Enter ID of the currency in which the refund will be issued"
required=true
type="Number"
[coingate.metadata.platform_id]
name="platform_id"
label="Platform ID of the currency in which the refund will be issued"
placeholder="Enter Platform ID of the currency in which the refund will be issued"
required=true
type="Number"
[coingate.metadata.ledger_account_id]
name="ledger_account_id"
label="ID of the trader balance associated with the currency in which the refund will be issued"
placeholder="Enter ID of the trader balance associated with the currency in which the refund will be issued"
required=true
type="Text"
[cryptopay]
[[cryptopay.crypto]]
payment_method_type = "crypto_currency"
[cryptopay.connector_auth.BodyKey]
api_key="API Key"
key1="Secret Key"
[cryptopay.connector_webhook_details]
merchant_secret="Source verification key"
[cybersource]
[[cybersource.credit]]
payment_method_type = "Mastercard"
[[cybersource.credit]]
payment_method_type = "Visa"
[[cybersource.credit]]
payment_method_type = "Interac"
[[cybersource.credit]]
payment_method_type = "AmericanExpress"
[[cybersource.credit]]
payment_method_type = "JCB"
[[cybersource.credit]]
payment_method_type = "DinersClub"
[[cybersource.credit]]
payment_method_type = "Discover"
[[cybersource.credit]]
payment_method_type = "CartesBancaires"
[[cybersource.credit]]
payment_method_type = "UnionPay"
[[cybersource.debit]]
payment_method_type = "Mastercard"
[[cybersource.debit]]
payment_method_type = "Visa"
[[cybersource.debit]]
payment_method_type = "Interac"
[[cybersource.debit]]
payment_method_type = "AmericanExpress"
[[cybersource.debit]]
payment_method_type = "JCB"
[[cybersource.debit]]
payment_method_type = "DinersClub"
[[cybersource.debit]]
payment_method_type = "Discover"
[[cybersource.debit]]
payment_method_type = "CartesBancaires"
[[cybersource.debit]]
payment_method_type = "UnionPay"
[[cybersource.wallet]]
payment_method_type = "apple_pay"
[[cybersource.wallet]]
payment_method_type = "google_pay"
[[cybersource.wallet]]
payment_method_type = "paze"
[[cybersource.wallet]]
payment_method_type = "samsung_pay"
[cybersource.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[cybersource.connector_webhook_details]
merchant_secret="Source verification key"
[cybersource.metadata]
disable_avs = "Disable AVS check"
disable_cvn = "Disable CVN check"
[[cybersource.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[cybersource.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[cybersource.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[cybersource.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[cybersource.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[cybersource.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[cybersource.connector_wallets_details.samsung_pay]]
name="service_id"
label="Samsung Pay Service Id"
placeholder="Enter Samsung Pay Service Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.samsung_pay]]
name="merchant_display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[cybersource.connector_wallets_details.samsung_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[cybersource.connector_wallets_details.samsung_pay]]
name="allowed_brands"
label="Allowed Brands"
placeholder="Enter Allowed Brands"
required=true
type="MultiSelect"
options=["visa","masterCard","amex","discover"]
[cybersource.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[cybersource.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[cybersource.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[cybersource_payout]
[[cybersource_payout.credit]]
payment_method_type = "Mastercard"
[[cybersource_payout.credit]]
payment_method_type = "Visa"
[[cybersource_payout.credit]]
payment_method_type = "Interac"
[[cybersource_payout.credit]]
payment_method_type = "AmericanExpress"
[[cybersource_payout.credit]]
payment_method_type = "JCB"
[[cybersource_payout.credit]]
payment_method_type = "DinersClub"
[[cybersource_payout.credit]]
payment_method_type = "Discover"
[[cybersource_payout.credit]]
payment_method_type = "CartesBancaires"
[[cybersource_payout.credit]]
payment_method_type = "UnionPay"
[[cybersource_payout.debit]]
payment_method_type = "Mastercard"
[[cybersource_payout.debit]]
payment_method_type = "Visa"
[[cybersource_payout.debit]]
payment_method_type = "Interac"
[[cybersource_payout.debit]]
payment_method_type = "AmericanExpress"
[[cybersource_payout.debit]]
payment_method_type = "JCB"
[[cybersource_payout.debit]]
payment_method_type = "DinersClub"
[[cybersource_payout.debit]]
payment_method_type = "Discover"
[[cybersource_payout.debit]]
payment_method_type = "CartesBancaires"
[[cybersource_payout.debit]]
payment_method_type = "UnionPay"
[cybersource_payout.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[deutschebank]
[[deutschebank.bank_debit]]
payment_method_type = "sepa"
[[deutschebank.credit]]
payment_method_type = "Visa"
[[deutschebank.credit]]
payment_method_type = "Mastercard"
[[deutschebank.debit]]
payment_method_type = "Visa"
[[deutschebank.debit]]
payment_method_type = "Mastercard"
[deutschebank.connector_auth.SignatureKey]
api_key="Client ID"
key1="Merchant ID"
api_secret="Client Key"
[digitalvirgo]
[[digitalvirgo.mobile_payment]]
payment_method_type = "direct_carrier_billing"
[digitalvirgo.connector_auth.BodyKey]
api_key="Password"
key1="Username"
[dlocal]
[[dlocal.credit]]
payment_method_type = "Mastercard"
[[dlocal.credit]]
payment_method_type = "Visa"
[[dlocal.credit]]
payment_method_type = "Interac"
[[dlocal.credit]]
payment_method_type = "AmericanExpress"
[[dlocal.credit]]
payment_method_type = "JCB"
[[dlocal.credit]]
payment_method_type = "DinersClub"
[[dlocal.credit]]
payment_method_type = "Discover"
[[dlocal.credit]]
payment_method_type = "CartesBancaires"
[[dlocal.credit]]
payment_method_type = "UnionPay"
[[dlocal.debit]]
payment_method_type = "Mastercard"
[[dlocal.debit]]
payment_method_type = "Visa"
[[dlocal.debit]]
payment_method_type = "Interac"
[[dlocal.debit]]
payment_method_type = "AmericanExpress"
[[dlocal.debit]]
payment_method_type = "JCB"
[[dlocal.debit]]
payment_method_type = "DinersClub"
[[dlocal.debit]]
payment_method_type = "Discover"
[[dlocal.debit]]
payment_method_type = "CartesBancaires"
[[dlocal.debit]]
payment_method_type = "UnionPay"
[dlocal.connector_auth.SignatureKey]
api_key="X Login"
key1="X Trans Key"
api_secret="Secret Key"
[dlocal.connector_webhook_details]
merchant_secret="Source verification key"
[ebanx_payout]
[[ebanx_payout.bank_transfer]]
payment_method_type = "pix"
[ebanx_payout.connector_auth.HeaderKey]
api_key = "Integration Key"
[fiserv]
[[fiserv.credit]]
payment_method_type = "Mastercard"
[[fiserv.credit]]
payment_method_type = "Visa"
[[fiserv.credit]]
payment_method_type = "Interac"
[[fiserv.credit]]
payment_method_type = "AmericanExpress"
[[fiserv.credit]]
payment_method_type = "JCB"
[[fiserv.credit]]
payment_method_type = "DinersClub"
[[fiserv.credit]]
payment_method_type = "Discover"
[[fiserv.credit]]
payment_method_type = "CartesBancaires"
[[fiserv.credit]]
payment_method_type = "UnionPay"
[[fiserv.debit]]
payment_method_type = "Mastercard"
[[fiserv.debit]]
payment_method_type = "Visa"
[[fiserv.debit]]
payment_method_type = "Interac"
[[fiserv.debit]]
payment_method_type = "AmericanExpress"
[[fiserv.debit]]
payment_method_type = "JCB"
[[fiserv.debit]]
payment_method_type = "DinersClub"
[[fiserv.debit]]
payment_method_type = "Discover"
[[fiserv.debit]]
payment_method_type = "CartesBancaires"
[[fiserv.debit]]
payment_method_type = "UnionPay"
[fiserv.connector_auth.SignatureKey]
api_key="API Key"
key1="Merchant ID"
api_secret="API Secret"
[fiserv.connector_webhook_details]
merchant_secret="Source verification key"
[fiserv.metadata.terminal_id]
name="terminal_id"
label="Terminal ID"
placeholder="Enter Terminal ID"
required=true
type="Text"
[fiservemea]
[[fiservemea.credit]]
payment_method_type = "Mastercard"
[[fiservemea.credit]]
payment_method_type = "Visa"
[[fiservemea.credit]]
payment_method_type = "Interac"
[[fiservemea.credit]]
payment_method_type = "AmericanExpress"
[[fiservemea.credit]]
payment_method_type = "JCB"
[[fiservemea.credit]]
payment_method_type = "DinersClub"
[[fiservemea.credit]]
payment_method_type = "Discover"
[[fiservemea.credit]]
payment_method_type = "CartesBancaires"
[[fiservemea.credit]]
payment_method_type = "UnionPay"
[[fiservemea.debit]]
payment_method_type = "Mastercard"
[[fiservemea.debit]]
payment_method_type = "Visa"
[[fiservemea.debit]]
payment_method_type = "Interac"
[[fiservemea.debit]]
payment_method_type = "AmericanExpress"
[[fiservemea.debit]]
payment_method_type = "JCB"
[[fiservemea.debit]]
payment_method_type = "DinersClub"
[[fiservemea.debit]]
payment_method_type = "Discover"
[[fiservemea.debit]]
payment_method_type = "CartesBancaires"
[[fiservemea.debit]]
payment_method_type = "UnionPay"
[fiservemea.connector_auth.BodyKey]
api_key="API Key"
key1="Secret Key"
[forte]
[[forte.credit]]
payment_method_type = "Mastercard"
[[forte.credit]]
payment_method_type = "Visa"
[[forte.credit]]
payment_method_type = "Interac"
[[forte.credit]]
payment_method_type = "AmericanExpress"
[[forte.credit]]
payment_method_type = "JCB"
[[forte.credit]]
payment_method_type = "DinersClub"
[[forte.credit]]
payment_method_type = "Discover"
[[forte.credit]]
payment_method_type = "CartesBancaires"
[[forte.credit]]
payment_method_type = "UnionPay"
[[forte.debit]]
payment_method_type = "Mastercard"
[[forte.debit]]
payment_method_type = "Visa"
[[forte.debit]]
payment_method_type = "Interac"
[[forte.debit]]
payment_method_type = "AmericanExpress"
[[forte.debit]]
payment_method_type = "JCB"
[[forte.debit]]
payment_method_type = "DinersClub"
[[forte.debit]]
payment_method_type = "Discover"
[[forte.debit]]
payment_method_type = "CartesBancaires"
[[forte.debit]]
payment_method_type = "UnionPay"
[forte.connector_auth.MultiAuthKey]
api_key="API Access ID"
key1="Organization ID"
api_secret="API Secure Key"
key2="Location ID"
[forte.connector_webhook_details]
merchant_secret="Source verification key"
[getnet]
[[getnet.credit]]
payment_method_type = "Mastercard"
[[getnet.credit]]
payment_method_type = "Visa"
[[getnet.credit]]
payment_method_type = "Interac"
[[getnet.credit]]
payment_method_type = "AmericanExpress"
[[getnet.credit]]
payment_method_type = "JCB"
[[getnet.credit]]
payment_method_type = "DinersClub"
[[getnet.credit]]
payment_method_type = "Discover"
[[getnet.credit]]
payment_method_type = "CartesBancaires"
[[getnet.credit]]
payment_method_type = "UnionPay"
[[getnet.credit]]
payment_method_type = "RuPay"
[[getnet.credit]]
payment_method_type = "Maestro"
[globalpay]
[[globalpay.credit]]
payment_method_type = "Mastercard"
[[globalpay.credit]]
payment_method_type = "Visa"
[[globalpay.credit]]
payment_method_type = "Interac"
[[globalpay.credit]]
payment_method_type = "AmericanExpress"
[[globalpay.credit]]
payment_method_type = "JCB"
[[globalpay.credit]]
payment_method_type = "DinersClub"
[[globalpay.credit]]
payment_method_type = "Discover"
[[globalpay.credit]]
payment_method_type = "CartesBancaires"
[[globalpay.credit]]
payment_method_type = "UnionPay"
[[globalpay.debit]]
payment_method_type = "Mastercard"
[[globalpay.debit]]
payment_method_type = "Visa"
[[globalpay.debit]]
payment_method_type = "Interac"
[[globalpay.debit]]
payment_method_type = "AmericanExpress"
[[globalpay.debit]]
payment_method_type = "JCB"
[[globalpay.debit]]
payment_method_type = "DinersClub"
[[globalpay.debit]]
payment_method_type = "Discover"
[[globalpay.debit]]
payment_method_type = "CartesBancaires"
[[globalpay.debit]]
payment_method_type = "UnionPay"
[[globalpay.bank_redirect]]
payment_method_type = "ideal"
[[globalpay.bank_redirect]]
payment_method_type = "giropay"
[[globalpay.bank_redirect]]
payment_method_type = "sofort"
[[globalpay.bank_redirect]]
payment_method_type = "eps"
[[globalpay.wallet]]
payment_method_type = "google_pay"
[[globalpay.wallet]]
payment_method_type = "paypal"
[globalpay.connector_auth.BodyKey]
api_key="Global App Key"
key1="Global App ID"
[globalpay.connector_webhook_details]
merchant_secret="Source verification key"
[[globalpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[globalpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[globalpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[globalpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[globalpay.metadata.account_name]
name="account_name"
label="Account Name"
placeholder="Enter Account Name"
required=true
type="Text"
[globepay]
[[globepay.wallet]]
payment_method_type = "we_chat_pay"
[[globepay.wallet]]
payment_method_type = "ali_pay"
[globepay.connector_auth.BodyKey]
api_key="Partner Code"
key1="Credential Code"
[globepay.connector_webhook_details]
merchant_secret="Source verification key"
[gocardless]
[[gocardless.bank_debit]]
payment_method_type = "ach"
[[gocardless.bank_debit]]
payment_method_type = "becs"
[[gocardless.bank_debit]]
payment_method_type = "sepa"
[gocardless.connector_auth.HeaderKey]
api_key="Access Token"
[gocardless.connector_webhook_details]
merchant_secret="Source verification key"
[iatapay]
[[iatapay.upi]]
payment_method_type = "upi_collect"
[iatapay.connector_auth.SignatureKey]
api_key="Client ID"
key1="Airline ID"
api_secret="Client Secret"
[iatapay.connector_webhook_details]
merchant_secret="Source verification key"
[itaubank]
[[itaubank.bank_transfer]]
payment_method_type = "pix"
[itaubank.connector_auth.MultiAuthKey]
key1="Client Id"
api_key="Client Secret"
api_secret="Certificates"
key2="Certificate Key"
[jpmorgan]
[[jpmorgan.credit]]
payment_method_type = "AmericanExpress"
[[jpmorgan.credit]]
payment_method_type = "DinersClub"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "JCB"
[[jpmorgan.credit]]
payment_method_type = "Mastercard"
[[jpmorgan.credit]]
payment_method_type = "Discover"
[[jpmorgan.credit]]
payment_method_type = "UnionPay"
[[jpmorgan.credit]]
payment_method_type = "Visa"
[[jpmorgan.debit]]
payment_method_type = "AmericanExpress"
[[jpmorgan.debit]]
payment_method_type = "DinersClub"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "JCB"
[[jpmorgan.debit]]
payment_method_type = "Mastercard"
[[jpmorgan.debit]]
payment_method_type = "Discover"
[[jpmorgan.debit]]
payment_method_type = "UnionPay"
[[jpmorgan.debit]]
payment_method_type = "Visa"
[jpmorgan.connector_auth.BodyKey]
api_key="Access Token"
key1="Client Secret"
[klarna]
[[klarna.pay_later]]
payment_method_type = "klarna"
payment_experience = "invoke_sdk_client"
[[klarna.pay_later]]
payment_method_type = "klarna"
payment_experience = "redirect_to_url"
[klarna.connector_auth.BodyKey]
key1="Klarna Merchant Username"
api_key="Klarna Merchant ID Password"
[klarna.metadata.klarna_region]
name="klarna_region"
label="Region of your Klarna Merchant Account"
placeholder="Enter Region of your Klarna Merchant Account"
required=true
type="Select"
options=["Europe","NorthAmerica","Oceania"]
[mifinity]
[[mifinity.wallet]]
payment_method_type = "mifinity"
[mifinity.connector_auth.HeaderKey]
api_key="key"
[mifinity.metadata.brand_id]
name="brand_id"
label="Merchant Brand ID"
placeholder="Enter Brand ID"
required=true
type="Text"
[mifinity.metadata.destination_account_number]
name="destination_account_number"
label="Destination Account Number"
placeholder="Enter Destination Account Number"
required=true
type="Text"
[razorpay]
[[razorpay.upi]]
payment_method_type = "upi_collect"
[razorpay.connector_auth.BodyKey]
api_key="Razorpay Id"
key1 = "Razorpay Secret"
[mollie]
[[mollie.credit]]
payment_method_type = "Mastercard"
[[mollie.credit]]
payment_method_type = "Visa"
[[mollie.credit]]
payment_method_type = "Interac"
[[mollie.credit]]
payment_method_type = "AmericanExpress"
[[mollie.credit]]
payment_method_type = "JCB"
[[mollie.credit]]
payment_method_type = "DinersClub"
[[mollie.credit]]
payment_method_type = "Discover"
[[mollie.credit]]
payment_method_type = "CartesBancaires"
[[mollie.credit]]
payment_method_type = "UnionPay"
[[mollie.debit]]
payment_method_type = "Mastercard"
[[mollie.debit]]
payment_method_type = "Visa"
[[mollie.debit]]
payment_method_type = "Interac"
[[mollie.debit]]
payment_method_type = "AmericanExpress"
[[mollie.debit]]
payment_method_type = "JCB"
[[mollie.debit]]
payment_method_type = "DinersClub"
[[mollie.debit]]
payment_method_type = "Discover"
[[mollie.debit]]
payment_method_type = "CartesBancaires"
[[mollie.debit]]
payment_method_type = "UnionPay"
[[mollie.bank_redirect]]
payment_method_type = "ideal"
[[mollie.bank_redirect]]
payment_method_type = "giropay"
[[mollie.bank_redirect]]
payment_method_type = "sofort"
[[mollie.bank_redirect]]
payment_method_type = "eps"
[[mollie.bank_redirect]]
payment_method_type = "przelewy24"
[[mollie.bank_redirect]]
payment_method_type = "bancontact_card"
[[mollie.wallet]]
payment_method_type = "paypal"
[mollie.connector_auth.BodyKey]
api_key="API Key"
key1="Profile Token"
[mollie.connector_webhook_details]
merchant_secret="Source verification key"
[moneris]
[[moneris.credit]]
payment_method_type = "Mastercard"
[[moneris.credit]]
payment_method_type = "Visa"
[[moneris.credit]]
payment_method_type = "Interac"
[[moneris.credit]]
payment_method_type = "AmericanExpress"
[[moneris.credit]]
payment_method_type = "JCB"
[[moneris.credit]]
payment_method_type = "DinersClub"
[[moneris.credit]]
payment_method_type = "Discover"
[[moneris.credit]]
payment_method_type = "CartesBancaires"
[[moneris.credit]]
payment_method_type = "UnionPay"
[[moneris.debit]]
payment_method_type = "Mastercard"
[[moneris.debit]]
payment_method_type = "Visa"
[[moneris.debit]]
payment_method_type = "Interac"
[[moneris.debit]]
payment_method_type = "AmericanExpress"
[[moneris.debit]]
payment_method_type = "JCB"
[[moneris.debit]]
payment_method_type = "DinersClub"
[[moneris.debit]]
payment_method_type = "Discover"
[[moneris.debit]]
payment_method_type = "CartesBancaires"
[[moneris.debit]]
payment_method_type = "UnionPay"
[moneris.connector_auth.SignatureKey]
api_key="Client Secret"
key1="Client Id"
api_secret="Merchant Id"
[multisafepay]
[[multisafepay.credit]]
payment_method_type = "Mastercard"
[[multisafepay.credit]]
payment_method_type = "Visa"
[[multisafepay.credit]]
payment_method_type = "Interac"
[[multisafepay.credit]]
payment_method_type = "AmericanExpress"
[[multisafepay.credit]]
payment_method_type = "JCB"
[[multisafepay.credit]]
payment_method_type = "DinersClub"
[[multisafepay.credit]]
payment_method_type = "Discover"
[[multisafepay.credit]]
payment_method_type = "CartesBancaires"
[[multisafepay.credit]]
payment_method_type = "UnionPay"
[[multisafepay.debit]]
payment_method_type = "Mastercard"
[[multisafepay.debit]]
payment_method_type = "Visa"
[[multisafepay.debit]]
payment_method_type = "Interac"
[[multisafepay.debit]]
payment_method_type = "AmericanExpress"
[[multisafepay.debit]]
payment_method_type = "JCB"
[[multisafepay.debit]]
payment_method_type = "DinersClub"
[[multisafepay.debit]]
payment_method_type = "Discover"
[[multisafepay.debit]]
payment_method_type = "CartesBancaires"
[[multisafepay.debit]]
payment_method_type = "UnionPay"
[[multisafepay.wallet]]
payment_method_type = "google_pay"
[[multisafepay.wallet]]
payment_method_type = "paypal"
[multisafepay.connector_auth.HeaderKey]
api_key="Enter API Key"
[multisafepay.connector_webhook_details]
merchant_secret="Source verification key"
[[multisafepay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[multisafepay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[multisafepay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[multisafepay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[multisafepay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[multisafepay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[nexinets]
[[nexinets.credit]]
payment_method_type = "Mastercard"
[[nexinets.credit]]
payment_method_type = "Visa"
[[nexinets.credit]]
payment_method_type = "Interac"
[[nexinets.credit]]
payment_method_type = "AmericanExpress"
[[nexinets.credit]]
payment_method_type = "JCB"
[[nexinets.credit]]
payment_method_type = "DinersClub"
[[nexinets.credit]]
payment_method_type = "Discover"
[[nexinets.credit]]
payment_method_type = "CartesBancaires"
[[nexinets.credit]]
payment_method_type = "UnionPay"
[[nexinets.debit]]
payment_method_type = "Mastercard"
[[nexinets.debit]]
payment_method_type = "Visa"
[[nexinets.debit]]
payment_method_type = "Interac"
[[nexinets.debit]]
payment_method_type = "AmericanExpress"
[[nexinets.debit]]
payment_method_type = "JCB"
[[nexinets.debit]]
payment_method_type = "DinersClub"
[[nexinets.debit]]
payment_method_type = "Discover"
[[nexinets.debit]]
payment_method_type = "CartesBancaires"
[[nexinets.debit]]
payment_method_type = "UnionPay"
[[nexinets.bank_redirect]]
payment_method_type = "ideal"
[[nexinets.bank_redirect]]
payment_method_type = "giropay"
[[nexinets.bank_redirect]]
payment_method_type = "sofort"
[[nexinets.bank_redirect]]
payment_method_type = "eps"
[[nexinets.wallet]]
payment_method_type = "apple_pay"
[[nexinets.wallet]]
payment_method_type = "paypal"
[nexinets.connector_auth.BodyKey]
api_key="API Key"
key1="Merchant ID"
[nexinets.connector_webhook_details]
merchant_secret="Source verification key"
[[nexinets.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[nexinets.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[nexinets.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[nexixpay]
[[nexixpay.credit]]
payment_method_type = "Mastercard"
[[nexixpay.credit]]
payment_method_type = "Visa"
[[nexixpay.credit]]
payment_method_type = "AmericanExpress"
[[nexixpay.credit]]
payment_method_type = "JCB"
[[nexixpay.debit]]
payment_method_type = "Mastercard"
[[nexixpay.debit]]
payment_method_type = "Visa"
[[nexixpay.debit]]
payment_method_type = "AmericanExpress"
[[nexixpay.debit]]
payment_method_type = "JCB"
[nexixpay.connector_auth.HeaderKey]
api_key="API Key"
[nmi]
[[nmi.credit]]
payment_method_type = "Mastercard"
[[nmi.credit]]
payment_method_type = "Visa"
[[nmi.credit]]
payment_method_type = "Interac"
[[nmi.credit]]
payment_method_type = "AmericanExpress"
[[nmi.credit]]
payment_method_type = "JCB"
[[nmi.credit]]
payment_method_type = "DinersClub"
[[nmi.credit]]
payment_method_type = "Discover"
[[nmi.credit]]
payment_method_type = "CartesBancaires"
[[nmi.credit]]
payment_method_type = "UnionPay"
[[nmi.debit]]
payment_method_type = "Mastercard"
[[nmi.debit]]
payment_method_type = "Visa"
[[nmi.debit]]
payment_method_type = "Interac"
[[nmi.debit]]
payment_method_type = "AmericanExpress"
[[nmi.debit]]
payment_method_type = "JCB"
[[nmi.debit]]
payment_method_type = "DinersClub"
[[nmi.debit]]
payment_method_type = "Discover"
[[nmi.debit]]
payment_method_type = "CartesBancaires"
[[nmi.debit]]
payment_method_type = "UnionPay"
[[nmi.bank_redirect]]
payment_method_type = "ideal"
[[nmi.wallet]]
payment_method_type = "apple_pay"
[[nmi.wallet]]
payment_method_type = "google_pay"
[nmi.connector_auth.BodyKey]
api_key="API Key"
key1="Public Key"
[nmi.connector_webhook_details]
merchant_secret="Source verification key"
[[nmi.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[nmi.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[nmi.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[nmi.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nmi.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nmi.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nmi.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[nmi.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[nmi.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[nmi.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[nmi.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[nmi.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[noon]
[[noon.credit]]
payment_method_type = "Mastercard"
[[noon.credit]]
payment_method_type = "Visa"
[[noon.credit]]
payment_method_type = "Interac"
[[noon.credit]]
payment_method_type = "AmericanExpress"
[[noon.credit]]
payment_method_type = "JCB"
[[noon.credit]]
payment_method_type = "DinersClub"
[[noon.credit]]
payment_method_type = "Discover"
[[noon.credit]]
payment_method_type = "CartesBancaires"
[[noon.credit]]
payment_method_type = "UnionPay"
[[noon.debit]]
payment_method_type = "Mastercard"
[[noon.debit]]
payment_method_type = "Visa"
[[noon.debit]]
payment_method_type = "Interac"
[[noon.debit]]
payment_method_type = "AmericanExpress"
[[noon.debit]]
payment_method_type = "JCB"
[[noon.debit]]
payment_method_type = "DinersClub"
[[noon.debit]]
payment_method_type = "Discover"
[[noon.debit]]
payment_method_type = "CartesBancaires"
[[noon.debit]]
payment_method_type = "UnionPay"
[[noon.wallet]]
payment_method_type = "apple_pay"
[[noon.wallet]]
payment_method_type = "google_pay"
[[noon.wallet]]
payment_method_type = "paypal"
[noon.connector_auth.SignatureKey]
api_key="API Key"
key1="Business Identifier"
api_secret="Application Identifier"
[noon.connector_webhook_details]
merchant_secret="Source verification key"
[[noon.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[noon.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[noon.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[noon.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[noon.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[noon.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[noon.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[noon.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[noon.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[novalnet]
[[novalnet.credit]]
payment_method_type = "Mastercard"
[[novalnet.credit]]
payment_method_type = "Visa"
[[novalnet.credit]]
payment_method_type = "Interac"
[[novalnet.credit]]
payment_method_type = "AmericanExpress"
[[novalnet.credit]]
payment_method_type = "JCB"
[[novalnet.credit]]
payment_method_type = "DinersClub"
[[novalnet.credit]]
payment_method_type = "Discover"
[[novalnet.credit]]
payment_method_type = "CartesBancaires"
[[novalnet.credit]]
payment_method_type = "UnionPay"
[[novalnet.debit]]
payment_method_type = "Mastercard"
[[novalnet.debit]]
payment_method_type = "Visa"
[[novalnet.debit]]
payment_method_type = "Interac"
[[novalnet.debit]]
payment_method_type = "AmericanExpress"
[[novalnet.debit]]
payment_method_type = "JCB"
[[novalnet.debit]]
payment_method_type = "DinersClub"
[[novalnet.debit]]
payment_method_type = "Discover"
[[novalnet.debit]]
payment_method_type = "CartesBancaires"
[[novalnet.debit]]
payment_method_type = "UnionPay"
[[novalnet.wallet]]
payment_method_type = "google_pay"
[[novalnet.wallet]]
payment_method_type = "paypal"
[[novalnet.wallet]]
payment_method_type = "apple_pay"
[novalnet.connector_auth.SignatureKey]
api_key="Product Activation Key"
key1="Payment Access Key"
api_secret="Tariff ID"
[novalnet.connector_webhook_details]
merchant_secret="Source verification key"
[[novalnet.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[novalnet.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[novalnet.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[novalnet.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[novalnet.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[novalnet.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[novalnet.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[novalnet.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[nuvei]
[[nuvei.credit]]
payment_method_type = "Mastercard"
[[nuvei.credit]]
payment_method_type = "Visa"
[[nuvei.credit]]
payment_method_type = "Interac"
[[nuvei.credit]]
payment_method_type = "AmericanExpress"
[[nuvei.credit]]
payment_method_type = "JCB"
[[nuvei.credit]]
payment_method_type = "DinersClub"
[[nuvei.credit]]
payment_method_type = "Discover"
[[nuvei.credit]]
payment_method_type = "CartesBancaires"
[[nuvei.credit]]
payment_method_type = "UnionPay"
[[nuvei.debit]]
payment_method_type = "Mastercard"
[[nuvei.debit]]
payment_method_type = "Visa"
[[nuvei.debit]]
payment_method_type = "Interac"
[[nuvei.debit]]
payment_method_type = "AmericanExpress"
[[nuvei.debit]]
payment_method_type = "JCB"
[[nuvei.debit]]
payment_method_type = "DinersClub"
[[nuvei.debit]]
payment_method_type = "Discover"
[[nuvei.debit]]
payment_method_type = "CartesBancaires"
[[nuvei.debit]]
payment_method_type = "UnionPay"
[[nuvei.pay_later]]
payment_method_type = "klarna"
[[nuvei.pay_later]]
payment_method_type = "afterpay_clearpay"
[[nuvei.bank_redirect]]
payment_method_type = "ideal"
[[nuvei.bank_redirect]]
payment_method_type = "giropay"
[[nuvei.bank_redirect]]
payment_method_type = "sofort"
[[nuvei.bank_redirect]]
payment_method_type = "eps"
[[nuvei.wallet]]
payment_method_type = "apple_pay"
[[nuvei.wallet]]
payment_method_type = "google_pay"
[[nuvei.wallet]]
payment_method_type = "paypal"
[nuvei.connector_auth.SignatureKey]
api_key="Merchant ID"
key1="Merchant Site ID"
api_secret="Merchant Secret"
[nuvei.connector_webhook_details]
merchant_secret="Source verification key"
[[nuvei.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[nuvei.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[nuvei.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[nuvei.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nuvei.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nuvei.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nuvei.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[nuvei.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[nuvei.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[opennode]
[[opennode.crypto]]
payment_method_type = "crypto_currency"
[opennode.connector_auth.HeaderKey]
api_key="API Key"
[opennode.connector_webhook_details]
merchant_secret="Source verification key"
[prophetpay]
[[prophetpay.card_redirect]]
payment_method_type = "card_redirect"
[prophetpay.connector_auth.SignatureKey]
api_key="Username"
key1="Token"
api_secret="Profile"
[payme]
[[payme.credit]]
payment_method_type = "Mastercard"
[[payme.credit]]
payment_method_type = "Visa"
[[payme.credit]]
payment_method_type = "Interac"
[[payme.credit]]
payment_method_type = "AmericanExpress"
[[payme.credit]]
payment_method_type = "JCB"
[[payme.credit]]
payment_method_type = "DinersClub"
[[payme.credit]]
payment_method_type = "Discover"
[[payme.credit]]
payment_method_type = "CartesBancaires"
[[payme.credit]]
payment_method_type = "UnionPay"
[[payme.debit]]
payment_method_type = "Mastercard"
[[payme.debit]]
payment_method_type = "Visa"
[[payme.debit]]
payment_method_type = "Interac"
[[payme.debit]]
payment_method_type = "AmericanExpress"
[[payme.debit]]
payment_method_type = "JCB"
[[payme.debit]]
payment_method_type = "DinersClub"
[[payme.debit]]
payment_method_type = "Discover"
[[payme.debit]]
payment_method_type = "CartesBancaires"
[[payme.debit]]
payment_method_type = "UnionPay"
[payme.connector_auth.BodyKey]
api_key="Seller Payme Id"
key1="Payme Public Key"
[payme.connector_webhook_details]
merchant_secret="Payme Client Secret"
additional_secret="Payme Client Key"
[paypal]
[[paypal.credit]]
payment_method_type = "Mastercard"
[[paypal.credit]]
payment_method_type = "Visa"
[[paypal.credit]]
payment_method_type = "Interac"
[[paypal.credit]]
payment_method_type = "AmericanExpress"
[[paypal.credit]]
payment_method_type = "JCB"
[[paypal.credit]]
payment_method_type = "DinersClub"
[[paypal.credit]]
payment_method_type = "Discover"
[[paypal.credit]]
payment_method_type = "CartesBancaires"
[[paypal.credit]]
payment_method_type = "UnionPay"
[[paypal.debit]]
payment_method_type = "Mastercard"
[[paypal.debit]]
payment_method_type = "Visa"
[[paypal.debit]]
payment_method_type = "Interac"
[[paypal.debit]]
payment_method_type = "AmericanExpress"
[[paypal.debit]]
payment_method_type = "JCB"
[[paypal.debit]]
payment_method_type = "DinersClub"
[[paypal.debit]]
payment_method_type = "Discover"
[[paypal.debit]]
payment_method_type = "CartesBancaires"
[[paypal.debit]]
payment_method_type = "UnionPay"
[[paypal.wallet]]
payment_method_type = "paypal"
payment_experience = "invoke_sdk_client"
[[paypal.wallet]]
payment_method_type = "paypal"
payment_experience = "redirect_to_url"
[[paypal.bank_redirect]]
payment_method_type = "ideal"
[[paypal.bank_redirect]]
payment_method_type = "giropay"
[[paypal.bank_redirect]]
payment_method_type = "sofort"
[[paypal.bank_redirect]]
payment_method_type = "eps"
is_verifiable = true
[paypal.connector_auth.BodyKey]
api_key="Client Secret"
key1="Client ID"
[paypal.connector_webhook_details]
merchant_secret="Source verification key"
[paypal.metadata.paypal_sdk]
client_id="Client ID"
[paypal_payout]
[[paypal_payout.wallet]]
payment_method_type = "paypal"
[[paypal_payout.wallet]]
payment_method_type = "venmo"
[paypal_payout.connector_auth.BodyKey]
api_key="Client Secret"
key1="Client ID"
[payu]
[[payu.credit]]
payment_method_type = "Mastercard"
[[payu.credit]]
payment_method_type = "Visa"
[[payu.credit]]
payment_method_type = "Interac"
[[payu.credit]]
payment_method_type = "AmericanExpress"
[[payu.credit]]
payment_method_type = "JCB"
[[payu.credit]]
payment_method_type = "DinersClub"
[[payu.credit]]
payment_method_type = "Discover"
[[payu.credit]]
payment_method_type = "CartesBancaires"
[[payu.credit]]
payment_method_type = "UnionPay"
[[payu.debit]]
payment_method_type = "Mastercard"
[[payu.debit]]
payment_method_type = "Visa"
[[payu.debit]]
payment_method_type = "Interac"
[[payu.debit]]
payment_method_type = "AmericanExpress"
[[payu.debit]]
payment_method_type = "JCB"
[[payu.debit]]
payment_method_type = "DinersClub"
[[payu.debit]]
payment_method_type = "Discover"
[[payu.debit]]
payment_method_type = "CartesBancaires"
[[payu.debit]]
payment_method_type = "UnionPay"
[[payu.wallet]]
payment_method_type = "google_pay"
[payu.connector_auth.BodyKey]
api_key="API Key"
key1="Merchant POS ID"
[payu.connector_webhook_details]
merchant_secret="Source verification key"
[[payu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[payu.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[payu.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[payu.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[placetopay]
[[placetopay.credit]]
payment_method_type = "Mastercard"
[[placetopay.credit]]
payment_method_type = "Visa"
[[placetopay.credit]]
payment_method_type = "Interac"
[[placetopay.credit]]
payment_method_type = "AmericanExpress"
[[placetopay.credit]]
payment_method_type = "JCB"
[[placetopay.credit]]
payment_method_type = "DinersClub"
[[placetopay.credit]]
payment_method_type = "Discover"
[[placetopay.credit]]
payment_method_type = "CartesBancaires"
[[placetopay.credit]]
payment_method_type = "UnionPay"
[[placetopay.debit]]
payment_method_type = "Mastercard"
[[placetopay.debit]]
payment_method_type = "Visa"
[[placetopay.debit]]
payment_method_type = "Interac"
[[placetopay.debit]]
payment_method_type = "AmericanExpress"
[[placetopay.debit]]
payment_method_type = "JCB"
[[placetopay.debit]]
payment_method_type = "DinersClub"
[[placetopay.debit]]
payment_method_type = "Discover"
[[placetopay.debit]]
payment_method_type = "CartesBancaires"
[[placetopay.debit]]
payment_method_type = "UnionPay"
[placetopay.connector_auth.BodyKey]
api_key="Login"
key1="Trankey"
[plaid]
[[plaid.open_banking]]
payment_method_type = "open_banking_pis"
[plaid.connector_auth.BodyKey]
api_key="client_id"
key1="secret"
[plaid.additional_merchant_data.open_banking_recipient_data]
name="open_banking_recipient_data"
label="Open Banking Recipient Data"
placeholder="Enter Open Banking Recipient Data"
required=true
type="Select"
options=["account_data","connector_recipient_id","wallet_id"]
[plaid.additional_merchant_data.account_data]
name="account_data"
label="Account Data"
placeholder="Enter account_data"
required=true
type="Select"
options=["iban","bacs"]
[plaid.additional_merchant_data.connector_recipient_id]
name="connector_recipient_id"
label="Connector Recipient Id"
placeholder="Enter connector recipient id"
required=true
type="Text"
[plaid.additional_merchant_data.wallet_id]
name="wallet_id"
label="Wallet Id"
placeholder="Enter wallet id"
required=true
type="Text"
[[plaid.additional_merchant_data.iban]]
name="iban"
label="Iban"
placeholder="Enter iban"
required=true
type="Text"
[[plaid.additional_merchant_data.iban]]
name="iban.name"
label="Name"
placeholder="Enter name"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="sort_code"
label="Sort Code"
placeholder="Enter sort code"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="account_number"
label="Bank scheme"
placeholder="Enter account number"
required=true
type="Text"
[[plaid.additional_merchant_data.bacs]]
name="bacs.name"
label="Name"
placeholder="Enter name"
required=true
type="Text"
[powertranz]
[[powertranz.credit]]
payment_method_type = "Mastercard"
[[powertranz.credit]]
payment_method_type = "Visa"
[[powertranz.credit]]
payment_method_type = "Interac"
[[powertranz.credit]]
payment_method_type = "AmericanExpress"
[[powertranz.credit]]
payment_method_type = "JCB"
[[powertranz.credit]]
payment_method_type = "DinersClub"
[[powertranz.credit]]
payment_method_type = "Discover"
[[powertranz.credit]]
payment_method_type = "CartesBancaires"
[[powertranz.credit]]
payment_method_type = "UnionPay"
[[powertranz.debit]]
payment_method_type = "Mastercard"
[[powertranz.debit]]
payment_method_type = "Visa"
[[powertranz.debit]]
payment_method_type = "Interac"
[[powertranz.debit]]
payment_method_type = "AmericanExpress"
[[powertranz.debit]]
payment_method_type = "JCB"
[[powertranz.debit]]
payment_method_type = "DinersClub"
[[powertranz.debit]]
payment_method_type = "Discover"
[[powertranz.debit]]
payment_method_type = "CartesBancaires"
[[powertranz.debit]]
payment_method_type = "UnionPay"
[powertranz.connector_auth.BodyKey]
key1 = "PowerTranz Id"
api_key="PowerTranz Password"
[powertranz.connector_webhook_details]
merchant_secret="Source verification key"
[rapyd]
[[rapyd.credit]]
payment_method_type = "Mastercard"
[[rapyd.credit]]
payment_method_type = "Visa"
[[rapyd.credit]]
payment_method_type = "Interac"
[[rapyd.credit]]
payment_method_type = "AmericanExpress"
[[rapyd.credit]]
payment_method_type = "JCB"
[[rapyd.credit]]
payment_method_type = "DinersClub"
[[rapyd.credit]]
payment_method_type = "Discover"
[[rapyd.credit]]
payment_method_type = "CartesBancaires"
[[rapyd.credit]]
payment_method_type = "UnionPay"
[[rapyd.debit]]
payment_method_type = "Mastercard"
[[rapyd.debit]]
payment_method_type = "Visa"
[[rapyd.debit]]
payment_method_type = "Interac"
[[rapyd.debit]]
payment_method_type = "AmericanExpress"
[[rapyd.debit]]
payment_method_type = "JCB"
[[rapyd.debit]]
payment_method_type = "DinersClub"
[[rapyd.debit]]
payment_method_type = "Discover"
[[rapyd.debit]]
payment_method_type = "CartesBancaires"
[[rapyd.debit]]
payment_method_type = "UnionPay"
[[rapyd.wallet]]
payment_method_type = "apple_pay"
[rapyd.connector_auth.BodyKey]
api_key="Access Key"
key1="API Secret"
[rapyd.connector_webhook_details]
merchant_secret="Source verification key"
[[rapyd.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[rapyd.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[rapyd.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[shift4]
[[shift4.credit]]
payment_method_type = "Mastercard"
[[shift4.credit]]
payment_method_type = "Visa"
[[shift4.credit]]
payment_method_type = "Interac"
[[shift4.credit]]
payment_method_type = "AmericanExpress"
[[shift4.credit]]
payment_method_type = "JCB"
[[shift4.credit]]
payment_method_type = "DinersClub"
[[shift4.credit]]
payment_method_type = "Discover"
[[shift4.credit]]
payment_method_type = "CartesBancaires"
[[shift4.credit]]
payment_method_type = "UnionPay"
[[shift4.debit]]
payment_method_type = "Mastercard"
[[shift4.debit]]
payment_method_type = "Visa"
[[shift4.debit]]
payment_method_type = "Interac"
[[shift4.debit]]
payment_method_type = "AmericanExpress"
[[shift4.debit]]
payment_method_type = "JCB"
[[shift4.debit]]
payment_method_type = "DinersClub"
[[shift4.debit]]
payment_method_type = "Discover"
[[shift4.debit]]
payment_method_type = "CartesBancaires"
[[shift4.debit]]
payment_method_type = "UnionPay"
[[shift4.bank_redirect]]
payment_method_type = "ideal"
[[shift4.bank_redirect]]
payment_method_type = "giropay"
[[shift4.bank_redirect]]
payment_method_type = "sofort"
[[shift4.bank_redirect]]
payment_method_type = "eps"
[shift4.connector_auth.HeaderKey]
api_key="API Key"
[shift4.connector_webhook_details]
merchant_secret="Source verification key"
[stripe]
[[stripe.credit]]
payment_method_type = "Mastercard"
[[stripe.credit]]
payment_method_type = "Visa"
[[stripe.credit]]
payment_method_type = "Interac"
[[stripe.credit]]
payment_method_type = "AmericanExpress"
[[stripe.credit]]
payment_method_type = "JCB"
[[stripe.credit]]
payment_method_type = "DinersClub"
[[stripe.credit]]
payment_method_type = "Discover"
[[stripe.credit]]
payment_method_type = "CartesBancaires"
[[stripe.credit]]
payment_method_type = "UnionPay"
[[stripe.debit]]
payment_method_type = "Mastercard"
[[stripe.debit]]
payment_method_type = "Visa"
[[stripe.debit]]
payment_method_type = "Interac"
[[stripe.debit]]
payment_method_type = "AmericanExpress"
[[stripe.debit]]
payment_method_type = "JCB"
[[stripe.debit]]
payment_method_type = "DinersClub"
[[stripe.debit]]
payment_method_type = "Discover"
[[stripe.debit]]
payment_method_type = "CartesBancaires"
[[stripe.debit]]
payment_method_type = "UnionPay"
[[stripe.pay_later]]
payment_method_type = "klarna"
[[stripe.pay_later]]
payment_method_type = "affirm"
[[stripe.pay_later]]
payment_method_type = "afterpay_clearpay"
[[stripe.bank_redirect]]
payment_method_type = "ideal"
[[stripe.bank_redirect]]
payment_method_type = "giropay"
[[stripe.bank_redirect]]
payment_method_type = "sofort"
[[stripe.bank_redirect]]
payment_method_type = "eps"
[[stripe.bank_redirect]]
payment_method_type = "bancontact_card"
[[stripe.bank_redirect]]
payment_method_type = "przelewy24"
[[stripe.bank_debit]]
payment_method_type = "ach"
[[stripe.bank_debit]]
payment_method_type = "bacs"
[[stripe.bank_debit]]
payment_method_type = "becs"
[[stripe.bank_debit]]
payment_method_type = "sepa"
[[stripe.bank_transfer]]
payment_method_type = "ach"
[[stripe.bank_transfer]]
payment_method_type = "bacs"
[[stripe.bank_transfer]]
payment_method_type = "sepa"
[[stripe.bank_transfer]]
payment_method_type = "multibanco"
[[stripe.wallet]]
payment_method_type = "amazon_pay"
[[stripe.wallet]]
payment_method_type = "apple_pay"
[[stripe.wallet]]
payment_method_type = "google_pay"
[[stripe.wallet]]
payment_method_type = "we_chat_pay"
[[stripe.wallet]]
payment_method_type = "ali_pay"
[[stripe.wallet]]
payment_method_type = "cashapp"
is_verifiable = true
[stripe.connector_auth.HeaderKey]
api_key="Secret Key"
[stripe.connector_webhook_details]
merchant_secret="Source verification key"
[[stripe.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[stripe.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[stripe.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
[[stripe.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="stripe:publishableKey"
label="Stripe Publishable Key"
placeholder="Enter Stripe Publishable Key"
required=true
type="Text"
[[stripe.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[stripe.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="stripe:publishableKey"
label="Stripe Publishable Key"
placeholder="Enter Stripe Publishable Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[stripe.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[stax]
[[stax.credit]]
payment_method_type = "Mastercard"
[[stax.credit]]
payment_method_type = "Visa"
[[stax.credit]]
payment_method_type = "Interac"
[[stax.credit]]
payment_method_type = "AmericanExpress"
[[stax.credit]]
payment_method_type = "JCB"
[[stax.credit]]
payment_method_type = "DinersClub"
[[stax.credit]]
payment_method_type = "Discover"
[[stax.credit]]
payment_method_type = "CartesBancaires"
[[stax.credit]]
payment_method_type = "UnionPay"
[[stax.debit]]
payment_method_type = "Mastercard"
[[stax.debit]]
payment_method_type = "Visa"
[[stax.debit]]
payment_method_type = "Interac"
[[stax.debit]]
payment_method_type = "AmericanExpress"
[[stax.debit]]
payment_method_type = "JCB"
[[stax.debit]]
payment_method_type = "DinersClub"
[[stax.debit]]
payment_method_type = "Discover"
[[stax.debit]]
payment_method_type = "CartesBancaires"
[[stax.debit]]
payment_method_type = "UnionPay"
[[stax.bank_debit]]
payment_method_type = "ach"
[stax.connector_auth.HeaderKey]
api_key="Api Key"
[stax.connector_webhook_details]
merchant_secret="Source verification key"
[square]
[[square.credit]]
payment_method_type = "Mastercard"
[[square.credit]]
payment_method_type = "Visa"
[[square.credit]]
payment_method_type = "Interac"
[[square.credit]]
payment_method_type = "AmericanExpress"
[[square.credit]]
payment_method_type = "JCB"
[[square.credit]]
payment_method_type = "DinersClub"
[[square.credit]]
payment_method_type = "Discover"
[[square.credit]]
payment_method_type = "CartesBancaires"
[[square.credit]]
payment_method_type = "UnionPay"
[[square.debit]]
payment_method_type = "Mastercard"
[[square.debit]]
payment_method_type = "Visa"
[[square.debit]]
payment_method_type = "Interac"
[[square.debit]]
payment_method_type = "AmericanExpress"
[[square.debit]]
payment_method_type = "JCB"
[[square.debit]]
payment_method_type = "DinersClub"
[[square.debit]]
payment_method_type = "Discover"
[[square.debit]]
payment_method_type = "CartesBancaires"
[[square.debit]]
payment_method_type = "UnionPay"
[square.connector_auth.BodyKey]
api_key = "Square API Key"
key1 = "Square Client Id"
[square.connector_webhook_details]
merchant_secret="Source verification key"
[trustpay]
[[trustpay.credit]]
payment_method_type = "Mastercard"
[[trustpay.credit]]
payment_method_type = "Visa"
[[trustpay.credit]]
payment_method_type = "Interac"
[[trustpay.credit]]
payment_method_type = "AmericanExpress"
[[trustpay.credit]]
payment_method_type = "JCB"
[[trustpay.credit]]
payment_method_type = "DinersClub"
[[trustpay.credit]]
payment_method_type = "Discover"
[[trustpay.credit]]
payment_method_type = "CartesBancaires"
[[trustpay.credit]]
payment_method_type = "UnionPay"
[[trustpay.debit]]
payment_method_type = "Mastercard"
[[trustpay.debit]]
payment_method_type = "Visa"
[[trustpay.debit]]
payment_method_type = "Interac"
[[trustpay.debit]]
payment_method_type = "AmericanExpress"
[[trustpay.debit]]
payment_method_type = "JCB"
[[trustpay.debit]]
payment_method_type = "DinersClub"
[[trustpay.debit]]
payment_method_type = "Discover"
[[trustpay.debit]]
payment_method_type = "CartesBancaires"
[[trustpay.debit]]
payment_method_type = "UnionPay"
[[trustpay.bank_redirect]]
payment_method_type = "ideal"
[[trustpay.bank_redirect]]
payment_method_type = "giropay"
[[trustpay.bank_redirect]]
payment_method_type = "sofort"
[[trustpay.bank_redirect]]
payment_method_type = "eps"
[[trustpay.bank_redirect]]
payment_method_type = "blik"
[[trustpay.wallet]]
payment_method_type = "apple_pay"
[[trustpay.wallet]]
payment_method_type = "google_pay"
[[trustpay.bank_transfer]]
payment_method_type = "sepa_bank_transfer"
[[trustpay.bank_transfer]]
payment_method_type = "instant_bank_transfer"
[trustpay.connector_auth.SignatureKey]
api_key="API Key"
key1="Project ID"
api_secret="Secret Key"
[trustpay.connector_webhook_details]
merchant_secret="Source verification key"
[[trustpay.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[trustpay.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[trustpay.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[trustpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[trustpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[trustpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[trustpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[tsys]
[[tsys.credit]]
payment_method_type = "Mastercard"
[[tsys.credit]]
payment_method_type = "Visa"
[[tsys.credit]]
payment_method_type = "Interac"
[[tsys.credit]]
payment_method_type = "AmericanExpress"
[[tsys.credit]]
payment_method_type = "JCB"
[[tsys.credit]]
payment_method_type = "DinersClub"
[[tsys.credit]]
payment_method_type = "Discover"
[[tsys.credit]]
payment_method_type = "CartesBancaires"
[[tsys.credit]]
payment_method_type = "UnionPay"
[[tsys.debit]]
payment_method_type = "Mastercard"
[[tsys.debit]]
payment_method_type = "Visa"
[[tsys.debit]]
payment_method_type = "Interac"
[[tsys.debit]]
payment_method_type = "AmericanExpress"
[[tsys.debit]]
payment_method_type = "JCB"
[[tsys.debit]]
payment_method_type = "DinersClub"
[[tsys.debit]]
payment_method_type = "Discover"
[[tsys.debit]]
payment_method_type = "CartesBancaires"
[[tsys.debit]]
payment_method_type = "UnionPay"
[tsys.connector_auth.SignatureKey]
api_key="Device Id"
key1="Transaction Key"
api_secret="Developer Id"
[tsys.connector_webhook_details]
merchant_secret="Source verification key"
[volt]
[[volt.bank_redirect]]
payment_method_type = "open_banking_uk"
[volt.connector_auth.MultiAuthKey]
api_key = "Username"
api_secret = "Password"
key1 = "Client ID"
key2 = "Client Secret"
[volt.connector_webhook_details]
merchant_secret="Source verification key"
[worldline]
[[worldline.credit]]
payment_method_type = "Mastercard"
[[worldline.credit]]
payment_method_type = "Visa"
[[worldline.credit]]
payment_method_type = "Interac"
[[worldline.credit]]
payment_method_type = "AmericanExpress"
[[worldline.credit]]
payment_method_type = "JCB"
[[worldline.credit]]
payment_method_type = "DinersClub"
[[worldline.credit]]
payment_method_type = "Discover"
[[worldline.credit]]
payment_method_type = "CartesBancaires"
[[worldline.credit]]
payment_method_type = "UnionPay"
[[worldline.debit]]
payment_method_type = "Mastercard"
[[worldline.debit]]
payment_method_type = "Visa"
[[worldline.debit]]
payment_method_type = "Interac"
[[worldline.debit]]
payment_method_type = "AmericanExpress"
[[worldline.debit]]
payment_method_type = "JCB"
[[worldline.debit]]
payment_method_type = "DinersClub"
[[worldline.debit]]
payment_method_type = "Discover"
[[worldline.debit]]
payment_method_type = "CartesBancaires"
[[worldline.debit]]
payment_method_type = "UnionPay"
[[worldline.bank_redirect]]
payment_method_type = "ideal"
[[worldline.bank_redirect]]
payment_method_type = "giropay"
[worldline.connector_auth.SignatureKey]
api_key="API Key ID"
key1="Merchant ID"
api_secret="Secret API Key"
[worldline.connector_webhook_details]
merchant_secret="Source verification key"
[worldpay]
[[worldpay.credit]]
payment_method_type = "Mastercard"
[[worldpay.credit]]
payment_method_type = "Visa"
[[worldpay.credit]]
payment_method_type = "Interac"
[[worldpay.credit]]
payment_method_type = "AmericanExpress"
[[worldpay.credit]]
payment_method_type = "JCB"
[[worldpay.credit]]
payment_method_type = "DinersClub"
[[worldpay.credit]]
payment_method_type = "Discover"
[[worldpay.credit]]
payment_method_type = "CartesBancaires"
[[worldpay.credit]]
payment_method_type = "UnionPay"
[[worldpay.debit]]
payment_method_type = "Mastercard"
[[worldpay.debit]]
payment_method_type = "Visa"
[[worldpay.debit]]
payment_method_type = "Interac"
[[worldpay.debit]]
payment_method_type = "AmericanExpress"
[[worldpay.debit]]
payment_method_type = "JCB"
[[worldpay.debit]]
payment_method_type = "DinersClub"
[[worldpay.debit]]
payment_method_type = "Discover"
[[worldpay.debit]]
payment_method_type = "CartesBancaires"
[[worldpay.debit]]
payment_method_type = "UnionPay"
[[worldpay.wallet]]
payment_method_type = "google_pay"
[[worldpay.wallet]]
payment_method_type = "apple_pay"
[worldpay.connector_auth.SignatureKey]
key1="Username"
api_key="Password"
api_secret="Merchant Identifier"
[worldpay.connector_webhook_details]
merchant_secret="Source verification key"
[worldpay.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant to de displayed during 3DS challenge"
placeholder="Enter Name of the merchant"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[worldpay.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[worldpay.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector"]
[[worldpay.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[worldpay.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[worldpay.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[worldpay.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[zen]
[[zen.credit]]
payment_method_type = "Mastercard"
[[zen.credit]]
payment_method_type = "Visa"
[[zen.credit]]
payment_method_type = "Interac"
[[zen.credit]]
payment_method_type = "AmericanExpress"
[[zen.credit]]
payment_method_type = "JCB"
[[zen.credit]]
payment_method_type = "DinersClub"
[[zen.credit]]
payment_method_type = "Discover"
[[zen.credit]]
payment_method_type = "CartesBancaires"
[[zen.credit]]
payment_method_type = "UnionPay"
[[zen.debit]]
payment_method_type = "Mastercard"
[[zen.debit]]
payment_method_type = "Visa"
[[zen.debit]]
payment_method_type = "Interac"
[[zen.debit]]
payment_method_type = "AmericanExpress"
[[zen.debit]]
payment_method_type = "JCB"
[[zen.debit]]
payment_method_type = "DinersClub"
[[zen.debit]]
payment_method_type = "Discover"
[[zen.debit]]
payment_method_type = "CartesBancaires"
[[zen.debit]]
payment_method_type = "UnionPay"
[[zen.voucher]]
payment_method_type = "boleto"
[[zen.voucher]]
payment_method_type = "efecty"
[[zen.voucher]]
payment_method_type = "pago_efectivo"
[[zen.voucher]]
payment_method_type = "red_compra"
[[zen.voucher]]
payment_method_type = "red_pagos"
[[zen.bank_transfer]]
payment_method_type = "pix"
[[zen.bank_transfer]]
payment_method_type = "pse"
[[zen.wallet]]
payment_method_type = "apple_pay"
[[zen.wallet]]
payment_method_type = "google_pay"
[zen.connector_auth.HeaderKey]
api_key="API Key"
[zen.connector_webhook_details]
merchant_secret="Source verification key"
[[zen.metadata.apple_pay]]
name="terminal_uuid"
label="Terminal UUID"
placeholder="Enter Terminal UUID"
required=true
type="Text"
[[zen.metadata.apple_pay]]
name="pay_wall_secret"
label="Pay Wall Secret"
placeholder="Enter Pay Wall Secret"
required=true
type="Text"
[[zen.metadata.google_pay]]
name="terminal_uuid"
label="Terminal UUID"
placeholder="Enter Terminal UUID"
required=true
type="Text"
[[zen.metadata.google_pay]]
name="pay_wall_secret"
label="Pay Wall Secret"
placeholder="Enter Pay Wall Secret"
required=true
type="Text"
[zsl]
[[zsl.bank_transfer]]
payment_method_type = "local_bank_transfer"
[zsl.connector_auth.BodyKey]
api_key = "Key"
key1 = "Merchant ID"
[dummy_connector]
[[dummy_connector.credit]]
payment_method_type = "Mastercard"
[[dummy_connector.credit]]
payment_method_type = "Visa"
[[dummy_connector.credit]]
payment_method_type = "Interac"
[[dummy_connector.credit]]
payment_method_type = "AmericanExpress"
[[dummy_connector.credit]]
payment_method_type = "JCB"
[[dummy_connector.credit]]
payment_method_type = "DinersClub"
[[dummy_connector.credit]]
payment_method_type = "Discover"
[[dummy_connector.credit]]
payment_method_type = "CartesBancaires"
[[dummy_connector.credit]]
payment_method_type = "UnionPay"
[[dummy_connector.debit]]
payment_method_type = "Mastercard"
[[dummy_connector.debit]]
payment_method_type = "Visa"
[[dummy_connector.debit]]
payment_method_type = "Interac"
[[dummy_connector.debit]]
payment_method_type = "AmericanExpress"
[[dummy_connector.debit]]
payment_method_type = "JCB"
[[dummy_connector.debit]]
payment_method_type = "DinersClub"
[[dummy_connector.debit]]
payment_method_type = "Discover"
[[dummy_connector.debit]]
payment_method_type = "CartesBancaires"
[[dummy_connector.debit]]
payment_method_type = "UnionPay"
[dummy_connector.connector_auth.HeaderKey]
api_key="Api Key"
[paypal_test]
[[paypal_test.credit]]
payment_method_type = "Mastercard"
[[paypal_test.credit]]
payment_method_type = "Visa"
[[paypal_test.credit]]
payment_method_type = "Interac"
[[paypal_test.credit]]
payment_method_type = "AmericanExpress"
[[paypal_test.credit]]
payment_method_type = "JCB"
[[paypal_test.credit]]
payment_method_type = "DinersClub"
[[paypal_test.credit]]
payment_method_type = "Discover"
[[paypal_test.credit]]
payment_method_type = "CartesBancaires"
[[paypal_test.credit]]
payment_method_type = "UnionPay"
[[paypal_test.debit]]
payment_method_type = "Mastercard"
[[paypal_test.debit]]
payment_method_type = "Visa"
[[paypal_test.debit]]
payment_method_type = "Interac"
[[paypal_test.debit]]
payment_method_type = "AmericanExpress"
[[paypal_test.debit]]
payment_method_type = "JCB"
[[paypal_test.debit]]
payment_method_type = "DinersClub"
[[paypal_test.debit]]
payment_method_type = "Discover"
[[paypal_test.debit]]
payment_method_type = "CartesBancaires"
[[paypal_test.debit]]
payment_method_type = "UnionPay"
[[paypal_test.wallet]]
payment_method_type = "paypal"
[paypal_test.connector_auth.HeaderKey]
api_key="Api Key"
[paystack]
[[paystack.bank_redirect]]
payment_method_type = "eft"
[paystack.connector_auth.HeaderKey]
api_key="API Key"
[paystack.connector_webhook_details]
merchant_secret="API Key"
[stripe_test]
[[stripe_test.credit]]
payment_method_type = "Mastercard"
[[stripe_test.credit]]
payment_method_type = "Visa"
[[stripe_test.credit]]
payment_method_type = "Interac"
[[stripe_test.credit]]
payment_method_type = "AmericanExpress"
[[stripe_test.credit]]
payment_method_type = "JCB"
[[stripe_test.credit]]
payment_method_type = "DinersClub"
[[stripe_test.credit]]
payment_method_type = "Discover"
[[stripe_test.credit]]
payment_method_type = "CartesBancaires"
[[stripe_test.credit]]
payment_method_type = "UnionPay"
[[stripe_test.debit]]
payment_method_type = "Mastercard"
[[stripe_test.debit]]
payment_method_type = "Visa"
[[stripe_test.debit]]
payment_method_type = "Interac"
[[stripe_test.debit]]
payment_method_type = "AmericanExpress"
[[stripe_test.debit]]
payment_method_type = "JCB"
[[stripe_test.debit]]
payment_method_type = "DinersClub"
[[stripe_test.debit]]
payment_method_type = "Discover"
[[stripe_test.debit]]
payment_method_type = "CartesBancaires"
[[stripe_test.debit]]
payment_method_type = "UnionPay"
[[stripe_test.wallet]]
payment_method_type = "google_pay"
[[stripe_test.wallet]]
payment_method_type = "ali_pay"
[[stripe_test.wallet]]
payment_method_type = "we_chat_pay"
[[stripe_test.pay_later]]
payment_method_type = "klarna"
[[stripe_test.pay_later]]
payment_method_type = "affirm"
[[stripe_test.pay_later]]
payment_method_type = "afterpay_clearpay"
[[paypal_test.wallet]]
payment_method_type = "paypal"
[stripe_test.connector_auth.HeaderKey]
api_key="Api Key"
[helcim]
[[helcim.credit]]
payment_method_type = "Mastercard"
[[helcim.credit]]
payment_method_type = "Visa"
[[helcim.credit]]
payment_method_type = "Interac"
[[helcim.credit]]
payment_method_type = "AmericanExpress"
[[helcim.credit]]
payment_method_type = "JCB"
[[helcim.credit]]
payment_method_type = "DinersClub"
[[helcim.credit]]
payment_method_type = "Discover"
[[helcim.credit]]
payment_method_type = "CartesBancaires"
[[helcim.credit]]
payment_method_type = "UnionPay"
[[helcim.debit]]
payment_method_type = "Mastercard"
[[helcim.debit]]
payment_method_type = "Visa"
[[helcim.debit]]
payment_method_type = "Interac"
[[helcim.debit]]
payment_method_type = "AmericanExpress"
[[helcim.debit]]
payment_method_type = "JCB"
[[helcim.debit]]
payment_method_type = "DinersClub"
[[helcim.debit]]
payment_method_type = "Discover"
[[helcim.debit]]
payment_method_type = "CartesBancaires"
[[helcim.debit]]
payment_method_type = "UnionPay"
[helcim.connector_auth.HeaderKey]
api_key="Api Key"
[adyen_payout]
[[adyen_payout.credit]]
payment_method_type = "Mastercard"
[[adyen_payout.credit]]
payment_method_type = "Visa"
[[adyen_payout.credit]]
payment_method_type = "Interac"
[[adyen_payout.credit]]
payment_method_type = "AmericanExpress"
[[adyen_payout.credit]]
payment_method_type = "JCB"
[[adyen_payout.credit]]
payment_method_type = "DinersClub"
[[adyen_payout.credit]]
payment_method_type = "Discover"
[[adyen_payout.credit]]
payment_method_type = "CartesBancaires"
[[adyen_payout.credit]]
payment_method_type = "UnionPay"
[[adyen_payout.debit]]
payment_method_type = "Mastercard"
[[adyen_payout.debit]]
payment_method_type = "Visa"
[[adyen_payout.debit]]
payment_method_type = "Interac"
[[adyen_payout.debit]]
payment_method_type = "AmericanExpress"
[[adyen_payout.debit]]
payment_method_type = "JCB"
[[adyen_payout.debit]]
payment_method_type = "DinersClub"
[[adyen_payout.debit]]
payment_method_type = "Discover"
[[adyen_payout.debit]]
payment_method_type = "CartesBancaires"
[[adyen_payout.debit]]
payment_method_type = "UnionPay"
[[adyen_payout.bank_transfer]]
payment_method_type = "sepa"
[[adyen_payout.wallet]]
payment_method_type = "paypal"
[adyen_payout.connector_auth.SignatureKey]
api_key = "Adyen API Key (Payout creation)"
api_secret = "Adyen Key (Payout submission)"
key1 = "Adyen Account Id"
[adyen_payout.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="Enter Live endpoint prefix"
required=true
type="Text"
[stripe_payout]
[[stripe_payout.bank_transfer]]
payment_method_type = "ach"
[stripe_payout.connector_auth.HeaderKey]
api_key = "Stripe API Key"
[nomupay_payout]
[[nomupay_payout.bank_transfer]]
payment_method_type = "sepa"
[nomupay_payout.connector_auth.BodyKey]
api_key = "Nomupay kid"
key1 = "Nomupay eid"
[nomupay_payout.metadata.private_key]
name="Private key for signature generation"
label="Enter your private key"
placeholder="------BEGIN PRIVATE KEY-------"
required=true
type="Text"
[wise_payout]
[[wise_payout.bank_transfer]]
payment_method_type = "ach"
[[wise_payout.bank_transfer]]
payment_method_type = "bacs"
[[wise_payout.bank_transfer]]
payment_method_type = "sepa"
[wise_payout.connector_auth.BodyKey]
api_key = "Wise API Key"
key1 = "Wise Account Id"
[threedsecureio]
[threedsecureio.connector_auth.HeaderKey]
api_key="Api Key"
[threedsecureio.metadata.mcc]
name="mcc"
label="MCC"
placeholder="Enter MCC"
required=true
type="Text"
[threedsecureio.metadata.merchant_country_code]
name="merchant_country_code"
label="3 digit numeric country code"
placeholder="Enter 3 digit numeric country code"
required=true
type="Text"
[threedsecureio.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant"
placeholder="Enter Name of the merchant"
required=true
type="Text"
[threedsecureio.metadata.pull_mechanism_for_external_3ds_enabled]
name="pull_mechanism_for_external_3ds_enabled"
label="Pull Mechanism Enabled"
placeholder="Enter Pull Mechanism Enabled"
required=false
type="Toggle"
[netcetera]
[netcetera.connector_auth.CertificateAuth]
certificate="Base64 encoded PEM formatted certificate chain"
private_key="Base64 encoded PEM formatted private key"
[netcetera.metadata.endpoint_prefix]
name="endpoint_prefix"
label="Live endpoint prefix"
placeholder="string that will replace '{prefix}' in this base url 'https://{prefix}.3ds-server.prev.netcetera-cloud-payment.ch'"
required=true
type="Text"
[netcetera.metadata.mcc]
name="mcc"
label="MCC"
placeholder="Enter MCC"
required=false
type="Text"
[netcetera.metadata.merchant_country_code]
name="merchant_country_code"
label="3 digit numeric country code"
placeholder="Enter 3 digit numeric country code"
required=false
type="Text"
[netcetera.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant"
placeholder="Enter Name of the merchant"
required=false
type="Text"
[netcetera.metadata.three_ds_requestor_name]
name="three_ds_requestor_name"
label="ThreeDS requestor name"
placeholder="Enter ThreeDS requestor name"
required=false
type="Text"
[netcetera.metadata.three_ds_requestor_id]
name="three_ds_requestor_id"
label="ThreeDS request id"
placeholder="Enter ThreeDS request id"
required=false
type="Text"
[netcetera.metadata.merchant_configuration_id]
name="merchant_configuration_id"
label="Merchant Configuration ID"
placeholder="Enter Merchant Configuration ID"
required=false
type="Text"
[taxjar]
[taxjar.connector_auth.HeaderKey]
api_key="Sandbox Token"
[billwerk]
[[billwerk.credit]]
payment_method_type = "Mastercard"
[[billwerk.credit]]
payment_method_type = "Visa"
[[billwerk.credit]]
payment_method_type = "Interac"
[[billwerk.credit]]
payment_method_type = "AmericanExpress"
[[billwerk.credit]]
payment_method_type = "JCB"
[[billwerk.credit]]
payment_method_type = "DinersClub"
[[billwerk.credit]]
payment_method_type = "Discover"
[[billwerk.credit]]
payment_method_type = "CartesBancaires"
[[billwerk.credit]]
payment_method_type = "UnionPay"
[[billwerk.debit]]
payment_method_type = "Mastercard"
[[billwerk.debit]]
payment_method_type = "Visa"
[[billwerk.debit]]
payment_method_type = "Interac"
[[billwerk.debit]]
payment_method_type = "AmericanExpress"
[[billwerk.debit]]
payment_method_type = "JCB"
[[billwerk.debit]]
payment_method_type = "DinersClub"
[[billwerk.debit]]
payment_method_type = "Discover"
[[billwerk.debit]]
payment_method_type = "CartesBancaires"
[[billwerk.debit]]
payment_method_type = "UnionPay"
[billwerk.connector_auth.BodyKey]
api_key="Private Api Key"
key1="Public Api Key"
[datatrans]
[[datatrans.credit]]
payment_method_type = "Mastercard"
[[datatrans.credit]]
payment_method_type = "Visa"
[[datatrans.credit]]
payment_method_type = "Interac"
[[datatrans.credit]]
payment_method_type = "AmericanExpress"
[[datatrans.credit]]
payment_method_type = "JCB"
[[datatrans.credit]]
payment_method_type = "DinersClub"
[[datatrans.credit]]
payment_method_type = "Discover"
[[datatrans.credit]]
payment_method_type = "CartesBancaires"
[[datatrans.credit]]
payment_method_type = "UnionPay"
[[datatrans.debit]]
payment_method_type = "Mastercard"
[[datatrans.debit]]
payment_method_type = "Visa"
[[datatrans.debit]]
payment_method_type = "Interac"
[[datatrans.debit]]
payment_method_type = "AmericanExpress"
[[datatrans.debit]]
payment_method_type = "JCB"
[[datatrans.debit]]
payment_method_type = "DinersClub"
[[datatrans.debit]]
payment_method_type = "Discover"
[[datatrans.debit]]
payment_method_type = "CartesBancaires"
[[datatrans.debit]]
payment_method_type = "UnionPay"
[datatrans.connector_auth.BodyKey]
api_key = "Passcode"
key1 = "datatrans MerchantId"
[datatrans.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=false
type="Text"
[datatrans.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant ID"
placeholder="Enter Acquirer Merchant ID"
required=false
type="Text"
[datatrans.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=false
type="Text"
[paybox]
[[paybox.credit]]
payment_method_type = "Mastercard"
[[paybox.credit]]
payment_method_type = "Visa"
[[paybox.credit]]
payment_method_type = "Interac"
[[paybox.credit]]
payment_method_type = "AmericanExpress"
[[paybox.credit]]
payment_method_type = "JCB"
[[paybox.credit]]
payment_method_type = "DinersClub"
[[paybox.credit]]
payment_method_type = "Discover"
[[paybox.credit]]
payment_method_type = "CartesBancaires"
[[paybox.credit]]
payment_method_type = "UnionPay"
[[paybox.debit]]
payment_method_type = "Mastercard"
[[paybox.debit]]
payment_method_type = "Visa"
[[paybox.debit]]
payment_method_type = "Interac"
[[paybox.debit]]
payment_method_type = "AmericanExpress"
[[paybox.debit]]
payment_method_type = "JCB"
[[paybox.debit]]
payment_method_type = "DinersClub"
[[paybox.debit]]
payment_method_type = "Discover"
[[paybox.debit]]
payment_method_type = "CartesBancaires"
[paybox.connector_auth.MultiAuthKey]
api_key="SITE Key"
key1="Rang Identifier"
api_secret="CLE Secret"
key2 ="Merchant Id"
[wellsfargo]
[[wellsfargo.credit]]
payment_method_type = "Mastercard"
[[wellsfargo.credit]]
payment_method_type = "Visa"
[[wellsfargo.credit]]
payment_method_type = "Interac"
[[wellsfargo.credit]]
payment_method_type = "AmericanExpress"
[[wellsfargo.credit]]
payment_method_type = "JCB"
[[wellsfargo.credit]]
payment_method_type = "DinersClub"
[[wellsfargo.credit]]
payment_method_type = "Discover"
[[wellsfargo.credit]]
payment_method_type = "CartesBancaires"
[[wellsfargo.credit]]
payment_method_type = "UnionPay"
[[wellsfargo.debit]]
payment_method_type = "Mastercard"
[[wellsfargo.debit]]
payment_method_type = "Visa"
[[wellsfargo.debit]]
payment_method_type = "Interac"
[[wellsfargo.debit]]
payment_method_type = "AmericanExpress"
[[wellsfargo.debit]]
payment_method_type = "JCB"
[[wellsfargo.debit]]
payment_method_type = "DinersClub"
[[wellsfargo.debit]]
payment_method_type = "Discover"
[[wellsfargo.debit]]
payment_method_type = "CartesBancaires"
[[wellsfargo.debit]]
payment_method_type = "UnionPay"
[wellsfargo.connector_auth.SignatureKey]
api_key="Key"
key1="Merchant ID"
api_secret="Shared Secret"
[fiuu]
[[fiuu.credit]]
payment_method_type = "Mastercard"
[[fiuu.credit]]
payment_method_type = "Visa"
[[fiuu.credit]]
payment_method_type = "Interac"
[[fiuu.credit]]
payment_method_type = "AmericanExpress"
[[fiuu.credit]]
payment_method_type = "JCB"
[[fiuu.credit]]
payment_method_type = "DinersClub"
[[fiuu.credit]]
payment_method_type = "Discover"
[[fiuu.credit]]
payment_method_type = "CartesBancaires"
[[fiuu.credit]]
payment_method_type = "UnionPay"
[[fiuu.debit]]
payment_method_type = "Mastercard"
[[fiuu.debit]]
payment_method_type = "Visa"
[[fiuu.debit]]
payment_method_type = "Interac"
[[fiuu.debit]]
payment_method_type = "AmericanExpress"
[[fiuu.debit]]
payment_method_type = "JCB"
[[fiuu.debit]]
payment_method_type = "DinersClub"
[[fiuu.debit]]
payment_method_type = "Discover"
[[fiuu.debit]]
payment_method_type = "CartesBancaires"
[[fiuu.debit]]
payment_method_type = "UnionPay"
[[fiuu.real_time_payment]]
payment_method_type = "duit_now"
[[fiuu.wallet]]
payment_method_type = "google_pay"
[[fiuu.wallet]]
payment_method_type = "apple_pay"
[[fiuu.bank_redirect]]
payment_method_type = "online_banking_fpx"
[fiuu.connector_auth.SignatureKey]
api_key="Verify Key"
key1="Merchant ID"
api_secret="Secret Key"
[[fiuu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[fiuu.connector_wallets_details.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="public_key"
label="Google Pay Public Key"
placeholder="Enter Google Pay Public Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="private_key"
label="Google Pay Private Key"
placeholder="Enter Google Pay Private Key"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="recipient_id"
label="Recipient Id"
placeholder="Enter Recipient Id"
required=true
type="Text"
[[fiuu.connector_wallets_details.google_pay]]
name="allowed_auth_methods"
label="Allowed Auth Methods"
placeholder="Enter Allowed Auth Methods"
required=true
type="MultiSelect"
options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
[[fiuu.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[fiuu.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[fiuu.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Hyperswitch"]
[fiuu.connector_webhook_details]
merchant_secret="Source verification key"
[elavon]
[[elavon.credit]]
payment_method_type = "Mastercard"
[[elavon.credit]]
payment_method_type = "Visa"
[[elavon.credit]]
payment_method_type = "Interac"
[[elavon.credit]]
payment_method_type = "AmericanExpress"
[[elavon.credit]]
payment_method_type = "JCB"
[[elavon.credit]]
payment_method_type = "DinersClub"
[[elavon.credit]]
payment_method_type = "Discover"
[[elavon.credit]]
payment_method_type = "CartesBancaires"
[[elavon.credit]]
payment_method_type = "UnionPay"
[[elavon.debit]]
payment_method_type = "Mastercard"
[[elavon.debit]]
payment_method_type = "Visa"
[[elavon.debit]]
payment_method_type = "Interac"
[[elavon.debit]]
payment_method_type = "AmericanExpress"
[[elavon.debit]]
payment_method_type = "JCB"
[[elavon.debit]]
payment_method_type = "DinersClub"
[[elavon.debit]]
payment_method_type = "Discover"
[[elavon.debit]]
payment_method_type = "CartesBancaires"
[[elavon.debit]]
payment_method_type = "UnionPay"
[elavon.connector_auth.SignatureKey]
api_key="Account Id"
key1="User ID"
api_secret="Pin"
[ctp_mastercard]
[ctp_mastercard.connector_auth.HeaderKey]
api_key="API Key"
[ctp_mastercard.metadata.dpa_id]
name="dpa_id"
label="DPA Id"
placeholder="Enter DPA Id"
required=true
type="Text"
[ctp_mastercard.metadata.dpa_name]
name="dpa_name"
label="DPA Name"
placeholder="Enter DPA Name"
required=true
type="Text"
[ctp_mastercard.metadata.locale]
name="locale"
label="Locale"
placeholder="Enter locale"
required=true
type="Text"
[ctp_mastercard.metadata.card_brands]
name="card_brands"
label="Card Brands"
placeholder="Enter Card Brands"
required=true
type="MultiSelect"
options=["visa","mastercard"]
[ctp_mastercard.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquire Bin"
placeholder="Enter Acquirer Bin"
required=true
type="Text"
[ctp_mastercard.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquire Merchant Id"
placeholder="Enter Acquirer Merchant Id"
required=true
type="Text"
[ctp_mastercard.metadata.merchant_category_code]
name="merchant_category_code"
label="Merchant Category Code"
placeholder="Enter Merchant Category Code"
required=true
type="Text"
[ctp_mastercard.metadata.merchant_country_code]
name="merchant_country_code"
label="Merchant Country Code"
placeholder="Enter Merchant Country Code"
required=true
type="Text"
[xendit]
[[xendit.credit]]
payment_method_type = "Mastercard"
[[xendit.credit]]
payment_method_type = "Visa"
[[xendit.credit]]
payment_method_type = "Interac"
[[xendit.credit]]
payment_method_type = "AmericanExpress"
[[xendit.credit]]
payment_method_type = "JCB"
[[xendit.credit]]
payment_method_type = "DinersClub"
[[xendit.credit]]
payment_method_type = "Discover"
[[xendit.credit]]
payment_method_type = "CartesBancaires"
[[xendit.credit]]
payment_method_type = "UnionPay"
[[xendit.debit]]
payment_method_type = "Mastercard"
[[xendit.debit]]
payment_method_type = "Visa"
[[xendit.debit]]
payment_method_type = "Interac"
[[xendit.debit]]
payment_method_type = "AmericanExpress"
[[xendit.debit]]
payment_method_type = "JCB"
[[xendit.debit]]
payment_method_type = "DinersClub"
[[xendit.debit]]
payment_method_type = "Discover"
[[xendit.debit]]
payment_method_type = "CartesBancaires"
[[xendit.debit]]
payment_method_type = "UnionPay"
[xendit.connector_auth.HeaderKey]
api_key="API Key"
[xendit.connector_webhook_details]
merchant_secret="Webhook Verification Token"
[inespay]
[[inespay.bank_debit]]
payment_method_type = "sepa"
[inespay.connector_auth.BodyKey]
api_key="API Key"
key1="API Token"
[inespay.connector_webhook_details]
merchant_secret="API Key"
[juspaythreedsserver]
[juspaythreedsserver.metadata.mcc]
name="mcc"
label="MCC"
placeholder="Enter MCC"
required=false
type="Text"
[juspaythreedsserver.metadata.merchant_country_code]
name="merchant_country_code"
label="3 digit numeric country code"
placeholder="Enter 3 digit numeric country code"
required=false
type="Text"
[juspaythreedsserver.metadata.merchant_name]
name="merchant_name"
label="Name of the merchant"
placeholder="Enter Name of the merchant"
required=false
type="Text"
[juspaythreedsserver.metadata.three_ds_requestor_name]
name="three_ds_requestor_name"
label="ThreeDS requestor name"
placeholder="Enter ThreeDS requestor name"
required=false
type="Text"
[juspaythreedsserver.metadata.three_ds_requestor_id]
name="three_ds_requestor_id"
label="ThreeDS request id"
placeholder="Enter ThreeDS request id"
required=false
type="Text"
[juspaythreedsserver.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
placeholder="Enter Acquirer Bin"
required=true
type="Text"
[juspaythreedsserver.metadata.acquirer_country_code]
name="acquirer_country_code"
label="Acquirer Country Code"
placeholder="Enter Acquirer Country Code"
required=true
type="Text"
[juspaythreedsserver.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquirer Merchant Id"
placeholder="Enter Acquirer Merchant Id"
required=true
type="Text"
[juspaythreedsserver.connector_auth.HeaderKey]
api_key="API Key"
[hipay]
[[hipay.credit]]
payment_method_type = "Mastercard"
[[hipay.credit]]
payment_method_type = "Visa"
[[hipay.credit]]
payment_method_type = "Interac"
[[hipay.credit]]
payment_method_type = "AmericanExpress"
[[hipay.credit]]
payment_method_type = "JCB"
[[hipay.credit]]
payment_method_type = "DinersClub"
[[hipay.credit]]
payment_method_type = "Discover"
[[hipay.credit]]
payment_method_type = "CartesBancaires"
[[hipay.credit]]
payment_method_type = "UnionPay"
[[hipay.debit]]
payment_method_type = "Mastercard"
[[hipay.debit]]
payment_method_type = "Visa"
[[hipay.debit]]
payment_method_type = "Interac"
[[hipay.debit]]
payment_method_type = "AmericanExpress"
[[hipay.debit]]
payment_method_type = "JCB"
[[hipay.debit]]
payment_method_type = "DinersClub"
[[hipay.debit]]
payment_method_type = "Discover"
[[hipay.debit]]
payment_method_type = "CartesBancaires"
[[hipay.debit]]
payment_method_type = "UnionPay"
[hipay.connector_auth.BodyKey]
api_key="API Login ID"
key1="API password"
[ctp_visa]
[ctp_visa.connector_auth.NoKey]
[ctp_visa.metadata.dpa_id]
name="dpa_id"
label="DPA Id"
placeholder="Enter DPA Id"
required=true
type="Text"
[ctp_visa.metadata.dpa_name]
name="dpa_name"
label="DPA Name"
placeholder="Enter DPA Name"
required=true
type="Text"
[ctp_visa.metadata.locale]
name="locale"
label="Locale"
placeholder="Enter locale"
required=true
type="Text"
[ctp_visa.metadata.card_brands]
name="card_brands"
label="Card Brands"
placeholder="Enter Card Brands"
required=true
type="MultiSelect"
options=["visa","mastercard"]
[ctp_visa.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquire Bin"
placeholder="Enter Acquirer Bin"
required=true
type="Text"
[ctp_visa.metadata.acquirer_merchant_id]
name="acquirer_merchant_id"
label="Acquire Merchant Id"
placeholder="Enter Acquirer Merchant Id"
required=true
type="Text"
[ctp_visa.metadata.merchant_category_code]
name="merchant_category_code"
label="Merchant Category Code"
placeholder="Enter Merchant Category Code"
required=true
type="Text"
[ctp_visa.metadata.merchant_country_code]
name="merchant_country_code"
label="Merchant Country Code"
placeholder="Enter Merchant Country Code"
required=true
type="Text"
[ctp_visa.metadata.dpa_client_id]
name="dpa_client_id"
label="DPA Client ID"
placeholder="Enter DPA Client ID"
required=true
type="Text"
[redsys]
[[redsys.credit]]
payment_method_type = "Mastercard"
[[redsys.credit]]
payment_method_type = "Visa"
[[redsys.credit]]
payment_method_type = "AmericanExpress"
[[redsys.credit]]
payment_method_type = "JCB"
[[redsys.credit]]
payment_method_type = "DinersClub"
[[redsys.credit]]
payment_method_type = "UnionPay"
[[redsys.debit]]
payment_method_type = "Mastercard"
[[redsys.debit]]
payment_method_type = "Visa"
[[redsys.debit]]
payment_method_type = "AmericanExpress"
[[redsys.debit]]
payment_method_type = "JCB"
[[redsys.debit]]
payment_method_type = "DinersClub"
[[redsys.debit]]
payment_method_type = "UnionPay"
[redsys.connector_auth.SignatureKey]
api_key = "Merchant ID"
key1 = "Terminal ID"
api_secret = "Secret Key"
| 38,749 | 895 |
hyperswitch | crates/connector_configs/src/transformer.rs | .rs | use std::str::FromStr;
use api_models::{
enums::{
Connector, PaymentMethod,
PaymentMethodType::{self, AliPay, ApplePay, GooglePay, Klarna, Paypal, WeChatPay},
},
payment_methods,
refunds::MinorUnit,
};
use crate::common_config::{
ConnectorApiIntegrationPayload, DashboardRequestPayload, PaymentMethodsEnabled, Provider,
};
impl DashboardRequestPayload {
pub fn transform_card(
payment_method_type: PaymentMethodType,
card_provider: Vec<api_models::enums::CardNetwork>,
) -> payment_methods::RequestPaymentMethodTypes {
payment_methods::RequestPaymentMethodTypes {
payment_method_type,
card_networks: Some(card_provider),
minimum_amount: Some(MinorUnit::zero()),
maximum_amount: Some(MinorUnit::new(68607706)),
recurring_enabled: true,
installment_payment_enabled: false,
accepted_currencies: None,
accepted_countries: None,
payment_experience: None,
}
}
pub fn get_payment_experience(
connector: Connector,
payment_method_type: PaymentMethodType,
payment_method: PaymentMethod,
payment_experience: Option<api_models::enums::PaymentExperience>,
) -> Option<api_models::enums::PaymentExperience> {
match payment_method {
PaymentMethod::BankRedirect => None,
_ => match (connector, payment_method_type) {
#[cfg(feature = "dummy_connector")]
(Connector::DummyConnector4, _) | (Connector::DummyConnector7, _) => {
Some(api_models::enums::PaymentExperience::RedirectToUrl)
}
(Connector::Paypal, Paypal) => payment_experience,
(Connector::Klarna, Klarna) => payment_experience,
(Connector::Zen, GooglePay) | (Connector::Zen, ApplePay) => {
Some(api_models::enums::PaymentExperience::RedirectToUrl)
}
(Connector::Braintree, Paypal) => {
Some(api_models::enums::PaymentExperience::InvokeSdkClient)
}
(Connector::Globepay, AliPay)
| (Connector::Globepay, WeChatPay)
| (Connector::Stripe, WeChatPay) => {
Some(api_models::enums::PaymentExperience::DisplayQrCode)
}
(_, GooglePay)
| (_, ApplePay)
| (_, PaymentMethodType::SamsungPay)
| (_, PaymentMethodType::Paze) => {
Some(api_models::enums::PaymentExperience::InvokeSdkClient)
}
(_, PaymentMethodType::DirectCarrierBilling) => {
Some(api_models::enums::PaymentExperience::CollectOtp)
}
(_, PaymentMethodType::Cashapp) | (_, PaymentMethodType::Swish) => {
Some(api_models::enums::PaymentExperience::DisplayQrCode)
}
_ => Some(api_models::enums::PaymentExperience::RedirectToUrl),
},
}
}
pub fn transform_payment_method(
connector: Connector,
provider: Vec<Provider>,
payment_method: PaymentMethod,
) -> Vec<payment_methods::RequestPaymentMethodTypes> {
let mut payment_method_types = Vec::new();
for method_type in provider {
let data = payment_methods::RequestPaymentMethodTypes {
payment_method_type: method_type.payment_method_type,
card_networks: None,
minimum_amount: Some(MinorUnit::zero()),
maximum_amount: Some(MinorUnit::new(68607706)),
recurring_enabled: true,
installment_payment_enabled: false,
accepted_currencies: method_type.accepted_currencies,
accepted_countries: method_type.accepted_countries,
payment_experience: Self::get_payment_experience(
connector,
method_type.payment_method_type,
payment_method,
method_type.payment_experience,
),
};
payment_method_types.push(data)
}
payment_method_types
}
pub fn create_connector_request(
request: Self,
api_response: ConnectorApiIntegrationPayload,
) -> ConnectorApiIntegrationPayload {
let mut card_payment_method_types = Vec::new();
let mut payment_method_enabled = Vec::new();
if let Some(payment_methods_enabled) = request.payment_methods_enabled.clone() {
for payload in payment_methods_enabled {
match payload.payment_method {
PaymentMethod::Card => {
if let Some(card_provider) = payload.card_provider {
let payment_type =
PaymentMethodType::from_str(&payload.payment_method_type)
.map_err(|_| "Invalid key received".to_string());
if let Ok(payment_type) = payment_type {
for method in card_provider {
let data = payment_methods::RequestPaymentMethodTypes {
payment_method_type: payment_type,
card_networks: Some(vec![method.payment_method_type]),
minimum_amount: Some(MinorUnit::zero()),
maximum_amount: Some(MinorUnit::new(68607706)),
recurring_enabled: true,
installment_payment_enabled: false,
accepted_currencies: method.accepted_currencies,
accepted_countries: method.accepted_countries,
payment_experience: None,
};
card_payment_method_types.push(data)
}
}
}
}
PaymentMethod::BankRedirect
| PaymentMethod::Wallet
| PaymentMethod::PayLater
| PaymentMethod::BankTransfer
| PaymentMethod::Crypto
| PaymentMethod::BankDebit
| PaymentMethod::Reward
| PaymentMethod::RealTimePayment
| PaymentMethod::Upi
| PaymentMethod::Voucher
| PaymentMethod::GiftCard
| PaymentMethod::OpenBanking
| PaymentMethod::CardRedirect
| PaymentMethod::MobilePayment => {
if let Some(provider) = payload.provider {
let val = Self::transform_payment_method(
request.connector,
provider,
payload.payment_method,
);
if !val.is_empty() {
let methods = PaymentMethodsEnabled {
payment_method: payload.payment_method,
payment_method_types: Some(val),
};
payment_method_enabled.push(methods);
}
}
}
};
}
if !card_payment_method_types.is_empty() {
let card = PaymentMethodsEnabled {
payment_method: PaymentMethod::Card,
payment_method_types: Some(card_payment_method_types),
};
payment_method_enabled.push(card);
}
}
ConnectorApiIntegrationPayload {
connector_type: api_response.connector_type,
profile_id: api_response.profile_id,
connector_name: api_response.connector_name,
connector_label: api_response.connector_label,
merchant_connector_id: api_response.merchant_connector_id,
disabled: api_response.disabled,
test_mode: api_response.test_mode,
payment_methods_enabled: Some(payment_method_enabled),
connector_webhook_details: api_response.connector_webhook_details,
metadata: request.metadata,
}
}
}
| 1,464 | 896 |
hyperswitch | crates/connector_configs/src/response_modifier.rs | .rs | use crate::common_config::{
CardProvider, ConnectorApiIntegrationPayload, DashboardPaymentMethodPayload,
DashboardRequestPayload, Provider,
};
impl ConnectorApiIntegrationPayload {
pub fn get_transformed_response_payload(response: Self) -> DashboardRequestPayload {
let mut wallet_details: Vec<Provider> = Vec::new();
let mut bank_redirect_details: Vec<Provider> = Vec::new();
let mut pay_later_details: Vec<Provider> = Vec::new();
let mut debit_details: Vec<CardProvider> = Vec::new();
let mut credit_details: Vec<CardProvider> = Vec::new();
let mut bank_transfer_details: Vec<Provider> = Vec::new();
let mut crypto_details: Vec<Provider> = Vec::new();
let mut bank_debit_details: Vec<Provider> = Vec::new();
let mut reward_details: Vec<Provider> = Vec::new();
let mut real_time_payment_details: Vec<Provider> = Vec::new();
let mut upi_details: Vec<Provider> = Vec::new();
let mut voucher_details: Vec<Provider> = Vec::new();
let mut gift_card_details: Vec<Provider> = Vec::new();
let mut card_redirect_details: Vec<Provider> = Vec::new();
let mut open_banking_details: Vec<Provider> = Vec::new();
let mut mobile_payment_details: Vec<Provider> = Vec::new();
if let Some(payment_methods_enabled) = response.payment_methods_enabled.clone() {
for methods in payment_methods_enabled {
match methods.payment_method {
api_models::enums::PaymentMethod::Card => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
match method_type.payment_method_type {
api_models::enums::PaymentMethodType::Credit => {
if let Some(card_networks) = method_type.card_networks {
for card in card_networks {
credit_details.push(CardProvider {
payment_method_type: card,
accepted_currencies: method_type
.accepted_currencies
.clone(),
accepted_countries: method_type
.accepted_countries
.clone(),
})
}
}
}
api_models::enums::PaymentMethodType::Debit => {
if let Some(card_networks) = method_type.card_networks {
for card in card_networks {
// debit_details.push(card)
debit_details.push(CardProvider {
payment_method_type: card,
accepted_currencies: method_type
.accepted_currencies
.clone(),
accepted_countries: method_type
.accepted_countries
.clone(),
})
}
}
}
_ => (),
}
}
}
}
api_models::enums::PaymentMethod::Wallet => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
// wallet_details.push(method_type.payment_method_type)
wallet_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::BankRedirect => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
bank_redirect_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::PayLater => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
pay_later_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::BankTransfer => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
bank_transfer_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::Crypto => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
crypto_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::BankDebit => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
bank_debit_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::Reward => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
reward_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::RealTimePayment => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
real_time_payment_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::OpenBanking => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
open_banking_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::Upi => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
upi_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::Voucher => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
voucher_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::GiftCard => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
gift_card_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::CardRedirect => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
card_redirect_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
api_models::enums::PaymentMethod::MobilePayment => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
mobile_payment_details.push(Provider {
payment_method_type: method_type.payment_method_type,
accepted_currencies: method_type.accepted_currencies.clone(),
accepted_countries: method_type.accepted_countries.clone(),
payment_experience: method_type.payment_experience,
})
}
}
}
}
}
}
let open_banking = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::OpenBanking,
payment_method_type: api_models::enums::PaymentMethod::OpenBanking.to_string(),
provider: Some(open_banking_details),
card_provider: None,
};
let upi = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::Upi,
payment_method_type: api_models::enums::PaymentMethod::Upi.to_string(),
provider: Some(upi_details),
card_provider: None,
};
let voucher: DashboardPaymentMethodPayload = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::Voucher,
payment_method_type: api_models::enums::PaymentMethod::Voucher.to_string(),
provider: Some(voucher_details),
card_provider: None,
};
let gift_card: DashboardPaymentMethodPayload = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::GiftCard,
payment_method_type: api_models::enums::PaymentMethod::GiftCard.to_string(),
provider: Some(gift_card_details),
card_provider: None,
};
let reward = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::Reward,
payment_method_type: api_models::enums::PaymentMethod::Reward.to_string(),
provider: Some(reward_details),
card_provider: None,
};
let real_time_payment = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::RealTimePayment,
payment_method_type: api_models::enums::PaymentMethod::RealTimePayment.to_string(),
provider: Some(real_time_payment_details),
card_provider: None,
};
let wallet = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::Wallet,
payment_method_type: api_models::enums::PaymentMethod::Wallet.to_string(),
provider: Some(wallet_details),
card_provider: None,
};
let bank_redirect = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::BankRedirect,
payment_method_type: api_models::enums::PaymentMethod::BankRedirect.to_string(),
provider: Some(bank_redirect_details),
card_provider: None,
};
let bank_debit = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::BankDebit,
payment_method_type: api_models::enums::PaymentMethod::BankDebit.to_string(),
provider: Some(bank_debit_details),
card_provider: None,
};
let bank_transfer = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::BankTransfer,
payment_method_type: api_models::enums::PaymentMethod::BankTransfer.to_string(),
provider: Some(bank_transfer_details),
card_provider: None,
};
let crypto = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::Crypto,
payment_method_type: api_models::enums::PaymentMethod::Crypto.to_string(),
provider: Some(crypto_details),
card_provider: None,
};
let card_redirect = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::CardRedirect,
payment_method_type: api_models::enums::PaymentMethod::CardRedirect.to_string(),
provider: Some(card_redirect_details),
card_provider: None,
};
let pay_later = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::PayLater,
payment_method_type: api_models::enums::PaymentMethod::PayLater.to_string(),
provider: Some(pay_later_details),
card_provider: None,
};
let debit_details = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::Card,
payment_method_type: api_models::enums::PaymentMethodType::Debit.to_string(),
provider: None,
card_provider: Some(debit_details),
};
let credit_details = DashboardPaymentMethodPayload {
payment_method: api_models::enums::PaymentMethod::Card,
payment_method_type: api_models::enums::PaymentMethodType::Credit.to_string(),
provider: None,
card_provider: Some(credit_details),
};
DashboardRequestPayload {
connector: response.connector_name,
payment_methods_enabled: Some(vec![
open_banking,
upi,
voucher,
reward,
real_time_payment,
wallet,
bank_redirect,
bank_debit,
bank_transfer,
crypto,
card_redirect,
pay_later,
debit_details,
credit_details,
gift_card,
]),
metadata: response.metadata,
}
}
}
| 2,938 | 897 |
hyperswitch | crates/connector_configs/src/lib.rs | .rs | pub mod common_config;
pub mod connector;
pub mod response_modifier;
pub mod transformer;
| 18 | 898 |
hyperswitch | crates/connector_configs/src/connector.rs | .rs | use std::collections::HashMap;
#[cfg(feature = "payouts")]
use api_models::enums::PayoutConnectors;
use api_models::{
enums::{AuthenticationConnectors, Connector, PmAuthConnectors, TaxConnectors},
payments,
};
use serde::Deserialize;
use toml;
use crate::common_config::{CardProvider, InputData, Provider, ZenApplePay};
#[derive(Default, Debug, Clone, serde::Serialize, serde::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)]
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 {
pub classic: Classic,
pub evoucher: Evoucher,
}
#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum ConnectorAuthType {
HeaderKey {
api_key: String,
},
BodyKey {
api_key: String,
key1: String,
},
SignatureKey {
api_key: String,
key1: String,
api_secret: String,
},
MultiAuthKey {
api_key: String,
key1: String,
api_secret: String,
key2: String,
},
CurrencyAuthKey {
auth_key_map: HashMap<String, CurrencyAuthKeyType>,
},
CertificateAuth {
certificate: String,
private_key: String,
},
#[default]
NoKey,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(untagged)]
pub enum ApplePayTomlConfig {
Standard(Box<payments::ApplePayMetadata>),
Zen(ZenApplePay),
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, serde::Serialize, Deserialize)]
pub enum KlarnaEndpoint {
Europe,
NorthAmerica,
Oceania,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
pub struct ConfigMerchantAdditionalDetails {
pub open_banking_recipient_data: Option<InputData>,
pub account_data: Option<InputData>,
pub iban: Option<Vec<InputData>>,
pub bacs: Option<Vec<InputData>>,
pub connector_recipient_id: Option<InputData>,
pub wallet_id: Option<InputData>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
pub struct ConfigMetadata {
pub merchant_config_currency: Option<InputData>,
pub merchant_account_id: Option<InputData>,
pub account_name: Option<InputData>,
pub terminal_id: Option<InputData>,
pub google_pay: Option<Vec<InputData>>,
pub apple_pay: Option<Vec<InputData>>,
pub merchant_id: Option<InputData>,
pub endpoint_prefix: Option<InputData>,
pub mcc: Option<InputData>,
pub merchant_country_code: Option<InputData>,
pub merchant_name: Option<InputData>,
pub acquirer_bin: Option<InputData>,
pub acquirer_merchant_id: Option<InputData>,
pub acquirer_country_code: Option<InputData>,
pub three_ds_requestor_name: Option<InputData>,
pub three_ds_requestor_id: Option<InputData>,
pub pull_mechanism_for_external_3ds_enabled: Option<InputData>,
pub klarna_region: Option<InputData>,
pub source_balance_account: Option<InputData>,
pub brand_id: Option<InputData>,
pub destination_account_number: Option<InputData>,
pub dpa_id: Option<InputData>,
pub dpa_name: Option<InputData>,
pub locale: Option<InputData>,
pub card_brands: Option<InputData>,
pub merchant_category_code: Option<InputData>,
pub merchant_configuration_id: Option<InputData>,
pub currency_id: Option<InputData>,
pub platform_id: Option<InputData>,
pub ledger_account_id: Option<InputData>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::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)]
pub struct ConnectorTomlConfig {
pub connector_auth: Option<ConnectorAuthType>,
pub connector_webhook_details: Option<api_models::admin::MerchantConnectorWebhookDetails>,
pub metadata: Option<Box<ConfigMetadata>>,
pub connector_wallets_details: Option<Box<ConnectorWalletDetailsConfig>>,
pub additional_merchant_data: Option<Box<ConfigMerchantAdditionalDetails>>,
pub credit: Option<Vec<CardProvider>>,
pub debit: Option<Vec<CardProvider>>,
pub bank_transfer: Option<Vec<Provider>>,
pub bank_redirect: Option<Vec<Provider>>,
pub bank_debit: Option<Vec<Provider>>,
pub open_banking: Option<Vec<Provider>>,
pub pay_later: Option<Vec<Provider>>,
pub wallet: Option<Vec<Provider>>,
pub crypto: Option<Vec<Provider>>,
pub reward: Option<Vec<Provider>>,
pub upi: Option<Vec<Provider>>,
pub voucher: Option<Vec<Provider>>,
pub gift_card: Option<Vec<Provider>>,
pub card_redirect: Option<Vec<Provider>>,
pub is_verifiable: Option<bool>,
pub real_time_payment: Option<Vec<Provider>>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
pub struct ConnectorConfig {
pub juspaythreedsserver: Option<ConnectorTomlConfig>,
pub aci: Option<ConnectorTomlConfig>,
pub adyen: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub adyen_payout: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub adyenplatform_payout: Option<ConnectorTomlConfig>,
pub airwallex: Option<ConnectorTomlConfig>,
pub authorizedotnet: Option<ConnectorTomlConfig>,
pub bamboraapac: Option<ConnectorTomlConfig>,
pub bankofamerica: Option<ConnectorTomlConfig>,
pub billwerk: Option<ConnectorTomlConfig>,
pub bitpay: Option<ConnectorTomlConfig>,
pub bluesnap: Option<ConnectorTomlConfig>,
pub boku: Option<ConnectorTomlConfig>,
pub braintree: Option<ConnectorTomlConfig>,
pub cashtocode: Option<ConnectorTomlConfig>,
pub chargebee: Option<ConnectorTomlConfig>,
pub checkout: Option<ConnectorTomlConfig>,
pub coinbase: Option<ConnectorTomlConfig>,
pub coingate: Option<ConnectorTomlConfig>,
pub cryptopay: Option<ConnectorTomlConfig>,
pub ctp_visa: Option<ConnectorTomlConfig>,
pub cybersource: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub cybersource_payout: Option<ConnectorTomlConfig>,
pub iatapay: Option<ConnectorTomlConfig>,
pub itaubank: Option<ConnectorTomlConfig>,
pub opennode: Option<ConnectorTomlConfig>,
pub bambora: Option<ConnectorTomlConfig>,
pub datatrans: Option<ConnectorTomlConfig>,
pub deutschebank: Option<ConnectorTomlConfig>,
pub digitalvirgo: Option<ConnectorTomlConfig>,
pub dlocal: Option<ConnectorTomlConfig>,
pub ebanx_payout: Option<ConnectorTomlConfig>,
pub elavon: Option<ConnectorTomlConfig>,
// pub facilitapay: Option<ConnectorTomlConfig>,
pub fiserv: Option<ConnectorTomlConfig>,
pub fiservemea: Option<ConnectorTomlConfig>,
pub fiuu: Option<ConnectorTomlConfig>,
pub forte: Option<ConnectorTomlConfig>,
pub getnet: Option<ConnectorTomlConfig>,
pub globalpay: Option<ConnectorTomlConfig>,
pub globepay: Option<ConnectorTomlConfig>,
pub gocardless: Option<ConnectorTomlConfig>,
pub gpayments: Option<ConnectorTomlConfig>,
pub hipay: Option<ConnectorTomlConfig>,
pub helcim: Option<ConnectorTomlConfig>,
pub inespay: Option<ConnectorTomlConfig>,
pub jpmorgan: Option<ConnectorTomlConfig>,
pub klarna: Option<ConnectorTomlConfig>,
pub mifinity: Option<ConnectorTomlConfig>,
pub mollie: Option<ConnectorTomlConfig>,
pub moneris: Option<ConnectorTomlConfig>,
pub multisafepay: Option<ConnectorTomlConfig>,
pub nexinets: Option<ConnectorTomlConfig>,
pub nexixpay: Option<ConnectorTomlConfig>,
pub nmi: Option<ConnectorTomlConfig>,
pub nomupay_payout: Option<ConnectorTomlConfig>,
pub noon: Option<ConnectorTomlConfig>,
pub novalnet: Option<ConnectorTomlConfig>,
pub nuvei: Option<ConnectorTomlConfig>,
pub paybox: Option<ConnectorTomlConfig>,
pub payme: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub payone_payout: Option<ConnectorTomlConfig>,
pub paypal: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub paypal_payout: Option<ConnectorTomlConfig>,
pub paystack: Option<ConnectorTomlConfig>,
pub payu: Option<ConnectorTomlConfig>,
pub placetopay: Option<ConnectorTomlConfig>,
pub plaid: Option<ConnectorTomlConfig>,
pub powertranz: Option<ConnectorTomlConfig>,
pub prophetpay: Option<ConnectorTomlConfig>,
pub razorpay: Option<ConnectorTomlConfig>,
pub recurly: Option<ConnectorTomlConfig>,
pub riskified: Option<ConnectorTomlConfig>,
pub rapyd: Option<ConnectorTomlConfig>,
pub redsys: Option<ConnectorTomlConfig>,
pub shift4: Option<ConnectorTomlConfig>,
pub stripe: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub stripe_payout: Option<ConnectorTomlConfig>,
pub stripebilling: Option<ConnectorTomlConfig>,
pub signifyd: Option<ConnectorTomlConfig>,
pub trustpay: Option<ConnectorTomlConfig>,
pub threedsecureio: Option<ConnectorTomlConfig>,
pub netcetera: Option<ConnectorTomlConfig>,
pub tsys: Option<ConnectorTomlConfig>,
pub volt: Option<ConnectorTomlConfig>,
pub wellsfargo: Option<ConnectorTomlConfig>,
#[cfg(feature = "payouts")]
pub wise_payout: Option<ConnectorTomlConfig>,
pub worldline: Option<ConnectorTomlConfig>,
pub worldpay: Option<ConnectorTomlConfig>,
pub xendit: Option<ConnectorTomlConfig>,
pub square: Option<ConnectorTomlConfig>,
pub stax: Option<ConnectorTomlConfig>,
pub dummy_connector: Option<ConnectorTomlConfig>,
pub stripe_test: Option<ConnectorTomlConfig>,
pub paypal_test: Option<ConnectorTomlConfig>,
pub zen: Option<ConnectorTomlConfig>,
pub zsl: Option<ConnectorTomlConfig>,
pub taxjar: Option<ConnectorTomlConfig>,
pub ctp_mastercard: Option<ConnectorTomlConfig>,
pub unified_authentication_service: Option<ConnectorTomlConfig>,
}
impl ConnectorConfig {
fn new() -> Result<Self, String> {
let config_str = if cfg!(feature = "production") {
include_str!("../toml/production.toml")
} else if cfg!(feature = "sandbox") {
include_str!("../toml/sandbox.toml")
} else {
include_str!("../toml/development.toml")
};
let config = toml::from_str::<Self>(config_str);
match config {
Ok(data) => Ok(data),
Err(err) => Err(err.to_string()),
}
}
#[cfg(feature = "payouts")]
pub fn get_payout_connector_config(
connector: PayoutConnectors,
) -> Result<Option<ConnectorTomlConfig>, String> {
let connector_data = Self::new()?;
match connector {
PayoutConnectors::Adyen => Ok(connector_data.adyen_payout),
PayoutConnectors::Adyenplatform => Ok(connector_data.adyenplatform_payout),
PayoutConnectors::Cybersource => Ok(connector_data.cybersource_payout),
PayoutConnectors::Ebanx => Ok(connector_data.ebanx_payout),
PayoutConnectors::Nomupay => Ok(connector_data.nomupay_payout),
PayoutConnectors::Payone => Ok(connector_data.payone_payout),
PayoutConnectors::Paypal => Ok(connector_data.paypal_payout),
PayoutConnectors::Stripe => Ok(connector_data.stripe_payout),
PayoutConnectors::Wise => Ok(connector_data.wise_payout),
}
}
pub fn get_authentication_connector_config(
connector: AuthenticationConnectors,
) -> Result<Option<ConnectorTomlConfig>, String> {
let connector_data = Self::new()?;
match connector {
AuthenticationConnectors::Threedsecureio => Ok(connector_data.threedsecureio),
AuthenticationConnectors::Netcetera => Ok(connector_data.netcetera),
AuthenticationConnectors::Gpayments => Ok(connector_data.gpayments),
AuthenticationConnectors::CtpMastercard => Ok(connector_data.ctp_mastercard),
AuthenticationConnectors::CtpVisa => Ok(connector_data.ctp_visa),
AuthenticationConnectors::UnifiedAuthenticationService => {
Ok(connector_data.unified_authentication_service)
}
AuthenticationConnectors::Juspaythreedsserver => Ok(connector_data.juspaythreedsserver),
}
}
pub fn get_tax_processor_config(
connector: TaxConnectors,
) -> Result<Option<ConnectorTomlConfig>, String> {
let connector_data = Self::new()?;
match connector {
TaxConnectors::Taxjar => Ok(connector_data.taxjar),
}
}
pub fn get_pm_authentication_processor_config(
connector: PmAuthConnectors,
) -> Result<Option<ConnectorTomlConfig>, String> {
let connector_data = Self::new()?;
match connector {
PmAuthConnectors::Plaid => Ok(connector_data.plaid),
}
}
pub fn get_connector_config(
connector: Connector,
) -> Result<Option<ConnectorTomlConfig>, String> {
let connector_data = Self::new()?;
match connector {
Connector::Aci => Ok(connector_data.aci),
Connector::Adyen => Ok(connector_data.adyen),
Connector::Adyenplatform => Err("Use get_payout_connector_config".to_string()),
Connector::Airwallex => Ok(connector_data.airwallex),
Connector::Authorizedotnet => Ok(connector_data.authorizedotnet),
Connector::Bamboraapac => Ok(connector_data.bamboraapac),
Connector::Bankofamerica => Ok(connector_data.bankofamerica),
Connector::Billwerk => Ok(connector_data.billwerk),
Connector::Bitpay => Ok(connector_data.bitpay),
Connector::Bluesnap => Ok(connector_data.bluesnap),
Connector::Boku => Ok(connector_data.boku),
Connector::Braintree => Ok(connector_data.braintree),
Connector::Cashtocode => Ok(connector_data.cashtocode),
Connector::Chargebee => Ok(connector_data.chargebee),
Connector::Checkout => Ok(connector_data.checkout),
Connector::Coinbase => Ok(connector_data.coinbase),
Connector::Coingate => Ok(connector_data.coingate),
Connector::Cryptopay => Ok(connector_data.cryptopay),
Connector::CtpVisa => Ok(connector_data.ctp_visa),
Connector::Cybersource => Ok(connector_data.cybersource),
Connector::Iatapay => Ok(connector_data.iatapay),
Connector::Itaubank => Ok(connector_data.itaubank),
Connector::Opennode => Ok(connector_data.opennode),
Connector::Bambora => Ok(connector_data.bambora),
Connector::Datatrans => Ok(connector_data.datatrans),
Connector::Deutschebank => Ok(connector_data.deutschebank),
Connector::Digitalvirgo => Ok(connector_data.digitalvirgo),
Connector::Dlocal => Ok(connector_data.dlocal),
Connector::Ebanx => Ok(connector_data.ebanx_payout),
Connector::Elavon => Ok(connector_data.elavon),
// Connector::Facilitapay => Ok(connector_data.facilitapay),
Connector::Fiserv => Ok(connector_data.fiserv),
Connector::Fiservemea => Ok(connector_data.fiservemea),
Connector::Fiuu => Ok(connector_data.fiuu),
Connector::Forte => Ok(connector_data.forte),
Connector::Getnet => Ok(connector_data.getnet),
Connector::Globalpay => Ok(connector_data.globalpay),
Connector::Globepay => Ok(connector_data.globepay),
Connector::Gocardless => Ok(connector_data.gocardless),
Connector::Gpayments => Ok(connector_data.gpayments),
Connector::Hipay => Ok(connector_data.hipay),
Connector::Helcim => Ok(connector_data.helcim),
Connector::Inespay => Ok(connector_data.inespay),
Connector::Jpmorgan => Ok(connector_data.jpmorgan),
Connector::Juspaythreedsserver => Ok(connector_data.juspaythreedsserver),
Connector::Klarna => Ok(connector_data.klarna),
Connector::Mifinity => Ok(connector_data.mifinity),
Connector::Mollie => Ok(connector_data.mollie),
Connector::Moneris => Ok(connector_data.moneris),
Connector::Multisafepay => Ok(connector_data.multisafepay),
Connector::Nexinets => Ok(connector_data.nexinets),
Connector::Nexixpay => Ok(connector_data.nexixpay),
Connector::Prophetpay => Ok(connector_data.prophetpay),
Connector::Nmi => Ok(connector_data.nmi),
Connector::Nomupay => Err("Use get_payout_connector_config".to_string()),
Connector::Novalnet => Ok(connector_data.novalnet),
Connector::Noon => Ok(connector_data.noon),
Connector::Nuvei => Ok(connector_data.nuvei),
Connector::Paybox => Ok(connector_data.paybox),
Connector::Payme => Ok(connector_data.payme),
Connector::Payone => Err("Use get_payout_connector_config".to_string()),
Connector::Paypal => Ok(connector_data.paypal),
Connector::Paystack => Ok(connector_data.paystack),
Connector::Payu => Ok(connector_data.payu),
Connector::Placetopay => Ok(connector_data.placetopay),
Connector::Plaid => Ok(connector_data.plaid),
Connector::Powertranz => Ok(connector_data.powertranz),
Connector::Razorpay => Ok(connector_data.razorpay),
Connector::Rapyd => Ok(connector_data.rapyd),
Connector::Recurly => Ok(connector_data.recurly),
Connector::Redsys => Ok(connector_data.redsys),
Connector::Riskified => Ok(connector_data.riskified),
Connector::Shift4 => Ok(connector_data.shift4),
Connector::Signifyd => Ok(connector_data.signifyd),
Connector::Square => Ok(connector_data.square),
Connector::Stax => Ok(connector_data.stax),
Connector::Stripe => Ok(connector_data.stripe),
Connector::Stripebilling => Ok(connector_data.stripebilling),
Connector::Trustpay => Ok(connector_data.trustpay),
Connector::Threedsecureio => Ok(connector_data.threedsecureio),
Connector::Taxjar => Ok(connector_data.taxjar),
Connector::Tsys => Ok(connector_data.tsys),
Connector::Volt => Ok(connector_data.volt),
Connector::Wellsfargo => Ok(connector_data.wellsfargo),
Connector::Wise => Err("Use get_payout_connector_config".to_string()),
Connector::Worldline => Ok(connector_data.worldline),
Connector::Worldpay => Ok(connector_data.worldpay),
Connector::Zen => Ok(connector_data.zen),
Connector::Zsl => Ok(connector_data.zsl),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector1 => Ok(connector_data.dummy_connector),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector2 => Ok(connector_data.dummy_connector),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector3 => Ok(connector_data.dummy_connector),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector4 => Ok(connector_data.stripe_test),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector5 => Ok(connector_data.dummy_connector),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector6 => Ok(connector_data.dummy_connector),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector7 => Ok(connector_data.paypal_test),
Connector::Netcetera => Ok(connector_data.netcetera),
Connector::CtpMastercard => Ok(connector_data.ctp_mastercard),
Connector::Xendit => Ok(connector_data.xendit),
}
}
}
| 4,799 | 899 |
hyperswitch | crates/connector_configs/src/common_config.rs | .rs | use api_models::{payment_methods, payments};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(rename_all = "snake_case")]
pub struct ZenApplePay {
pub terminal_uuid: Option<String>,
pub pay_wall_secret: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(untagged)]
pub enum ApplePayData {
ApplePay(payments::ApplePayMetadata),
ApplePayCombined(payments::ApplePayCombinedMetadata),
Zen(ZenApplePay),
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct GpayDashboardPayLoad {
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway_merchant_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", rename = "stripe:version")]
pub stripe_version: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename(
serialize = "stripe_publishable_key",
deserialize = "stripe:publishable_key"
))]
#[serde(alias = "stripe:publishable_key")]
#[serde(alias = "stripe_publishable_key")]
pub stripe_publishable_key: Option<String>,
pub merchant_name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub merchant_id: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(rename_all = "snake_case")]
pub struct ZenGooglePay {
pub terminal_uuid: Option<String>,
pub pay_wall_secret: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(untagged)]
pub enum GooglePayData {
Standard(GpayDashboardPayLoad),
Zen(ZenGooglePay),
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct PaypalSdkData {
pub client_id: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(untagged)]
pub enum GoogleApiModelData {
Standard(payments::GpayMetaData),
Zen(ZenGooglePay),
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct PaymentMethodsEnabled {
pub payment_method: api_models::enums::PaymentMethod,
pub payment_method_types: Option<Vec<payment_methods::RequestPaymentMethodTypes>>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct ApiModelMetaData {
pub merchant_config_currency: Option<api_models::enums::Currency>,
pub merchant_account_id: Option<String>,
pub account_name: Option<String>,
pub terminal_id: Option<String>,
pub merchant_id: Option<String>,
pub google_pay: Option<GoogleApiModelData>,
pub paypal_sdk: Option<PaypalSdkData>,
pub apple_pay: Option<ApplePayData>,
pub apple_pay_combined: Option<ApplePayData>,
pub endpoint_prefix: Option<String>,
pub mcc: Option<String>,
pub merchant_country_code: Option<String>,
pub merchant_name: Option<String>,
pub acquirer_bin: Option<String>,
pub acquirer_merchant_id: Option<String>,
pub acquirer_country_code: Option<String>,
pub three_ds_requestor_name: Option<String>,
pub three_ds_requestor_id: Option<String>,
pub pull_mechanism_for_external_3ds_enabled: Option<bool>,
pub klarna_region: Option<KlarnaEndpoint>,
pub source_balance_account: Option<String>,
pub brand_id: Option<String>,
pub destination_account_number: Option<String>,
pub dpa_id: Option<String>,
pub dpa_name: Option<String>,
pub locale: Option<String>,
pub card_brands: Option<Vec<String>>,
pub merchant_category_code: Option<String>,
pub merchant_configuration_id: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub enum KlarnaEndpoint {
Europe,
NorthAmerica,
Oceania,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, ToSchema, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct CardProvider {
pub payment_method_type: api_models::enums::CardNetwork,
/// List of currencies accepted or has the processing capabilities of the processor
#[schema(example = json!(
{
"type": "specific_accepted",
"list": ["USD", "INR"]
}
), value_type = Option<AcceptedCurrencies>)]
pub accepted_currencies: Option<api_models::admin::AcceptedCurrencies>,
#[schema(example = json!(
{
"type": "specific_accepted",
"list": ["UK", "AU"]
}
), value_type = Option<AcceptedCountries>)]
pub accepted_countries: Option<api_models::admin::AcceptedCountries>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, ToSchema, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct Provider {
pub payment_method_type: api_models::enums::PaymentMethodType,
/// List of currencies accepted or has the processing capabilities of the processor
#[schema(example = json!(
{
"type": "specific_accepted",
"list": ["USD", "INR"]
}
), value_type = Option<AcceptedCurrencies>)]
pub accepted_currencies: Option<api_models::admin::AcceptedCurrencies>,
#[schema(example = json!(
{
"type": "specific_accepted",
"list": ["UK", "AU"]
}
), value_type = Option<AcceptedCountries>)]
pub accepted_countries: Option<api_models::admin::AcceptedCountries>,
pub payment_experience: Option<api_models::enums::PaymentExperience>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct ConnectorApiIntegrationPayload {
pub connector_type: String,
pub profile_id: common_utils::id_type::ProfileId,
pub connector_name: api_models::enums::Connector,
#[serde(skip_deserializing)]
#[schema(example = "stripe_US_travel")]
pub connector_label: Option<String>,
pub merchant_connector_id: Option<String>,
pub disabled: bool,
pub test_mode: bool,
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
pub metadata: Option<ApiModelMetaData>,
pub connector_webhook_details: Option<api_models::admin::MerchantConnectorWebhookDetails>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct DashboardPaymentMethodPayload {
pub payment_method: api_models::enums::PaymentMethod,
pub payment_method_type: String,
pub provider: Option<Vec<Provider>>,
pub card_provider: Option<Vec<CardProvider>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde_with::skip_serializing_none]
#[serde(rename_all = "snake_case")]
pub struct DashboardRequestPayload {
pub connector: api_models::enums::Connector,
pub payment_methods_enabled: Option<Vec<DashboardPaymentMethodPayload>>,
pub metadata: Option<ApiModelMetaData>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(tag = "type", content = "options")]
pub enum InputType {
Text,
Number,
Toggle,
Radio(Vec<String>),
Select(Vec<String>),
MultiSelect(Vec<String>),
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
#[serde(rename_all = "snake_case")]
pub struct InputData {
pub name: String,
pub label: String,
pub placeholder: String,
pub required: bool,
#[serde(flatten)]
pub input_type: InputType,
}
| 1,772 | 900 |
hyperswitch | crates/test_utils/Cargo.toml | .toml | [package]
name = "test_utils"
description = "Postman collection runner and utility"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true
readme = "README.md"
license.workspace = true
[features]
default = ["dummy_connector", "payouts"]
dummy_connector = []
payouts = []
[dependencies]
anyhow = "1.0.81"
async-trait = "0.1.79"
base64 = "0.22.0"
clap = { version = "4.4.18", default-features = false, features = ["std", "derive", "help", "usage"] }
rand = "0.8.5"
regex = "1.10.4"
reqwest = { version = "0.11.27", features = ["native-tls"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.115"
serde_urlencoded = "0.7.1"
serial_test = "3.0.0"
thirtyfour = "0.31.0"
time = { version = "0.3.35", features = ["macros"] }
tokio = "1.37.0"
toml = "0.8.12"
# First party crates
masking = { version = "0.1.0", path = "../masking" }
[lints]
workspace = true
| 328 | 901 |
hyperswitch | crates/test_utils/README.md | .md | # Test Utils
The heart of `newman`(with directory support) and `UI-tests`
> [!NOTE]
> If you're developing a collection and you want to learn more about it, click [_**here**_](/postman/README.md)
## Newman
- Make sure you that you _**do not**_ have the newman (from the Postman team) installed but rather the `newman` fork with directory support
- The `newman` fork can be installed by running `npm install -g 'https://github.com/knutties/newman.git#feature/newman-dir'`
- To see the features that the fork of `newman` supports, click [_**here**_](https://github.com/knutties/newman/blob/feature/newman-dir/DIR_COMMANDS.md)
## Test Utils Usage
- Add the connector credentials to the `connector_auth.toml` / `auth.toml` by creating a copy of the `sample_auth.toml` from `router/tests/connectors/sample_auth.toml`
- Export the auth file path as an environment variable:
```shell
export CONNECTOR_AUTH_FILE_PATH=/path/to/auth.toml
```
> [!IMPORTANT]
> You might also need to export the `GATEWAY_MERCHANT_ID`, `GPAY_CERTIFICATE` and `GPAY_CERTIFICATE_KEYS` as environment variables for certain collections with necessary values. Make sure you do that before running the tests
### Supported Commands
Required fields:
- `--admin-api-key` -- Admin API Key of the environment. `test_admin` is the Admin API Key for running locally
- `--base-url` -- Base URL of the environment. `http://127.0.0.1:8080` / `http://localhost:8080` is the Base URL for running locally
- `--connector-name` -- Name of the connector that you wish to run. Example: `adyen`, `shift4`, `stripe`
Optional fields:
- `--delay` -- To add a delay between requests in milliseconds.
- Maximum delay is 4294967295 milliseconds or 4294967.295 seconds or 71616 minutes or 1193.6 hours or 49.733 days
- Example: `--delay 1000` (for 1 second delay)
- `--folder` -- To run individual folders in the collection
- Use double quotes to specify folder name. If you wish to run multiple folders, separate them with a comma (`,`)
- Example: `--folder "QuickStart"` or `--folder "Health check,QuickStart"`
- `--header` -- If you wish to add custom headers to the requests, you can pass them as a string
- Example: `--header "key:value"`
- If you want to pass multiple custom headers, you can pass multiple `--header` flags
- Example: `--header "key1:value1" --header "key2:value2"`
- `--verbose` -- A boolean to print detailed logs (requests and responses)
> [!Note]
> Passing `--verbose` will also print the connector as well as admin API keys in the logs. So, make sure you don't push the commands with `--verbose` to any public repository.
### Running tests
- Tests can be run with the following command:
```shell
cargo run --package test_utils --bin test_utils -- --connector-name=<connector_name> --base-url=<base_url> --admin-api-key=<admin_api_key> \
# optionally
--folder "<folder_name_1>,<folder_name_2>,...<folder_name_n>" --verbose
```
> [!Note]
> You can omit `--package test_utils` at the time of running the above command since it is optional.
## UI tests
To run the UI tests, run the following command:
```shell
cargo test --package test_utils --test connectors -- <connector_ui_name>::<optionally_name_of_specific_function_run> --test-threads=1
```
### Example
Below is an example to run UI test to only run the `GooglePay` payment test for `adyen` connector:
```shell
cargo test --package test_utils --test connectors -- adyen_uk_ui::should_make_gpay_payment_test --test-threads=1
```
Below is an example to run all the UI tests for `adyen` connector:
```shell
cargo test --package test_utils --test connectors -- adyen_uk_ui:: --test-threads=1
```
| 993 | 902 |
hyperswitch | crates/test_utils/tests/sample_auth.toml | .toml | # Copy this file and rename it as `auth.toml`
# Each of the connector's section is optional
[aci]
api_key = "Bearer MyApiKey"
key1 = "MyEntityId"
[adyen]
api_key = "Bearer MyApiKey"
key1 = "MerchantId"
api_secret = "Secondary key"
[authorizedotnet]
api_key = "MyMerchantName"
key1 = "MyTransactionKey"
[checkout]
api_key = "PublicKey"
api_secret = "SecretKey"
key1 = "MyProcessingChannelId"
[cybersource]
api_key = "Bearer MyApiKey"
key1 = "Merchant id"
api_secret = "Secret key"
[shift4]
api_key = "Bearer MyApiKey"
[worldpay]
api_key = "api_key"
key1 = "key1"
api_secret = "Merchant Identifier"
[payu]
api_key = "Bearer MyApiKey"
key1 = "MerchantPosId"
[globalpay]
api_key = "api_key"
key1 = "key1"
[rapyd]
api_key = "access_key"
key1 = "secret_key"
[fiserv]
api_key = "MyApiKey"
key1 = "MerchantID"
api_secret = "MySecretKey"
[worldline]
key1 = "Merchant Id"
api_key = "API Key"
api_secret = "API Secret Key"
[multisafepay]
api_key = "API Key"
[dlocal]
key1 = "key1"
api_key = "api_key"
api_secret = "secret"
[bambora]
api_key = "api_key"
key1 = "key1"
[nmi]
api_key = "NMI API Key"
[nuvei]
api_key = "api_key"
key1 = "key1"
api_secret = "secret"
[paypal]
api_key = "api_key"
key1 = "key1"
[mollie]
api_key = "API Key"
[forte]
api_key = "api_key"
key1 = "key1"
key2 = "key2"
api_secret = "api_secret"
[coinbase]
api_key = "API Key"
[opennode]
api_key = "API Key"
[nexinets]
api_key = "api_key"
key1 = "key1"
[payeezy]
api_key = "api_key"
key1 = "key1"
api_secret = "secret"
[bitpay]
api_key = "API Key"
[iatapay]
key1 = "key1"
api_key = "api_key"
api_secret = "secret"
[dummyconnector]
api_key = "API Key"
[noon]
api_key = "Application API KEY"
api_secret = "Application Identifier"
key1 = "Business Identifier"
[opayo]
api_key="API Key"
[wise]
api_key = "API Key"
key1 = "Profile ID"
[automation_configs]
hs_base_url="http://localhost:8080"
hs_test_browser="firefox"
chrome_profile_path=""
firefox_profile_path=""
pypl_email=""
pypl_pass=""
gmail_email=""
gmail_pass=""
[payme]
# Open api key
api_key="seller payme id"
key1="payme client key"
[cryptopay]
api_key = "api_key"
key1 = "key1"
[cashtocode]
api_key="Classic PMT API Key"
key1 = "Evoucher PMT API Key"
[tsys]
api_key="device id"
key1 = "transaction key"
api_secret = "developer id"
[globepay]
api_key = "Partner code"
key1 = "Credential code"
[powertranz]
api_key="PowerTranz-PowerTranzPassword"
key1 = "PowerTranz-PowerTranzId"
[stax]
api_key="API Key"
[boku]
api_key="API Key"
key1 = "transaction key" | 816 | 903 |
hyperswitch | crates/test_utils/tests/connectors/zen_ui.rs | .rs | use serial_test::serial;
use thirtyfour::{prelude::*, WebDriver};
use crate::{selenium::*, tester};
struct ZenSeleniumTest;
impl SeleniumTest for ZenSeleniumTest {
fn get_connector_name(&self) -> String {
"zen".to_string()
}
}
async fn should_make_zen_3ds_payment(web_driver: WebDriver) -> Result<(), WebDriverError> {
let mycon = ZenSeleniumTest {};
mycon
.make_redirection_payment(
web_driver,
vec![
Event::Trigger(Trigger::Goto(&format!("{CHECKOUT_BASE_URL}/saved/201"))),
Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
Event::Trigger(Trigger::Sleep(10)), //url gets updated only after some time, so need this timeout to solve the issue
Event::Trigger(Trigger::SwitchFrame(By::Name("cko-3ds2-iframe"))),
Event::Trigger(Trigger::SendKeys(By::Id("password"), "Checkout1!")),
Event::Trigger(Trigger::Click(By::Id("txtButton"))),
Event::Trigger(Trigger::Sleep(3)),
Event::Assert(Assert::IsPresent("succeeded")),
],
)
.await?;
Ok(())
}
#[test]
#[serial]
fn should_make_zen_3ds_payment_test() {
tester!(should_make_zen_3ds_payment);
}
| 308 | 904 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.