id
stringlengths 20
153
| type
stringclasses 1
value | granularity
stringclasses 14
values | content
stringlengths 16
84.3k
| metadata
dict |
|---|---|---|---|---|
connector-service_snippet_-6262692988738800615_2375_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
}
payment_method_data::BankTransferData::BniVaBankTransfer { .. } => {
Self::BniVaBankTransfer
}
payment_method_data::BankTransferData::BriVaBankTransfer { .. } => {
Self::BriVaBankTransfer
}
payment_method_data::BankTransferData::CimbVaBankTransfer { .. } => {
Self::CimbVaBankTransfer
}
payment_method_data::BankTransferData::DanamonVaBankTransfer { .. } => {
Self::DanamonVaBankTransfer
}
payment_method_data::BankTransferData::MandiriVaBankTransfer { .. } => {
Self::MandiriVaBankTransfer
}
payment_method_data::BankTransferData::Pix { .. } => Self::Pix,
payment_method_data::BankTransferData::Pse {} => Self::Pse,
payment_method_data::BankTransferData::LocalBankTransfer { .. } => {
Self::LocalBankTransfer
}
payment_method_data::BankTransferData::InstantBankTransfer { .. } => {
Self::InstantBankTransfer
}
payment_method_data::BankTransferData::InstantBankTransferFinland { .. } => {
Self::InstantBankTransferFinland
}
payment_method_data::BankTransferData::InstantBankTransferPoland { .. } => {
Self::InstantBankTransferPoland
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2375,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2375_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
}
payment_method_data::BankTransferData::BniVaBankTransfer { .. } => {
Self::BniVaBankTransfer
}
payment_method_data::BankTransferData::BriVaBankTransfer { .. } => {
Self::BriVaBankTransfer
}
payment_method_data::BankTransferData::CimbVaBankTransfer { .. } => {
Self::CimbVaBankTransfer
}
payment_method_data::BankTransferData::DanamonVaBankTransfer { .. } => {
Self::DanamonVaBankTransfer
}
payment_method_data::BankTransferData::MandiriVaBankTransfer { .. } => {
Self::MandiriVaBankTransfer
}
payment_method_data::BankTransferData::Pix { .. } => Self::Pix,
payment_method_data::BankTransferData::Pse {} => Self::Pse,
payment_method_data::BankTransferData::LocalBankTransfer { .. } => {
Self::LocalBankTransfer
}
payment_method_data::BankTransferData::InstantBankTransfer { .. } => {
Self::InstantBankTransfer
}
payment_method_data::BankTransferData::InstantBankTransferFinland { .. } => {
Self::InstantBankTransferFinland
}
payment_method_data::BankTransferData::InstantBankTransferPoland { .. } => {
Self::InstantBankTransferPoland
}
},
PaymentMethodData::Crypto(_) => Self::Crypto,
PaymentMethodData::MandatePayment => Self::MandatePayment,
PaymentMethodData::Reward => Self::Reward,
PaymentMethodData::Upi(_) => Self::Upi,
PaymentMethodData::Voucher(voucher_data) => match voucher_data {
payment_method_data::VoucherData::Boleto(_) => Self::Boleto,
payment_method_data::VoucherData::Efecty => Self::Efecty,
payment_method_data::VoucherData::PagoEfectivo => Self::PagoEfectivo,
payment_method_data::VoucherData::RedCompra => Self::RedCompra,
payment_method_data::VoucherData::RedPagos => Self::RedPagos,
payment_method_data::VoucherData::Alfamart(_) => Self::Alfamart,
payment_method_data::VoucherData::Indomaret(_) => Self::Indomaret,
payment_method_data::VoucherData::Oxxo => Self::Oxxo,
payment_method_data::VoucherData::SevenEleven(_) => Self::SevenEleven,
payment_method_data::VoucherData::Lawson(_) => Self::Lawson,
payment_method_data::VoucherData::MiniStop(_) => Self::MiniStop,
payment_method_data::VoucherData::FamilyMart(_) => Self::FamilyMart,
payment_method_data::VoucherData::Seicomart(_) => Self::Seicomart,
payment_method_data::VoucherData::PayEasy(_) => Self::PayEasy,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2375,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2400_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
Self::InstantBankTransferFinland
}
payment_method_data::BankTransferData::InstantBankTransferPoland { .. } => {
Self::InstantBankTransferPoland
}
},
PaymentMethodData::Crypto(_) => Self::Crypto,
PaymentMethodData::MandatePayment => Self::MandatePayment,
PaymentMethodData::Reward => Self::Reward,
PaymentMethodData::Upi(_) => Self::Upi,
PaymentMethodData::Voucher(voucher_data) => match voucher_data {
payment_method_data::VoucherData::Boleto(_) => Self::Boleto,
payment_method_data::VoucherData::Efecty => Self::Efecty,
payment_method_data::VoucherData::PagoEfectivo => Self::PagoEfectivo,
payment_method_data::VoucherData::RedCompra => Self::RedCompra,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2400,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2400_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
Self::InstantBankTransferFinland
}
payment_method_data::BankTransferData::InstantBankTransferPoland { .. } => {
Self::InstantBankTransferPoland
}
},
PaymentMethodData::Crypto(_) => Self::Crypto,
PaymentMethodData::MandatePayment => Self::MandatePayment,
PaymentMethodData::Reward => Self::Reward,
PaymentMethodData::Upi(_) => Self::Upi,
PaymentMethodData::Voucher(voucher_data) => match voucher_data {
payment_method_data::VoucherData::Boleto(_) => Self::Boleto,
payment_method_data::VoucherData::Efecty => Self::Efecty,
payment_method_data::VoucherData::PagoEfectivo => Self::PagoEfectivo,
payment_method_data::VoucherData::RedCompra => Self::RedCompra,
payment_method_data::VoucherData::RedPagos => Self::RedPagos,
payment_method_data::VoucherData::Alfamart(_) => Self::Alfamart,
payment_method_data::VoucherData::Indomaret(_) => Self::Indomaret,
payment_method_data::VoucherData::Oxxo => Self::Oxxo,
payment_method_data::VoucherData::SevenEleven(_) => Self::SevenEleven,
payment_method_data::VoucherData::Lawson(_) => Self::Lawson,
payment_method_data::VoucherData::MiniStop(_) => Self::MiniStop,
payment_method_data::VoucherData::FamilyMart(_) => Self::FamilyMart,
payment_method_data::VoucherData::Seicomart(_) => Self::Seicomart,
payment_method_data::VoucherData::PayEasy(_) => Self::PayEasy,
},
PaymentMethodData::RealTimePayment(real_time_payment_data) => {
match *real_time_payment_data {
payment_method_data::RealTimePaymentData::DuitNow {} => Self::DuitNow,
payment_method_data::RealTimePaymentData::Fps {} => Self::Fps,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2400,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2400_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
Self::InstantBankTransferFinland
}
payment_method_data::BankTransferData::InstantBankTransferPoland { .. } => {
Self::InstantBankTransferPoland
}
},
PaymentMethodData::Crypto(_) => Self::Crypto,
PaymentMethodData::MandatePayment => Self::MandatePayment,
PaymentMethodData::Reward => Self::Reward,
PaymentMethodData::Upi(_) => Self::Upi,
PaymentMethodData::Voucher(voucher_data) => match voucher_data {
payment_method_data::VoucherData::Boleto(_) => Self::Boleto,
payment_method_data::VoucherData::Efecty => Self::Efecty,
payment_method_data::VoucherData::PagoEfectivo => Self::PagoEfectivo,
payment_method_data::VoucherData::RedCompra => Self::RedCompra,
payment_method_data::VoucherData::RedPagos => Self::RedPagos,
payment_method_data::VoucherData::Alfamart(_) => Self::Alfamart,
payment_method_data::VoucherData::Indomaret(_) => Self::Indomaret,
payment_method_data::VoucherData::Oxxo => Self::Oxxo,
payment_method_data::VoucherData::SevenEleven(_) => Self::SevenEleven,
payment_method_data::VoucherData::Lawson(_) => Self::Lawson,
payment_method_data::VoucherData::MiniStop(_) => Self::MiniStop,
payment_method_data::VoucherData::FamilyMart(_) => Self::FamilyMart,
payment_method_data::VoucherData::Seicomart(_) => Self::Seicomart,
payment_method_data::VoucherData::PayEasy(_) => Self::PayEasy,
},
PaymentMethodData::RealTimePayment(real_time_payment_data) => {
match *real_time_payment_data {
payment_method_data::RealTimePaymentData::DuitNow {} => Self::DuitNow,
payment_method_data::RealTimePaymentData::Fps {} => Self::Fps,
payment_method_data::RealTimePaymentData::PromptPay {} => Self::PromptPay,
payment_method_data::RealTimePaymentData::VietQr {} => Self::VietQr,
}
}
PaymentMethodData::GiftCard(gift_card_data) => match *gift_card_data {
payment_method_data::GiftCardData::Givex(_) => Self::Givex,
payment_method_data::GiftCardData::PaySafeCard {} => Self::PaySafeCar,
},
PaymentMethodData::CardToken(_) => Self::CardToken,
PaymentMethodData::OpenBanking(data) => match data {
payment_method_data::OpenBankingData::OpenBankingPIS {} => Self::OpenBanking,
},
PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {
Self::CardDetailsForNetworkTransactionId
}
PaymentMethodData::NetworkToken(_) => Self::NetworkToken,
PaymentMethodData::MobilePayment(mobile_payment_data) => match mobile_payment_data {
payment_method_data::MobilePaymentData::DirectCarrierBilling { .. } => {
Self::DirectCarrierBilling
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2400,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2425_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
},
PaymentMethodData::RealTimePayment(real_time_payment_data) => {
match *real_time_payment_data {
payment_method_data::RealTimePaymentData::DuitNow {} => Self::DuitNow,
payment_method_data::RealTimePaymentData::Fps {} => Self::Fps,
payment_method_data::RealTimePaymentData::PromptPay {} => Self::PromptPay,
payment_method_data::RealTimePaymentData::VietQr {} => Self::VietQr,
}
}
PaymentMethodData::GiftCard(gift_card_data) => match *gift_card_data {
payment_method_data::GiftCardData::Givex(_) => Self::Givex,
payment_method_data::GiftCardData::PaySafeCard {} => Self::PaySafeCar,
},
PaymentMethodData::CardToken(_) => Self::CardToken,
PaymentMethodData::OpenBanking(data) => match data {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2425,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2425_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
},
PaymentMethodData::RealTimePayment(real_time_payment_data) => {
match *real_time_payment_data {
payment_method_data::RealTimePaymentData::DuitNow {} => Self::DuitNow,
payment_method_data::RealTimePaymentData::Fps {} => Self::Fps,
payment_method_data::RealTimePaymentData::PromptPay {} => Self::PromptPay,
payment_method_data::RealTimePaymentData::VietQr {} => Self::VietQr,
}
}
PaymentMethodData::GiftCard(gift_card_data) => match *gift_card_data {
payment_method_data::GiftCardData::Givex(_) => Self::Givex,
payment_method_data::GiftCardData::PaySafeCard {} => Self::PaySafeCar,
},
PaymentMethodData::CardToken(_) => Self::CardToken,
PaymentMethodData::OpenBanking(data) => match data {
payment_method_data::OpenBankingData::OpenBankingPIS {} => Self::OpenBanking,
},
PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {
Self::CardDetailsForNetworkTransactionId
}
PaymentMethodData::NetworkToken(_) => Self::NetworkToken,
PaymentMethodData::MobilePayment(mobile_payment_data) => match mobile_payment_data {
payment_method_data::MobilePaymentData::DirectCarrierBilling { .. } => {
Self::DirectCarrierBilling
}
},
}
}
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2425,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2425_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
},
PaymentMethodData::RealTimePayment(real_time_payment_data) => {
match *real_time_payment_data {
payment_method_data::RealTimePaymentData::DuitNow {} => Self::DuitNow,
payment_method_data::RealTimePaymentData::Fps {} => Self::Fps,
payment_method_data::RealTimePaymentData::PromptPay {} => Self::PromptPay,
payment_method_data::RealTimePaymentData::VietQr {} => Self::VietQr,
}
}
PaymentMethodData::GiftCard(gift_card_data) => match *gift_card_data {
payment_method_data::GiftCardData::Givex(_) => Self::Givex,
payment_method_data::GiftCardData::PaySafeCard {} => Self::PaySafeCar,
},
PaymentMethodData::CardToken(_) => Self::CardToken,
PaymentMethodData::OpenBanking(data) => match data {
payment_method_data::OpenBankingData::OpenBankingPIS {} => Self::OpenBanking,
},
PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {
Self::CardDetailsForNetworkTransactionId
}
PaymentMethodData::NetworkToken(_) => Self::NetworkToken,
PaymentMethodData::MobilePayment(mobile_payment_data) => match mobile_payment_data {
payment_method_data::MobilePaymentData::DirectCarrierBilling { .. } => {
Self::DirectCarrierBilling
}
},
}
}
}
#[derive(Debug, Clone)]
pub struct DisputeDefendData {
pub dispute_id: String,
pub connector_dispute_id: String,
pub defense_reason_code: String,
pub integrity_object: Option<DefendDisputeIntegrityObject>,
}
pub trait SupportedPaymentMethodsExt {
fn add(
&mut self,
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
);
}
impl SupportedPaymentMethodsExt for SupportedPaymentMethods {
fn add(
&mut self,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2425,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2450_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
},
}
}
}
#[derive(Debug, Clone)]
pub struct DisputeDefendData {
pub dispute_id: String,
pub connector_dispute_id: String,
pub defense_reason_code: String,
pub integrity_object: Option<DefendDisputeIntegrityObject>,
}
pub trait SupportedPaymentMethodsExt {
fn add(
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2450,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2450_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
},
}
}
}
#[derive(Debug, Clone)]
pub struct DisputeDefendData {
pub dispute_id: String,
pub connector_dispute_id: String,
pub defense_reason_code: String,
pub integrity_object: Option<DefendDisputeIntegrityObject>,
}
pub trait SupportedPaymentMethodsExt {
fn add(
&mut self,
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
);
}
impl SupportedPaymentMethodsExt for SupportedPaymentMethods {
fn add(
&mut self,
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
) {
if let Some(payment_method_data) = self.get_mut(&payment_method) {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2450,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2450_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
},
}
}
}
#[derive(Debug, Clone)]
pub struct DisputeDefendData {
pub dispute_id: String,
pub connector_dispute_id: String,
pub defense_reason_code: String,
pub integrity_object: Option<DefendDisputeIntegrityObject>,
}
pub trait SupportedPaymentMethodsExt {
fn add(
&mut self,
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
);
}
impl SupportedPaymentMethodsExt for SupportedPaymentMethods {
fn add(
&mut self,
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
) {
if let Some(payment_method_data) = self.get_mut(&payment_method) {
payment_method_data.insert(payment_method_type, payment_method_details);
} else {
let mut payment_method_type_metadata = PaymentMethodTypeMetadata::new();
payment_method_type_metadata.insert(payment_method_type, payment_method_details);
self.insert(payment_method, payment_method_type_metadata);
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected
pub enum SplitPaymentsRequest {
/// StripeSplitPayment
StripeSplitPayment(StripeSplitPaymentRequest),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2450,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2475_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
) {
if let Some(payment_method_data) = self.get_mut(&payment_method) {
payment_method_data.insert(payment_method_type, payment_method_details);
} else {
let mut payment_method_type_metadata = PaymentMethodTypeMetadata::new();
payment_method_type_metadata.insert(payment_method_type, payment_method_details);
self.insert(payment_method, payment_method_type_metadata);
}
}
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2475,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2475_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
) {
if let Some(payment_method_data) = self.get_mut(&payment_method) {
payment_method_data.insert(payment_method_type, payment_method_details);
} else {
let mut payment_method_type_metadata = PaymentMethodTypeMetadata::new();
payment_method_type_metadata.insert(payment_method_type, payment_method_details);
self.insert(payment_method, payment_method_type_metadata);
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected
pub enum SplitPaymentsRequest {
/// StripeSplitPayment
StripeSplitPayment(StripeSplitPaymentRequest),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected for Stripe
pub struct StripeSplitPaymentRequest {
/// Stripe's charge type
pub charge_type: common_enums::PaymentChargeType,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2475,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2475_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
payment_method: PaymentMethod,
payment_method_type: PaymentMethodType,
payment_method_details: PaymentMethodDetails,
) {
if let Some(payment_method_data) = self.get_mut(&payment_method) {
payment_method_data.insert(payment_method_type, payment_method_details);
} else {
let mut payment_method_type_metadata = PaymentMethodTypeMetadata::new();
payment_method_type_metadata.insert(payment_method_type, payment_method_details);
self.insert(payment_method, payment_method_type_metadata);
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected
pub enum SplitPaymentsRequest {
/// StripeSplitPayment
StripeSplitPayment(StripeSplitPaymentRequest),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected for Stripe
pub struct StripeSplitPaymentRequest {
/// Stripe's charge type
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees to be collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
pub enum ConnectorChargeResponseData {
/// StripeChargeResponseData
StripeSplitPayment(StripeChargeResponseData),
}
/// Fee information to be charged on the payment being collected via Stripe
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct StripeChargeResponseData {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2475,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2500_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected for Stripe
pub struct StripeSplitPaymentRequest {
/// Stripe's charge type
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees to be collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2500,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2500_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected for Stripe
pub struct StripeSplitPaymentRequest {
/// Stripe's charge type
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees to be collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
pub enum ConnectorChargeResponseData {
/// StripeChargeResponseData
StripeSplitPayment(StripeChargeResponseData),
}
/// Fee information to be charged on the payment being collected via Stripe
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct StripeChargeResponseData {
/// Identifier for charge created for the payment
pub charge_id: Option<String>,
/// Type of charge (connector specific)
pub charge_type: common_enums::PaymentChargeType,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2500,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2500_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
#[serde(deny_unknown_fields)]
/// Fee information for Split Payments to be charged on the payment being collected for Stripe
pub struct StripeSplitPaymentRequest {
/// Stripe's charge type
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees to be collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
pub enum ConnectorChargeResponseData {
/// StripeChargeResponseData
StripeSplitPayment(StripeChargeResponseData),
}
/// Fee information to be charged on the payment being collected via Stripe
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct StripeChargeResponseData {
/// Identifier for charge created for the payment
pub charge_id: Option<String>,
/// Type of charge (connector specific)
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Debug, serde::Deserialize, Clone)]
pub enum SplitRefundsRequest {
StripeSplitRefund(StripeSplitRefund),
}
#[derive(Debug, serde::Deserialize, Clone)]
pub struct StripeSplitRefund {
pub charge_id: String,
pub transfer_account_id: String,
pub charge_type: common_enums::PaymentChargeType,
pub options: ChargeRefundsOptions,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2500,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2525_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
/// Identifier for charge created for the payment
pub charge_id: Option<String>,
/// Type of charge (connector specific)
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Debug, serde::Deserialize, Clone)]
pub enum SplitRefundsRequest {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2525,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2525_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
/// Identifier for charge created for the payment
pub charge_id: Option<String>,
/// Type of charge (connector specific)
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Debug, serde::Deserialize, Clone)]
pub enum SplitRefundsRequest {
StripeSplitRefund(StripeSplitRefund),
}
#[derive(Debug, serde::Deserialize, Clone)]
pub struct StripeSplitRefund {
pub charge_id: String,
pub transfer_account_id: String,
pub charge_type: common_enums::PaymentChargeType,
pub options: ChargeRefundsOptions,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum ChargeRefundsOptions {
Destination(DestinationChargeRefund),
Direct(DirectChargeRefund),
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2525,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2525_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
/// Identifier for charge created for the payment
pub charge_id: Option<String>,
/// Type of charge (connector specific)
pub charge_type: common_enums::PaymentChargeType,
/// Platform fees collected on the payment
pub application_fees: Option<MinorUnit>,
/// Identifier for the reseller's account where the funds were transferred
pub transfer_account_id: String,
}
#[derive(Debug, serde::Deserialize, Clone)]
pub enum SplitRefundsRequest {
StripeSplitRefund(StripeSplitRefund),
}
#[derive(Debug, serde::Deserialize, Clone)]
pub struct StripeSplitRefund {
pub charge_id: String,
pub transfer_account_id: String,
pub charge_type: common_enums::PaymentChargeType,
pub options: ChargeRefundsOptions,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum ChargeRefundsOptions {
Destination(DestinationChargeRefund),
Direct(DirectChargeRefund),
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DirectChargeRefund {
pub revert_platform_fee: bool,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DestinationChargeRefund {
pub revert_platform_fee: bool,
pub revert_transfer: bool,
}
#[derive(Debug, Default, Clone, Serialize)]
pub struct RecurringMandatePaymentData {
pub payment_method_type: Option<common_enums::PaymentMethodType>, //required for making recurring payment using saved payment method through stripe
pub original_payment_authorized_amount: Option<MinorUnit>,
pub original_payment_authorized_currency: Option<common_enums::Currency>,
pub mandate_metadata: Option<common_utils::pii::SecretSerdeValue>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2525,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2550_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum ChargeRefundsOptions {
Destination(DestinationChargeRefund),
Direct(DirectChargeRefund),
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DirectChargeRefund {
pub revert_platform_fee: bool,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DestinationChargeRefund {
pub revert_platform_fee: bool,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2550,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2550_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum ChargeRefundsOptions {
Destination(DestinationChargeRefund),
Direct(DirectChargeRefund),
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DirectChargeRefund {
pub revert_platform_fee: bool,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DestinationChargeRefund {
pub revert_platform_fee: bool,
pub revert_transfer: bool,
}
#[derive(Debug, Default, Clone, Serialize)]
pub struct RecurringMandatePaymentData {
pub payment_method_type: Option<common_enums::PaymentMethodType>, //required for making recurring payment using saved payment method through stripe
pub original_payment_authorized_amount: Option<MinorUnit>,
pub original_payment_authorized_currency: Option<common_enums::Currency>,
pub mandate_metadata: Option<common_utils::pii::SecretSerdeValue>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 25,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2550,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-6262692988738800615_2550_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/connector_types.rs
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum ChargeRefundsOptions {
Destination(DestinationChargeRefund),
Direct(DirectChargeRefund),
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DirectChargeRefund {
pub revert_platform_fee: bool,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct DestinationChargeRefund {
pub revert_platform_fee: bool,
pub revert_transfer: bool,
}
#[derive(Debug, Default, Clone, Serialize)]
pub struct RecurringMandatePaymentData {
pub payment_method_type: Option<common_enums::PaymentMethodType>, //required for making recurring payment using saved payment method through stripe
pub original_payment_authorized_amount: Option<MinorUnit>,
pub original_payment_authorized_currency: Option<common_enums::Currency>,
pub mandate_metadata: Option<common_utils::pii::SecretSerdeValue>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 25,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 2550,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_2301475437378205030_0_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/lib.rs
pub mod api;
pub mod connector_flow;
pub mod connector_types;
pub mod errors;
pub mod mandates;
pub mod payment_address;
pub mod payment_method_data;
pub mod router_data;
pub mod router_data_v2;
pub mod router_flow_types;
pub mod router_request_types;
pub mod router_response_types;
pub mod types;
pub mod utils;
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 14,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_2301475437378205030_0_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/lib.rs
pub mod api;
pub mod connector_flow;
pub mod connector_types;
pub mod errors;
pub mod mandates;
pub mod payment_address;
pub mod payment_method_data;
pub mod router_data;
pub mod router_data_v2;
pub mod router_flow_types;
pub mod router_request_types;
pub mod router_response_types;
pub mod types;
pub mod utils;
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 14,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_2301475437378205030_0_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/lib.rs
pub mod api;
pub mod connector_flow;
pub mod connector_types;
pub mod errors;
pub mod mandates;
pub mod payment_address;
pub mod payment_method_data;
pub mod router_data;
pub mod router_data_v2;
pub mod router_flow_types;
pub mod router_request_types;
pub mod router_response_types;
pub mod types;
pub mod utils;
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 14,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-764259173922624356_0_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_flow_types.rs
use serde::Serialize;
#[derive(Clone, Debug)]
pub struct VerifyWebhookSource;
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorMandateDetails {
pub connector_mandate_id: hyperswitch_masking::Secret<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorNetworkTxnId(hyperswitch_masking::Secret<String>);
impl ConnectorNetworkTxnId {
pub fn new(txn_id: hyperswitch_masking::Secret<String>) -> Self {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-764259173922624356_0_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_flow_types.rs
use serde::Serialize;
#[derive(Clone, Debug)]
pub struct VerifyWebhookSource;
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorMandateDetails {
pub connector_mandate_id: hyperswitch_masking::Secret<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorNetworkTxnId(hyperswitch_masking::Secret<String>);
impl ConnectorNetworkTxnId {
pub fn new(txn_id: hyperswitch_masking::Secret<String>) -> Self {
Self(txn_id)
}
pub fn get_id(&self) -> &hyperswitch_masking::Secret<String> {
&self.0
}
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 21,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-764259173922624356_0_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_flow_types.rs
use serde::Serialize;
#[derive(Clone, Debug)]
pub struct VerifyWebhookSource;
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorMandateDetails {
pub connector_mandate_id: hyperswitch_masking::Secret<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ConnectorNetworkTxnId(hyperswitch_masking::Secret<String>);
impl ConnectorNetworkTxnId {
pub fn new(txn_id: hyperswitch_masking::Secret<String>) -> Self {
Self(txn_id)
}
pub fn get_id(&self) -> &hyperswitch_masking::Secret<String> {
&self.0
}
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 21,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_0_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
use std::collections::HashMap;
use cards::{
validate::{CardExpirationMonth, CardExpirationYear},
NetworkToken,
};
use common_utils::ext_traits::{OptionExt, ValueExt};
use error_stack::ResultExt;
use hyperswitch_masking::{ExposeInterface, Secret};
use crate::utils::missing_field_err;
pub type Error = error_stack::Report<crate::errors::ConnectorError>;
#[derive(Default, Debug, Clone, serde::Deserialize, serde::Serialize)]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_0_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
use std::collections::HashMap;
use cards::{
validate::{CardExpirationMonth, CardExpirationYear},
NetworkToken,
};
use common_utils::ext_traits::{OptionExt, ValueExt};
use error_stack::ResultExt;
use hyperswitch_masking::{ExposeInterface, Secret};
use crate::utils::missing_field_err;
pub type Error = error_stack::Report<crate::errors::ConnectorError>;
#[derive(Default, Debug, Clone, serde::Deserialize, serde::Serialize)]
#[serde(tag = "auth_type")]
pub enum ConnectorAuthType {
TemporaryAuth,
HeaderKey {
api_key: Secret<String>,
},
BodyKey {
api_key: Secret<String>,
key1: Secret<String>,
},
SignatureKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
},
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_0_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
use std::collections::HashMap;
use cards::{
validate::{CardExpirationMonth, CardExpirationYear},
NetworkToken,
};
use common_utils::ext_traits::{OptionExt, ValueExt};
use error_stack::ResultExt;
use hyperswitch_masking::{ExposeInterface, Secret};
use crate::utils::missing_field_err;
pub type Error = error_stack::Report<crate::errors::ConnectorError>;
#[derive(Default, Debug, Clone, serde::Deserialize, serde::Serialize)]
#[serde(tag = "auth_type")]
pub enum ConnectorAuthType {
TemporaryAuth,
HeaderKey {
api_key: Secret<String>,
},
BodyKey {
api_key: Secret<String>,
key1: Secret<String>,
},
SignatureKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
},
MultiAuthKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
key2: Secret<String>,
},
CurrencyAuthKey {
auth_key_map: HashMap<common_enums::enums::Currency, common_utils::pii::SecretSerdeValue>,
},
CertificateAuth {
certificate: Secret<String>,
private_key: Secret<String>,
},
#[default]
NoKey,
}
impl ConnectorAuthType {
pub fn from_option_secret_value(
value: Option<common_utils::pii::SecretSerdeValue>,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_25_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
SignatureKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
},
MultiAuthKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
key2: Secret<String>,
},
CurrencyAuthKey {
auth_key_map: HashMap<common_enums::enums::Currency, common_utils::pii::SecretSerdeValue>,
},
CertificateAuth {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_25_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
SignatureKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
},
MultiAuthKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
key2: Secret<String>,
},
CurrencyAuthKey {
auth_key_map: HashMap<common_enums::enums::Currency, common_utils::pii::SecretSerdeValue>,
},
CertificateAuth {
certificate: Secret<String>,
private_key: Secret<String>,
},
#[default]
NoKey,
}
impl ConnectorAuthType {
pub fn from_option_secret_value(
value: Option<common_utils::pii::SecretSerdeValue>,
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_25_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
SignatureKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
},
MultiAuthKey {
api_key: Secret<String>,
key1: Secret<String>,
api_secret: Secret<String>,
key2: Secret<String>,
},
CurrencyAuthKey {
auth_key_map: HashMap<common_enums::enums::Currency, common_utils::pii::SecretSerdeValue>,
},
CertificateAuth {
certificate: Secret<String>,
private_key: Secret<String>,
},
#[default]
NoKey,
}
impl ConnectorAuthType {
pub fn from_option_secret_value(
value: Option<common_utils::pii::SecretSerdeValue>,
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
))
}
pub fn from_secret_value(
value: common_utils::pii::SecretSerdeValue,
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
))
}
// show only first and last two digits of the key and mask others with *
// mask the entire key if it's length is less than or equal to 4
fn mask_key(&self, key: String) -> Secret<String> {
let key_len = key.len();
let masked_key = if key_len <= 4 {
"*".repeat(key_len)
} else {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_50_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
))
}
pub fn from_secret_value(
value: common_utils::pii::SecretSerdeValue,
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_50_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
))
}
pub fn from_secret_value(
value: common_utils::pii::SecretSerdeValue,
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
))
}
// show only first and last two digits of the key and mask others with *
// mask the entire key if it's length is less than or equal to 4
fn mask_key(&self, key: String) -> Secret<String> {
let key_len = key.len();
let masked_key = if key_len <= 4 {
"*".repeat(key_len)
} else {
// Show the first two and last two characters, mask the rest with '*'
let mut masked_key = String::new();
let key_len = key.len();
// Iterate through characters by their index
for (index, character) in key.chars().enumerate() {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_50_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
))
}
pub fn from_secret_value(
value: common_utils::pii::SecretSerdeValue,
) -> common_utils::errors::CustomResult<Self, common_utils::errors::ParsingError> {
value
.parse_value::<Self>("ConnectorAuthType")
.change_context(common_utils::errors::ParsingError::StructParseFailure(
"ConnectorAuthType",
))
}
// show only first and last two digits of the key and mask others with *
// mask the entire key if it's length is less than or equal to 4
fn mask_key(&self, key: String) -> Secret<String> {
let key_len = key.len();
let masked_key = if key_len <= 4 {
"*".repeat(key_len)
} else {
// Show the first two and last two characters, mask the rest with '*'
let mut masked_key = String::new();
let key_len = key.len();
// Iterate through characters by their index
for (index, character) in key.chars().enumerate() {
if index < 2 || index >= key_len - 2 {
masked_key.push(character); // Keep the first two and last two characters
} else {
masked_key.push('*'); // Mask the middle characters
}
}
masked_key
};
Secret::new(masked_key)
}
// Mask the keys in the auth_type
pub fn get_masked_keys(&self) -> Self {
match self {
Self::TemporaryAuth => Self::TemporaryAuth,
Self::NoKey => Self::NoKey,
Self::HeaderKey { api_key } => Self::HeaderKey {
api_key: self.mask_key(api_key.clone().expose()),
},
Self::BodyKey { api_key, key1 } => Self::BodyKey {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_75_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
// Show the first two and last two characters, mask the rest with '*'
let mut masked_key = String::new();
let key_len = key.len();
// Iterate through characters by their index
for (index, character) in key.chars().enumerate() {
if index < 2 || index >= key_len - 2 {
masked_key.push(character); // Keep the first two and last two characters
} else {
masked_key.push('*'); // Mask the middle characters
}
}
masked_key
};
Secret::new(masked_key)
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_75_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
// Show the first two and last two characters, mask the rest with '*'
let mut masked_key = String::new();
let key_len = key.len();
// Iterate through characters by their index
for (index, character) in key.chars().enumerate() {
if index < 2 || index >= key_len - 2 {
masked_key.push(character); // Keep the first two and last two characters
} else {
masked_key.push('*'); // Mask the middle characters
}
}
masked_key
};
Secret::new(masked_key)
}
// Mask the keys in the auth_type
pub fn get_masked_keys(&self) -> Self {
match self {
Self::TemporaryAuth => Self::TemporaryAuth,
Self::NoKey => Self::NoKey,
Self::HeaderKey { api_key } => Self::HeaderKey {
api_key: self.mask_key(api_key.clone().expose()),
},
Self::BodyKey { api_key, key1 } => Self::BodyKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
},
Self::SignatureKey {
api_key,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_75_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
// Show the first two and last two characters, mask the rest with '*'
let mut masked_key = String::new();
let key_len = key.len();
// Iterate through characters by their index
for (index, character) in key.chars().enumerate() {
if index < 2 || index >= key_len - 2 {
masked_key.push(character); // Keep the first two and last two characters
} else {
masked_key.push('*'); // Mask the middle characters
}
}
masked_key
};
Secret::new(masked_key)
}
// Mask the keys in the auth_type
pub fn get_masked_keys(&self) -> Self {
match self {
Self::TemporaryAuth => Self::TemporaryAuth,
Self::NoKey => Self::NoKey,
Self::HeaderKey { api_key } => Self::HeaderKey {
api_key: self.mask_key(api_key.clone().expose()),
},
Self::BodyKey { api_key, key1 } => Self::BodyKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
},
Self::SignatureKey {
api_key,
key1,
api_secret,
} => Self::SignatureKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
api_secret: self.mask_key(api_secret.clone().expose()),
},
Self::MultiAuthKey {
api_key,
key1,
api_secret,
key2,
} => Self::MultiAuthKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
api_secret: self.mask_key(api_secret.clone().expose()),
key2: self.mask_key(key2.clone().expose()),
},
Self::CurrencyAuthKey { auth_key_map } => Self::CurrencyAuthKey {
auth_key_map: auth_key_map.clone(),
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_100_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
},
Self::SignatureKey {
api_key,
key1,
api_secret,
} => Self::SignatureKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
api_secret: self.mask_key(api_secret.clone().expose()),
},
Self::MultiAuthKey {
api_key,
key1,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_100_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
},
Self::SignatureKey {
api_key,
key1,
api_secret,
} => Self::SignatureKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
api_secret: self.mask_key(api_secret.clone().expose()),
},
Self::MultiAuthKey {
api_key,
key1,
api_secret,
key2,
} => Self::MultiAuthKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
api_secret: self.mask_key(api_secret.clone().expose()),
key2: self.mask_key(key2.clone().expose()),
},
Self::CurrencyAuthKey { auth_key_map } => Self::CurrencyAuthKey {
auth_key_map: auth_key_map.clone(),
},
Self::CertificateAuth {
certificate,
private_key,
} => Self::CertificateAuth {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_100_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
},
Self::SignatureKey {
api_key,
key1,
api_secret,
} => Self::SignatureKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
api_secret: self.mask_key(api_secret.clone().expose()),
},
Self::MultiAuthKey {
api_key,
key1,
api_secret,
key2,
} => Self::MultiAuthKey {
api_key: self.mask_key(api_key.clone().expose()),
key1: self.mask_key(key1.clone().expose()),
api_secret: self.mask_key(api_secret.clone().expose()),
key2: self.mask_key(key2.clone().expose()),
},
Self::CurrencyAuthKey { auth_key_map } => Self::CurrencyAuthKey {
auth_key_map: auth_key_map.clone(),
},
Self::CertificateAuth {
certificate,
private_key,
} => Self::CertificateAuth {
certificate: self.mask_key(certificate.clone().expose()),
private_key: self.mask_key(private_key.clone().expose()),
},
}
}
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct ErrorResponse {
pub code: String,
pub message: String,
pub reason: Option<String>,
pub status_code: u16,
pub attempt_status: Option<common_enums::enums::AttemptStatus>,
pub connector_transaction_id: Option<String>,
pub network_decline_code: Option<String>,
pub network_advice_code: Option<String>,
pub network_error_message: Option<String>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_125_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
},
Self::CertificateAuth {
certificate,
private_key,
} => Self::CertificateAuth {
certificate: self.mask_key(certificate.clone().expose()),
private_key: self.mask_key(private_key.clone().expose()),
},
}
}
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct ErrorResponse {
pub code: String,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_125_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
},
Self::CertificateAuth {
certificate,
private_key,
} => Self::CertificateAuth {
certificate: self.mask_key(certificate.clone().expose()),
private_key: self.mask_key(private_key.clone().expose()),
},
}
}
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct ErrorResponse {
pub code: String,
pub message: String,
pub reason: Option<String>,
pub status_code: u16,
pub attempt_status: Option<common_enums::enums::AttemptStatus>,
pub connector_transaction_id: Option<String>,
pub network_decline_code: Option<String>,
pub network_advice_code: Option<String>,
pub network_error_message: Option<String>,
}
impl Default for ErrorResponse {
fn default() -> Self {
Self {
code: "HE_00".to_string(),
message: "Something went wrong".to_string(),
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_125_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
},
Self::CertificateAuth {
certificate,
private_key,
} => Self::CertificateAuth {
certificate: self.mask_key(certificate.clone().expose()),
private_key: self.mask_key(private_key.clone().expose()),
},
}
}
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct ErrorResponse {
pub code: String,
pub message: String,
pub reason: Option<String>,
pub status_code: u16,
pub attempt_status: Option<common_enums::enums::AttemptStatus>,
pub connector_transaction_id: Option<String>,
pub network_decline_code: Option<String>,
pub network_advice_code: Option<String>,
pub network_error_message: Option<String>,
}
impl Default for ErrorResponse {
fn default() -> Self {
Self {
code: "HE_00".to_string(),
message: "Something went wrong".to_string(),
reason: None,
status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
attempt_status: None,
connector_transaction_id: None,
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
impl ErrorResponse {
pub fn get_not_implemented() -> Self {
Self {
code: "IR_00".to_string(),
message: "This API is under development and will be made available soon.".to_string(),
reason: None,
status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
attempt_status: None,
connector_transaction_id: None,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_150_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
impl Default for ErrorResponse {
fn default() -> Self {
Self {
code: "HE_00".to_string(),
message: "Something went wrong".to_string(),
reason: None,
status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
attempt_status: None,
connector_transaction_id: None,
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_150_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
impl Default for ErrorResponse {
fn default() -> Self {
Self {
code: "HE_00".to_string(),
message: "Something went wrong".to_string(),
reason: None,
status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
attempt_status: None,
connector_transaction_id: None,
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
impl ErrorResponse {
pub fn get_not_implemented() -> Self {
Self {
code: "IR_00".to_string(),
message: "This API is under development and will be made available soon.".to_string(),
reason: None,
status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
attempt_status: None,
connector_transaction_id: None,
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_150_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
impl Default for ErrorResponse {
fn default() -> Self {
Self {
code: "HE_00".to_string(),
message: "Something went wrong".to_string(),
reason: None,
status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
attempt_status: None,
connector_transaction_id: None,
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
impl ErrorResponse {
pub fn get_not_implemented() -> Self {
Self {
code: "IR_00".to_string(),
message: "This API is under development and will be made available soon.".to_string(),
reason: None,
status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(),
attempt_status: None,
connector_transaction_id: None,
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayCryptogramData {
pub online_payment_cryptogram: Secret<String>,
pub eci_indicator: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayPredecryptData {
pub application_primary_account_number: Secret<String>,
pub application_expiration_date: String,
pub currency_code: String,
pub transaction_amount: i64,
pub device_manufacturer_identifier: Secret<String>,
pub payment_data_type: Secret<String>,
pub payment_data: ApplePayCryptogramData,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_175_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayCryptogramData {
pub online_payment_cryptogram: Secret<String>,
pub eci_indicator: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_175_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayCryptogramData {
pub online_payment_cryptogram: Secret<String>,
pub eci_indicator: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayPredecryptData {
pub application_primary_account_number: Secret<String>,
pub application_expiration_date: String,
pub currency_code: String,
pub transaction_amount: i64,
pub device_manufacturer_identifier: Secret<String>,
pub payment_data_type: Secret<String>,
pub payment_data: ApplePayCryptogramData,
}
impl ApplePayPredecryptData {
pub fn get_four_digit_expiry_year(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(format!(
"20{}",
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_175_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
network_decline_code: None,
network_advice_code: None,
network_error_message: None,
}
}
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayCryptogramData {
pub online_payment_cryptogram: Secret<String>,
pub eci_indicator: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApplePayPredecryptData {
pub application_primary_account_number: Secret<String>,
pub application_expiration_date: String,
pub currency_code: String,
pub transaction_amount: i64,
pub device_manufacturer_identifier: Secret<String>,
pub payment_data_type: Secret<String>,
pub payment_data: ApplePayCryptogramData,
}
impl ApplePayPredecryptData {
pub fn get_four_digit_expiry_year(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(format!(
"20{}",
self.application_expiration_date
.get(0..2)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
)))
}
pub fn get_expiry_month(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(
self.application_expiration_date
.get(2..4)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
.to_owned(),
))
}
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayDecryptedData {
pub message_expiration: String,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_200_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
impl ApplePayPredecryptData {
pub fn get_four_digit_expiry_year(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(format!(
"20{}",
self.application_expiration_date
.get(0..2)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
)))
}
pub fn get_expiry_month(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(
self.application_expiration_date
.get(2..4)
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 200,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_200_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
impl ApplePayPredecryptData {
pub fn get_four_digit_expiry_year(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(format!(
"20{}",
self.application_expiration_date
.get(0..2)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
)))
}
pub fn get_expiry_month(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(
self.application_expiration_date
.get(2..4)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
.to_owned(),
))
}
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayDecryptedData {
pub message_expiration: String,
pub message_id: String,
#[serde(rename = "paymentMethod")]
pub payment_method_type: String,
pub payment_method_details: GooglePayPaymentMethodDetails,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 200,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_200_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
impl ApplePayPredecryptData {
pub fn get_four_digit_expiry_year(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(format!(
"20{}",
self.application_expiration_date
.get(0..2)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
)))
}
pub fn get_expiry_month(&self) -> Result<Secret<String>, Error> {
Ok(Secret::new(
self.application_expiration_date
.get(2..4)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
.to_owned(),
))
}
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayDecryptedData {
pub message_expiration: String,
pub message_id: String,
#[serde(rename = "paymentMethod")]
pub payment_method_type: String,
pub payment_method_details: GooglePayPaymentMethodDetails,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayPaymentMethodDetails {
pub auth_method: common_enums::enums::GooglePayAuthMethod,
pub expiration_month: CardExpirationMonth,
pub expiration_year: CardExpirationYear,
pub pan: cards::CardNumber,
pub cryptogram: Option<Secret<String>>,
pub eci_indicator: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeDecryptedData {
pub client_id: Secret<String>,
pub profile_id: String,
pub token: PazeToken,
pub payment_card_network: common_enums::enums::CardNetwork,
pub dynamic_data: Vec<PazeDynamicData>,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 200,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_225_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub message_id: String,
#[serde(rename = "paymentMethod")]
pub payment_method_type: String,
pub payment_method_details: GooglePayPaymentMethodDetails,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayPaymentMethodDetails {
pub auth_method: common_enums::enums::GooglePayAuthMethod,
pub expiration_month: CardExpirationMonth,
pub expiration_year: CardExpirationYear,
pub pan: cards::CardNumber,
pub cryptogram: Option<Secret<String>>,
pub eci_indicator: Option<String>,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_225_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub message_id: String,
#[serde(rename = "paymentMethod")]
pub payment_method_type: String,
pub payment_method_details: GooglePayPaymentMethodDetails,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayPaymentMethodDetails {
pub auth_method: common_enums::enums::GooglePayAuthMethod,
pub expiration_month: CardExpirationMonth,
pub expiration_year: CardExpirationYear,
pub pan: cards::CardNumber,
pub cryptogram: Option<Secret<String>>,
pub eci_indicator: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeDecryptedData {
pub client_id: Secret<String>,
pub profile_id: String,
pub token: PazeToken,
pub payment_card_network: common_enums::enums::CardNetwork,
pub dynamic_data: Vec<PazeDynamicData>,
pub billing_address: PazeAddress,
pub consumer: PazeConsumer,
pub eci: Option<String>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_225_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub message_id: String,
#[serde(rename = "paymentMethod")]
pub payment_method_type: String,
pub payment_method_details: GooglePayPaymentMethodDetails,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GooglePayPaymentMethodDetails {
pub auth_method: common_enums::enums::GooglePayAuthMethod,
pub expiration_month: CardExpirationMonth,
pub expiration_year: CardExpirationYear,
pub pan: cards::CardNumber,
pub cryptogram: Option<Secret<String>>,
pub eci_indicator: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeDecryptedData {
pub client_id: Secret<String>,
pub profile_id: String,
pub token: PazeToken,
pub payment_card_network: common_enums::enums::CardNetwork,
pub dynamic_data: Vec<PazeDynamicData>,
pub billing_address: PazeAddress,
pub consumer: PazeConsumer,
pub eci: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeToken {
pub payment_token: NetworkTokenNumber,
pub token_expiration_month: Secret<String>,
pub token_expiration_year: Secret<String>,
pub payment_account_reference: Secret<String>,
}
pub type NetworkTokenNumber = NetworkToken;
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeConsumer {
// This is consumer data not customer data.
pub first_name: Option<Secret<String>>,
pub last_name: Option<Secret<String>>,
pub full_name: Secret<String>,
pub email_address: common_utils::pii::Email,
pub mobile_number: Option<PazePhoneNumber>,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_250_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub billing_address: PazeAddress,
pub consumer: PazeConsumer,
pub eci: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeToken {
pub payment_token: NetworkTokenNumber,
pub token_expiration_month: Secret<String>,
pub token_expiration_year: Secret<String>,
pub payment_account_reference: Secret<String>,
}
pub type NetworkTokenNumber = NetworkToken;
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 250,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_250_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub billing_address: PazeAddress,
pub consumer: PazeConsumer,
pub eci: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeToken {
pub payment_token: NetworkTokenNumber,
pub token_expiration_month: Secret<String>,
pub token_expiration_year: Secret<String>,
pub payment_account_reference: Secret<String>,
}
pub type NetworkTokenNumber = NetworkToken;
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeConsumer {
// This is consumer data not customer data.
pub first_name: Option<Secret<String>>,
pub last_name: Option<Secret<String>>,
pub full_name: Secret<String>,
pub email_address: common_utils::pii::Email,
pub mobile_number: Option<PazePhoneNumber>,
pub country_code: Option<common_enums::enums::CountryAlpha2>,
pub language_code: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 250,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_250_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub billing_address: PazeAddress,
pub consumer: PazeConsumer,
pub eci: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeToken {
pub payment_token: NetworkTokenNumber,
pub token_expiration_month: Secret<String>,
pub token_expiration_year: Secret<String>,
pub payment_account_reference: Secret<String>,
}
pub type NetworkTokenNumber = NetworkToken;
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeConsumer {
// This is consumer data not customer data.
pub first_name: Option<Secret<String>>,
pub last_name: Option<Secret<String>>,
pub full_name: Secret<String>,
pub email_address: common_utils::pii::Email,
pub mobile_number: Option<PazePhoneNumber>,
pub country_code: Option<common_enums::enums::CountryAlpha2>,
pub language_code: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazePhoneNumber {
pub country_code: Secret<String>,
pub phone_number: Secret<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeAddress {
pub name: Option<Secret<String>>,
pub line1: Option<Secret<String>>,
pub line2: Option<Secret<String>>,
pub line3: Option<Secret<String>>,
pub city: Option<Secret<String>>,
pub state: Option<Secret<String>>,
pub zip: Option<Secret<String>>,
pub country_code: Option<common_enums::enums::CountryAlpha2>,
}
#[derive(Debug, Clone, serde::Deserialize)]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 250,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_275_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub country_code: Option<common_enums::enums::CountryAlpha2>,
pub language_code: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazePhoneNumber {
pub country_code: Secret<String>,
pub phone_number: Secret<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeAddress {
pub name: Option<Secret<String>>,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 275,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_275_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub country_code: Option<common_enums::enums::CountryAlpha2>,
pub language_code: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazePhoneNumber {
pub country_code: Secret<String>,
pub phone_number: Secret<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeAddress {
pub name: Option<Secret<String>>,
pub line1: Option<Secret<String>>,
pub line2: Option<Secret<String>>,
pub line3: Option<Secret<String>>,
pub city: Option<Secret<String>>,
pub state: Option<Secret<String>>,
pub zip: Option<Secret<String>>,
pub country_code: Option<common_enums::enums::CountryAlpha2>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeDynamicData {
pub dynamic_data_value: Option<Secret<String>>,
pub dynamic_data_type: Option<String>,
pub dynamic_data_expiration: Option<String>,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 275,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_275_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub country_code: Option<common_enums::enums::CountryAlpha2>,
pub language_code: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazePhoneNumber {
pub country_code: Secret<String>,
pub phone_number: Secret<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeAddress {
pub name: Option<Secret<String>>,
pub line1: Option<Secret<String>>,
pub line2: Option<Secret<String>>,
pub line3: Option<Secret<String>>,
pub city: Option<Secret<String>>,
pub state: Option<Secret<String>>,
pub zip: Option<Secret<String>>,
pub country_code: Option<common_enums::enums::CountryAlpha2>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PazeDynamicData {
pub dynamic_data_value: Option<Secret<String>>,
pub dynamic_data_type: Option<String>,
pub dynamic_data_expiration: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
pub enum PaymentMethodToken {
Token(Secret<String>),
ApplePayDecrypt(Box<ApplePayPredecryptData>),
GooglePayDecrypt(Box<GooglePayDecryptedData>),
PazeDecrypt(Box<PazeDecryptedData>),
}
#[derive(Debug, Default, Clone)]
pub struct RecurringMandatePaymentData {
pub payment_method_type: Option<common_enums::enums::PaymentMethodType>, //required for making recurring payment using saved payment method through stripe
pub original_payment_authorized_amount: Option<i64>,
pub original_payment_authorized_currency: Option<common_enums::enums::Currency>,
pub mandate_metadata: Option<common_utils::pii::SecretSerdeValue>,
}
impl RecurringMandatePaymentData {
pub fn get_original_payment_amount(&self) -> Result<i64, Error> {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 275,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_300_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
#[serde(rename_all = "camelCase")]
pub struct PazeDynamicData {
pub dynamic_data_value: Option<Secret<String>>,
pub dynamic_data_type: Option<String>,
pub dynamic_data_expiration: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
pub enum PaymentMethodToken {
Token(Secret<String>),
ApplePayDecrypt(Box<ApplePayPredecryptData>),
GooglePayDecrypt(Box<GooglePayDecryptedData>),
PazeDecrypt(Box<PazeDecryptedData>),
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 300,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_300_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
#[serde(rename_all = "camelCase")]
pub struct PazeDynamicData {
pub dynamic_data_value: Option<Secret<String>>,
pub dynamic_data_type: Option<String>,
pub dynamic_data_expiration: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
pub enum PaymentMethodToken {
Token(Secret<String>),
ApplePayDecrypt(Box<ApplePayPredecryptData>),
GooglePayDecrypt(Box<GooglePayDecryptedData>),
PazeDecrypt(Box<PazeDecryptedData>),
}
#[derive(Debug, Default, Clone)]
pub struct RecurringMandatePaymentData {
pub payment_method_type: Option<common_enums::enums::PaymentMethodType>, //required for making recurring payment using saved payment method through stripe
pub original_payment_authorized_amount: Option<i64>,
pub original_payment_authorized_currency: Option<common_enums::enums::Currency>,
pub mandate_metadata: Option<common_utils::pii::SecretSerdeValue>,
}
impl RecurringMandatePaymentData {
pub fn get_original_payment_amount(&self) -> Result<i64, Error> {
self.original_payment_authorized_amount
.ok_or_else(missing_field_err("original_payment_authorized_amount"))
}
pub fn get_original_payment_currency(&self) -> Result<common_enums::Currency, Error> {
self.original_payment_authorized_currency
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 300,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_300_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
#[serde(rename_all = "camelCase")]
pub struct PazeDynamicData {
pub dynamic_data_value: Option<Secret<String>>,
pub dynamic_data_type: Option<String>,
pub dynamic_data_expiration: Option<String>,
}
#[derive(Debug, Clone, serde::Deserialize)]
pub enum PaymentMethodToken {
Token(Secret<String>),
ApplePayDecrypt(Box<ApplePayPredecryptData>),
GooglePayDecrypt(Box<GooglePayDecryptedData>),
PazeDecrypt(Box<PazeDecryptedData>),
}
#[derive(Debug, Default, Clone)]
pub struct RecurringMandatePaymentData {
pub payment_method_type: Option<common_enums::enums::PaymentMethodType>, //required for making recurring payment using saved payment method through stripe
pub original_payment_authorized_amount: Option<i64>,
pub original_payment_authorized_currency: Option<common_enums::enums::Currency>,
pub mandate_metadata: Option<common_utils::pii::SecretSerdeValue>,
}
impl RecurringMandatePaymentData {
pub fn get_original_payment_amount(&self) -> Result<i64, Error> {
self.original_payment_authorized_amount
.ok_or_else(missing_field_err("original_payment_authorized_amount"))
}
pub fn get_original_payment_currency(&self) -> Result<common_enums::Currency, Error> {
self.original_payment_authorized_currency
.ok_or_else(missing_field_err("original_payment_authorized_currency"))
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ConnectorResponseData {
pub additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
is_overcapture_enabled: Option<bool>,
}
impl ConnectorResponseData {
pub fn with_additional_payment_method_data(
additional_payment_method_data: AdditionalPaymentMethodConnectorResponse,
) -> Self {
Self {
additional_payment_method_data: Some(additional_payment_method_data),
extended_authorization_response_data: None,
is_overcapture_enabled: None,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 300,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_325_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
self.original_payment_authorized_amount
.ok_or_else(missing_field_err("original_payment_authorized_amount"))
}
pub fn get_original_payment_currency(&self) -> Result<common_enums::Currency, Error> {
self.original_payment_authorized_currency
.ok_or_else(missing_field_err("original_payment_authorized_currency"))
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ConnectorResponseData {
pub additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
is_overcapture_enabled: Option<bool>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 325,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_325_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
self.original_payment_authorized_amount
.ok_or_else(missing_field_err("original_payment_authorized_amount"))
}
pub fn get_original_payment_currency(&self) -> Result<common_enums::Currency, Error> {
self.original_payment_authorized_currency
.ok_or_else(missing_field_err("original_payment_authorized_currency"))
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ConnectorResponseData {
pub additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
is_overcapture_enabled: Option<bool>,
}
impl ConnectorResponseData {
pub fn with_additional_payment_method_data(
additional_payment_method_data: AdditionalPaymentMethodConnectorResponse,
) -> Self {
Self {
additional_payment_method_data: Some(additional_payment_method_data),
extended_authorization_response_data: None,
is_overcapture_enabled: None,
}
}
pub fn new(
additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
is_overcapture_enabled: Option<bool>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 325,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_325_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
self.original_payment_authorized_amount
.ok_or_else(missing_field_err("original_payment_authorized_amount"))
}
pub fn get_original_payment_currency(&self) -> Result<common_enums::Currency, Error> {
self.original_payment_authorized_currency
.ok_or_else(missing_field_err("original_payment_authorized_currency"))
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ConnectorResponseData {
pub additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
is_overcapture_enabled: Option<bool>,
}
impl ConnectorResponseData {
pub fn with_additional_payment_method_data(
additional_payment_method_data: AdditionalPaymentMethodConnectorResponse,
) -> Self {
Self {
additional_payment_method_data: Some(additional_payment_method_data),
extended_authorization_response_data: None,
is_overcapture_enabled: None,
}
}
pub fn new(
additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
is_overcapture_enabled: Option<bool>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
) -> Self {
Self {
additional_payment_method_data,
extended_authorization_response_data,
is_overcapture_enabled,
}
}
pub fn get_extended_authorization_response_data(
&self,
) -> Option<&ExtendedAuthorizationResponseData> {
self.extended_authorization_response_data.as_ref()
}
pub fn is_overcapture_enabled(&self) -> Option<bool> {
self.is_overcapture_enabled
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 325,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_350_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
}
pub fn new(
additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
is_overcapture_enabled: Option<bool>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
) -> Self {
Self {
additional_payment_method_data,
extended_authorization_response_data,
is_overcapture_enabled,
}
}
pub fn get_extended_authorization_response_data(
&self,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 350,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_350_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
}
pub fn new(
additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
is_overcapture_enabled: Option<bool>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
) -> Self {
Self {
additional_payment_method_data,
extended_authorization_response_data,
is_overcapture_enabled,
}
}
pub fn get_extended_authorization_response_data(
&self,
) -> Option<&ExtendedAuthorizationResponseData> {
self.extended_authorization_response_data.as_ref()
}
pub fn is_overcapture_enabled(&self) -> Option<bool> {
self.is_overcapture_enabled
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum AdditionalPaymentMethodConnectorResponse {
Card {
/// Details regarding the authentication details of the connector, if this is a 3ds payment.
authentication_data: Option<serde_json::Value>,
/// Various payment checks that are done for a payment
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 350,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_350_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
}
pub fn new(
additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>,
is_overcapture_enabled: Option<bool>,
extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>,
) -> Self {
Self {
additional_payment_method_data,
extended_authorization_response_data,
is_overcapture_enabled,
}
}
pub fn get_extended_authorization_response_data(
&self,
) -> Option<&ExtendedAuthorizationResponseData> {
self.extended_authorization_response_data.as_ref()
}
pub fn is_overcapture_enabled(&self) -> Option<bool> {
self.is_overcapture_enabled
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum AdditionalPaymentMethodConnectorResponse {
Card {
/// Details regarding the authentication details of the connector, if this is a 3ds payment.
authentication_data: Option<serde_json::Value>,
/// Various payment checks that are done for a payment
payment_checks: Option<serde_json::Value>,
/// Card Network returned by the processor
card_network: Option<String>,
/// Domestic(Co-Branded) Card network returned by the processor
domestic_network: Option<String>,
},
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExtendedAuthorizationResponseData {
pub extended_authentication_applied: Option<bool>,
pub capture_before: Option<time::PrimitiveDateTime>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 43,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 350,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_375_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub enum AdditionalPaymentMethodConnectorResponse {
Card {
/// Details regarding the authentication details of the connector, if this is a 3ds payment.
authentication_data: Option<serde_json::Value>,
/// Various payment checks that are done for a payment
payment_checks: Option<serde_json::Value>,
/// Card Network returned by the processor
card_network: Option<String>,
/// Domestic(Co-Branded) Card network returned by the processor
domestic_network: Option<String>,
},
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExtendedAuthorizationResponseData {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 375,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_375_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub enum AdditionalPaymentMethodConnectorResponse {
Card {
/// Details regarding the authentication details of the connector, if this is a 3ds payment.
authentication_data: Option<serde_json::Value>,
/// Various payment checks that are done for a payment
payment_checks: Option<serde_json::Value>,
/// Card Network returned by the processor
card_network: Option<String>,
/// Domestic(Co-Branded) Card network returned by the processor
domestic_network: Option<String>,
},
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExtendedAuthorizationResponseData {
pub extended_authentication_applied: Option<bool>,
pub capture_before: Option<time::PrimitiveDateTime>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 18,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 375,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_7969894047322031300_375_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_data.rs
pub enum AdditionalPaymentMethodConnectorResponse {
Card {
/// Details regarding the authentication details of the connector, if this is a 3ds payment.
authentication_data: Option<serde_json::Value>,
/// Various payment checks that are done for a payment
payment_checks: Option<serde_json::Value>,
/// Card Network returned by the processor
card_network: Option<String>,
/// Domestic(Co-Branded) Card network returned by the processor
domestic_network: Option<String>,
},
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExtendedAuthorizationResponseData {
pub extended_authentication_applied: Option<bool>,
pub capture_before: Option<time::PrimitiveDateTime>,
}
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 18,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 375,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_0_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
use common_utils::errors::ErrorSwitch;
// use api_models::errors::types::{ Extra};
use strum::Display;
#[derive(Debug, thiserror::Error, PartialEq, Clone)]
pub enum ApiClientError {
#[error("Header map construction failed")]
HeaderMapConstructionFailed,
#[error("Invalid proxy configuration")]
InvalidProxyConfiguration,
#[error("Client construction failed")]
ClientConstructionFailed,
#[error("Certificate decode failed")]
CertificateDecodeFailed,
#[error("Request body serialization failed")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_0_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
use common_utils::errors::ErrorSwitch;
// use api_models::errors::types::{ Extra};
use strum::Display;
#[derive(Debug, thiserror::Error, PartialEq, Clone)]
pub enum ApiClientError {
#[error("Header map construction failed")]
HeaderMapConstructionFailed,
#[error("Invalid proxy configuration")]
InvalidProxyConfiguration,
#[error("Client construction failed")]
ClientConstructionFailed,
#[error("Certificate decode failed")]
CertificateDecodeFailed,
#[error("Request body serialization failed")]
BodySerializationFailed,
#[error("Unexpected state reached/Invariants conflicted")]
UnexpectedState,
#[error("Url Parsing Failed")]
UrlParsingFailed,
#[error("URL encoding of request payload failed")]
UrlEncodingFailed,
#[error("Failed to send request to connector {0}")]
RequestNotSent(String),
#[error("Failed to decode response")]
ResponseDecodingFailed,
#[error("Server responded with Request Timeout")]
RequestTimeoutReceived,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_0_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
use common_utils::errors::ErrorSwitch;
// use api_models::errors::types::{ Extra};
use strum::Display;
#[derive(Debug, thiserror::Error, PartialEq, Clone)]
pub enum ApiClientError {
#[error("Header map construction failed")]
HeaderMapConstructionFailed,
#[error("Invalid proxy configuration")]
InvalidProxyConfiguration,
#[error("Client construction failed")]
ClientConstructionFailed,
#[error("Certificate decode failed")]
CertificateDecodeFailed,
#[error("Request body serialization failed")]
BodySerializationFailed,
#[error("Unexpected state reached/Invariants conflicted")]
UnexpectedState,
#[error("Url Parsing Failed")]
UrlParsingFailed,
#[error("URL encoding of request payload failed")]
UrlEncodingFailed,
#[error("Failed to send request to connector {0}")]
RequestNotSent(String),
#[error("Failed to decode response")]
ResponseDecodingFailed,
#[error("Server responded with Request Timeout")]
RequestTimeoutReceived,
#[error("connection closed before a message could complete")]
ConnectionClosedIncompleteMessage,
#[error("Server responded with Internal Server Error")]
InternalServerErrorReceived,
#[error("Server responded with Bad Gateway")]
BadGatewayReceived,
#[error("Server responded with Service Unavailable")]
ServiceUnavailableReceived,
#[error("Server responded with Gateway Timeout")]
GatewayTimeoutReceived,
#[error("Server responded with unexpected response")]
UnexpectedServerResponse,
}
#[derive(Debug, Clone, thiserror::Error, Display)]
pub enum ApplicationErrorResponse {
Unauthorized(ApiError),
ForbiddenCommonResource(ApiError),
ForbiddenPrivateResource(ApiError),
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_25_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ResponseDecodingFailed,
#[error("Server responded with Request Timeout")]
RequestTimeoutReceived,
#[error("connection closed before a message could complete")]
ConnectionClosedIncompleteMessage,
#[error("Server responded with Internal Server Error")]
InternalServerErrorReceived,
#[error("Server responded with Bad Gateway")]
BadGatewayReceived,
#[error("Server responded with Service Unavailable")]
ServiceUnavailableReceived,
#[error("Server responded with Gateway Timeout")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_25_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ResponseDecodingFailed,
#[error("Server responded with Request Timeout")]
RequestTimeoutReceived,
#[error("connection closed before a message could complete")]
ConnectionClosedIncompleteMessage,
#[error("Server responded with Internal Server Error")]
InternalServerErrorReceived,
#[error("Server responded with Bad Gateway")]
BadGatewayReceived,
#[error("Server responded with Service Unavailable")]
ServiceUnavailableReceived,
#[error("Server responded with Gateway Timeout")]
GatewayTimeoutReceived,
#[error("Server responded with unexpected response")]
UnexpectedServerResponse,
}
#[derive(Debug, Clone, thiserror::Error, Display)]
pub enum ApplicationErrorResponse {
Unauthorized(ApiError),
ForbiddenCommonResource(ApiError),
ForbiddenPrivateResource(ApiError),
Conflict(ApiError),
Gone(ApiError),
Unprocessable(ApiError),
InternalServerError(ApiError),
NotImplemented(ApiError),
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_25_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ResponseDecodingFailed,
#[error("Server responded with Request Timeout")]
RequestTimeoutReceived,
#[error("connection closed before a message could complete")]
ConnectionClosedIncompleteMessage,
#[error("Server responded with Internal Server Error")]
InternalServerErrorReceived,
#[error("Server responded with Bad Gateway")]
BadGatewayReceived,
#[error("Server responded with Service Unavailable")]
ServiceUnavailableReceived,
#[error("Server responded with Gateway Timeout")]
GatewayTimeoutReceived,
#[error("Server responded with unexpected response")]
UnexpectedServerResponse,
}
#[derive(Debug, Clone, thiserror::Error, Display)]
pub enum ApplicationErrorResponse {
Unauthorized(ApiError),
ForbiddenCommonResource(ApiError),
ForbiddenPrivateResource(ApiError),
Conflict(ApiError),
Gone(ApiError),
Unprocessable(ApiError),
InternalServerError(ApiError),
NotImplemented(ApiError),
NotFound(ApiError),
MethodNotAllowed(ApiError),
BadRequest(ApiError),
DomainError(ApiError),
}
#[derive(Debug, serde::Serialize, Clone)]
pub struct ApiError {
pub sub_code: String,
pub error_identifier: u16,
pub error_message: String,
pub error_object: Option<serde_json::Value>,
}
#[derive(Debug, thiserror::Error)]
pub enum ParsingError {
#[error("Failed to parse struct: {0}")]
StructParseFailure(&'static str),
#[error("Failed to serialize to {0} format")]
EncodeError(&'static str),
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_50_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
Conflict(ApiError),
Gone(ApiError),
Unprocessable(ApiError),
InternalServerError(ApiError),
NotImplemented(ApiError),
NotFound(ApiError),
MethodNotAllowed(ApiError),
BadRequest(ApiError),
DomainError(ApiError),
}
#[derive(Debug, serde::Serialize, Clone)]
pub struct ApiError {
pub sub_code: String,
pub error_identifier: u16,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_50_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
Conflict(ApiError),
Gone(ApiError),
Unprocessable(ApiError),
InternalServerError(ApiError),
NotImplemented(ApiError),
NotFound(ApiError),
MethodNotAllowed(ApiError),
BadRequest(ApiError),
DomainError(ApiError),
}
#[derive(Debug, serde::Serialize, Clone)]
pub struct ApiError {
pub sub_code: String,
pub error_identifier: u16,
pub error_message: String,
pub error_object: Option<serde_json::Value>,
}
#[derive(Debug, thiserror::Error)]
pub enum ParsingError {
#[error("Failed to parse struct: {0}")]
StructParseFailure(&'static str),
#[error("Failed to serialize to {0} format")]
EncodeError(&'static str),
}
#[derive(Clone, Debug, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorType {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_50_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
Conflict(ApiError),
Gone(ApiError),
Unprocessable(ApiError),
InternalServerError(ApiError),
NotImplemented(ApiError),
NotFound(ApiError),
MethodNotAllowed(ApiError),
BadRequest(ApiError),
DomainError(ApiError),
}
#[derive(Debug, serde::Serialize, Clone)]
pub struct ApiError {
pub sub_code: String,
pub error_identifier: u16,
pub error_message: String,
pub error_object: Option<serde_json::Value>,
}
#[derive(Debug, thiserror::Error)]
pub enum ParsingError {
#[error("Failed to parse struct: {0}")]
StructParseFailure(&'static str),
#[error("Failed to serialize to {0} format")]
EncodeError(&'static str),
}
#[derive(Clone, Debug, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorType {
InvalidRequestError,
ObjectNotFound,
RouterError,
ProcessingError,
BadGateway,
ServerNotAvailable,
DuplicateRequest,
ValidationError,
ConnectorError,
LockTimeout,
}
// CE Connector Error Errors originating from connector's end
// HE Hyperswitch Error Errors originating from Hyperswitch's end
// IR Invalid Request Error Error caused due to invalid fields and values in API request
// WE Webhook Error Errors related to Webhooks
#[derive(Debug, Clone, router_derive::ApiError)]
#[error(error_type_enum = ErrorType)]
pub enum ApiErrorResponse {
#[error(error_type = ErrorType::ConnectorError, code = "CE_00", message = "{code}: {message}", ignore = "status_code")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_75_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
}
#[derive(Clone, Debug, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorType {
InvalidRequestError,
ObjectNotFound,
RouterError,
ProcessingError,
BadGateway,
ServerNotAvailable,
DuplicateRequest,
ValidationError,
ConnectorError,
LockTimeout,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_75_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
}
#[derive(Clone, Debug, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorType {
InvalidRequestError,
ObjectNotFound,
RouterError,
ProcessingError,
BadGateway,
ServerNotAvailable,
DuplicateRequest,
ValidationError,
ConnectorError,
LockTimeout,
}
// CE Connector Error Errors originating from connector's end
// HE Hyperswitch Error Errors originating from Hyperswitch's end
// IR Invalid Request Error Error caused due to invalid fields and values in API request
// WE Webhook Error Errors related to Webhooks
#[derive(Debug, Clone, router_derive::ApiError)]
#[error(error_type_enum = ErrorType)]
pub enum ApiErrorResponse {
#[error(error_type = ErrorType::ConnectorError, code = "CE_00", message = "{code}: {message}", ignore = "status_code")]
ExternalConnectorError {
code: String,
message: String,
connector: String,
status_code: u16,
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_75_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
}
#[derive(Clone, Debug, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorType {
InvalidRequestError,
ObjectNotFound,
RouterError,
ProcessingError,
BadGateway,
ServerNotAvailable,
DuplicateRequest,
ValidationError,
ConnectorError,
LockTimeout,
}
// CE Connector Error Errors originating from connector's end
// HE Hyperswitch Error Errors originating from Hyperswitch's end
// IR Invalid Request Error Error caused due to invalid fields and values in API request
// WE Webhook Error Errors related to Webhooks
#[derive(Debug, Clone, router_derive::ApiError)]
#[error(error_type_enum = ErrorType)]
pub enum ApiErrorResponse {
#[error(error_type = ErrorType::ConnectorError, code = "CE_00", message = "{code}: {message}", ignore = "status_code")]
ExternalConnectorError {
code: String,
message: String,
connector: String,
status_code: u16,
reason: Option<String>,
},
#[error(error_type = ErrorType::ProcessingError, code = "CE_01", message = "Payment failed during authorization with connector. Retry payment")]
PaymentAuthorizationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_02", message = "Payment failed during authentication with connector. Retry payment")]
PaymentAuthenticationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_03", message = "Capture attempt failed while processing with connector")]
PaymentCaptureFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_04", message = "The card data is invalid")]
InvalidCardData { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_05", message = "The card has expired")]
CardExpired { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_06", message = "Refund failed while processing with connector. Retry refund")]
RefundFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_07", message = "Verification failed while processing with connector. Retry operation")]
VerificationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_08", message = "Dispute operation failed while processing with connector. Retry operation")]
DisputeFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::LockTimeout, code = "HE_00", message = "Resource is busy. Please try again later.")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_100_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ExternalConnectorError {
code: String,
message: String,
connector: String,
status_code: u16,
reason: Option<String>,
},
#[error(error_type = ErrorType::ProcessingError, code = "CE_01", message = "Payment failed during authorization with connector. Retry payment")]
PaymentAuthorizationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_02", message = "Payment failed during authentication with connector. Retry payment")]
PaymentAuthenticationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_03", message = "Capture attempt failed while processing with connector")]
PaymentCaptureFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_04", message = "The card data is invalid")]
InvalidCardData { data: Option<serde_json::Value> },
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_100_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ExternalConnectorError {
code: String,
message: String,
connector: String,
status_code: u16,
reason: Option<String>,
},
#[error(error_type = ErrorType::ProcessingError, code = "CE_01", message = "Payment failed during authorization with connector. Retry payment")]
PaymentAuthorizationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_02", message = "Payment failed during authentication with connector. Retry payment")]
PaymentAuthenticationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_03", message = "Capture attempt failed while processing with connector")]
PaymentCaptureFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_04", message = "The card data is invalid")]
InvalidCardData { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_05", message = "The card has expired")]
CardExpired { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_06", message = "Refund failed while processing with connector. Retry refund")]
RefundFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_07", message = "Verification failed while processing with connector. Retry operation")]
VerificationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_08", message = "Dispute operation failed while processing with connector. Retry operation")]
DisputeFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::LockTimeout, code = "HE_00", message = "Resource is busy. Please try again later.")]
ResourceBusy,
#[error(error_type = ErrorType::ServerNotAvailable, code = "HE_00", message = "Something went wrong")]
InternalServerError,
#[error(error_type = ErrorType::ServerNotAvailable, code= "HE_00", message = "{component} health check is failing with error: {message}")]
HealthCheckError {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_100_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ExternalConnectorError {
code: String,
message: String,
connector: String,
status_code: u16,
reason: Option<String>,
},
#[error(error_type = ErrorType::ProcessingError, code = "CE_01", message = "Payment failed during authorization with connector. Retry payment")]
PaymentAuthorizationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_02", message = "Payment failed during authentication with connector. Retry payment")]
PaymentAuthenticationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_03", message = "Capture attempt failed while processing with connector")]
PaymentCaptureFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_04", message = "The card data is invalid")]
InvalidCardData { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_05", message = "The card has expired")]
CardExpired { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_06", message = "Refund failed while processing with connector. Retry refund")]
RefundFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_07", message = "Verification failed while processing with connector. Retry operation")]
VerificationFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::ProcessingError, code = "CE_08", message = "Dispute operation failed while processing with connector. Retry operation")]
DisputeFailed { data: Option<serde_json::Value> },
#[error(error_type = ErrorType::LockTimeout, code = "HE_00", message = "Resource is busy. Please try again later.")]
ResourceBusy,
#[error(error_type = ErrorType::ServerNotAvailable, code = "HE_00", message = "Something went wrong")]
InternalServerError,
#[error(error_type = ErrorType::ServerNotAvailable, code= "HE_00", message = "{component} health check is failing with error: {message}")]
HealthCheckError {
component: &'static str,
message: String,
},
#[error(error_type = ErrorType::ValidationError, code = "HE_00", message = "Failed to convert currency to minor unit")]
CurrencyConversionFailed,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate refund request. Refund already attempted with the refund ID")]
DuplicateRefundRequest,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate mandate request. Mandate already attempted with the Mandate ID")]
DuplicateMandate,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The merchant account with the specified details already exists in our records")]
DuplicateMerchantAccount,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The merchant connector account with the specified profile_id '{profile_id}' and connector_label '{connector_label}' already exists in our records")]
DuplicateMerchantConnectorAccount {
profile_id: String,
connector_label: String,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment method with the specified details already exists in our records")]
DuplicatePaymentMethod,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment with the specified payment_id already exists in our records")]
DuplicatePayment {
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_125_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ResourceBusy,
#[error(error_type = ErrorType::ServerNotAvailable, code = "HE_00", message = "Something went wrong")]
InternalServerError,
#[error(error_type = ErrorType::ServerNotAvailable, code= "HE_00", message = "{component} health check is failing with error: {message}")]
HealthCheckError {
component: &'static str,
message: String,
},
#[error(error_type = ErrorType::ValidationError, code = "HE_00", message = "Failed to convert currency to minor unit")]
CurrencyConversionFailed,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate refund request. Refund already attempted with the refund ID")]
DuplicateRefundRequest,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate mandate request. Mandate already attempted with the Mandate ID")]
DuplicateMandate,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The merchant account with the specified details already exists in our records")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_125_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ResourceBusy,
#[error(error_type = ErrorType::ServerNotAvailable, code = "HE_00", message = "Something went wrong")]
InternalServerError,
#[error(error_type = ErrorType::ServerNotAvailable, code= "HE_00", message = "{component} health check is failing with error: {message}")]
HealthCheckError {
component: &'static str,
message: String,
},
#[error(error_type = ErrorType::ValidationError, code = "HE_00", message = "Failed to convert currency to minor unit")]
CurrencyConversionFailed,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate refund request. Refund already attempted with the refund ID")]
DuplicateRefundRequest,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate mandate request. Mandate already attempted with the Mandate ID")]
DuplicateMandate,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The merchant account with the specified details already exists in our records")]
DuplicateMerchantAccount,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The merchant connector account with the specified profile_id '{profile_id}' and connector_label '{connector_label}' already exists in our records")]
DuplicateMerchantConnectorAccount {
profile_id: String,
connector_label: String,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment method with the specified details already exists in our records")]
DuplicatePaymentMethod,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment with the specified payment_id already exists in our records")]
DuplicatePayment {
payment_id: common_utils::id_type::PaymentId,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payout with the specified payout_id '{payout_id}' already exists in our records")]
DuplicatePayout { payout_id: String },
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The config with the specified key already exists in our records")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_125_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ResourceBusy,
#[error(error_type = ErrorType::ServerNotAvailable, code = "HE_00", message = "Something went wrong")]
InternalServerError,
#[error(error_type = ErrorType::ServerNotAvailable, code= "HE_00", message = "{component} health check is failing with error: {message}")]
HealthCheckError {
component: &'static str,
message: String,
},
#[error(error_type = ErrorType::ValidationError, code = "HE_00", message = "Failed to convert currency to minor unit")]
CurrencyConversionFailed,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate refund request. Refund already attempted with the refund ID")]
DuplicateRefundRequest,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "Duplicate mandate request. Mandate already attempted with the Mandate ID")]
DuplicateMandate,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The merchant account with the specified details already exists in our records")]
DuplicateMerchantAccount,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The merchant connector account with the specified profile_id '{profile_id}' and connector_label '{connector_label}' already exists in our records")]
DuplicateMerchantConnectorAccount {
profile_id: String,
connector_label: String,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment method with the specified details already exists in our records")]
DuplicatePaymentMethod,
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment with the specified payment_id already exists in our records")]
DuplicatePayment {
payment_id: common_utils::id_type::PaymentId,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payout with the specified payout_id '{payout_id}' already exists in our records")]
DuplicatePayout { payout_id: String },
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The config with the specified key already exists in our records")]
DuplicateConfig,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Refund does not exist in our records")]
RefundNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment Link does not exist in our records")]
PaymentLinkNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Customer does not exist in our records")]
CustomerNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Config key does not exist in our records.")]
ConfigNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment does not exist in our records")]
PaymentNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment method does not exist in our records")]
PaymentMethodNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant account does not exist in our records")]
MerchantAccountNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant connector account does not exist in our records")]
MerchantConnectorAccountNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Business profile with the given id '{id}' does not exist in our records")]
ProfileNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Profile acquirer with id '{profile_acquirer_id}' not found for profile '{profile_id}'.")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_150_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
payment_id: common_utils::id_type::PaymentId,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payout with the specified payout_id '{payout_id}' already exists in our records")]
DuplicatePayout { payout_id: String },
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The config with the specified key already exists in our records")]
DuplicateConfig,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Refund does not exist in our records")]
RefundNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment Link does not exist in our records")]
PaymentLinkNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Customer does not exist in our records")]
CustomerNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Config key does not exist in our records.")]
ConfigNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment does not exist in our records")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_150_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
payment_id: common_utils::id_type::PaymentId,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payout with the specified payout_id '{payout_id}' already exists in our records")]
DuplicatePayout { payout_id: String },
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The config with the specified key already exists in our records")]
DuplicateConfig,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Refund does not exist in our records")]
RefundNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment Link does not exist in our records")]
PaymentLinkNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Customer does not exist in our records")]
CustomerNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Config key does not exist in our records.")]
ConfigNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment does not exist in our records")]
PaymentNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment method does not exist in our records")]
PaymentMethodNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant account does not exist in our records")]
MerchantAccountNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant connector account does not exist in our records")]
MerchantConnectorAccountNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Business profile with the given id '{id}' does not exist in our records")]
ProfileNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Profile acquirer with id '{profile_acquirer_id}' not found for profile '{profile_id}'.")]
ProfileAcquirerNotFound {
profile_acquirer_id: String,
profile_id: String,
},
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Poll with the given id '{id}' does not exist in our records")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_150_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
payment_id: common_utils::id_type::PaymentId,
},
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payout with the specified payout_id '{payout_id}' already exists in our records")]
DuplicatePayout { payout_id: String },
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The config with the specified key already exists in our records")]
DuplicateConfig,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Refund does not exist in our records")]
RefundNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment Link does not exist in our records")]
PaymentLinkNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Customer does not exist in our records")]
CustomerNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Config key does not exist in our records.")]
ConfigNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment does not exist in our records")]
PaymentNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payment method does not exist in our records")]
PaymentMethodNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant account does not exist in our records")]
MerchantAccountNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant connector account does not exist in our records")]
MerchantConnectorAccountNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Business profile with the given id '{id}' does not exist in our records")]
ProfileNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Profile acquirer with id '{profile_acquirer_id}' not found for profile '{profile_id}'.")]
ProfileAcquirerNotFound {
profile_acquirer_id: String,
profile_id: String,
},
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Poll with the given id '{id}' does not exist in our records")]
PollNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Resource ID does not exist in our records")]
ResourceIdNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Mandate does not exist in our records")]
MandateNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Authentication does not exist in our records")]
AuthenticationNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Failed to update mandate")]
MandateUpdateFailed,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "API Key does not exist in our records")]
ApiKeyNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payout does not exist in our records")]
PayoutNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Event does not exist in our records")]
EventNotFound,
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "Invalid mandate id passed from connector")]
MandateSerializationFailed,
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "Unable to parse the mandate identifier passed from connector")]
MandateDeserializationFailed,
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "Return URL is not configured and not passed in payments request")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_175_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ProfileAcquirerNotFound {
profile_acquirer_id: String,
profile_id: String,
},
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Poll with the given id '{id}' does not exist in our records")]
PollNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Resource ID does not exist in our records")]
ResourceIdNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Mandate does not exist in our records")]
MandateNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Authentication does not exist in our records")]
AuthenticationNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Failed to update mandate")]
MandateUpdateFailed,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "API Key does not exist in our records")]
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_4311916100995806462_175_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/errors.rs
ProfileAcquirerNotFound {
profile_acquirer_id: String,
profile_id: String,
},
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Poll with the given id '{id}' does not exist in our records")]
PollNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Resource ID does not exist in our records")]
ResourceIdNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Mandate does not exist in our records")]
MandateNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Authentication does not exist in our records")]
AuthenticationNotFound { id: String },
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Failed to update mandate")]
MandateUpdateFailed,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "API Key does not exist in our records")]
ApiKeyNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Payout does not exist in our records")]
PayoutNotFound,
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Event does not exist in our records")]
EventNotFound,
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "Invalid mandate id passed from connector")]
MandateSerializationFailed,
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "Unable to parse the mandate identifier passed from connector")]
MandateDeserializationFailed,
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "Return URL is not configured and not passed in payments request")]
ReturnUrlUnavailable,
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "This refund is not possible through Hyperswitch. Please raise the refund through {connector} dashboard")]
RefundNotPossible { connector: String },
#[error(error_type = ErrorType::ValidationError, code = "HE_03", message = "Mandate Validation Failed" )]
MandateValidationFailed { reason: String },
|
{
"chunk": null,
"crate": "domain_types",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.