id
stringlengths 20
153
| type
stringclasses 1
value | granularity
stringclasses 14
values | content
stringlengths 16
84.3k
| metadata
dict |
|---|---|---|---|---|
connector-service_snippet_6123773352099696515_0_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
use std::collections::HashMap;
use common_utils::Method;
#[derive(Debug, Eq, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
pub enum RedirectForm {
Form {
endpoint: String,
method: Method,
form_fields: HashMap<String, String>,
},
Html {
html_data: String,
},
BlueSnap {
|
{
"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_6123773352099696515_0_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
use std::collections::HashMap;
use common_utils::Method;
#[derive(Debug, Eq, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
pub enum RedirectForm {
Form {
endpoint: String,
method: Method,
form_fields: HashMap<String, String>,
},
Html {
html_data: String,
},
BlueSnap {
payment_fields_token: String, // payment-field-token
},
CybersourceAuthSetup {
access_token: String,
ddc_url: String,
reference_id: String,
},
CybersourceConsumerAuth {
access_token: String,
step_up_url: String,
},
DeutschebankThreeDSChallengeFlow {
acs_url: String,
creq: 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_6123773352099696515_0_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
use std::collections::HashMap;
use common_utils::Method;
#[derive(Debug, Eq, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
pub enum RedirectForm {
Form {
endpoint: String,
method: Method,
form_fields: HashMap<String, String>,
},
Html {
html_data: String,
},
BlueSnap {
payment_fields_token: String, // payment-field-token
},
CybersourceAuthSetup {
access_token: String,
ddc_url: String,
reference_id: String,
},
CybersourceConsumerAuth {
access_token: String,
step_up_url: String,
},
DeutschebankThreeDSChallengeFlow {
acs_url: String,
creq: String,
},
Payme,
Braintree {
client_token: String,
card_token: String,
bin: String,
acs_url: String,
},
Nmi {
amount: String,
currency: common_enums::Currency,
public_key: hyperswitch_masking::Secret<String>,
customer_vault_id: String,
order_id: String,
},
Mifinity {
initialization_token: String,
},
WorldpayDDCForm {
endpoint: url::Url,
method: 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": 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_6123773352099696515_25_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
},
DeutschebankThreeDSChallengeFlow {
acs_url: String,
creq: String,
},
Payme,
Braintree {
client_token: String,
card_token: String,
bin: String,
acs_url: String,
},
Nmi {
amount: String,
currency: common_enums::Currency,
|
{
"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_6123773352099696515_25_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
},
DeutschebankThreeDSChallengeFlow {
acs_url: String,
creq: String,
},
Payme,
Braintree {
client_token: String,
card_token: String,
bin: String,
acs_url: String,
},
Nmi {
amount: String,
currency: common_enums::Currency,
public_key: hyperswitch_masking::Secret<String>,
customer_vault_id: String,
order_id: String,
},
Mifinity {
initialization_token: String,
},
WorldpayDDCForm {
endpoint: url::Url,
method: Method,
form_fields: HashMap<String, String>,
collection_id: Option<String>,
},
Uri {
uri: 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": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_6123773352099696515_25_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
},
DeutschebankThreeDSChallengeFlow {
acs_url: String,
creq: String,
},
Payme,
Braintree {
client_token: String,
card_token: String,
bin: String,
acs_url: String,
},
Nmi {
amount: String,
currency: common_enums::Currency,
public_key: hyperswitch_masking::Secret<String>,
customer_vault_id: String,
order_id: String,
},
Mifinity {
initialization_token: String,
},
WorldpayDDCForm {
endpoint: url::Url,
method: Method,
form_fields: HashMap<String, String>,
collection_id: Option<String>,
},
Uri {
uri: String,
},
}
impl From<(url::Url, Method)> for RedirectForm {
fn from((mut redirect_url, method): (url::Url, Method)) -> Self {
let form_fields = HashMap::from_iter(
redirect_url
.query_pairs()
.map(|(key, value)| (key.to_string(), value.to_string())),
);
// Do not include query params in the endpoint
redirect_url.set_query(None);
Self::Form {
endpoint: redirect_url.to_string(),
method,
form_fields,
}
}
|
{
"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_6123773352099696515_50_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
form_fields: HashMap<String, String>,
collection_id: Option<String>,
},
Uri {
uri: String,
},
}
impl From<(url::Url, Method)> for RedirectForm {
fn from((mut redirect_url, method): (url::Url, Method)) -> Self {
let form_fields = HashMap::from_iter(
redirect_url
.query_pairs()
.map(|(key, value)| (key.to_string(), value.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": 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_6123773352099696515_50_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
form_fields: HashMap<String, String>,
collection_id: Option<String>,
},
Uri {
uri: String,
},
}
impl From<(url::Url, Method)> for RedirectForm {
fn from((mut redirect_url, method): (url::Url, Method)) -> Self {
let form_fields = HashMap::from_iter(
redirect_url
.query_pairs()
.map(|(key, value)| (key.to_string(), value.to_string())),
);
// Do not include query params in the endpoint
redirect_url.set_query(None);
Self::Form {
endpoint: redirect_url.to_string(),
method,
form_fields,
}
}
}
#[derive(Clone, Debug)]
pub struct Response {
/// headers
|
{
"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_6123773352099696515_50_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
form_fields: HashMap<String, String>,
collection_id: Option<String>,
},
Uri {
uri: String,
},
}
impl From<(url::Url, Method)> for RedirectForm {
fn from((mut redirect_url, method): (url::Url, Method)) -> Self {
let form_fields = HashMap::from_iter(
redirect_url
.query_pairs()
.map(|(key, value)| (key.to_string(), value.to_string())),
);
// Do not include query params in the endpoint
redirect_url.set_query(None);
Self::Form {
endpoint: redirect_url.to_string(),
method,
form_fields,
}
}
}
#[derive(Clone, Debug)]
pub struct Response {
/// headers
pub headers: Option<http::HeaderMap>,
/// response
pub response: bytes::Bytes,
/// status code
pub 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": 36,
"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_6123773352099696515_75_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
}
#[derive(Clone, Debug)]
pub struct Response {
/// headers
pub headers: Option<http::HeaderMap>,
/// response
pub response: bytes::Bytes,
/// status code
pub 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": 11,
"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_6123773352099696515_75_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
}
#[derive(Clone, Debug)]
pub struct Response {
/// headers
pub headers: Option<http::HeaderMap>,
/// response
pub response: bytes::Bytes,
/// status code
pub 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": 11,
"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_6123773352099696515_75_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/router_response_types.rs
}
#[derive(Clone, Debug)]
pub struct Response {
/// headers
pub headers: Option<http::HeaderMap>,
/// response
pub response: bytes::Bytes,
/// status code
pub 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": 11,
"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_-4017303140956931129_0_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
use std::fmt::Debug;
use base64::Engine;
use common_enums::{CardNetwork, CountryAlpha2, RegulatedName, SamsungPayCardBrand};
use common_utils::{
ext_traits::OptionExt, new_types::MaskedBankAccount, pii::UpiVpaMaskingStrategy, Email,
ValidationError,
};
use error_stack::{self, ResultExt};
use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use time::Date;
use utoipa::ToSchema;
use crate::{
|
{
"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_-4017303140956931129_0_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
use std::fmt::Debug;
use base64::Engine;
use common_enums::{CardNetwork, CountryAlpha2, RegulatedName, SamsungPayCardBrand};
use common_utils::{
ext_traits::OptionExt, new_types::MaskedBankAccount, pii::UpiVpaMaskingStrategy, Email,
ValidationError,
};
use error_stack::{self, ResultExt};
use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use time::Date;
use utoipa::ToSchema;
use crate::{
errors,
router_data::NetworkTokenNumber,
utils::{get_card_issuer, missing_field_err, CardIssuer, Error},
};
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Default)]
pub struct Card<T: PaymentMethodDataTypes> {
pub card_number: RawCardNumber<T>,
pub card_exp_month: Secret<String>,
pub card_exp_year: Secret<String>,
pub card_cvc: Secret<String>,
pub card_issuer: Option<String>,
pub card_network: Option<CardNetwork>,
pub card_type: Option<String>,
pub card_issuing_country: 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": 0,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_0_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
use std::fmt::Debug;
use base64::Engine;
use common_enums::{CardNetwork, CountryAlpha2, RegulatedName, SamsungPayCardBrand};
use common_utils::{
ext_traits::OptionExt, new_types::MaskedBankAccount, pii::UpiVpaMaskingStrategy, Email,
ValidationError,
};
use error_stack::{self, ResultExt};
use hyperswitch_masking::{ExposeInterface, PeekInterface, Secret};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use time::Date;
use utoipa::ToSchema;
use crate::{
errors,
router_data::NetworkTokenNumber,
utils::{get_card_issuer, missing_field_err, CardIssuer, Error},
};
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Default)]
pub struct Card<T: PaymentMethodDataTypes> {
pub card_number: RawCardNumber<T>,
pub card_exp_month: Secret<String>,
pub card_exp_year: Secret<String>,
pub card_cvc: Secret<String>,
pub card_issuer: Option<String>,
pub card_network: Option<CardNetwork>,
pub card_type: Option<String>,
pub card_issuing_country: Option<String>,
pub bank_code: Option<String>,
pub nick_name: Option<Secret<String>>,
pub card_holder_name: Option<Secret<String>>,
pub co_badged_card_data: Option<CoBadgedCardData>,
}
pub trait PaymentMethodDataTypes: Clone {
type Inner: Default + Debug + Send + Eq + PartialEq + Serialize + DeserializeOwned + Clone;
}
/// PCI holder implementation for handling raw PCI data
#[derive(Default, Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub struct DefaultPCIHolder;
/// Vault token holder implementation for handling vault token data
#[derive(Default, Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub struct VaultTokenHolder;
/// Generic CardNumber struct that uses PaymentMethodDataTypes trait
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct RawCardNumber<T: PaymentMethodDataTypes>(pub T::Inner);
|
{
"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_-4017303140956931129_25_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub card_cvc: Secret<String>,
pub card_issuer: Option<String>,
pub card_network: Option<CardNetwork>,
pub card_type: Option<String>,
pub card_issuing_country: Option<String>,
pub bank_code: Option<String>,
pub nick_name: Option<Secret<String>>,
pub card_holder_name: Option<Secret<String>>,
pub co_badged_card_data: Option<CoBadgedCardData>,
}
pub trait PaymentMethodDataTypes: Clone {
type Inner: Default + Debug + Send + Eq + PartialEq + Serialize + DeserializeOwned + 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": 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_-4017303140956931129_25_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub card_cvc: Secret<String>,
pub card_issuer: Option<String>,
pub card_network: Option<CardNetwork>,
pub card_type: Option<String>,
pub card_issuing_country: Option<String>,
pub bank_code: Option<String>,
pub nick_name: Option<Secret<String>>,
pub card_holder_name: Option<Secret<String>>,
pub co_badged_card_data: Option<CoBadgedCardData>,
}
pub trait PaymentMethodDataTypes: Clone {
type Inner: Default + Debug + Send + Eq + PartialEq + Serialize + DeserializeOwned + Clone;
}
/// PCI holder implementation for handling raw PCI data
#[derive(Default, Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub struct DefaultPCIHolder;
/// Vault token holder implementation for handling vault token data
#[derive(Default, Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub struct VaultTokenHolder;
/// Generic CardNumber struct that uses PaymentMethodDataTypes trait
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct RawCardNumber<T: PaymentMethodDataTypes>(pub T::Inner);
impl RawCardNumber<DefaultPCIHolder> {
pub fn peek(&self) -> &str {
self.0.peek()
}
|
{
"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_-4017303140956931129_25_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub card_cvc: Secret<String>,
pub card_issuer: Option<String>,
pub card_network: Option<CardNetwork>,
pub card_type: Option<String>,
pub card_issuing_country: Option<String>,
pub bank_code: Option<String>,
pub nick_name: Option<Secret<String>>,
pub card_holder_name: Option<Secret<String>>,
pub co_badged_card_data: Option<CoBadgedCardData>,
}
pub trait PaymentMethodDataTypes: Clone {
type Inner: Default + Debug + Send + Eq + PartialEq + Serialize + DeserializeOwned + Clone;
}
/// PCI holder implementation for handling raw PCI data
#[derive(Default, Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub struct DefaultPCIHolder;
/// Vault token holder implementation for handling vault token data
#[derive(Default, Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
pub struct VaultTokenHolder;
/// Generic CardNumber struct that uses PaymentMethodDataTypes trait
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct RawCardNumber<T: PaymentMethodDataTypes>(pub T::Inner);
impl RawCardNumber<DefaultPCIHolder> {
pub fn peek(&self) -> &str {
self.0.peek()
}
}
impl RawCardNumber<VaultTokenHolder> {
pub fn peek(&self) -> &str {
&self.0
}
}
impl PaymentMethodDataTypes for DefaultPCIHolder {
type Inner = cards::CardNumber;
}
impl PaymentMethodDataTypes for VaultTokenHolder {
type Inner = String; //Token
}
// Generic implementation for all Card<T> types
impl<T: PaymentMethodDataTypes> Card<T> {
pub fn get_card_expiry_year_2_digit(
&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": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_50_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
impl RawCardNumber<DefaultPCIHolder> {
pub fn peek(&self) -> &str {
self.0.peek()
}
}
impl RawCardNumber<VaultTokenHolder> {
pub fn peek(&self) -> &str {
&self.0
}
}
impl PaymentMethodDataTypes for DefaultPCIHolder {
type Inner = cards::CardNumber;
|
{
"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_-4017303140956931129_50_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
impl RawCardNumber<DefaultPCIHolder> {
pub fn peek(&self) -> &str {
self.0.peek()
}
}
impl RawCardNumber<VaultTokenHolder> {
pub fn peek(&self) -> &str {
&self.0
}
}
impl PaymentMethodDataTypes for DefaultPCIHolder {
type Inner = cards::CardNumber;
}
impl PaymentMethodDataTypes for VaultTokenHolder {
type Inner = String; //Token
}
// Generic implementation for all Card<T> types
impl<T: PaymentMethodDataTypes> Card<T> {
pub fn get_card_expiry_year_2_digit(
&self,
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let binding = self.card_exp_year.clone();
let year = binding.peek();
Ok(Secret::new(
year.get(year.len() - 2..)
|
{
"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_-4017303140956931129_50_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
impl RawCardNumber<DefaultPCIHolder> {
pub fn peek(&self) -> &str {
self.0.peek()
}
}
impl RawCardNumber<VaultTokenHolder> {
pub fn peek(&self) -> &str {
&self.0
}
}
impl PaymentMethodDataTypes for DefaultPCIHolder {
type Inner = cards::CardNumber;
}
impl PaymentMethodDataTypes for VaultTokenHolder {
type Inner = String; //Token
}
// Generic implementation for all Card<T> types
impl<T: PaymentMethodDataTypes> Card<T> {
pub fn get_card_expiry_year_2_digit(
&self,
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let binding = self.card_exp_year.clone();
let year = binding.peek();
Ok(Secret::new(
year.get(year.len() - 2..)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
.to_string(),
))
}
pub fn get_card_expiry_month_year_2_digit_with_delimiter(
&self,
delimiter: String,
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?;
Ok(Secret::new(format!(
"{}{}{}",
self.card_exp_month.peek(),
delimiter,
year.peek()
)))
}
pub fn get_expiry_year_4_digit(&self) -> Secret<String> {
let mut year = self.card_exp_year.peek().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": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_75_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let binding = self.card_exp_year.clone();
let year = binding.peek();
Ok(Secret::new(
year.get(year.len() - 2..)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
.to_string(),
))
}
pub fn get_card_expiry_month_year_2_digit_with_delimiter(
&self,
delimiter: String,
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?;
|
{
"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_-4017303140956931129_75_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let binding = self.card_exp_year.clone();
let year = binding.peek();
Ok(Secret::new(
year.get(year.len() - 2..)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
.to_string(),
))
}
pub fn get_card_expiry_month_year_2_digit_with_delimiter(
&self,
delimiter: String,
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?;
Ok(Secret::new(format!(
"{}{}{}",
self.card_exp_month.peek(),
delimiter,
year.peek()
)))
}
pub fn get_expiry_year_4_digit(&self) -> Secret<String> {
let mut year = self.card_exp_year.peek().clone();
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
|
{
"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_-4017303140956931129_75_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let binding = self.card_exp_year.clone();
let year = binding.peek();
Ok(Secret::new(
year.get(year.len() - 2..)
.ok_or(crate::errors::ConnectorError::RequestEncodingFailed)?
.to_string(),
))
}
pub fn get_card_expiry_month_year_2_digit_with_delimiter(
&self,
delimiter: String,
) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?;
Ok(Secret::new(format!(
"{}{}{}",
self.card_exp_month.peek(),
delimiter,
year.peek()
)))
}
pub fn get_expiry_year_4_digit(&self) -> Secret<String> {
let mut year = self.card_exp_year.peek().clone();
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
pub fn get_expiry_month_as_i8(&self) -> Result<Secret<i8>, Error> {
self.card_exp_month
.peek()
.clone()
.parse::<i8>()
.change_context(crate::errors::ConnectorError::ResponseDeserializationFailed)
.map(Secret::new)
}
}
impl Card<DefaultPCIHolder> {
pub fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
get_card_issuer(self.card_number.peek())
}
pub fn get_expiry_date_as_yyyymm(&self, delimiter: &str) -> Secret<String> {
let year = self.get_expiry_year_4_digit();
Secret::new(format!(
"{}{}{}",
year.peek(),
|
{
"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_-4017303140956931129_100_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
pub fn get_expiry_month_as_i8(&self) -> Result<Secret<i8>, Error> {
self.card_exp_month
.peek()
.clone()
.parse::<i8>()
.change_context(crate::errors::ConnectorError::ResponseDeserializationFailed)
.map(Secret::new)
}
}
|
{
"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_-4017303140956931129_100_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
pub fn get_expiry_month_as_i8(&self) -> Result<Secret<i8>, Error> {
self.card_exp_month
.peek()
.clone()
.parse::<i8>()
.change_context(crate::errors::ConnectorError::ResponseDeserializationFailed)
.map(Secret::new)
}
}
impl Card<DefaultPCIHolder> {
pub fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
get_card_issuer(self.card_number.peek())
}
pub fn get_expiry_date_as_yyyymm(&self, delimiter: &str) -> Secret<String> {
let year = self.get_expiry_year_4_digit();
Secret::new(format!(
"{}{}{}",
year.peek(),
delimiter,
self.card_exp_month.peek()
))
}
pub fn get_expiry_date_as_mmyyyy(&self, delimiter: &str) -> 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": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_100_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
pub fn get_expiry_month_as_i8(&self) -> Result<Secret<i8>, Error> {
self.card_exp_month
.peek()
.clone()
.parse::<i8>()
.change_context(crate::errors::ConnectorError::ResponseDeserializationFailed)
.map(Secret::new)
}
}
impl Card<DefaultPCIHolder> {
pub fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
get_card_issuer(self.card_number.peek())
}
pub fn get_expiry_date_as_yyyymm(&self, delimiter: &str) -> Secret<String> {
let year = self.get_expiry_year_4_digit();
Secret::new(format!(
"{}{}{}",
year.peek(),
delimiter,
self.card_exp_month.peek()
))
}
pub fn get_expiry_date_as_mmyyyy(&self, delimiter: &str) -> Secret<String> {
let year = self.get_expiry_year_4_digit();
Secret::new(format!(
"{}{}{}",
self.card_exp_month.peek(),
delimiter,
year.peek()
))
}
pub fn get_expiry_date_as_yymm(&self) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?.expose();
let month = self.card_exp_month.clone().expose();
Ok(Secret::new(format!("{year}{month}")))
}
pub fn get_expiry_year_as_i32(&self) -> Result<Secret<i32>, Error> {
self.card_exp_year
.peek()
.clone()
.parse::<i32>()
.change_context(crate::errors::ConnectorError::ResponseDeserializationFailed)
.map(Secret::new)
|
{
"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_-4017303140956931129_125_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
delimiter,
self.card_exp_month.peek()
))
}
pub fn get_expiry_date_as_mmyyyy(&self, delimiter: &str) -> Secret<String> {
let year = self.get_expiry_year_4_digit();
Secret::new(format!(
"{}{}{}",
self.card_exp_month.peek(),
delimiter,
year.peek()
))
}
pub fn get_expiry_date_as_yymm(&self) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?.expose();
|
{
"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_-4017303140956931129_125_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
delimiter,
self.card_exp_month.peek()
))
}
pub fn get_expiry_date_as_mmyyyy(&self, delimiter: &str) -> Secret<String> {
let year = self.get_expiry_year_4_digit();
Secret::new(format!(
"{}{}{}",
self.card_exp_month.peek(),
delimiter,
year.peek()
))
}
pub fn get_expiry_date_as_yymm(&self) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?.expose();
let month = self.card_exp_month.clone().expose();
Ok(Secret::new(format!("{year}{month}")))
}
pub fn get_expiry_year_as_i32(&self) -> Result<Secret<i32>, Error> {
self.card_exp_year
.peek()
.clone()
.parse::<i32>()
.change_context(crate::errors::ConnectorError::ResponseDeserializationFailed)
.map(Secret::new)
}
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum PaymentMethodData<T: PaymentMethodDataTypes> {
|
{
"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_-4017303140956931129_125_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
delimiter,
self.card_exp_month.peek()
))
}
pub fn get_expiry_date_as_mmyyyy(&self, delimiter: &str) -> Secret<String> {
let year = self.get_expiry_year_4_digit();
Secret::new(format!(
"{}{}{}",
self.card_exp_month.peek(),
delimiter,
year.peek()
))
}
pub fn get_expiry_date_as_yymm(&self) -> Result<Secret<String>, crate::errors::ConnectorError> {
let year = self.get_card_expiry_year_2_digit()?.expose();
let month = self.card_exp_month.clone().expose();
Ok(Secret::new(format!("{year}{month}")))
}
pub fn get_expiry_year_as_i32(&self) -> Result<Secret<i32>, Error> {
self.card_exp_year
.peek()
.clone()
.parse::<i32>()
.change_context(crate::errors::ConnectorError::ResponseDeserializationFailed)
.map(Secret::new)
}
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum PaymentMethodData<T: PaymentMethodDataTypes> {
Card(Card<T>),
CardDetailsForNetworkTransactionId(CardDetailsForNetworkTransactionId),
CardRedirect(CardRedirectData),
Wallet(WalletData),
PayLater(PayLaterData),
BankRedirect(BankRedirectData),
BankDebit(BankDebitData),
BankTransfer(Box<BankTransferData>),
Crypto(CryptoData),
MandatePayment,
Reward,
RealTimePayment(Box<RealTimePaymentData>),
Upi(UpiData),
Voucher(VoucherData),
GiftCard(Box<GiftCardData>),
CardToken(CardToken),
OpenBanking(OpenBankingData),
NetworkToken(NetworkTokenData),
MobilePayment(MobilePaymentData),
}
|
{
"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_-4017303140956931129_150_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
}
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum PaymentMethodData<T: PaymentMethodDataTypes> {
Card(Card<T>),
CardDetailsForNetworkTransactionId(CardDetailsForNetworkTransactionId),
CardRedirect(CardRedirectData),
Wallet(WalletData),
PayLater(PayLaterData),
BankRedirect(BankRedirectData),
BankDebit(BankDebitData),
BankTransfer(Box<BankTransferData>),
Crypto(CryptoData),
MandatePayment,
|
{
"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_-4017303140956931129_150_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
}
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum PaymentMethodData<T: PaymentMethodDataTypes> {
Card(Card<T>),
CardDetailsForNetworkTransactionId(CardDetailsForNetworkTransactionId),
CardRedirect(CardRedirectData),
Wallet(WalletData),
PayLater(PayLaterData),
BankRedirect(BankRedirectData),
BankDebit(BankDebitData),
BankTransfer(Box<BankTransferData>),
Crypto(CryptoData),
MandatePayment,
Reward,
RealTimePayment(Box<RealTimePaymentData>),
Upi(UpiData),
Voucher(VoucherData),
GiftCard(Box<GiftCardData>),
CardToken(CardToken),
OpenBanking(OpenBankingData),
NetworkToken(NetworkTokenData),
MobilePayment(MobilePaymentData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum OpenBankingData {
OpenBankingPIS {},
|
{
"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_-4017303140956931129_150_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
}
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum PaymentMethodData<T: PaymentMethodDataTypes> {
Card(Card<T>),
CardDetailsForNetworkTransactionId(CardDetailsForNetworkTransactionId),
CardRedirect(CardRedirectData),
Wallet(WalletData),
PayLater(PayLaterData),
BankRedirect(BankRedirectData),
BankDebit(BankDebitData),
BankTransfer(Box<BankTransferData>),
Crypto(CryptoData),
MandatePayment,
Reward,
RealTimePayment(Box<RealTimePaymentData>),
Upi(UpiData),
Voucher(VoucherData),
GiftCard(Box<GiftCardData>),
CardToken(CardToken),
OpenBanking(OpenBankingData),
NetworkToken(NetworkTokenData),
MobilePayment(MobilePaymentData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum OpenBankingData {
OpenBankingPIS {},
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum MobilePaymentData {
DirectCarrierBilling {
/// The phone number of the user
msisdn: String,
/// Unique user identifier
client_uid: Option<String>,
},
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Default)]
pub struct NetworkTokenData {
pub network_token: cards::NetworkToken,
pub network_token_exp_month: Secret<String>,
pub network_token_exp_year: Secret<String>,
pub cryptogram: Option<Secret<String>>,
pub card_issuer: Option<String>, //since network token is tied to card, so its issuer will be same as card issuer
|
{
"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_-4017303140956931129_175_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum OpenBankingData {
OpenBankingPIS {},
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum MobilePaymentData {
DirectCarrierBilling {
/// The phone number of the user
msisdn: String,
/// Unique user identifier
client_uid: 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": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_175_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum OpenBankingData {
OpenBankingPIS {},
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum MobilePaymentData {
DirectCarrierBilling {
/// The phone number of the user
msisdn: String,
/// Unique user identifier
client_uid: Option<String>,
},
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Default)]
pub struct NetworkTokenData {
pub network_token: cards::NetworkToken,
pub network_token_exp_month: Secret<String>,
pub network_token_exp_year: Secret<String>,
pub cryptogram: Option<Secret<String>>,
pub card_issuer: Option<String>, //since network token is tied to card, so its issuer will be same as card issuer
pub card_network: Option<common_enums::CardNetwork>,
pub card_type: Option<CardType>,
pub card_issuing_country: Option<common_enums::CountryAlpha2>,
pub bank_code: Option<String>,
pub card_holder_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": 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_-4017303140956931129_175_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum OpenBankingData {
OpenBankingPIS {},
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum MobilePaymentData {
DirectCarrierBilling {
/// The phone number of the user
msisdn: String,
/// Unique user identifier
client_uid: Option<String>,
},
}
#[derive(Eq, PartialEq, Clone, Debug, Serialize, Deserialize, Default)]
pub struct NetworkTokenData {
pub network_token: cards::NetworkToken,
pub network_token_exp_month: Secret<String>,
pub network_token_exp_year: Secret<String>,
pub cryptogram: Option<Secret<String>>,
pub card_issuer: Option<String>, //since network token is tied to card, so its issuer will be same as card issuer
pub card_network: Option<common_enums::CardNetwork>,
pub card_type: Option<CardType>,
pub card_issuing_country: Option<common_enums::CountryAlpha2>,
pub bank_code: Option<String>,
pub card_holder_name: Option<Secret<String>>,
pub nick_name: Option<Secret<String>>,
pub eci: Option<String>,
}
impl NetworkTokenData {
pub fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
get_card_issuer(self.network_token.peek())
}
pub fn get_expiry_year_4_digit(&self) -> Secret<String> {
let mut year = self.network_token_exp_year.peek().clone();
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
pub fn get_network_token(&self) -> NetworkTokenNumber {
self.network_token.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": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_200_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub card_network: Option<common_enums::CardNetwork>,
pub card_type: Option<CardType>,
pub card_issuing_country: Option<common_enums::CountryAlpha2>,
pub bank_code: Option<String>,
pub card_holder_name: Option<Secret<String>>,
pub nick_name: Option<Secret<String>>,
pub eci: Option<String>,
}
impl NetworkTokenData {
pub fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
get_card_issuer(self.network_token.peek())
}
pub fn get_expiry_year_4_digit(&self) -> 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": 200,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_200_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub card_network: Option<common_enums::CardNetwork>,
pub card_type: Option<CardType>,
pub card_issuing_country: Option<common_enums::CountryAlpha2>,
pub bank_code: Option<String>,
pub card_holder_name: Option<Secret<String>>,
pub nick_name: Option<Secret<String>>,
pub eci: Option<String>,
}
impl NetworkTokenData {
pub fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
get_card_issuer(self.network_token.peek())
}
pub fn get_expiry_year_4_digit(&self) -> Secret<String> {
let mut year = self.network_token_exp_year.peek().clone();
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
pub fn get_network_token(&self) -> NetworkTokenNumber {
self.network_token.clone()
}
pub fn get_network_token_expiry_month(&self) -> Secret<String> {
self.network_token_exp_month.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": 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_-4017303140956931129_200_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub card_network: Option<common_enums::CardNetwork>,
pub card_type: Option<CardType>,
pub card_issuing_country: Option<common_enums::CountryAlpha2>,
pub bank_code: Option<String>,
pub card_holder_name: Option<Secret<String>>,
pub nick_name: Option<Secret<String>>,
pub eci: Option<String>,
}
impl NetworkTokenData {
pub fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
get_card_issuer(self.network_token.peek())
}
pub fn get_expiry_year_4_digit(&self) -> Secret<String> {
let mut year = self.network_token_exp_year.peek().clone();
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
pub fn get_network_token(&self) -> NetworkTokenNumber {
self.network_token.clone()
}
pub fn get_network_token_expiry_month(&self) -> Secret<String> {
self.network_token_exp_month.clone()
}
pub fn get_network_token_expiry_year(&self) -> Secret<String> {
self.network_token_exp_year.clone()
}
pub fn get_cryptogram(&self) -> Option<Secret<String>> {
self.cryptogram.clone()
}
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum GiftCardData {
Givex(GiftCardDetails),
PaySafeCard {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub struct GiftCardDetails {
/// The gift card number
|
{
"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_-4017303140956931129_225_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub fn get_network_token_expiry_month(&self) -> Secret<String> {
self.network_token_exp_month.clone()
}
pub fn get_network_token_expiry_year(&self) -> Secret<String> {
self.network_token_exp_year.clone()
}
pub fn get_cryptogram(&self) -> Option<Secret<String>> {
self.cryptogram.clone()
}
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
|
{
"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_-4017303140956931129_225_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub fn get_network_token_expiry_month(&self) -> Secret<String> {
self.network_token_exp_month.clone()
}
pub fn get_network_token_expiry_year(&self) -> Secret<String> {
self.network_token_exp_year.clone()
}
pub fn get_cryptogram(&self) -> Option<Secret<String>> {
self.cryptogram.clone()
}
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum GiftCardData {
Givex(GiftCardDetails),
PaySafeCard {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub struct GiftCardDetails {
/// The gift card number
pub number: Secret<String>,
/// The card verification code.
pub cvc: 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": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_225_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub fn get_network_token_expiry_month(&self) -> Secret<String> {
self.network_token_exp_month.clone()
}
pub fn get_network_token_expiry_year(&self) -> Secret<String> {
self.network_token_exp_year.clone()
}
pub fn get_cryptogram(&self) -> Option<Secret<String>> {
self.cryptogram.clone()
}
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum GiftCardData {
Givex(GiftCardDetails),
PaySafeCard {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub struct GiftCardDetails {
/// The gift card number
pub number: Secret<String>,
/// The card verification code.
pub cvc: Secret<String>,
}
#[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, Default)]
#[serde(rename_all = "snake_case")]
pub struct CardToken {
/// The card holder's name
pub card_holder_name: Option<Secret<String>>,
/// The CVC number for the card
pub card_cvc: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BoletoVoucherData {
/// The shopper's social security number
pub social_security_number: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AlfamartVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, 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": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_250_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub number: Secret<String>,
/// The card verification code.
pub cvc: Secret<String>,
}
#[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, Default)]
#[serde(rename_all = "snake_case")]
pub struct CardToken {
/// The card holder's name
pub card_holder_name: Option<Secret<String>>,
/// The CVC number for the card
pub card_cvc: 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": 250,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_250_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub number: Secret<String>,
/// The card verification code.
pub cvc: Secret<String>,
}
#[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, Default)]
#[serde(rename_all = "snake_case")]
pub struct CardToken {
/// The card holder's name
pub card_holder_name: Option<Secret<String>>,
/// The CVC number for the card
pub card_cvc: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BoletoVoucherData {
/// The shopper's social security number
pub social_security_number: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AlfamartVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IndomaretVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct JCSVoucherData {}
|
{
"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_-4017303140956931129_250_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub number: Secret<String>,
/// The card verification code.
pub cvc: Secret<String>,
}
#[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone, Default)]
#[serde(rename_all = "snake_case")]
pub struct CardToken {
/// The card holder's name
pub card_holder_name: Option<Secret<String>>,
/// The CVC number for the card
pub card_cvc: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BoletoVoucherData {
/// The shopper's social security number
pub social_security_number: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AlfamartVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IndomaretVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct JCSVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum VoucherData {
Boleto(Box<BoletoVoucherData>),
Efecty,
PagoEfectivo,
RedCompra,
RedPagos,
Alfamart(Box<AlfamartVoucherData>),
Indomaret(Box<IndomaretVoucherData>),
Oxxo,
SevenEleven(Box<JCSVoucherData>),
Lawson(Box<JCSVoucherData>),
MiniStop(Box<JCSVoucherData>),
FamilyMart(Box<JCSVoucherData>),
Seicomart(Box<JCSVoucherData>),
PayEasy(Box<JCSVoucherData>),
}
#[derive(Debug, Clone, Eq, PartialEq, 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": 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_-4017303140956931129_275_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub struct IndomaretVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct JCSVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum VoucherData {
Boleto(Box<BoletoVoucherData>),
Efecty,
PagoEfectivo,
RedCompra,
RedPagos,
Alfamart(Box<AlfamartVoucherData>),
Indomaret(Box<IndomaretVoucherData>),
|
{
"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_-4017303140956931129_275_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub struct IndomaretVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct JCSVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum VoucherData {
Boleto(Box<BoletoVoucherData>),
Efecty,
PagoEfectivo,
RedCompra,
RedPagos,
Alfamart(Box<AlfamartVoucherData>),
Indomaret(Box<IndomaretVoucherData>),
Oxxo,
SevenEleven(Box<JCSVoucherData>),
Lawson(Box<JCSVoucherData>),
MiniStop(Box<JCSVoucherData>),
FamilyMart(Box<JCSVoucherData>),
Seicomart(Box<JCSVoucherData>),
PayEasy(Box<JCSVoucherData>),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum UpiData {
/// UPI Collect - Customer approves a collect request sent to their UPI app
UpiCollect(UpiCollectData),
/// UPI Intent - Customer is redirected to their UPI app with a pre-filled payment 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": 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_-4017303140956931129_275_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub struct IndomaretVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct JCSVoucherData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum VoucherData {
Boleto(Box<BoletoVoucherData>),
Efecty,
PagoEfectivo,
RedCompra,
RedPagos,
Alfamart(Box<AlfamartVoucherData>),
Indomaret(Box<IndomaretVoucherData>),
Oxxo,
SevenEleven(Box<JCSVoucherData>),
Lawson(Box<JCSVoucherData>),
MiniStop(Box<JCSVoucherData>),
FamilyMart(Box<JCSVoucherData>),
Seicomart(Box<JCSVoucherData>),
PayEasy(Box<JCSVoucherData>),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum UpiData {
/// UPI Collect - Customer approves a collect request sent to their UPI app
UpiCollect(UpiCollectData),
/// UPI Intent - Customer is redirected to their UPI app with a pre-filled payment request
UpiIntent(UpiIntentData),
/// UPI QR - Unique QR generated per txn
UpiQr(UpiQrData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct UpiCollectData {
pub vpa_id: Option<Secret<String, UpiVpaMaskingStrategy>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpiIntentData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpiQrData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum RealTimePaymentData {
DuitNow {},
|
{
"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_-4017303140956931129_300_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[serde(rename_all = "snake_case")]
pub enum UpiData {
/// UPI Collect - Customer approves a collect request sent to their UPI app
UpiCollect(UpiCollectData),
/// UPI Intent - Customer is redirected to their UPI app with a pre-filled payment request
UpiIntent(UpiIntentData),
/// UPI QR - Unique QR generated per txn
UpiQr(UpiQrData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct UpiCollectData {
pub vpa_id: Option<Secret<String, UpiVpaMaskingStrategy>>,
}
|
{
"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_-4017303140956931129_300_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[serde(rename_all = "snake_case")]
pub enum UpiData {
/// UPI Collect - Customer approves a collect request sent to their UPI app
UpiCollect(UpiCollectData),
/// UPI Intent - Customer is redirected to their UPI app with a pre-filled payment request
UpiIntent(UpiIntentData),
/// UPI QR - Unique QR generated per txn
UpiQr(UpiQrData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct UpiCollectData {
pub vpa_id: Option<Secret<String, UpiVpaMaskingStrategy>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpiIntentData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpiQrData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum RealTimePaymentData {
DuitNow {},
Fps {},
PromptPay {},
VietQr {},
}
|
{
"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_-4017303140956931129_300_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[serde(rename_all = "snake_case")]
pub enum UpiData {
/// UPI Collect - Customer approves a collect request sent to their UPI app
UpiCollect(UpiCollectData),
/// UPI Intent - Customer is redirected to their UPI app with a pre-filled payment request
UpiIntent(UpiIntentData),
/// UPI QR - Unique QR generated per txn
UpiQr(UpiQrData),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct UpiCollectData {
pub vpa_id: Option<Secret<String, UpiVpaMaskingStrategy>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpiIntentData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpiQrData {}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum RealTimePaymentData {
DuitNow {},
Fps {},
PromptPay {},
VietQr {},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct CryptoData {
pub pay_currency: Option<String>,
pub network: Option<String>,
}
impl CryptoData {
pub fn get_pay_currency(&self) -> Result<String, Error> {
self.pay_currency
.clone()
.ok_or_else(missing_field_err("crypto_data.pay_currency"))
}
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum BankTransferData {
AchBankTransfer {},
SepaBankTransfer {},
|
{
"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_-4017303140956931129_325_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
Fps {},
PromptPay {},
VietQr {},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct CryptoData {
pub pay_currency: Option<String>,
pub network: Option<String>,
}
impl CryptoData {
pub fn get_pay_currency(&self) -> Result<String, Error> {
self.pay_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": 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_-4017303140956931129_325_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
Fps {},
PromptPay {},
VietQr {},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct CryptoData {
pub pay_currency: Option<String>,
pub network: Option<String>,
}
impl CryptoData {
pub fn get_pay_currency(&self) -> Result<String, Error> {
self.pay_currency
.clone()
.ok_or_else(missing_field_err("crypto_data.pay_currency"))
}
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum BankTransferData {
AchBankTransfer {},
SepaBankTransfer {},
BacsBankTransfer {},
MultibancoBankTransfer {},
PermataBankTransfer {},
BcaBankTransfer {},
BniVaBankTransfer {},
|
{
"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_-4017303140956931129_325_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
Fps {},
PromptPay {},
VietQr {},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct CryptoData {
pub pay_currency: Option<String>,
pub network: Option<String>,
}
impl CryptoData {
pub fn get_pay_currency(&self) -> Result<String, Error> {
self.pay_currency
.clone()
.ok_or_else(missing_field_err("crypto_data.pay_currency"))
}
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum BankTransferData {
AchBankTransfer {},
SepaBankTransfer {},
BacsBankTransfer {},
MultibancoBankTransfer {},
PermataBankTransfer {},
BcaBankTransfer {},
BniVaBankTransfer {},
BriVaBankTransfer {},
CimbVaBankTransfer {},
DanamonVaBankTransfer {},
MandiriVaBankTransfer {},
Pix {
/// Unique key for pix transfer
pix_key: Option<Secret<String>>,
/// CPF is a Brazilian tax identification number
cpf: Option<Secret<String>>,
/// CNPJ is a Brazilian company tax identification number
cnpj: Option<Secret<String>>,
/// Source bank account UUID
source_bank_account_id: Option<MaskedBankAccount>,
/// Destination bank account UUID.
destination_bank_account_id: Option<MaskedBankAccount>,
},
Pse {},
LocalBankTransfer {
bank_code: 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": 325,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_350_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
BacsBankTransfer {},
MultibancoBankTransfer {},
PermataBankTransfer {},
BcaBankTransfer {},
BniVaBankTransfer {},
BriVaBankTransfer {},
CimbVaBankTransfer {},
DanamonVaBankTransfer {},
MandiriVaBankTransfer {},
Pix {
/// Unique key for pix transfer
pix_key: Option<Secret<String>>,
/// CPF is a Brazilian tax identification number
cpf: Option<Secret<String>>,
/// CNPJ is a Brazilian company tax identification number
|
{
"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_-4017303140956931129_350_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
BacsBankTransfer {},
MultibancoBankTransfer {},
PermataBankTransfer {},
BcaBankTransfer {},
BniVaBankTransfer {},
BriVaBankTransfer {},
CimbVaBankTransfer {},
DanamonVaBankTransfer {},
MandiriVaBankTransfer {},
Pix {
/// Unique key for pix transfer
pix_key: Option<Secret<String>>,
/// CPF is a Brazilian tax identification number
cpf: Option<Secret<String>>,
/// CNPJ is a Brazilian company tax identification number
cnpj: Option<Secret<String>>,
/// Source bank account UUID
source_bank_account_id: Option<MaskedBankAccount>,
/// Destination bank account UUID.
destination_bank_account_id: Option<MaskedBankAccount>,
},
Pse {},
LocalBankTransfer {
bank_code: Option<String>,
},
InstantBankTransfer {},
InstantBankTransferFinland {},
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": 350,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_350_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
BacsBankTransfer {},
MultibancoBankTransfer {},
PermataBankTransfer {},
BcaBankTransfer {},
BniVaBankTransfer {},
BriVaBankTransfer {},
CimbVaBankTransfer {},
DanamonVaBankTransfer {},
MandiriVaBankTransfer {},
Pix {
/// Unique key for pix transfer
pix_key: Option<Secret<String>>,
/// CPF is a Brazilian tax identification number
cpf: Option<Secret<String>>,
/// CNPJ is a Brazilian company tax identification number
cnpj: Option<Secret<String>>,
/// Source bank account UUID
source_bank_account_id: Option<MaskedBankAccount>,
/// Destination bank account UUID.
destination_bank_account_id: Option<MaskedBankAccount>,
},
Pse {},
LocalBankTransfer {
bank_code: Option<String>,
},
InstantBankTransfer {},
InstantBankTransferFinland {},
InstantBankTransferPoland {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum BankDebitData {
AchBankDebit {
account_number: Secret<String>,
routing_number: Secret<String>,
card_holder_name: Option<Secret<String>>,
bank_account_holder_name: Option<Secret<String>>,
bank_name: Option<common_enums::BankNames>,
bank_type: Option<common_enums::BankType>,
bank_holder_type: Option<common_enums::BankHolderType>,
},
SepaBankDebit {
iban: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
BecsBankDebit {
account_number: Secret<String>,
bsb_number: Secret<String>,
bank_account_holder_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": 50,
"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_-4017303140956931129_375_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
InstantBankTransfer {},
InstantBankTransferFinland {},
InstantBankTransferPoland {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum BankDebitData {
AchBankDebit {
account_number: Secret<String>,
routing_number: Secret<String>,
card_holder_name: Option<Secret<String>>,
bank_account_holder_name: Option<Secret<String>>,
bank_name: Option<common_enums::BankNames>,
bank_type: Option<common_enums::BankType>,
|
{
"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_-4017303140956931129_375_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
InstantBankTransfer {},
InstantBankTransferFinland {},
InstantBankTransferPoland {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum BankDebitData {
AchBankDebit {
account_number: Secret<String>,
routing_number: Secret<String>,
card_holder_name: Option<Secret<String>>,
bank_account_holder_name: Option<Secret<String>>,
bank_name: Option<common_enums::BankNames>,
bank_type: Option<common_enums::BankType>,
bank_holder_type: Option<common_enums::BankHolderType>,
},
SepaBankDebit {
iban: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
BecsBankDebit {
account_number: Secret<String>,
bsb_number: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
BacsBankDebit {
account_number: Secret<String>,
sort_code: Secret<String>,
bank_account_holder_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": 30,
"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_-4017303140956931129_375_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
InstantBankTransfer {},
InstantBankTransferFinland {},
InstantBankTransferPoland {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum BankDebitData {
AchBankDebit {
account_number: Secret<String>,
routing_number: Secret<String>,
card_holder_name: Option<Secret<String>>,
bank_account_holder_name: Option<Secret<String>>,
bank_name: Option<common_enums::BankNames>,
bank_type: Option<common_enums::BankType>,
bank_holder_type: Option<common_enums::BankHolderType>,
},
SepaBankDebit {
iban: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
BecsBankDebit {
account_number: Secret<String>,
bsb_number: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
BacsBankDebit {
account_number: Secret<String>,
sort_code: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum BankRedirectData {
BancontactCard {
card_number: Option<cards::CardNumber>,
card_exp_month: Option<Secret<String>>,
card_exp_year: Option<Secret<String>>,
card_holder_name: Option<Secret<String>>,
},
Bizum {},
Blik {
blik_code: Option<String>,
},
Eps {
bank_name: Option<common_enums::BankNames>,
country: Option<CountryAlpha2>,
},
Giropay {
|
{
"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": 375,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_400_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
},
BacsBankDebit {
account_number: Secret<String>,
sort_code: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum BankRedirectData {
BancontactCard {
card_number: Option<cards::CardNumber>,
card_exp_month: Option<Secret<String>>,
card_exp_year: Option<Secret<String>>,
card_holder_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": 400,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_400_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
},
BacsBankDebit {
account_number: Secret<String>,
sort_code: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum BankRedirectData {
BancontactCard {
card_number: Option<cards::CardNumber>,
card_exp_month: Option<Secret<String>>,
card_exp_year: Option<Secret<String>>,
card_holder_name: Option<Secret<String>>,
},
Bizum {},
Blik {
blik_code: Option<String>,
},
Eps {
bank_name: Option<common_enums::BankNames>,
country: Option<CountryAlpha2>,
},
Giropay {
bank_account_bic: Option<Secret<String>>,
bank_account_iban: Option<Secret<String>>,
country: Option<CountryAlpha2>,
},
Ideal {
|
{
"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": 400,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_400_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
},
BacsBankDebit {
account_number: Secret<String>,
sort_code: Secret<String>,
bank_account_holder_name: Option<Secret<String>>,
},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
pub enum BankRedirectData {
BancontactCard {
card_number: Option<cards::CardNumber>,
card_exp_month: Option<Secret<String>>,
card_exp_year: Option<Secret<String>>,
card_holder_name: Option<Secret<String>>,
},
Bizum {},
Blik {
blik_code: Option<String>,
},
Eps {
bank_name: Option<common_enums::BankNames>,
country: Option<CountryAlpha2>,
},
Giropay {
bank_account_bic: Option<Secret<String>>,
bank_account_iban: Option<Secret<String>>,
country: Option<CountryAlpha2>,
},
Ideal {
bank_name: Option<common_enums::BankNames>,
},
Interac {
country: Option<CountryAlpha2>,
email: Option<Email>,
},
OnlineBankingCzechRepublic {
issuer: common_enums::BankNames,
},
OnlineBankingFinland {
email: Option<Email>,
},
OnlineBankingPoland {
issuer: common_enums::BankNames,
},
OnlineBankingSlovakia {
issuer: common_enums::BankNames,
},
OpenBankingUk {
issuer: Option<common_enums::BankNames>,
|
{
"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": 400,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_425_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
bank_account_bic: Option<Secret<String>>,
bank_account_iban: Option<Secret<String>>,
country: Option<CountryAlpha2>,
},
Ideal {
bank_name: Option<common_enums::BankNames>,
},
Interac {
country: Option<CountryAlpha2>,
email: Option<Email>,
},
OnlineBankingCzechRepublic {
issuer: common_enums::BankNames,
},
OnlineBankingFinland {
|
{
"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": 425,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_425_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
bank_account_bic: Option<Secret<String>>,
bank_account_iban: Option<Secret<String>>,
country: Option<CountryAlpha2>,
},
Ideal {
bank_name: Option<common_enums::BankNames>,
},
Interac {
country: Option<CountryAlpha2>,
email: Option<Email>,
},
OnlineBankingCzechRepublic {
issuer: common_enums::BankNames,
},
OnlineBankingFinland {
email: Option<Email>,
},
OnlineBankingPoland {
issuer: common_enums::BankNames,
},
OnlineBankingSlovakia {
issuer: common_enums::BankNames,
},
OpenBankingUk {
issuer: Option<common_enums::BankNames>,
country: Option<CountryAlpha2>,
},
Przelewy24 {
bank_name: Option<common_enums::BankNames>,
},
|
{
"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": 425,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_425_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
bank_account_bic: Option<Secret<String>>,
bank_account_iban: Option<Secret<String>>,
country: Option<CountryAlpha2>,
},
Ideal {
bank_name: Option<common_enums::BankNames>,
},
Interac {
country: Option<CountryAlpha2>,
email: Option<Email>,
},
OnlineBankingCzechRepublic {
issuer: common_enums::BankNames,
},
OnlineBankingFinland {
email: Option<Email>,
},
OnlineBankingPoland {
issuer: common_enums::BankNames,
},
OnlineBankingSlovakia {
issuer: common_enums::BankNames,
},
OpenBankingUk {
issuer: Option<common_enums::BankNames>,
country: Option<CountryAlpha2>,
},
Przelewy24 {
bank_name: Option<common_enums::BankNames>,
},
Sofort {
country: Option<CountryAlpha2>,
preferred_language: Option<String>,
},
Trustly {
country: Option<CountryAlpha2>,
},
OnlineBankingFpx {
issuer: common_enums::BankNames,
},
OnlineBankingThailand {
issuer: common_enums::BankNames,
},
LocalBankRedirect {},
Eft {
provider: String,
},
}
#[derive(Eq, PartialEq, Clone, Debug, 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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 425,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_450_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
country: Option<CountryAlpha2>,
},
Przelewy24 {
bank_name: Option<common_enums::BankNames>,
},
Sofort {
country: Option<CountryAlpha2>,
preferred_language: Option<String>,
},
Trustly {
country: Option<CountryAlpha2>,
},
OnlineBankingFpx {
issuer: common_enums::BankNames,
},
|
{
"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": 450,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_450_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
country: Option<CountryAlpha2>,
},
Przelewy24 {
bank_name: Option<common_enums::BankNames>,
},
Sofort {
country: Option<CountryAlpha2>,
preferred_language: Option<String>,
},
Trustly {
country: Option<CountryAlpha2>,
},
OnlineBankingFpx {
issuer: common_enums::BankNames,
},
OnlineBankingThailand {
issuer: common_enums::BankNames,
},
LocalBankRedirect {},
Eft {
provider: String,
},
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
pub enum PayLaterData {
KlarnaRedirect {},
KlarnaSdk { token: String },
AffirmRedirect {},
AfterpayClearpayRedirect {},
|
{
"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": 450,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_450_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
country: Option<CountryAlpha2>,
},
Przelewy24 {
bank_name: Option<common_enums::BankNames>,
},
Sofort {
country: Option<CountryAlpha2>,
preferred_language: Option<String>,
},
Trustly {
country: Option<CountryAlpha2>,
},
OnlineBankingFpx {
issuer: common_enums::BankNames,
},
OnlineBankingThailand {
issuer: common_enums::BankNames,
},
LocalBankRedirect {},
Eft {
provider: String,
},
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
pub enum PayLaterData {
KlarnaRedirect {},
KlarnaSdk { token: String },
AffirmRedirect {},
AfterpayClearpayRedirect {},
PayBrightRedirect {},
WalleyRedirect {},
AlmaRedirect {},
AtomeRedirect {},
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
pub enum WalletData {
AliPayQr(Box<AliPayQr>),
AliPayRedirect(AliPayRedirection),
AliPayHkRedirect(AliPayHkRedirection),
BluecodeRedirect {},
AmazonPayRedirect(Box<AmazonPayRedirectData>),
MomoRedirect(MomoRedirection),
KakaoPayRedirect(KakaoPayRedirection),
GoPayRedirect(GoPayRedirection),
GcashRedirect(GcashRedirection),
ApplePay(ApplePayWalletData),
ApplePayRedirect(Box<ApplePayRedirectData>),
ApplePayThirdPartySdk(Box<ApplePayThirdPartySdkData>),
|
{
"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": 450,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_475_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub enum PayLaterData {
KlarnaRedirect {},
KlarnaSdk { token: String },
AffirmRedirect {},
AfterpayClearpayRedirect {},
PayBrightRedirect {},
WalleyRedirect {},
AlmaRedirect {},
AtomeRedirect {},
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
pub enum WalletData {
AliPayQr(Box<AliPayQr>),
AliPayRedirect(AliPayRedirection),
|
{
"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": 475,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_475_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub enum PayLaterData {
KlarnaRedirect {},
KlarnaSdk { token: String },
AffirmRedirect {},
AfterpayClearpayRedirect {},
PayBrightRedirect {},
WalleyRedirect {},
AlmaRedirect {},
AtomeRedirect {},
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
pub enum WalletData {
AliPayQr(Box<AliPayQr>),
AliPayRedirect(AliPayRedirection),
AliPayHkRedirect(AliPayHkRedirection),
BluecodeRedirect {},
AmazonPayRedirect(Box<AmazonPayRedirectData>),
MomoRedirect(MomoRedirection),
KakaoPayRedirect(KakaoPayRedirection),
GoPayRedirect(GoPayRedirection),
GcashRedirect(GcashRedirection),
ApplePay(ApplePayWalletData),
ApplePayRedirect(Box<ApplePayRedirectData>),
ApplePayThirdPartySdk(Box<ApplePayThirdPartySdkData>),
DanaRedirect {},
GooglePay(GooglePayWalletData),
GooglePayRedirect(Box<GooglePayRedirectData>),
GooglePayThirdPartySdk(Box<GooglePayThirdPartySdkData>),
MbWayRedirect(Box<MbWayRedirection>),
|
{
"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": 475,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_475_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub enum PayLaterData {
KlarnaRedirect {},
KlarnaSdk { token: String },
AffirmRedirect {},
AfterpayClearpayRedirect {},
PayBrightRedirect {},
WalleyRedirect {},
AlmaRedirect {},
AtomeRedirect {},
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
pub enum WalletData {
AliPayQr(Box<AliPayQr>),
AliPayRedirect(AliPayRedirection),
AliPayHkRedirect(AliPayHkRedirection),
BluecodeRedirect {},
AmazonPayRedirect(Box<AmazonPayRedirectData>),
MomoRedirect(MomoRedirection),
KakaoPayRedirect(KakaoPayRedirection),
GoPayRedirect(GoPayRedirection),
GcashRedirect(GcashRedirection),
ApplePay(ApplePayWalletData),
ApplePayRedirect(Box<ApplePayRedirectData>),
ApplePayThirdPartySdk(Box<ApplePayThirdPartySdkData>),
DanaRedirect {},
GooglePay(GooglePayWalletData),
GooglePayRedirect(Box<GooglePayRedirectData>),
GooglePayThirdPartySdk(Box<GooglePayThirdPartySdkData>),
MbWayRedirect(Box<MbWayRedirection>),
MobilePayRedirect(Box<MobilePayRedirection>),
PaypalRedirect(PaypalRedirection),
PaypalSdk(PayPalWalletData),
Paze(PazeWalletData),
SamsungPay(Box<SamsungPayWalletData>),
TwintRedirect {},
VippsRedirect {},
TouchNGoRedirect(Box<TouchNGoRedirection>),
WeChatPayRedirect(Box<WeChatPayRedirection>),
WeChatPayQr(Box<WeChatPayQr>),
CashappQr(Box<CashappQr>),
SwishQr(SwishQrData),
Mifinity(MifinityData),
RevolutPay(RevolutPayData),
}
impl WalletData {
pub fn get_wallet_token(&self) -> Result<Secret<String>, Error> {
match self {
Self::GooglePay(data) => Ok(data.get_googlepay_encrypted_payment_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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 475,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_500_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
DanaRedirect {},
GooglePay(GooglePayWalletData),
GooglePayRedirect(Box<GooglePayRedirectData>),
GooglePayThirdPartySdk(Box<GooglePayThirdPartySdkData>),
MbWayRedirect(Box<MbWayRedirection>),
MobilePayRedirect(Box<MobilePayRedirection>),
PaypalRedirect(PaypalRedirection),
PaypalSdk(PayPalWalletData),
Paze(PazeWalletData),
SamsungPay(Box<SamsungPayWalletData>),
TwintRedirect {},
VippsRedirect {},
TouchNGoRedirect(Box<TouchNGoRedirection>),
WeChatPayRedirect(Box<WeChatPayRedirection>),
WeChatPayQr(Box<WeChatPayQr>),
|
{
"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": 500,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_500_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
DanaRedirect {},
GooglePay(GooglePayWalletData),
GooglePayRedirect(Box<GooglePayRedirectData>),
GooglePayThirdPartySdk(Box<GooglePayThirdPartySdkData>),
MbWayRedirect(Box<MbWayRedirection>),
MobilePayRedirect(Box<MobilePayRedirection>),
PaypalRedirect(PaypalRedirection),
PaypalSdk(PayPalWalletData),
Paze(PazeWalletData),
SamsungPay(Box<SamsungPayWalletData>),
TwintRedirect {},
VippsRedirect {},
TouchNGoRedirect(Box<TouchNGoRedirection>),
WeChatPayRedirect(Box<WeChatPayRedirection>),
WeChatPayQr(Box<WeChatPayQr>),
CashappQr(Box<CashappQr>),
SwishQr(SwishQrData),
Mifinity(MifinityData),
RevolutPay(RevolutPayData),
}
impl WalletData {
pub fn get_wallet_token(&self) -> Result<Secret<String>, Error> {
match self {
Self::GooglePay(data) => Ok(data.get_googlepay_encrypted_payment_data()?),
Self::ApplePay(data) => Ok(data.get_applepay_decoded_payment_data()?),
Self::PaypalSdk(data) => Ok(Secret::new(data.token.clone())),
_ => Err(crate::errors::ConnectorError::InvalidWallet.into()),
}
}
|
{
"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": 500,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_500_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
DanaRedirect {},
GooglePay(GooglePayWalletData),
GooglePayRedirect(Box<GooglePayRedirectData>),
GooglePayThirdPartySdk(Box<GooglePayThirdPartySdkData>),
MbWayRedirect(Box<MbWayRedirection>),
MobilePayRedirect(Box<MobilePayRedirection>),
PaypalRedirect(PaypalRedirection),
PaypalSdk(PayPalWalletData),
Paze(PazeWalletData),
SamsungPay(Box<SamsungPayWalletData>),
TwintRedirect {},
VippsRedirect {},
TouchNGoRedirect(Box<TouchNGoRedirection>),
WeChatPayRedirect(Box<WeChatPayRedirection>),
WeChatPayQr(Box<WeChatPayQr>),
CashappQr(Box<CashappQr>),
SwishQr(SwishQrData),
Mifinity(MifinityData),
RevolutPay(RevolutPayData),
}
impl WalletData {
pub fn get_wallet_token(&self) -> Result<Secret<String>, Error> {
match self {
Self::GooglePay(data) => Ok(data.get_googlepay_encrypted_payment_data()?),
Self::ApplePay(data) => Ok(data.get_applepay_decoded_payment_data()?),
Self::PaypalSdk(data) => Ok(Secret::new(data.token.clone())),
_ => Err(crate::errors::ConnectorError::InvalidWallet.into()),
}
}
pub fn get_wallet_token_as_json<T>(&self, wallet_name: String) -> Result<T, Error>
where
T: serde::de::DeserializeOwned,
{
serde_json::from_str::<T>(self.get_wallet_token()?.peek())
.change_context(crate::errors::ConnectorError::InvalidWalletToken { wallet_name })
}
pub fn get_encoded_wallet_token(&self) -> Result<String, Error> {
match self {
Self::GooglePay(_) => {
let json_token: serde_json::Value =
self.get_wallet_token_as_json("Google Pay".to_owned())?;
let token_as_vec = serde_json::to_vec(&json_token).change_context(
crate::errors::ConnectorError::InvalidWalletToken {
wallet_name: "Google Pay".to_string(),
},
)?;
let encoded_token = base64::engine::general_purpose::STANDARD.encode(token_as_vec);
Ok(encoded_token)
|
{
"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": 500,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_525_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
Self::ApplePay(data) => Ok(data.get_applepay_decoded_payment_data()?),
Self::PaypalSdk(data) => Ok(Secret::new(data.token.clone())),
_ => Err(crate::errors::ConnectorError::InvalidWallet.into()),
}
}
pub fn get_wallet_token_as_json<T>(&self, wallet_name: String) -> Result<T, Error>
where
T: serde::de::DeserializeOwned,
{
serde_json::from_str::<T>(self.get_wallet_token()?.peek())
.change_context(crate::errors::ConnectorError::InvalidWalletToken { wallet_name })
}
pub fn get_encoded_wallet_token(&self) -> Result<String, Error> {
match 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": 525,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_525_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
Self::ApplePay(data) => Ok(data.get_applepay_decoded_payment_data()?),
Self::PaypalSdk(data) => Ok(Secret::new(data.token.clone())),
_ => Err(crate::errors::ConnectorError::InvalidWallet.into()),
}
}
pub fn get_wallet_token_as_json<T>(&self, wallet_name: String) -> Result<T, Error>
where
T: serde::de::DeserializeOwned,
{
serde_json::from_str::<T>(self.get_wallet_token()?.peek())
.change_context(crate::errors::ConnectorError::InvalidWalletToken { wallet_name })
}
pub fn get_encoded_wallet_token(&self) -> Result<String, Error> {
match self {
Self::GooglePay(_) => {
let json_token: serde_json::Value =
self.get_wallet_token_as_json("Google Pay".to_owned())?;
let token_as_vec = serde_json::to_vec(&json_token).change_context(
crate::errors::ConnectorError::InvalidWalletToken {
wallet_name: "Google Pay".to_string(),
},
)?;
let encoded_token = base64::engine::general_purpose::STANDARD.encode(token_as_vec);
Ok(encoded_token)
}
_ => Err(crate::errors::ConnectorError::NotImplemented(
"SELECTED PAYMENT METHOD".to_owned(),
)
.into()),
|
{
"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": 525,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_525_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
Self::ApplePay(data) => Ok(data.get_applepay_decoded_payment_data()?),
Self::PaypalSdk(data) => Ok(Secret::new(data.token.clone())),
_ => Err(crate::errors::ConnectorError::InvalidWallet.into()),
}
}
pub fn get_wallet_token_as_json<T>(&self, wallet_name: String) -> Result<T, Error>
where
T: serde::de::DeserializeOwned,
{
serde_json::from_str::<T>(self.get_wallet_token()?.peek())
.change_context(crate::errors::ConnectorError::InvalidWalletToken { wallet_name })
}
pub fn get_encoded_wallet_token(&self) -> Result<String, Error> {
match self {
Self::GooglePay(_) => {
let json_token: serde_json::Value =
self.get_wallet_token_as_json("Google Pay".to_owned())?;
let token_as_vec = serde_json::to_vec(&json_token).change_context(
crate::errors::ConnectorError::InvalidWalletToken {
wallet_name: "Google Pay".to_string(),
},
)?;
let encoded_token = base64::engine::general_purpose::STANDARD.encode(token_as_vec);
Ok(encoded_token)
}
_ => Err(crate::errors::ConnectorError::NotImplemented(
"SELECTED PAYMENT METHOD".to_owned(),
)
.into()),
}
}
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct RevolutPayData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct MifinityData {
#[schema(value_type = Date)]
pub date_of_birth: Secret<Date>,
pub language_preference: Option<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct SwishQrData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct CashappQr {}
|
{
"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": 525,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_550_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
}
_ => Err(crate::errors::ConnectorError::NotImplemented(
"SELECTED PAYMENT METHOD".to_owned(),
)
.into()),
}
}
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct RevolutPayData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct MifinityData {
#[schema(value_type = Date)]
|
{
"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": 550,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_550_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
}
_ => Err(crate::errors::ConnectorError::NotImplemented(
"SELECTED PAYMENT METHOD".to_owned(),
)
.into()),
}
}
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct RevolutPayData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct MifinityData {
#[schema(value_type = Date)]
pub date_of_birth: Secret<Date>,
pub language_preference: Option<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct SwishQrData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct CashappQr {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayQr {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayRedirection {}
|
{
"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": 550,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_550_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
}
_ => Err(crate::errors::ConnectorError::NotImplemented(
"SELECTED PAYMENT METHOD".to_owned(),
)
.into()),
}
}
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct RevolutPayData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct MifinityData {
#[schema(value_type = Date)]
pub date_of_birth: Secret<Date>,
pub language_preference: Option<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct SwishQrData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct CashappQr {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayQr {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct TouchNGoRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletCredentials {
pub method: Option<String>,
pub recurring_payment: Option<bool>,
pub card_brand: common_enums::SamsungPayCardBrand,
pub dpan_last_four_digits: Option<String>,
#[serde(rename = "card_last4digits")]
pub card_last_four_digits: String,
#[serde(rename = "3_d_s")]
pub token_data: SamsungPayTokenData,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayTokenData {
|
{
"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": 550,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_575_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayQr {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct TouchNGoRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletCredentials {
pub method: Option<String>,
pub recurring_payment: Option<bool>,
pub card_brand: common_enums::SamsungPayCardBrand,
|
{
"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": 575,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_575_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayQr {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct TouchNGoRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletCredentials {
pub method: Option<String>,
pub recurring_payment: Option<bool>,
pub card_brand: common_enums::SamsungPayCardBrand,
pub dpan_last_four_digits: Option<String>,
#[serde(rename = "card_last4digits")]
pub card_last_four_digits: String,
#[serde(rename = "3_d_s")]
pub token_data: SamsungPayTokenData,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayTokenData {
#[serde(rename = "type")]
pub three_ds_type: Option<String>,
pub version: String,
pub data: 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": 575,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_575_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayQr {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct TouchNGoRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletCredentials {
pub method: Option<String>,
pub recurring_payment: Option<bool>,
pub card_brand: common_enums::SamsungPayCardBrand,
pub dpan_last_four_digits: Option<String>,
#[serde(rename = "card_last4digits")]
pub card_last_four_digits: String,
#[serde(rename = "3_d_s")]
pub token_data: SamsungPayTokenData,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayTokenData {
#[serde(rename = "type")]
pub three_ds_type: Option<String>,
pub version: String,
pub data: Secret<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletData {
pub payment_credential: SamsungPayWalletCredentials,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct PazeWalletData {
#[schema(value_type = String)]
pub complete_response: Secret<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PayPalWalletData {
/// Token generated for the Apple pay
pub token: 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": 575,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_600_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[serde(rename = "type")]
pub three_ds_type: Option<String>,
pub version: String,
pub data: Secret<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletData {
pub payment_credential: SamsungPayWalletCredentials,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct PazeWalletData {
|
{
"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": 600,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_600_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[serde(rename = "type")]
pub three_ds_type: Option<String>,
pub version: String,
pub data: Secret<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletData {
pub payment_credential: SamsungPayWalletCredentials,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct PazeWalletData {
#[schema(value_type = String)]
pub complete_response: Secret<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PayPalWalletData {
/// Token generated for the Apple pay
pub token: String,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PaypalRedirection {
/// paypal's email address
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")]
pub email: Option<Email>,
|
{
"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": 600,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_600_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[serde(rename = "type")]
pub three_ds_type: Option<String>,
pub version: String,
pub data: Secret<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct SamsungPayWalletData {
pub payment_credential: SamsungPayWalletCredentials,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct PazeWalletData {
#[schema(value_type = String)]
pub complete_response: Secret<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PayPalWalletData {
/// Token generated for the Apple pay
pub token: String,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PaypalRedirection {
/// paypal's email address
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")]
pub email: Option<Email>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct GooglePayThirdPartySdkData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct GooglePayWalletData {
/// The type of payment method
#[serde(rename = "type")]
pub pm_type: String,
/// User-facing message to describe the payment method that funds this transaction.
pub description: String,
/// The information of the payment method
pub info: GooglePayPaymentMethodInfo,
/// The tokenization data of Google pay
pub tokenization_data: GpayTokenizationData,
}
impl GooglePayWalletData {
|
{
"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": 600,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_625_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PaypalRedirection {
/// paypal's email address
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")]
pub email: Option<Email>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct GooglePayThirdPartySdkData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct GooglePayWalletData {
/// The type of payment method
#[serde(rename = "type")]
|
{
"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": 625,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_625_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PaypalRedirection {
/// paypal's email address
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")]
pub email: Option<Email>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct GooglePayThirdPartySdkData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct GooglePayWalletData {
/// The type of payment method
#[serde(rename = "type")]
pub pm_type: String,
/// User-facing message to describe the payment method that funds this transaction.
pub description: String,
/// The information of the payment method
pub info: GooglePayPaymentMethodInfo,
/// The tokenization data of Google pay
pub tokenization_data: GpayTokenizationData,
}
impl GooglePayWalletData {
fn get_googlepay_encrypted_payment_data(&self) -> Result<Secret<String>, Error> {
let encrypted_data = self
.tokenization_data
.get_encrypted_google_pay_payment_data_mandatory()
.change_context(errors::ConnectorError::InvalidWalletToken {
|
{
"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": 625,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_625_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PaypalRedirection {
/// paypal's email address
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")]
pub email: Option<Email>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct GooglePayThirdPartySdkData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub struct GooglePayWalletData {
/// The type of payment method
#[serde(rename = "type")]
pub pm_type: String,
/// User-facing message to describe the payment method that funds this transaction.
pub description: String,
/// The information of the payment method
pub info: GooglePayPaymentMethodInfo,
/// The tokenization data of Google pay
pub tokenization_data: GpayTokenizationData,
}
impl GooglePayWalletData {
fn get_googlepay_encrypted_payment_data(&self) -> Result<Secret<String>, Error> {
let encrypted_data = self
.tokenization_data
.get_encrypted_google_pay_payment_data_mandatory()
.change_context(errors::ConnectorError::InvalidWalletToken {
wallet_name: "Google Pay".to_string(),
})?;
Ok(Secret::new(encrypted_data.token.clone()))
}
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
/// This enum is used to represent the Gpay payment data, which can either be encrypted or decrypted.
pub enum GpayTokenizationData {
/// This variant contains the decrypted Gpay payment data as a structured object.
Decrypted(GPayPredecryptData),
/// This variant contains the encrypted Gpay payment data as a string.
Encrypted(GpayEcryptedTokenizationData),
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 625,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_650_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
fn get_googlepay_encrypted_payment_data(&self) -> Result<Secret<String>, Error> {
let encrypted_data = self
.tokenization_data
.get_encrypted_google_pay_payment_data_mandatory()
.change_context(errors::ConnectorError::InvalidWalletToken {
wallet_name: "Google Pay".to_string(),
})?;
Ok(Secret::new(encrypted_data.token.clone()))
}
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
|
{
"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": 650,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_650_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
fn get_googlepay_encrypted_payment_data(&self) -> Result<Secret<String>, Error> {
let encrypted_data = self
.tokenization_data
.get_encrypted_google_pay_payment_data_mandatory()
.change_context(errors::ConnectorError::InvalidWalletToken {
wallet_name: "Google Pay".to_string(),
})?;
Ok(Secret::new(encrypted_data.token.clone()))
}
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
/// This enum is used to represent the Gpay payment data, which can either be encrypted or decrypted.
pub enum GpayTokenizationData {
/// This variant contains the decrypted Gpay payment data as a structured object.
Decrypted(GPayPredecryptData),
/// This variant contains the encrypted Gpay payment data as a string.
Encrypted(GpayEcryptedTokenizationData),
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
/// This struct represents the decrypted Google Pay payment data
pub struct GPayPredecryptData {
/// The card's expiry month
pub card_exp_month: 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": 650,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_650_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
fn get_googlepay_encrypted_payment_data(&self) -> Result<Secret<String>, Error> {
let encrypted_data = self
.tokenization_data
.get_encrypted_google_pay_payment_data_mandatory()
.change_context(errors::ConnectorError::InvalidWalletToken {
wallet_name: "Google Pay".to_string(),
})?;
Ok(Secret::new(encrypted_data.token.clone()))
}
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
/// This enum is used to represent the Gpay payment data, which can either be encrypted or decrypted.
pub enum GpayTokenizationData {
/// This variant contains the decrypted Gpay payment data as a structured object.
Decrypted(GPayPredecryptData),
/// This variant contains the encrypted Gpay payment data as a string.
Encrypted(GpayEcryptedTokenizationData),
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
/// This struct represents the decrypted Google Pay payment data
pub struct GPayPredecryptData {
/// The card's expiry month
pub card_exp_month: Secret<String>,
/// The card's expiry year
pub card_exp_year: Secret<String>,
/// The Primary Account Number (PAN) of the card
pub application_primary_account_number: cards::CardNumber,
/// Cryptogram generated by the Network
pub cryptogram: Option<Secret<String>>,
/// Electronic Commerce Indicator
pub eci_indicator: Option<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
/// This struct represents the encrypted Gpay payment data
pub struct GpayEcryptedTokenizationData {
/// The type of the token
#[serde(rename = "type")]
pub token_type: String,
/// Token generated for the wallet
|
{
"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": 650,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_675_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
/// This struct represents the decrypted Google Pay payment data
pub struct GPayPredecryptData {
/// The card's expiry month
pub card_exp_month: Secret<String>,
/// The card's expiry year
pub card_exp_year: Secret<String>,
/// The Primary Account Number (PAN) of the card
pub application_primary_account_number: cards::CardNumber,
/// Cryptogram generated by the Network
pub cryptogram: Option<Secret<String>>,
/// Electronic Commerce Indicator
|
{
"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": 675,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_675_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
/// This struct represents the decrypted Google Pay payment data
pub struct GPayPredecryptData {
/// The card's expiry month
pub card_exp_month: Secret<String>,
/// The card's expiry year
pub card_exp_year: Secret<String>,
/// The Primary Account Number (PAN) of the card
pub application_primary_account_number: cards::CardNumber,
/// Cryptogram generated by the Network
pub cryptogram: Option<Secret<String>>,
/// Electronic Commerce Indicator
pub eci_indicator: Option<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
/// This struct represents the encrypted Gpay payment data
pub struct GpayEcryptedTokenizationData {
/// The type of the token
#[serde(rename = "type")]
pub token_type: String,
/// Token generated for the wallet
pub token: String,
}
impl GpayTokenizationData {
/// Get the encrypted Google Pay payment data, returning an error if it does not exist
|
{
"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": 675,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_675_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
/// This struct represents the decrypted Google Pay payment data
pub struct GPayPredecryptData {
/// The card's expiry month
pub card_exp_month: Secret<String>,
/// The card's expiry year
pub card_exp_year: Secret<String>,
/// The Primary Account Number (PAN) of the card
pub application_primary_account_number: cards::CardNumber,
/// Cryptogram generated by the Network
pub cryptogram: Option<Secret<String>>,
/// Electronic Commerce Indicator
pub eci_indicator: Option<String>,
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
/// This struct represents the encrypted Gpay payment data
pub struct GpayEcryptedTokenizationData {
/// The type of the token
#[serde(rename = "type")]
pub token_type: String,
/// Token generated for the wallet
pub token: String,
}
impl GpayTokenizationData {
/// Get the encrypted Google Pay payment data, returning an error if it does not exist
pub fn get_encrypted_google_pay_payment_data_mandatory(
&self,
) -> error_stack::Result<&GpayEcryptedTokenizationData, ValidationError> {
match self {
Self::Encrypted(encrypted_data) => Ok(encrypted_data),
Self::Decrypted(_) => Err(ValidationError::InvalidValue {
message: "Encrypted Google Pay payment data is mandatory".to_string(),
}
.into()),
}
}
/// Get the token from Google Pay tokenization data
/// Returns the token string if encrypted data exists, otherwise returns an error
pub fn get_encrypted_google_pay_token(&self) -> error_stack::Result<String, ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
.token
.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": 675,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_700_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub token: String,
}
impl GpayTokenizationData {
/// Get the encrypted Google Pay payment data, returning an error if it does not exist
pub fn get_encrypted_google_pay_payment_data_mandatory(
&self,
) -> error_stack::Result<&GpayEcryptedTokenizationData, ValidationError> {
match self {
Self::Encrypted(encrypted_data) => Ok(encrypted_data),
Self::Decrypted(_) => Err(ValidationError::InvalidValue {
message: "Encrypted Google Pay payment data is mandatory".to_string(),
}
.into()),
}
|
{
"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": 700,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_700_30
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub token: String,
}
impl GpayTokenizationData {
/// Get the encrypted Google Pay payment data, returning an error if it does not exist
pub fn get_encrypted_google_pay_payment_data_mandatory(
&self,
) -> error_stack::Result<&GpayEcryptedTokenizationData, ValidationError> {
match self {
Self::Encrypted(encrypted_data) => Ok(encrypted_data),
Self::Decrypted(_) => Err(ValidationError::InvalidValue {
message: "Encrypted Google Pay payment data is mandatory".to_string(),
}
.into()),
}
}
/// Get the token from Google Pay tokenization data
/// Returns the token string if encrypted data exists, otherwise returns an error
pub fn get_encrypted_google_pay_token(&self) -> error_stack::Result<String, ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
.token
.clone())
}
/// Get the token type from Google Pay tokenization data
/// Returns the token_type string if encrypted data exists, otherwise returns an error
pub fn get_encrypted_token_type(&self) -> error_stack::Result<String, ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
|
{
"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": 700,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_700_50
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
pub token: String,
}
impl GpayTokenizationData {
/// Get the encrypted Google Pay payment data, returning an error if it does not exist
pub fn get_encrypted_google_pay_payment_data_mandatory(
&self,
) -> error_stack::Result<&GpayEcryptedTokenizationData, ValidationError> {
match self {
Self::Encrypted(encrypted_data) => Ok(encrypted_data),
Self::Decrypted(_) => Err(ValidationError::InvalidValue {
message: "Encrypted Google Pay payment data is mandatory".to_string(),
}
.into()),
}
}
/// Get the token from Google Pay tokenization data
/// Returns the token string if encrypted data exists, otherwise returns an error
pub fn get_encrypted_google_pay_token(&self) -> error_stack::Result<String, ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
.token
.clone())
}
/// Get the token type from Google Pay tokenization data
/// Returns the token_type string if encrypted data exists, otherwise returns an error
pub fn get_encrypted_token_type(&self) -> error_stack::Result<String, ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
.token_type
.clone())
}
}
impl GPayPredecryptData {
/// Get the four-digit expiration year from the Google Pay pre-decrypt data
pub fn get_four_digit_expiry_year(
&self,
) -> error_stack::Result<Secret<String>, ValidationError> {
let mut year = self.card_exp_year.peek().clone();
// If it's a 2-digit year, convert to 4-digit
if year.len() == 2 {
year = format!("20{year}");
} else if year.len() != 4 {
return Err(ValidationError::InvalidValue {
message: format!(
"Invalid expiry year length: {}. Must be 2 or 4 digits",
year.len()
|
{
"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": 700,
"struct_name": null,
"total_crates": null,
"trait_name": null
}
|
connector-service_snippet_-4017303140956931129_725_15
|
clm
|
snippet
|
// connector-service/backend/domain_types/src/payment_method_data.rs
/// Get the token type from Google Pay tokenization data
/// Returns the token_type string if encrypted data exists, otherwise returns an error
pub fn get_encrypted_token_type(&self) -> error_stack::Result<String, ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
.token_type
.clone())
}
}
impl GPayPredecryptData {
/// Get the four-digit expiration year from the Google Pay pre-decrypt data
pub fn get_four_digit_expiry_year(
&self,
) -> error_stack::Result<Secret<String>, ValidationError> {
|
{
"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": 725,
"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.