id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
connector-service_snippet_4794849861800683444_325_15
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs pub fn to_state_code_as_optional(&self) -> Result<Option<Secret<String>>, Error> { self.state .as_ref() .map(|state| { if state.peek().len() == 2 { Ok(state.to_owned()) } else { self.to_state_code() } }) .transpose() } } #[derive(Debug, Clone, Default, 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": 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_4794849861800683444_325_30
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs pub fn to_state_code_as_optional(&self) -> Result<Option<Secret<String>>, Error> { self.state .as_ref() .map(|state| { if state.peek().len() == 2 { Ok(state.to_owned()) } else { self.to_state_code() } }) .transpose() } } #[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)] pub struct PhoneDetails { /// The contact number pub number: Option<Secret<String>>, /// The country code attached to the number pub country_code: Option<String>, } impl PhoneDetails { pub fn get_country_code(&self) -> Result<String, Error> { self.country_code .clone() .ok_or_else(missing_field_err("billing.phone.country_code")) } pub fn extract_country_code(&self) -> Result<String, Error> { self.get_country_code()
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_4794849861800683444_325_50
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs pub fn to_state_code_as_optional(&self) -> Result<Option<Secret<String>>, Error> { self.state .as_ref() .map(|state| { if state.peek().len() == 2 { Ok(state.to_owned()) } else { self.to_state_code() } }) .transpose() } } #[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)] pub struct PhoneDetails { /// The contact number pub number: Option<Secret<String>>, /// The country code attached to the number pub country_code: Option<String>, } impl PhoneDetails { pub fn get_country_code(&self) -> Result<String, Error> { self.country_code .clone() .ok_or_else(missing_field_err("billing.phone.country_code")) } pub fn extract_country_code(&self) -> Result<String, Error> { self.get_country_code() .map(|cc| cc.trim_start_matches('+').to_string()) } pub fn get_number(&self) -> Result<Secret<String>, Error> { self.number .clone() .ok_or_else(missing_field_err("billing.phone.number")) } pub fn get_number_with_country_code(&self) -> Result<Secret<String>, Error> { let number = self.get_number()?; let country_code = self.get_country_code()?; Ok(Secret::new(format!("{}{}", country_code, number.peek()))) } pub fn get_number_with_hash_country_code(&self) -> Result<Secret<String>, Error> { let number = self.get_number()?; let country_code = self.get_country_code()?; let number_without_plus = country_code.trim_start_matches('+'); Ok(Secret::new(format!( "{}#{}", number_without_plus, number.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": 325, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_4794849861800683444_350_15
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs .clone() .ok_or_else(missing_field_err("billing.phone.country_code")) } pub fn extract_country_code(&self) -> Result<String, Error> { self.get_country_code() .map(|cc| cc.trim_start_matches('+').to_string()) } pub fn get_number(&self) -> Result<Secret<String>, Error> { self.number .clone() .ok_or_else(missing_field_err("billing.phone.number")) } pub fn get_number_with_country_code(&self) -> Result<Secret<String>, Error> { let number = self.get_number()?; let country_code = self.get_country_code()?;
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_4794849861800683444_350_30
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs .clone() .ok_or_else(missing_field_err("billing.phone.country_code")) } pub fn extract_country_code(&self) -> Result<String, Error> { self.get_country_code() .map(|cc| cc.trim_start_matches('+').to_string()) } pub fn get_number(&self) -> Result<Secret<String>, Error> { self.number .clone() .ok_or_else(missing_field_err("billing.phone.number")) } pub fn get_number_with_country_code(&self) -> Result<Secret<String>, Error> { let number = self.get_number()?; let country_code = self.get_country_code()?; Ok(Secret::new(format!("{}{}", country_code, number.peek()))) } pub fn get_number_with_hash_country_code(&self) -> Result<Secret<String>, Error> { let number = self.get_number()?; let country_code = self.get_country_code()?; let number_without_plus = country_code.trim_start_matches('+'); Ok(Secret::new(format!( "{}#{}", number_without_plus, number.peek() ))) } } #[derive(Debug, serde::Serialize, PartialEq, Eq, serde::Deserialize)]
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_4794849861800683444_350_50
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs .clone() .ok_or_else(missing_field_err("billing.phone.country_code")) } pub fn extract_country_code(&self) -> Result<String, Error> { self.get_country_code() .map(|cc| cc.trim_start_matches('+').to_string()) } pub fn get_number(&self) -> Result<Secret<String>, Error> { self.number .clone() .ok_or_else(missing_field_err("billing.phone.number")) } pub fn get_number_with_country_code(&self) -> Result<Secret<String>, Error> { let number = self.get_number()?; let country_code = self.get_country_code()?; Ok(Secret::new(format!("{}{}", country_code, number.peek()))) } pub fn get_number_with_hash_country_code(&self) -> Result<Secret<String>, Error> { let number = self.get_number()?; let country_code = self.get_country_code()?; let number_without_plus = country_code.trim_start_matches('+'); Ok(Secret::new(format!( "{}#{}", number_without_plus, number.peek() ))) } } #[derive(Debug, serde::Serialize, PartialEq, Eq, serde::Deserialize)] pub struct RedirectionResponse { pub return_url_with_query_params: String, } #[derive(Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone)] pub struct OrderDetailsWithAmount { /// Name of the product that is being purchased pub product_name: String, /// The quantity of the product to be purchased pub quantity: u16, /// the amount per quantity of product pub amount: MinorUnit, /// tax rate applicable to the product pub tax_rate: Option<f64>, /// total tax amount applicable to the product pub total_tax_amount: Option<MinorUnit>, // Does the order includes shipping pub requires_shipping: Option<bool>, /// The image URL of the product pub product_img_link: 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": 350, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_4794849861800683444_375_15
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs ))) } } #[derive(Debug, serde::Serialize, PartialEq, Eq, serde::Deserialize)] pub struct RedirectionResponse { pub return_url_with_query_params: String, } #[derive(Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone)] pub struct OrderDetailsWithAmount { /// Name of the product that is being purchased pub product_name: String, /// The quantity of the product to be purchased pub quantity: u16,
{ "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_4794849861800683444_375_30
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs ))) } } #[derive(Debug, serde::Serialize, PartialEq, Eq, serde::Deserialize)] pub struct RedirectionResponse { pub return_url_with_query_params: String, } #[derive(Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone)] pub struct OrderDetailsWithAmount { /// Name of the product that is being purchased pub product_name: String, /// The quantity of the product to be purchased pub quantity: u16, /// the amount per quantity of product pub amount: MinorUnit, /// tax rate applicable to the product pub tax_rate: Option<f64>, /// total tax amount applicable to the product pub total_tax_amount: Option<MinorUnit>, // Does the order includes shipping pub requires_shipping: Option<bool>, /// The image URL of the product pub product_img_link: Option<String>, /// ID of the product that is being purchased pub product_id: Option<String>, /// Category of the product that is being purchased pub category: Option<String>, /// Sub category of the product that is being purchased
{ "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_4794849861800683444_375_50
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs ))) } } #[derive(Debug, serde::Serialize, PartialEq, Eq, serde::Deserialize)] pub struct RedirectionResponse { pub return_url_with_query_params: String, } #[derive(Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone)] pub struct OrderDetailsWithAmount { /// Name of the product that is being purchased pub product_name: String, /// The quantity of the product to be purchased pub quantity: u16, /// the amount per quantity of product pub amount: MinorUnit, /// tax rate applicable to the product pub tax_rate: Option<f64>, /// total tax amount applicable to the product pub total_tax_amount: Option<MinorUnit>, // Does the order includes shipping pub requires_shipping: Option<bool>, /// The image URL of the product pub product_img_link: Option<String>, /// ID of the product that is being purchased pub product_id: Option<String>, /// Category of the product that is being purchased pub category: Option<String>, /// Sub category of the product that is being purchased pub sub_category: Option<String>, /// Brand of the product that is being purchased pub brand: Option<String>, /// Type of the product that is being purchased pub product_type: Option<ProductType>, /// The tax code for the product pub product_tax_code: Option<String>, } impl hyperswitch_masking::SerializableSecret for OrderDetailsWithAmount {}
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 40, "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_4794849861800683444_400_15
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs /// ID of the product that is being purchased pub product_id: Option<String>, /// Category of the product that is being purchased pub category: Option<String>, /// Sub category of the product that is being purchased pub sub_category: Option<String>, /// Brand of the product that is being purchased pub brand: Option<String>, /// Type of the product that is being purchased pub product_type: Option<ProductType>, /// The tax code for the product pub product_tax_code: Option<String>, } impl hyperswitch_masking::SerializableSecret for OrderDetailsWithAmount {}
{ "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_4794849861800683444_400_30
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs /// ID of the product that is being purchased pub product_id: Option<String>, /// Category of the product that is being purchased pub category: Option<String>, /// Sub category of the product that is being purchased pub sub_category: Option<String>, /// Brand of the product that is being purchased pub brand: Option<String>, /// Type of the product that is being purchased pub product_type: Option<ProductType>, /// The tax code for the product pub product_tax_code: Option<String>, } impl hyperswitch_masking::SerializableSecret for OrderDetailsWithAmount {}
{ "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_4794849861800683444_400_50
clm
snippet
// connector-service/backend/domain_types/src/payment_address.rs /// ID of the product that is being purchased pub product_id: Option<String>, /// Category of the product that is being purchased pub category: Option<String>, /// Sub category of the product that is being purchased pub sub_category: Option<String>, /// Brand of the product that is being purchased pub brand: Option<String>, /// Type of the product that is being purchased pub product_type: Option<ProductType>, /// The tax code for the product pub product_tax_code: Option<String>, } impl hyperswitch_masking::SerializableSecret for OrderDetailsWithAmount {}
{ "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_-8778740194381731474_0_15
clm
snippet
// connector-service/backend/domain_types/src/router_data_v2.rs use std::marker::PhantomData; use crate::router_data::{ConnectorAuthType, ErrorResponse}; #[derive(Debug, Clone)] pub struct RouterDataV2<Flow, ResourceCommonData, FlowSpecificRequest, FlowSpecificResponse> { pub flow: PhantomData<Flow>, // pub tenant_id: id_type::TenantId, // TODO: Should we add this pub resource_common_data: ResourceCommonData, pub connector_auth_type: ConnectorAuthType, /// Contains flow-specific data required to construct a request and send it to the connector. pub request: FlowSpecificRequest, /// Contains flow-specific data that the connector responds with. pub response: Result<FlowSpecificResponse, ErrorResponse>, }
{ "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_-8778740194381731474_0_30
clm
snippet
// connector-service/backend/domain_types/src/router_data_v2.rs use std::marker::PhantomData; use crate::router_data::{ConnectorAuthType, ErrorResponse}; #[derive(Debug, Clone)] pub struct RouterDataV2<Flow, ResourceCommonData, FlowSpecificRequest, FlowSpecificResponse> { pub flow: PhantomData<Flow>, // pub tenant_id: id_type::TenantId, // TODO: Should we add this pub resource_common_data: ResourceCommonData, pub connector_auth_type: ConnectorAuthType, /// Contains flow-specific data required to construct a request and send it to the connector. pub request: FlowSpecificRequest, /// Contains flow-specific data that the connector responds with. pub response: Result<FlowSpecificResponse, ErrorResponse>, }
{ "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_-8778740194381731474_0_50
clm
snippet
// connector-service/backend/domain_types/src/router_data_v2.rs use std::marker::PhantomData; use crate::router_data::{ConnectorAuthType, ErrorResponse}; #[derive(Debug, Clone)] pub struct RouterDataV2<Flow, ResourceCommonData, FlowSpecificRequest, FlowSpecificResponse> { pub flow: PhantomData<Flow>, // pub tenant_id: id_type::TenantId, // TODO: Should we add this pub resource_common_data: ResourceCommonData, pub connector_auth_type: ConnectorAuthType, /// Contains flow-specific data required to construct a request and send it to the connector. pub request: FlowSpecificRequest, /// Contains flow-specific data that the connector responds with. pub response: Result<FlowSpecificResponse, ErrorResponse>, }
{ "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_-6262692988738800615_0_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs use std::collections::HashMap; use common_enums::{ AttemptStatus, AuthenticationType, Currency, DisputeStatus, EventClass, PaymentMethod, PaymentMethodType, }; use common_utils::{ errors, ext_traits::{OptionExt, ValueExt}, pii::IpAddress, types::{MinorUnit, StringMinorUnit}, CustomResult, CustomerId, Email, SecretSerdeValue, }; use error_stack::ResultExt; use hyperswitch_masking::Secret;
{ "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_-6262692988738800615_0_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs use std::collections::HashMap; use common_enums::{ AttemptStatus, AuthenticationType, Currency, DisputeStatus, EventClass, PaymentMethod, PaymentMethodType, }; use common_utils::{ errors, ext_traits::{OptionExt, ValueExt}, pii::IpAddress, types::{MinorUnit, StringMinorUnit}, CustomResult, CustomerId, Email, SecretSerdeValue, }; use error_stack::ResultExt; use hyperswitch_masking::Secret; use serde::{Deserialize, Serialize}; use strum::{Display, EnumString}; use crate::{ errors::{ApiError, ApplicationErrorResponse, ConnectorError}, mandates::{CustomerAcceptance, MandateData}, payment_address::{self, Address, AddressDetails, PhoneDetails}, payment_method_data::{self, Card, PaymentMethodData, PaymentMethodDataTypes}, router_data::{self, ConnectorResponseData, PaymentMethodToken}, router_request_types::{ self, AcceptDisputeIntegrityObject, AuthoriseIntegrityObject, BrowserInformation, CaptureIntegrityObject, CreateOrderIntegrityObject, DefendDisputeIntegrityObject, PaymentMethodTokenIntegrityObject, PaymentSynIntegrityObject, PaymentVoidIntegrityObject, PaymentVoidPostCaptureIntegrityObject, RefundIntegrityObject, RefundSyncIntegrityObject, RepeatPaymentIntegrityObject, SetupMandateIntegrityObject, SubmitEvidenceIntegrityObject,
{ "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_-6262692988738800615_0_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs use std::collections::HashMap; use common_enums::{ AttemptStatus, AuthenticationType, Currency, DisputeStatus, EventClass, PaymentMethod, PaymentMethodType, }; use common_utils::{ errors, ext_traits::{OptionExt, ValueExt}, pii::IpAddress, types::{MinorUnit, StringMinorUnit}, CustomResult, CustomerId, Email, SecretSerdeValue, }; use error_stack::ResultExt; use hyperswitch_masking::Secret; use serde::{Deserialize, Serialize}; use strum::{Display, EnumString}; use crate::{ errors::{ApiError, ApplicationErrorResponse, ConnectorError}, mandates::{CustomerAcceptance, MandateData}, payment_address::{self, Address, AddressDetails, PhoneDetails}, payment_method_data::{self, Card, PaymentMethodData, PaymentMethodDataTypes}, router_data::{self, ConnectorResponseData, PaymentMethodToken}, router_request_types::{ self, AcceptDisputeIntegrityObject, AuthoriseIntegrityObject, BrowserInformation, CaptureIntegrityObject, CreateOrderIntegrityObject, DefendDisputeIntegrityObject, PaymentMethodTokenIntegrityObject, PaymentSynIntegrityObject, PaymentVoidIntegrityObject, PaymentVoidPostCaptureIntegrityObject, RefundIntegrityObject, RefundSyncIntegrityObject, RepeatPaymentIntegrityObject, SetupMandateIntegrityObject, SubmitEvidenceIntegrityObject, SyncRequestType, }, router_response_types::RedirectForm, types::{ ConnectorInfo, Connectors, PaymentMethodDataType, PaymentMethodDetails, PaymentMethodTypeMetadata, SupportedPaymentMethods, }, utils::{missing_field_err, Error, ForeignTryFrom}, }; use url::Url; // snake case for enum variants #[derive(Clone, Copy, Debug, Display, EnumString)] #[strum(serialize_all = "snake_case")] pub enum ConnectorEnum { Adyen, Razorpay, RazorpayV2, Fiserv, Elavon,
{ "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_-6262692988738800615_25_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs self, AcceptDisputeIntegrityObject, AuthoriseIntegrityObject, BrowserInformation, CaptureIntegrityObject, CreateOrderIntegrityObject, DefendDisputeIntegrityObject, PaymentMethodTokenIntegrityObject, PaymentSynIntegrityObject, PaymentVoidIntegrityObject, PaymentVoidPostCaptureIntegrityObject, RefundIntegrityObject, RefundSyncIntegrityObject, RepeatPaymentIntegrityObject, SetupMandateIntegrityObject, SubmitEvidenceIntegrityObject, SyncRequestType, }, router_response_types::RedirectForm, types::{ ConnectorInfo, Connectors, PaymentMethodDataType, PaymentMethodDetails, PaymentMethodTypeMetadata, SupportedPaymentMethods, }, utils::{missing_field_err, Error, ForeignTryFrom}, }; use url::Url;
{ "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_-6262692988738800615_25_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs self, AcceptDisputeIntegrityObject, AuthoriseIntegrityObject, BrowserInformation, CaptureIntegrityObject, CreateOrderIntegrityObject, DefendDisputeIntegrityObject, PaymentMethodTokenIntegrityObject, PaymentSynIntegrityObject, PaymentVoidIntegrityObject, PaymentVoidPostCaptureIntegrityObject, RefundIntegrityObject, RefundSyncIntegrityObject, RepeatPaymentIntegrityObject, SetupMandateIntegrityObject, SubmitEvidenceIntegrityObject, SyncRequestType, }, router_response_types::RedirectForm, types::{ ConnectorInfo, Connectors, PaymentMethodDataType, PaymentMethodDetails, PaymentMethodTypeMetadata, SupportedPaymentMethods, }, utils::{missing_field_err, Error, ForeignTryFrom}, }; use url::Url; // snake case for enum variants #[derive(Clone, Copy, Debug, Display, EnumString)] #[strum(serialize_all = "snake_case")] pub enum ConnectorEnum { Adyen, Razorpay, RazorpayV2, Fiserv, Elavon, Xendit, Checkout, Authorizedotnet, Mifinity, Phonepe,
{ "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_-6262692988738800615_25_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs self, AcceptDisputeIntegrityObject, AuthoriseIntegrityObject, BrowserInformation, CaptureIntegrityObject, CreateOrderIntegrityObject, DefendDisputeIntegrityObject, PaymentMethodTokenIntegrityObject, PaymentSynIntegrityObject, PaymentVoidIntegrityObject, PaymentVoidPostCaptureIntegrityObject, RefundIntegrityObject, RefundSyncIntegrityObject, RepeatPaymentIntegrityObject, SetupMandateIntegrityObject, SubmitEvidenceIntegrityObject, SyncRequestType, }, router_response_types::RedirectForm, types::{ ConnectorInfo, Connectors, PaymentMethodDataType, PaymentMethodDetails, PaymentMethodTypeMetadata, SupportedPaymentMethods, }, utils::{missing_field_err, Error, ForeignTryFrom}, }; use url::Url; // snake case for enum variants #[derive(Clone, Copy, Debug, Display, EnumString)] #[strum(serialize_all = "snake_case")] pub enum ConnectorEnum { Adyen, Razorpay, RazorpayV2, Fiserv, Elavon, Xendit, Checkout, Authorizedotnet, Mifinity, Phonepe, Cashfree, Paytm, Fiuu, Payu, Cashtocode, Novalnet, Nexinets, Noon, Braintree, Volt, Bluecode, Cryptopay, Helcim, Dlocal, Placetopay, Rapyd, Aci, Trustpay, Stripe, Cybersource,
{ "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_-6262692988738800615_50_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Xendit, Checkout, Authorizedotnet, Mifinity, Phonepe, Cashfree, Paytm, Fiuu, Payu, Cashtocode, Novalnet, Nexinets, Noon, Braintree, Volt, Bluecode, Cryptopay, Helcim, Dlocal, Placetopay, Rapyd, Aci, Trustpay, Stripe, Cybersource, Worldpay, Worldpayvantiv, Payload, }
{ "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_-6262692988738800615_50_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Xendit, Checkout, Authorizedotnet, Mifinity, Phonepe, Cashfree, Paytm, Fiuu, Payu, Cashtocode, Novalnet, Nexinets, Noon, Braintree, Volt, Bluecode, Cryptopay, Helcim, Dlocal, Placetopay, Rapyd, Aci, Trustpay, Stripe, Cybersource, Worldpay, Worldpayvantiv, Payload, } impl ForeignTryFrom<grpc_api_types::payments::Connector> for ConnectorEnum { type Error = ApplicationErrorResponse; fn foreign_try_from( connector: grpc_api_types::payments::Connector, ) -> Result<Self, error_stack::Report<Self::Error>> { match connector { grpc_api_types::payments::Connector::Adyen => Ok(Self::Adyen), grpc_api_types::payments::Connector::Razorpay => Ok(Self::Razorpay), grpc_api_types::payments::Connector::Fiserv => Ok(Self::Fiserv), grpc_api_types::payments::Connector::Elavon => Ok(Self::Elavon), grpc_api_types::payments::Connector::Xendit => Ok(Self::Xendit), grpc_api_types::payments::Connector::Checkout => Ok(Self::Checkout), grpc_api_types::payments::Connector::Authorizedotnet => Ok(Self::Authorizedotnet), grpc_api_types::payments::Connector::Phonepe => Ok(Self::Phonepe), grpc_api_types::payments::Connector::Cashfree => Ok(Self::Cashfree), grpc_api_types::payments::Connector::Paytm => Ok(Self::Paytm), grpc_api_types::payments::Connector::Fiuu => Ok(Self::Fiuu), grpc_api_types::payments::Connector::Payu => Ok(Self::Payu), grpc_api_types::payments::Connector::Cashtocode => Ok(Self::Cashtocode),
{ "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_-6262692988738800615_75_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Worldpay, Worldpayvantiv, Payload, } impl ForeignTryFrom<grpc_api_types::payments::Connector> for ConnectorEnum { type Error = ApplicationErrorResponse; fn foreign_try_from( connector: grpc_api_types::payments::Connector, ) -> Result<Self, error_stack::Report<Self::Error>> { match connector { grpc_api_types::payments::Connector::Adyen => Ok(Self::Adyen), grpc_api_types::payments::Connector::Razorpay => Ok(Self::Razorpay), grpc_api_types::payments::Connector::Fiserv => Ok(Self::Fiserv),
{ "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_-6262692988738800615_75_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Worldpay, Worldpayvantiv, Payload, } impl ForeignTryFrom<grpc_api_types::payments::Connector> for ConnectorEnum { type Error = ApplicationErrorResponse; fn foreign_try_from( connector: grpc_api_types::payments::Connector, ) -> Result<Self, error_stack::Report<Self::Error>> { match connector { grpc_api_types::payments::Connector::Adyen => Ok(Self::Adyen), grpc_api_types::payments::Connector::Razorpay => Ok(Self::Razorpay), grpc_api_types::payments::Connector::Fiserv => Ok(Self::Fiserv), grpc_api_types::payments::Connector::Elavon => Ok(Self::Elavon), grpc_api_types::payments::Connector::Xendit => Ok(Self::Xendit), grpc_api_types::payments::Connector::Checkout => Ok(Self::Checkout), grpc_api_types::payments::Connector::Authorizedotnet => Ok(Self::Authorizedotnet), grpc_api_types::payments::Connector::Phonepe => Ok(Self::Phonepe), grpc_api_types::payments::Connector::Cashfree => Ok(Self::Cashfree), grpc_api_types::payments::Connector::Paytm => Ok(Self::Paytm), grpc_api_types::payments::Connector::Fiuu => Ok(Self::Fiuu), grpc_api_types::payments::Connector::Payu => Ok(Self::Payu), grpc_api_types::payments::Connector::Cashtocode => Ok(Self::Cashtocode), grpc_api_types::payments::Connector::Novalnet => Ok(Self::Novalnet), grpc_api_types::payments::Connector::Nexinets => Ok(Self::Nexinets), grpc_api_types::payments::Connector::Noon => Ok(Self::Noon), grpc_api_types::payments::Connector::Mifinity => Ok(Self::Mifinity), grpc_api_types::payments::Connector::Braintree => Ok(Self::Braintree),
{ "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_-6262692988738800615_75_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Worldpay, Worldpayvantiv, Payload, } impl ForeignTryFrom<grpc_api_types::payments::Connector> for ConnectorEnum { type Error = ApplicationErrorResponse; fn foreign_try_from( connector: grpc_api_types::payments::Connector, ) -> Result<Self, error_stack::Report<Self::Error>> { match connector { grpc_api_types::payments::Connector::Adyen => Ok(Self::Adyen), grpc_api_types::payments::Connector::Razorpay => Ok(Self::Razorpay), grpc_api_types::payments::Connector::Fiserv => Ok(Self::Fiserv), grpc_api_types::payments::Connector::Elavon => Ok(Self::Elavon), grpc_api_types::payments::Connector::Xendit => Ok(Self::Xendit), grpc_api_types::payments::Connector::Checkout => Ok(Self::Checkout), grpc_api_types::payments::Connector::Authorizedotnet => Ok(Self::Authorizedotnet), grpc_api_types::payments::Connector::Phonepe => Ok(Self::Phonepe), grpc_api_types::payments::Connector::Cashfree => Ok(Self::Cashfree), grpc_api_types::payments::Connector::Paytm => Ok(Self::Paytm), grpc_api_types::payments::Connector::Fiuu => Ok(Self::Fiuu), grpc_api_types::payments::Connector::Payu => Ok(Self::Payu), grpc_api_types::payments::Connector::Cashtocode => Ok(Self::Cashtocode), grpc_api_types::payments::Connector::Novalnet => Ok(Self::Novalnet), grpc_api_types::payments::Connector::Nexinets => Ok(Self::Nexinets), grpc_api_types::payments::Connector::Noon => Ok(Self::Noon), grpc_api_types::payments::Connector::Mifinity => Ok(Self::Mifinity), grpc_api_types::payments::Connector::Braintree => Ok(Self::Braintree), grpc_api_types::payments::Connector::Volt => Ok(Self::Volt), grpc_api_types::payments::Connector::Bluecode => Ok(Self::Bluecode), grpc_api_types::payments::Connector::Cryptopay => Ok(Self::Cryptopay), grpc_api_types::payments::Connector::Helcim => Ok(Self::Helcim), grpc_api_types::payments::Connector::Dlocal => Ok(Self::Dlocal), grpc_api_types::payments::Connector::Placetopay => Ok(Self::Placetopay), grpc_api_types::payments::Connector::Rapyd => Ok(Self::Rapyd), grpc_api_types::payments::Connector::Aci => Ok(Self::Aci), grpc_api_types::payments::Connector::Trustpay => Ok(Self::Trustpay), grpc_api_types::payments::Connector::Stripe => Ok(Self::Stripe), grpc_api_types::payments::Connector::Cybersource => Ok(Self::Cybersource), grpc_api_types::payments::Connector::Worldpay => Ok(Self::Worldpayvantiv), grpc_api_types::payments::Connector::Payload => Ok(Self::Payload), grpc_api_types::payments::Connector::Unspecified => { Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "UNSPECIFIED_CONNECTOR".to_owned(), error_identifier: 400, error_message: "Connector must be specified".to_owned(), error_object: None, })
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 75, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_100_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs grpc_api_types::payments::Connector::Novalnet => Ok(Self::Novalnet), grpc_api_types::payments::Connector::Nexinets => Ok(Self::Nexinets), grpc_api_types::payments::Connector::Noon => Ok(Self::Noon), grpc_api_types::payments::Connector::Mifinity => Ok(Self::Mifinity), grpc_api_types::payments::Connector::Braintree => Ok(Self::Braintree), grpc_api_types::payments::Connector::Volt => Ok(Self::Volt), grpc_api_types::payments::Connector::Bluecode => Ok(Self::Bluecode), grpc_api_types::payments::Connector::Cryptopay => Ok(Self::Cryptopay), grpc_api_types::payments::Connector::Helcim => Ok(Self::Helcim), grpc_api_types::payments::Connector::Dlocal => Ok(Self::Dlocal), grpc_api_types::payments::Connector::Placetopay => Ok(Self::Placetopay), grpc_api_types::payments::Connector::Rapyd => Ok(Self::Rapyd), grpc_api_types::payments::Connector::Aci => Ok(Self::Aci), grpc_api_types::payments::Connector::Trustpay => Ok(Self::Trustpay), grpc_api_types::payments::Connector::Stripe => Ok(Self::Stripe),
{ "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_-6262692988738800615_100_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs grpc_api_types::payments::Connector::Novalnet => Ok(Self::Novalnet), grpc_api_types::payments::Connector::Nexinets => Ok(Self::Nexinets), grpc_api_types::payments::Connector::Noon => Ok(Self::Noon), grpc_api_types::payments::Connector::Mifinity => Ok(Self::Mifinity), grpc_api_types::payments::Connector::Braintree => Ok(Self::Braintree), grpc_api_types::payments::Connector::Volt => Ok(Self::Volt), grpc_api_types::payments::Connector::Bluecode => Ok(Self::Bluecode), grpc_api_types::payments::Connector::Cryptopay => Ok(Self::Cryptopay), grpc_api_types::payments::Connector::Helcim => Ok(Self::Helcim), grpc_api_types::payments::Connector::Dlocal => Ok(Self::Dlocal), grpc_api_types::payments::Connector::Placetopay => Ok(Self::Placetopay), grpc_api_types::payments::Connector::Rapyd => Ok(Self::Rapyd), grpc_api_types::payments::Connector::Aci => Ok(Self::Aci), grpc_api_types::payments::Connector::Trustpay => Ok(Self::Trustpay), grpc_api_types::payments::Connector::Stripe => Ok(Self::Stripe), grpc_api_types::payments::Connector::Cybersource => Ok(Self::Cybersource), grpc_api_types::payments::Connector::Worldpay => Ok(Self::Worldpayvantiv), grpc_api_types::payments::Connector::Payload => Ok(Self::Payload), grpc_api_types::payments::Connector::Unspecified => { Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "UNSPECIFIED_CONNECTOR".to_owned(), error_identifier: 400, error_message: "Connector must be specified".to_owned(), error_object: None, }) .into()) } _ => Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "INVALID_CONNECTOR".to_owned(), error_identifier: 400,
{ "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_-6262692988738800615_100_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs grpc_api_types::payments::Connector::Novalnet => Ok(Self::Novalnet), grpc_api_types::payments::Connector::Nexinets => Ok(Self::Nexinets), grpc_api_types::payments::Connector::Noon => Ok(Self::Noon), grpc_api_types::payments::Connector::Mifinity => Ok(Self::Mifinity), grpc_api_types::payments::Connector::Braintree => Ok(Self::Braintree), grpc_api_types::payments::Connector::Volt => Ok(Self::Volt), grpc_api_types::payments::Connector::Bluecode => Ok(Self::Bluecode), grpc_api_types::payments::Connector::Cryptopay => Ok(Self::Cryptopay), grpc_api_types::payments::Connector::Helcim => Ok(Self::Helcim), grpc_api_types::payments::Connector::Dlocal => Ok(Self::Dlocal), grpc_api_types::payments::Connector::Placetopay => Ok(Self::Placetopay), grpc_api_types::payments::Connector::Rapyd => Ok(Self::Rapyd), grpc_api_types::payments::Connector::Aci => Ok(Self::Aci), grpc_api_types::payments::Connector::Trustpay => Ok(Self::Trustpay), grpc_api_types::payments::Connector::Stripe => Ok(Self::Stripe), grpc_api_types::payments::Connector::Cybersource => Ok(Self::Cybersource), grpc_api_types::payments::Connector::Worldpay => Ok(Self::Worldpayvantiv), grpc_api_types::payments::Connector::Payload => Ok(Self::Payload), grpc_api_types::payments::Connector::Unspecified => { Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "UNSPECIFIED_CONNECTOR".to_owned(), error_identifier: 400, error_message: "Connector must be specified".to_owned(), error_object: None, }) .into()) } _ => Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "INVALID_CONNECTOR".to_owned(), error_identifier: 400, error_message: format!("Connector {connector:?} is not supported"), error_object: None, }) .into()), } } } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct PaymentId(pub String); #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct UpdateHistory { pub connector_mandate_id: Option<String>, pub payment_method_id: String, pub original_payment_id: Option<PaymentId>, } #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)] pub struct ConnectorMandateReferenceId {
{ "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_-6262692988738800615_125_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .into()) } _ => Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "INVALID_CONNECTOR".to_owned(), error_identifier: 400, error_message: format!("Connector {connector:?} is not supported"), error_object: None, }) .into()), } } } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct PaymentId(pub String);
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_125_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .into()) } _ => Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "INVALID_CONNECTOR".to_owned(), error_identifier: 400, error_message: format!("Connector {connector:?} is not supported"), error_object: None, }) .into()), } } } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct PaymentId(pub String); #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct UpdateHistory { pub connector_mandate_id: Option<String>, pub payment_method_id: String, pub original_payment_id: Option<PaymentId>, } #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)] pub struct ConnectorMandateReferenceId { connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_-6262692988738800615_125_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .into()) } _ => Err(ApplicationErrorResponse::BadRequest(ApiError { sub_code: "INVALID_CONNECTOR".to_owned(), error_identifier: 400, error_message: format!("Connector {connector:?} is not supported"), error_object: None, }) .into()), } } } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct PaymentId(pub String); #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)] pub struct UpdateHistory { pub connector_mandate_id: Option<String>, pub payment_method_id: String, pub original_payment_id: Option<PaymentId>, } #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)] pub struct ConnectorMandateReferenceId { connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, } impl ConnectorMandateReferenceId { pub fn new( connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, ) -> Self { Self { connector_mandate_id, payment_method_id, update_history, mandate_metadata, } } pub fn get_connector_mandate_id(&self) -> Option<String> { self.connector_mandate_id.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": 125, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_150_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, } impl ConnectorMandateReferenceId { pub fn new( connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, ) -> Self { Self { connector_mandate_id,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_-6262692988738800615_150_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, } impl ConnectorMandateReferenceId { pub fn new( connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, ) -> Self { Self { connector_mandate_id, payment_method_id, update_history, mandate_metadata, } } pub fn get_connector_mandate_id(&self) -> Option<String> { self.connector_mandate_id.clone() } pub fn get_payment_method_id(&self) -> Option<&String> { self.payment_method_id.as_ref() } pub fn get_update_history(&self) -> Option<&Vec<UpdateHistory>> {
{ "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_-6262692988738800615_150_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, } impl ConnectorMandateReferenceId { pub fn new( connector_mandate_id: Option<String>, payment_method_id: Option<String>, update_history: Option<Vec<UpdateHistory>>, mandate_metadata: Option<SecretSerdeValue>, ) -> Self { Self { connector_mandate_id, payment_method_id, update_history, mandate_metadata, } } pub fn get_connector_mandate_id(&self) -> Option<String> { self.connector_mandate_id.clone() } pub fn get_payment_method_id(&self) -> Option<&String> { self.payment_method_id.as_ref() } pub fn get_update_history(&self) -> Option<&Vec<UpdateHistory>> { self.update_history.as_ref() } pub fn get_mandate_metadata(&self) -> Option<SecretSerdeValue> { self.mandate_metadata.clone() } } pub trait RawConnectorRequestResponse { fn set_raw_connector_response(&mut self, response: Option<Secret<String>>); fn get_raw_connector_response(&self) -> Option<Secret<String>>; fn set_raw_connector_request(&mut self, request: Option<Secret<String>>); fn get_raw_connector_request(&self) -> Option<Secret<String>>; } pub trait ConnectorResponseHeaders { fn set_connector_response_headers(&mut self, headers: Option<http::HeaderMap>); fn get_connector_response_headers(&self) -> Option<&http::HeaderMap>; fn get_connector_response_headers_as_map(&self) -> std::collections::HashMap<String, String> { self.get_connector_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": 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_-6262692988738800615_175_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_payment_method_id(&self) -> Option<&String> { self.payment_method_id.as_ref() } pub fn get_update_history(&self) -> Option<&Vec<UpdateHistory>> { self.update_history.as_ref() } pub fn get_mandate_metadata(&self) -> Option<SecretSerdeValue> { self.mandate_metadata.clone() } } pub trait RawConnectorRequestResponse { fn set_raw_connector_response(&mut self, response: 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": 175, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_175_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_payment_method_id(&self) -> Option<&String> { self.payment_method_id.as_ref() } pub fn get_update_history(&self) -> Option<&Vec<UpdateHistory>> { self.update_history.as_ref() } pub fn get_mandate_metadata(&self) -> Option<SecretSerdeValue> { self.mandate_metadata.clone() } } pub trait RawConnectorRequestResponse { fn set_raw_connector_response(&mut self, response: Option<Secret<String>>); fn get_raw_connector_response(&self) -> Option<Secret<String>>; fn set_raw_connector_request(&mut self, request: Option<Secret<String>>); fn get_raw_connector_request(&self) -> Option<Secret<String>>; } pub trait ConnectorResponseHeaders { fn set_connector_response_headers(&mut self, headers: Option<http::HeaderMap>); fn get_connector_response_headers(&self) -> Option<&http::HeaderMap>; fn get_connector_response_headers_as_map(&self) -> std::collections::HashMap<String, String> { self.get_connector_response_headers() .map(|headers| { headers .iter() .filter_map(|(name, value)| { value
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_-6262692988738800615_175_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_payment_method_id(&self) -> Option<&String> { self.payment_method_id.as_ref() } pub fn get_update_history(&self) -> Option<&Vec<UpdateHistory>> { self.update_history.as_ref() } pub fn get_mandate_metadata(&self) -> Option<SecretSerdeValue> { self.mandate_metadata.clone() } } pub trait RawConnectorRequestResponse { fn set_raw_connector_response(&mut self, response: Option<Secret<String>>); fn get_raw_connector_response(&self) -> Option<Secret<String>>; fn set_raw_connector_request(&mut self, request: Option<Secret<String>>); fn get_raw_connector_request(&self) -> Option<Secret<String>>; } pub trait ConnectorResponseHeaders { fn set_connector_response_headers(&mut self, headers: Option<http::HeaderMap>); fn get_connector_response_headers(&self) -> Option<&http::HeaderMap>; fn get_connector_response_headers_as_map(&self) -> std::collections::HashMap<String, String> { self.get_connector_response_headers() .map(|headers| { headers .iter() .filter_map(|(name, value)| { value .to_str() .ok() .map(|v| (name.to_string(), v.to_string())) }) .collect() }) .unwrap_or_default() } } #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)] pub struct NetworkTokenWithNTIRef { pub network_transaction_id: String, pub token_exp_month: Option<Secret<String>>, pub token_exp_year: Option<Secret<String>>, } #[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)] pub enum MandateReferenceId { ConnectorMandateId(ConnectorMandateReferenceId), // mandate_id send by connector
{ "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_-6262692988738800615_200_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .map(|headers| { headers .iter() .filter_map(|(name, value)| { value .to_str() .ok() .map(|v| (name.to_string(), v.to_string())) }) .collect() }) .unwrap_or_default() } }
{ "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_-6262692988738800615_200_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .map(|headers| { headers .iter() .filter_map(|(name, value)| { value .to_str() .ok() .map(|v| (name.to_string(), v.to_string())) }) .collect() }) .unwrap_or_default() } } #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)] pub struct NetworkTokenWithNTIRef { pub network_transaction_id: String, pub token_exp_month: Option<Secret<String>>, pub token_exp_year: Option<Secret<String>>, } #[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)] pub enum MandateReferenceId { ConnectorMandateId(ConnectorMandateReferenceId), // mandate_id send by connector NetworkMandateId(String), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with card data NetworkTokenWithNTI(NetworkTokenWithNTIRef), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with network token data } #[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, 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_-6262692988738800615_200_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .map(|headers| { headers .iter() .filter_map(|(name, value)| { value .to_str() .ok() .map(|v| (name.to_string(), v.to_string())) }) .collect() }) .unwrap_or_default() } } #[derive(Debug, serde::Deserialize, serde::Serialize, Clone, Eq, PartialEq)] pub struct NetworkTokenWithNTIRef { pub network_transaction_id: String, pub token_exp_month: Option<Secret<String>>, pub token_exp_year: Option<Secret<String>>, } #[derive(Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)] pub enum MandateReferenceId { ConnectorMandateId(ConnectorMandateReferenceId), // mandate_id send by connector NetworkMandateId(String), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with card data NetworkTokenWithNTI(NetworkTokenWithNTIRef), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with network token data } #[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)] pub struct MandateIds { pub mandate_id: Option<String>, pub mandate_reference_id: Option<MandateReferenceId>, } impl MandateIds { pub fn is_network_transaction_id_flow(&self) -> bool { matches!( self.mandate_reference_id, Some(MandateReferenceId::NetworkMandateId(_)) ) } pub fn new(mandate_id: String) -> Self { Self { mandate_id: Some(mandate_id), mandate_reference_id: None, } } }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 200, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_225_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs NetworkMandateId(String), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with card data NetworkTokenWithNTI(NetworkTokenWithNTIRef), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with network token data } #[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)] pub struct MandateIds { pub mandate_id: Option<String>, pub mandate_reference_id: Option<MandateReferenceId>, } impl MandateIds { pub fn is_network_transaction_id_flow(&self) -> bool { matches!( self.mandate_reference_id, Some(MandateReferenceId::NetworkMandateId(_))
{ "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_-6262692988738800615_225_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs NetworkMandateId(String), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with card data NetworkTokenWithNTI(NetworkTokenWithNTIRef), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with network token data } #[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)] pub struct MandateIds { pub mandate_id: Option<String>, pub mandate_reference_id: Option<MandateReferenceId>, } impl MandateIds { pub fn is_network_transaction_id_flow(&self) -> bool { matches!( self.mandate_reference_id, Some(MandateReferenceId::NetworkMandateId(_)) ) } pub fn new(mandate_id: String) -> Self { Self { mandate_id: Some(mandate_id), mandate_reference_id: None, } } } #[derive(Debug, Default, Clone)] pub struct PaymentsSyncData { pub connector_transaction_id: ResponseId, pub encoded_data: Option<String>,
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 225, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_225_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs NetworkMandateId(String), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with card data NetworkTokenWithNTI(NetworkTokenWithNTIRef), // network_txns_id send by Issuer to connector, Used for PG agnostic mandate txns along with network token data } #[derive(Default, Eq, PartialEq, Debug, serde::Deserialize, serde::Serialize, Clone)] pub struct MandateIds { pub mandate_id: Option<String>, pub mandate_reference_id: Option<MandateReferenceId>, } impl MandateIds { pub fn is_network_transaction_id_flow(&self) -> bool { matches!( self.mandate_reference_id, Some(MandateReferenceId::NetworkMandateId(_)) ) } pub fn new(mandate_id: String) -> Self { Self { mandate_id: Some(mandate_id), mandate_reference_id: None, } } } #[derive(Debug, Default, Clone)] pub struct PaymentsSyncData { pub connector_transaction_id: ResponseId, pub encoded_data: Option<String>, pub capture_method: Option<common_enums::CaptureMethod>, pub connector_meta: Option<serde_json::Value>, pub sync_type: SyncRequestType, pub mandate_id: Option<MandateIds>, pub payment_method_type: Option<common_enums::PaymentMethodType>, pub currency: common_enums::Currency, pub payment_experience: Option<common_enums::PaymentExperience>, pub amount: MinorUnit, pub all_keys_required: Option<bool>, pub integrity_object: Option<PaymentSynIntegrityObject>, pub split_payments: Option<SplitPaymentsRequest>, } impl PaymentsSyncData { pub fn is_auto_capture(&self) -> Result<bool, Error> { match self.capture_method { Some(common_enums::CaptureMethod::Automatic) | None | Some(common_enums::CaptureMethod::SequentialAutomatic) => Ok(true), Some(common_enums::CaptureMethod::Manual) => Ok(false),
{ "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_-6262692988738800615_250_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs #[derive(Debug, Default, Clone)] pub struct PaymentsSyncData { pub connector_transaction_id: ResponseId, pub encoded_data: Option<String>, pub capture_method: Option<common_enums::CaptureMethod>, pub connector_meta: Option<serde_json::Value>, pub sync_type: SyncRequestType, pub mandate_id: Option<MandateIds>, pub payment_method_type: Option<common_enums::PaymentMethodType>, pub currency: common_enums::Currency, pub payment_experience: Option<common_enums::PaymentExperience>, pub amount: MinorUnit, pub all_keys_required: Option<bool>, pub integrity_object: Option<PaymentSynIntegrityObject>,
{ "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_-6262692988738800615_250_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs #[derive(Debug, Default, Clone)] pub struct PaymentsSyncData { pub connector_transaction_id: ResponseId, pub encoded_data: Option<String>, pub capture_method: Option<common_enums::CaptureMethod>, pub connector_meta: Option<serde_json::Value>, pub sync_type: SyncRequestType, pub mandate_id: Option<MandateIds>, pub payment_method_type: Option<common_enums::PaymentMethodType>, pub currency: common_enums::Currency, pub payment_experience: Option<common_enums::PaymentExperience>, pub amount: MinorUnit, pub all_keys_required: Option<bool>, pub integrity_object: Option<PaymentSynIntegrityObject>, pub split_payments: Option<SplitPaymentsRequest>, } impl PaymentsSyncData { pub fn is_auto_capture(&self) -> Result<bool, Error> { match self.capture_method { Some(common_enums::CaptureMethod::Automatic) | None | Some(common_enums::CaptureMethod::SequentialAutomatic) => Ok(true), Some(common_enums::CaptureMethod::Manual) => Ok(false), Some(_) => Err(ConnectorError::CaptureMethodNotSupported.into()), } } pub fn get_connector_transaction_id(&self) -> CustomResult<String, ConnectorError> { match self.connector_transaction_id.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": 250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_250_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs #[derive(Debug, Default, Clone)] pub struct PaymentsSyncData { pub connector_transaction_id: ResponseId, pub encoded_data: Option<String>, pub capture_method: Option<common_enums::CaptureMethod>, pub connector_meta: Option<serde_json::Value>, pub sync_type: SyncRequestType, pub mandate_id: Option<MandateIds>, pub payment_method_type: Option<common_enums::PaymentMethodType>, pub currency: common_enums::Currency, pub payment_experience: Option<common_enums::PaymentExperience>, pub amount: MinorUnit, pub all_keys_required: Option<bool>, pub integrity_object: Option<PaymentSynIntegrityObject>, pub split_payments: Option<SplitPaymentsRequest>, } impl PaymentsSyncData { pub fn is_auto_capture(&self) -> Result<bool, Error> { match self.capture_method { Some(common_enums::CaptureMethod::Automatic) | None | Some(common_enums::CaptureMethod::SequentialAutomatic) => Ok(true), Some(common_enums::CaptureMethod::Manual) => Ok(false), Some(_) => Err(ConnectorError::CaptureMethodNotSupported.into()), } } pub fn get_connector_transaction_id(&self) -> CustomResult<String, ConnectorError> { match self.connector_transaction_id.clone() { ResponseId::ConnectorTransactionId(txn_id) => Ok(txn_id), _ => Err(errors::ValidationError::IncorrectValueProvided { field_name: "connector_transaction_id", }) .attach_printable("Expected connector transaction ID not found") .change_context(ConnectorError::MissingConnectorTransactionID)?, } } } #[derive(Debug, Clone)] pub struct PaymentFlowData { pub merchant_id: common_utils::id_type::MerchantId, pub customer_id: Option<common_utils::id_type::CustomerId>, pub connector_customer: Option<String>, pub payment_id: String, pub attempt_id: String, pub status: AttemptStatus, pub payment_method: PaymentMethod, pub description: 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": 250, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_275_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Some(_) => Err(ConnectorError::CaptureMethodNotSupported.into()), } } pub fn get_connector_transaction_id(&self) -> CustomResult<String, ConnectorError> { match self.connector_transaction_id.clone() { ResponseId::ConnectorTransactionId(txn_id) => Ok(txn_id), _ => Err(errors::ValidationError::IncorrectValueProvided { field_name: "connector_transaction_id", }) .attach_printable("Expected connector transaction ID not found") .change_context(ConnectorError::MissingConnectorTransactionID)?, } } }
{ "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_-6262692988738800615_275_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Some(_) => Err(ConnectorError::CaptureMethodNotSupported.into()), } } pub fn get_connector_transaction_id(&self) -> CustomResult<String, ConnectorError> { match self.connector_transaction_id.clone() { ResponseId::ConnectorTransactionId(txn_id) => Ok(txn_id), _ => Err(errors::ValidationError::IncorrectValueProvided { field_name: "connector_transaction_id", }) .attach_printable("Expected connector transaction ID not found") .change_context(ConnectorError::MissingConnectorTransactionID)?, } } } #[derive(Debug, Clone)] pub struct PaymentFlowData { pub merchant_id: common_utils::id_type::MerchantId, pub customer_id: Option<common_utils::id_type::CustomerId>, pub connector_customer: Option<String>, pub payment_id: String, pub attempt_id: String, pub status: AttemptStatus, pub payment_method: PaymentMethod, pub description: Option<String>, pub return_url: Option<String>, pub address: payment_address::PaymentAddress, pub auth_type: AuthenticationType, pub connector_meta_data: Option<common_utils::pii::SecretSerdeValue>, pub amount_captured: Option<i64>,
{ "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_-6262692988738800615_275_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs Some(_) => Err(ConnectorError::CaptureMethodNotSupported.into()), } } pub fn get_connector_transaction_id(&self) -> CustomResult<String, ConnectorError> { match self.connector_transaction_id.clone() { ResponseId::ConnectorTransactionId(txn_id) => Ok(txn_id), _ => Err(errors::ValidationError::IncorrectValueProvided { field_name: "connector_transaction_id", }) .attach_printable("Expected connector transaction ID not found") .change_context(ConnectorError::MissingConnectorTransactionID)?, } } } #[derive(Debug, Clone)] pub struct PaymentFlowData { pub merchant_id: common_utils::id_type::MerchantId, pub customer_id: Option<common_utils::id_type::CustomerId>, pub connector_customer: Option<String>, pub payment_id: String, pub attempt_id: String, pub status: AttemptStatus, pub payment_method: PaymentMethod, pub description: Option<String>, pub return_url: Option<String>, pub address: payment_address::PaymentAddress, pub auth_type: AuthenticationType, pub connector_meta_data: Option<common_utils::pii::SecretSerdeValue>, pub amount_captured: Option<i64>, // minor amount for amount frameworka pub minor_amount_captured: Option<MinorUnit>, pub minor_amount_capturable: Option<MinorUnit>, pub access_token: Option<AccessTokenResponseData>, pub session_token: Option<String>, pub reference_id: Option<String>, pub payment_method_token: Option<PaymentMethodToken>, pub preprocessing_id: Option<String>, ///for switching between two different versions of the same connector pub connector_api_version: Option<String>, /// Contains a reference ID that should be sent in the connector request pub connector_request_reference_id: String, pub test_mode: Option<bool>, pub connector_http_status_code: Option<u16>, pub connector_response_headers: Option<http::HeaderMap>, pub external_latency: Option<u128>, pub connectors: Connectors, pub raw_connector_response: Option<Secret<String>>, pub raw_connector_request: Option<Secret<String>>, pub vault_headers: Option<std::collections::HashMap<String, 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": 275, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_300_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub return_url: Option<String>, pub address: payment_address::PaymentAddress, pub auth_type: AuthenticationType, pub connector_meta_data: Option<common_utils::pii::SecretSerdeValue>, pub amount_captured: Option<i64>, // minor amount for amount frameworka pub minor_amount_captured: Option<MinorUnit>, pub minor_amount_capturable: Option<MinorUnit>, pub access_token: Option<AccessTokenResponseData>, pub session_token: Option<String>, pub reference_id: Option<String>, pub payment_method_token: Option<PaymentMethodToken>, pub preprocessing_id: Option<String>, ///for switching between two different versions of the same connector pub connector_api_version: 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": 300, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_300_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub return_url: Option<String>, pub address: payment_address::PaymentAddress, pub auth_type: AuthenticationType, pub connector_meta_data: Option<common_utils::pii::SecretSerdeValue>, pub amount_captured: Option<i64>, // minor amount for amount frameworka pub minor_amount_captured: Option<MinorUnit>, pub minor_amount_capturable: Option<MinorUnit>, pub access_token: Option<AccessTokenResponseData>, pub session_token: Option<String>, pub reference_id: Option<String>, pub payment_method_token: Option<PaymentMethodToken>, pub preprocessing_id: Option<String>, ///for switching between two different versions of the same connector pub connector_api_version: Option<String>, /// Contains a reference ID that should be sent in the connector request pub connector_request_reference_id: String, pub test_mode: Option<bool>, pub connector_http_status_code: Option<u16>, pub connector_response_headers: Option<http::HeaderMap>, pub external_latency: Option<u128>, pub connectors: Connectors, pub raw_connector_response: Option<Secret<String>>, pub raw_connector_request: Option<Secret<String>>, pub vault_headers: Option<std::collections::HashMap<String, Secret<String>>>, /// This field is used to store various data regarding the response from connector pub connector_response: Option<ConnectorResponseData>, pub recurring_mandate_payment_data: Option<RecurringMandatePaymentData>, }
{ "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_-6262692988738800615_300_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub return_url: Option<String>, pub address: payment_address::PaymentAddress, pub auth_type: AuthenticationType, pub connector_meta_data: Option<common_utils::pii::SecretSerdeValue>, pub amount_captured: Option<i64>, // minor amount for amount frameworka pub minor_amount_captured: Option<MinorUnit>, pub minor_amount_capturable: Option<MinorUnit>, pub access_token: Option<AccessTokenResponseData>, pub session_token: Option<String>, pub reference_id: Option<String>, pub payment_method_token: Option<PaymentMethodToken>, pub preprocessing_id: Option<String>, ///for switching between two different versions of the same connector pub connector_api_version: Option<String>, /// Contains a reference ID that should be sent in the connector request pub connector_request_reference_id: String, pub test_mode: Option<bool>, pub connector_http_status_code: Option<u16>, pub connector_response_headers: Option<http::HeaderMap>, pub external_latency: Option<u128>, pub connectors: Connectors, pub raw_connector_response: Option<Secret<String>>, pub raw_connector_request: Option<Secret<String>>, pub vault_headers: Option<std::collections::HashMap<String, Secret<String>>>, /// This field is used to store various data regarding the response from connector pub connector_response: Option<ConnectorResponseData>, pub recurring_mandate_payment_data: Option<RecurringMandatePaymentData>, } impl PaymentFlowData { pub fn set_status(&mut self, status: AttemptStatus) { self.status = status; } pub fn get_billing(&self) -> Result<&Address, Error> { self.address .get_payment_method_billing() .ok_or_else(missing_field_err("billing")) } pub fn get_billing_country(&self) -> Result<common_enums::CountryAlpha2, Error> { self.address .get_payment_method_billing() .and_then(|a| a.address.as_ref()) .and_then(|ad| ad.country) .ok_or_else(missing_field_err( "payment_method_data.billing.address.country", )) }
{ "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_-6262692988738800615_325_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs /// This field is used to store various data regarding the response from connector pub connector_response: Option<ConnectorResponseData>, pub recurring_mandate_payment_data: Option<RecurringMandatePaymentData>, } impl PaymentFlowData { pub fn set_status(&mut self, status: AttemptStatus) { self.status = status; } pub fn get_billing(&self) -> Result<&Address, Error> { self.address .get_payment_method_billing() .ok_or_else(missing_field_err("billing")) }
{ "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_-6262692988738800615_325_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs /// This field is used to store various data regarding the response from connector pub connector_response: Option<ConnectorResponseData>, pub recurring_mandate_payment_data: Option<RecurringMandatePaymentData>, } impl PaymentFlowData { pub fn set_status(&mut self, status: AttemptStatus) { self.status = status; } pub fn get_billing(&self) -> Result<&Address, Error> { self.address .get_payment_method_billing() .ok_or_else(missing_field_err("billing")) } pub fn get_billing_country(&self) -> Result<common_enums::CountryAlpha2, Error> { self.address .get_payment_method_billing() .and_then(|a| a.address.as_ref()) .and_then(|ad| ad.country) .ok_or_else(missing_field_err( "payment_method_data.billing.address.country", )) } pub fn get_billing_phone(&self) -> Result<&PhoneDetails, Error> { self.address .get_payment_method_billing() .and_then(|a| a.phone.as_ref())
{ "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_-6262692988738800615_325_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs /// This field is used to store various data regarding the response from connector pub connector_response: Option<ConnectorResponseData>, pub recurring_mandate_payment_data: Option<RecurringMandatePaymentData>, } impl PaymentFlowData { pub fn set_status(&mut self, status: AttemptStatus) { self.status = status; } pub fn get_billing(&self) -> Result<&Address, Error> { self.address .get_payment_method_billing() .ok_or_else(missing_field_err("billing")) } pub fn get_billing_country(&self) -> Result<common_enums::CountryAlpha2, Error> { self.address .get_payment_method_billing() .and_then(|a| a.address.as_ref()) .and_then(|ad| ad.country) .ok_or_else(missing_field_err( "payment_method_data.billing.address.country", )) } pub fn get_billing_phone(&self) -> Result<&PhoneDetails, Error> { self.address .get_payment_method_billing() .and_then(|a| a.phone.as_ref()) .ok_or_else(missing_field_err("billing.phone")) } pub fn get_optional_billing(&self) -> Option<&Address> { self.address.get_payment_method_billing() } pub fn get_optional_shipping(&self) -> Option<&Address> { self.address.get_shipping() } pub fn get_optional_shipping_first_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.first_name) }) }
{ "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_-6262692988738800615_350_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_phone(&self) -> Result<&PhoneDetails, Error> { self.address .get_payment_method_billing() .and_then(|a| a.phone.as_ref()) .ok_or_else(missing_field_err("billing.phone")) } pub fn get_optional_billing(&self) -> Option<&Address> { self.address.get_payment_method_billing() } pub fn get_optional_shipping(&self) -> Option<&Address> { self.address.get_shipping() }
{ "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_-6262692988738800615_350_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_phone(&self) -> Result<&PhoneDetails, Error> { self.address .get_payment_method_billing() .and_then(|a| a.phone.as_ref()) .ok_or_else(missing_field_err("billing.phone")) } pub fn get_optional_billing(&self) -> Option<&Address> { self.address.get_payment_method_billing() } pub fn get_optional_shipping(&self) -> Option<&Address> { self.address.get_shipping() } pub fn get_optional_shipping_first_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.first_name) }) } pub fn get_optional_shipping_last_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address
{ "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_-6262692988738800615_350_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_phone(&self) -> Result<&PhoneDetails, Error> { self.address .get_payment_method_billing() .and_then(|a| a.phone.as_ref()) .ok_or_else(missing_field_err("billing.phone")) } pub fn get_optional_billing(&self) -> Option<&Address> { self.address.get_payment_method_billing() } pub fn get_optional_shipping(&self) -> Option<&Address> { self.address.get_shipping() } pub fn get_optional_shipping_first_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.first_name) }) } pub fn get_optional_shipping_last_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.last_name) }) } pub fn get_optional_shipping_line1(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.line1) }) } pub fn get_optional_shipping_line2(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.line2) })
{ "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_-6262692988738800615_375_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_last_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.last_name) }) } pub fn get_optional_shipping_line1(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.line1)
{ "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_-6262692988738800615_375_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_last_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.last_name) }) } pub fn get_optional_shipping_line1(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.line1) }) } pub fn get_optional_shipping_line2(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.line2) }) } pub fn get_optional_shipping_city(&self) -> Option<String> { self.address.get_shipping().and_then(|shipping_address| { shipping_address
{ "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_-6262692988738800615_375_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_last_name(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.last_name) }) } pub fn get_optional_shipping_line1(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.line1) }) } pub fn get_optional_shipping_line2(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.line2) }) } pub fn get_optional_shipping_city(&self) -> Option<String> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.city) }) } pub fn get_optional_shipping_state(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.state) }) } pub fn get_optional_shipping_full_name(&self) -> Option<Secret<String>> { self.get_optional_shipping() .and_then(|shipping_details| shipping_details.address.as_ref()) .and_then(|shipping_address| shipping_address.get_optional_full_name()) }
{ "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_-6262692988738800615_400_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs } pub fn get_optional_shipping_city(&self) -> Option<String> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.city) }) } pub fn get_optional_shipping_state(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .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": 400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_400_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs } pub fn get_optional_shipping_city(&self) -> Option<String> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.city) }) } pub fn get_optional_shipping_state(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.state) }) } pub fn get_optional_shipping_full_name(&self) -> Option<Secret<String>> { self.get_optional_shipping() .and_then(|shipping_details| shipping_details.address.as_ref()) .and_then(|shipping_address| shipping_address.get_optional_full_name()) } pub fn get_optional_shipping_country(&self) -> Option<common_enums::CountryAlpha2> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .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": 400, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_400_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs } pub fn get_optional_shipping_city(&self) -> Option<String> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.city) }) } pub fn get_optional_shipping_state(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.state) }) } pub fn get_optional_shipping_full_name(&self) -> Option<Secret<String>> { self.get_optional_shipping() .and_then(|shipping_details| shipping_details.address.as_ref()) .and_then(|shipping_address| shipping_address.get_optional_full_name()) } pub fn get_optional_shipping_country(&self) -> Option<common_enums::CountryAlpha2> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.country) }) } pub fn get_optional_shipping_zip(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.zip) }) } pub fn get_optional_shipping_email(&self) -> Option<Email> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().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": 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_-6262692988738800615_425_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_country(&self) -> Option<common_enums::CountryAlpha2> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.country) }) } pub fn get_optional_shipping_zip(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address
{ "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_-6262692988738800615_425_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_country(&self) -> Option<common_enums::CountryAlpha2> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.country) }) } pub fn get_optional_shipping_zip(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.zip) }) } pub fn get_optional_shipping_email(&self) -> Option<Email> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().email) } pub fn get_optional_shipping_phone_number(&self) -> Option<Secret<String>> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().phone) .and_then(|phone_details| phone_details.get_number_with_country_code().ok())
{ "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_-6262692988738800615_425_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_country(&self) -> Option<common_enums::CountryAlpha2> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.country) }) } pub fn get_optional_shipping_zip(&self) -> Option<Secret<String>> { self.address.get_shipping().and_then(|shipping_address| { shipping_address .clone() .address .and_then(|shipping_details| shipping_details.zip) }) } pub fn get_optional_shipping_email(&self) -> Option<Email> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().email) } pub fn get_optional_shipping_phone_number(&self) -> Option<Secret<String>> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().phone) .and_then(|phone_details| phone_details.get_number_with_country_code().ok()) } pub fn get_description(&self) -> Result<String, Error> { self.description .clone() .ok_or_else(missing_field_err("description")) } pub fn get_billing_address(&self) -> Result<&AddressDetails, Error> { self.address .get_payment_method_billing() .as_ref() .and_then(|a| a.address.as_ref()) .ok_or_else(missing_field_err("billing.address")) } pub fn get_connector_meta(&self) -> Result<SecretSerdeValue, Error> { self.connector_meta_data .clone() .ok_or_else(missing_field_err("connector_meta_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": 425, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_450_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_phone_number(&self) -> Option<Secret<String>> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().phone) .and_then(|phone_details| phone_details.get_number_with_country_code().ok()) } pub fn get_description(&self) -> Result<String, Error> { self.description .clone() .ok_or_else(missing_field_err("description")) } pub fn get_billing_address(&self) -> Result<&AddressDetails, Error> { self.address .get_payment_method_billing()
{ "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_-6262692988738800615_450_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_phone_number(&self) -> Option<Secret<String>> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().phone) .and_then(|phone_details| phone_details.get_number_with_country_code().ok()) } pub fn get_description(&self) -> Result<String, Error> { self.description .clone() .ok_or_else(missing_field_err("description")) } pub fn get_billing_address(&self) -> Result<&AddressDetails, Error> { self.address .get_payment_method_billing() .as_ref() .and_then(|a| a.address.as_ref()) .ok_or_else(missing_field_err("billing.address")) } pub fn get_connector_meta(&self) -> Result<SecretSerdeValue, Error> { self.connector_meta_data .clone() .ok_or_else(missing_field_err("connector_meta_data")) } pub fn get_session_token(&self) -> Result<String, Error> { self.session_token .clone() .ok_or_else(missing_field_err("session_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": 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_-6262692988738800615_450_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_optional_shipping_phone_number(&self) -> Option<Secret<String>> { self.address .get_shipping() .and_then(|shipping_address| shipping_address.clone().phone) .and_then(|phone_details| phone_details.get_number_with_country_code().ok()) } pub fn get_description(&self) -> Result<String, Error> { self.description .clone() .ok_or_else(missing_field_err("description")) } pub fn get_billing_address(&self) -> Result<&AddressDetails, Error> { self.address .get_payment_method_billing() .as_ref() .and_then(|a| a.address.as_ref()) .ok_or_else(missing_field_err("billing.address")) } pub fn get_connector_meta(&self) -> Result<SecretSerdeValue, Error> { self.connector_meta_data .clone() .ok_or_else(missing_field_err("connector_meta_data")) } pub fn get_session_token(&self) -> Result<String, Error> { self.session_token .clone() .ok_or_else(missing_field_err("session_token")) } pub fn get_access_token(&self) -> Result<String, Error> { self.access_token .as_ref() .map(|token_data| token_data.access_token.clone()) .ok_or_else(missing_field_err("access_token")) } pub fn get_access_token_data(&self) -> Result<AccessTokenResponseData, Error> { self.access_token .clone() .ok_or_else(missing_field_err("access_token")) } pub fn set_access_token(mut self, access_token: Option<AccessTokenResponseData>) -> Self { self.access_token = access_token; 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": 450, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_475_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_session_token(&self) -> Result<String, Error> { self.session_token .clone() .ok_or_else(missing_field_err("session_token")) } pub fn get_access_token(&self) -> Result<String, Error> { self.access_token .as_ref() .map(|token_data| token_data.access_token.clone()) .ok_or_else(missing_field_err("access_token")) } pub fn get_access_token_data(&self) -> Result<AccessTokenResponseData, Error> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_-6262692988738800615_475_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_session_token(&self) -> Result<String, Error> { self.session_token .clone() .ok_or_else(missing_field_err("session_token")) } pub fn get_access_token(&self) -> Result<String, Error> { self.access_token .as_ref() .map(|token_data| token_data.access_token.clone()) .ok_or_else(missing_field_err("access_token")) } pub fn get_access_token_data(&self) -> Result<AccessTokenResponseData, Error> { self.access_token .clone() .ok_or_else(missing_field_err("access_token")) } pub fn set_access_token(mut self, access_token: Option<AccessTokenResponseData>) -> Self { self.access_token = access_token; self } pub fn get_billing_first_name(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address
{ "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_-6262692988738800615_475_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_session_token(&self) -> Result<String, Error> { self.session_token .clone() .ok_or_else(missing_field_err("session_token")) } pub fn get_access_token(&self) -> Result<String, Error> { self.access_token .as_ref() .map(|token_data| token_data.access_token.clone()) .ok_or_else(missing_field_err("access_token")) } pub fn get_access_token_data(&self) -> Result<AccessTokenResponseData, Error> { self.access_token .clone() .ok_or_else(missing_field_err("access_token")) } pub fn set_access_token(mut self, access_token: Option<AccessTokenResponseData>) -> Self { self.access_token = access_token; self } pub fn get_billing_first_name(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.first_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.first_name", )) } pub fn get_billing_full_name(&self) -> Result<Secret<String>, Error> { self.get_optional_billing() .and_then(|billing_details| billing_details.address.as_ref()) .and_then(|billing_address| billing_address.get_optional_full_name()) .ok_or_else(missing_field_err( "payment_method_data.billing.address.first_name", )) } pub fn get_billing_last_name(&self) -> Result<Secret<String>, Error> { self.address
{ "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_-6262692988738800615_500_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_first_name(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.first_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.first_name", )) } pub fn get_billing_full_name(&self) -> Result<Secret<String>, Error> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_-6262692988738800615_500_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_first_name(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.first_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.first_name", )) } pub fn get_billing_full_name(&self) -> Result<Secret<String>, Error> { self.get_optional_billing() .and_then(|billing_details| billing_details.address.as_ref()) .and_then(|billing_address| billing_address.get_optional_full_name()) .ok_or_else(missing_field_err( "payment_method_data.billing.address.first_name", )) } pub fn get_billing_last_name(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address
{ "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_-6262692988738800615_500_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_first_name(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.first_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.first_name", )) } pub fn get_billing_full_name(&self) -> Result<Secret<String>, Error> { self.get_optional_billing() .and_then(|billing_details| billing_details.address.as_ref()) .and_then(|billing_address| billing_address.get_optional_full_name()) .ok_or_else(missing_field_err( "payment_method_data.billing.address.first_name", )) } pub fn get_billing_last_name(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.last_name", )) } pub fn get_billing_line1(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line1.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.line1", )) }
{ "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_-6262692988738800615_525_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.last_name", )) } pub fn get_billing_line1(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing()
{ "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_-6262692988738800615_525_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.last_name", )) } pub fn get_billing_line1(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line1.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.line1", )) } pub fn get_billing_city(&self) -> Result<String, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address
{ "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_-6262692988738800615_525_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.last_name", )) } pub fn get_billing_line1(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line1.clone()) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.line1", )) } pub fn get_billing_city(&self) -> Result<String, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.city", )) } pub fn get_billing_email(&self) -> Result<Email, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.email.clone()) .ok_or_else(missing_field_err("payment_method_data.billing.email")) } pub fn get_billing_phone_number(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.clone().phone)
{ "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_-6262692988738800615_550_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_city(&self) -> Result<String, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.city", )) } pub fn get_billing_email(&self) -> Result<Email, Error> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_-6262692988738800615_550_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_city(&self) -> Result<String, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.city", )) } pub fn get_billing_email(&self) -> Result<Email, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.email.clone()) .ok_or_else(missing_field_err("payment_method_data.billing.email")) } pub fn get_billing_phone_number(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.clone().phone) .map(|phone_details| phone_details.get_number_with_country_code()) .transpose()? .ok_or_else(missing_field_err("payment_method_data.billing.phone")) }
{ "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_-6262692988738800615_550_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs pub fn get_billing_city(&self) -> Result<String, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) .ok_or_else(missing_field_err( "payment_method_data.billing.address.city", )) } pub fn get_billing_email(&self) -> Result<Email, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.email.clone()) .ok_or_else(missing_field_err("payment_method_data.billing.email")) } pub fn get_billing_phone_number(&self) -> Result<Secret<String>, Error> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.clone().phone) .map(|phone_details| phone_details.get_number_with_country_code()) .transpose()? .ok_or_else(missing_field_err("payment_method_data.billing.phone")) } pub fn get_optional_billing_line1(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line1) }) } pub fn get_optional_billing_line2(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line2) })
{ "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_-6262692988738800615_575_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .map(|phone_details| phone_details.get_number_with_country_code()) .transpose()? .ok_or_else(missing_field_err("payment_method_data.billing.phone")) } pub fn get_optional_billing_line1(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line1) }) }
{ "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_-6262692988738800615_575_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .map(|phone_details| phone_details.get_number_with_country_code()) .transpose()? .ok_or_else(missing_field_err("payment_method_data.billing.phone")) } pub fn get_optional_billing_line1(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line1) }) } pub fn get_optional_billing_line2(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line2) }) } pub fn get_optional_billing_city(&self) -> Option<String> { self.address .get_payment_method_billing()
{ "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_-6262692988738800615_575_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .map(|phone_details| phone_details.get_number_with_country_code()) .transpose()? .ok_or_else(missing_field_err("payment_method_data.billing.phone")) } pub fn get_optional_billing_line1(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line1) }) } pub fn get_optional_billing_line2(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.line2) }) } pub fn get_optional_billing_city(&self) -> Option<String> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) } pub fn get_optional_billing_country(&self) -> Option<common_enums::CountryAlpha2> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.country) }) } pub fn get_optional_billing_zip(&self) -> 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": 575, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_600_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs } pub fn get_optional_billing_city(&self) -> Option<String> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) } pub fn get_optional_billing_country(&self) -> Option<common_enums::CountryAlpha2> { self.address
{ "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_-6262692988738800615_600_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs } pub fn get_optional_billing_city(&self) -> Option<String> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) } pub fn get_optional_billing_country(&self) -> Option<common_enums::CountryAlpha2> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.country) }) } pub fn get_optional_billing_zip(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .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": 600, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_600_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs } pub fn get_optional_billing_city(&self) -> Option<String> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.city) }) } pub fn get_optional_billing_country(&self) -> Option<common_enums::CountryAlpha2> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.country) }) } pub fn get_optional_billing_zip(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.zip) }) } pub fn get_optional_billing_state(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.state) }) } pub fn get_optional_billing_first_name(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| {
{ "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_-6262692988738800615_625_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.zip) }) } pub fn get_optional_billing_state(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address
{ "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_-6262692988738800615_625_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.zip) }) } pub fn get_optional_billing_state(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.state) }) } pub fn get_optional_billing_first_name(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.first_name) })
{ "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_-6262692988738800615_625_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.zip) }) } pub fn get_optional_billing_state(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.state) }) } pub fn get_optional_billing_first_name(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.first_name) }) } pub fn get_optional_billing_last_name(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name) }) } pub fn get_optional_billing_phone_number(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .phone
{ "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_-6262692988738800615_650_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs billing_address .clone() .address .and_then(|billing_details| billing_details.first_name) }) } pub fn get_optional_billing_last_name(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name)
{ "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_-6262692988738800615_650_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs billing_address .clone() .address .and_then(|billing_details| billing_details.first_name) }) } pub fn get_optional_billing_last_name(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name) }) } pub fn get_optional_billing_phone_number(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .phone .and_then(|phone_data| phone_data.number) }) } pub fn get_optional_billing_email(&self) -> 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": 650, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_650_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs billing_address .clone() .address .and_then(|billing_details| billing_details.first_name) }) } pub fn get_optional_billing_last_name(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .address .and_then(|billing_details| billing_details.last_name) }) } pub fn get_optional_billing_phone_number(&self) -> Option<Secret<String>> { self.address .get_payment_method_billing() .and_then(|billing_address| { billing_address .clone() .phone .and_then(|phone_data| phone_data.number) }) } pub fn get_optional_billing_email(&self) -> Option<Email> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.clone().email) } pub fn to_connector_meta<T>(&self) -> Result<T, Error> where T: serde::de::DeserializeOwned, { self.get_connector_meta()? .parse_value(std::any::type_name::<T>()) .change_context(ConnectorError::NoConnectorMetaData) } pub fn is_three_ds(&self) -> bool { matches!(self.auth_type, common_enums::AuthenticationType::ThreeDs) } pub fn get_shipping_address(&self) -> Result<&AddressDetails, Error> { self.address .get_shipping()
{ "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_-6262692988738800615_675_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .and_then(|phone_data| phone_data.number) }) } pub fn get_optional_billing_email(&self) -> Option<Email> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.clone().email) } pub fn to_connector_meta<T>(&self) -> Result<T, Error> where T: serde::de::DeserializeOwned, { self.get_connector_meta()? .parse_value(std::any::type_name::<T>())
{ "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_-6262692988738800615_675_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .and_then(|phone_data| phone_data.number) }) } pub fn get_optional_billing_email(&self) -> Option<Email> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.clone().email) } pub fn to_connector_meta<T>(&self) -> Result<T, Error> where T: serde::de::DeserializeOwned, { self.get_connector_meta()? .parse_value(std::any::type_name::<T>()) .change_context(ConnectorError::NoConnectorMetaData) } pub fn is_three_ds(&self) -> bool { matches!(self.auth_type, common_enums::AuthenticationType::ThreeDs) } pub fn get_shipping_address(&self) -> Result<&AddressDetails, Error> { self.address .get_shipping() .and_then(|a| a.address.as_ref()) .ok_or_else(missing_field_err("shipping.address")) } pub fn get_shipping_address_with_phone_number(&self) -> Result<&Address, Error> {
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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_-6262692988738800615_675_50
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .and_then(|phone_data| phone_data.number) }) } pub fn get_optional_billing_email(&self) -> Option<Email> { self.address .get_payment_method_billing() .and_then(|billing_address| billing_address.clone().email) } pub fn to_connector_meta<T>(&self) -> Result<T, Error> where T: serde::de::DeserializeOwned, { self.get_connector_meta()? .parse_value(std::any::type_name::<T>()) .change_context(ConnectorError::NoConnectorMetaData) } pub fn is_three_ds(&self) -> bool { matches!(self.auth_type, common_enums::AuthenticationType::ThreeDs) } pub fn get_shipping_address(&self) -> Result<&AddressDetails, Error> { self.address .get_shipping() .and_then(|a| a.address.as_ref()) .ok_or_else(missing_field_err("shipping.address")) } pub fn get_shipping_address_with_phone_number(&self) -> Result<&Address, Error> { self.address .get_shipping() .ok_or_else(missing_field_err("shipping")) } pub fn get_payment_method_token(&self) -> Result<PaymentMethodToken, Error> { self.payment_method_token .clone() .ok_or_else(missing_field_err("payment_method_token")) } pub fn get_customer_id(&self) -> Result<CustomerId, Error> { self.customer_id .to_owned() .ok_or_else(missing_field_err("customer_id")) } pub fn get_connector_customer_id(&self) -> Result<String, Error> { self.connector_customer .to_owned() .ok_or_else(missing_field_err("connector_customer_id")) }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 675, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_-6262692988738800615_700_15
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .and_then(|a| a.address.as_ref()) .ok_or_else(missing_field_err("shipping.address")) } pub fn get_shipping_address_with_phone_number(&self) -> Result<&Address, Error> { self.address .get_shipping() .ok_or_else(missing_field_err("shipping")) } pub fn get_payment_method_token(&self) -> Result<PaymentMethodToken, Error> { self.payment_method_token .clone() .ok_or_else(missing_field_err("payment_method_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": 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_-6262692988738800615_700_30
clm
snippet
// connector-service/backend/domain_types/src/connector_types.rs .and_then(|a| a.address.as_ref()) .ok_or_else(missing_field_err("shipping.address")) } pub fn get_shipping_address_with_phone_number(&self) -> Result<&Address, Error> { self.address .get_shipping() .ok_or_else(missing_field_err("shipping")) } pub fn get_payment_method_token(&self) -> Result<PaymentMethodToken, Error> { self.payment_method_token .clone() .ok_or_else(missing_field_err("payment_method_token")) } pub fn get_customer_id(&self) -> Result<CustomerId, Error> { self.customer_id .to_owned() .ok_or_else(missing_field_err("customer_id")) } pub fn get_connector_customer_id(&self) -> Result<String, Error> { self.connector_customer .to_owned() .ok_or_else(missing_field_err("connector_customer_id")) } pub fn get_preprocessing_id(&self) -> Result<String, Error> { self.preprocessing_id .to_owned() .ok_or_else(missing_field_err("preprocessing_id")) }
{ "chunk": null, "crate": "domain_types", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 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 }