id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
connector-service_snippet_3490651234547846205_75_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs + std::marker::Sync + std::marker::Send + 'static + Serialize, > { #[serde(rename = "scheme")] RazorpayCard(Box<RazorpayCard<T>>), } #[derive(Clone, Default, Debug, Serialize, Deserialize)] pub enum AuthType { #[default] PreAuth, } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct Address { city: String, country: common_enums::CountryAlpha2, house_number_or_name: Secret<String>, postal_code: Secret<String>, state_or_province: Option<Secret<String>>, street: Option<Secret<String>>, } #[derive(Debug, Clone, Serialize)] #[serde(untagged)] pub enum PaymentMethod<
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_75_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs + std::marker::Sync + std::marker::Send + 'static + Serialize, > { #[serde(rename = "scheme")] RazorpayCard(Box<RazorpayCard<T>>), } #[derive(Clone, Default, Debug, Serialize, Deserialize)] pub enum AuthType { #[default] PreAuth, } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct Address { city: String, country: common_enums::CountryAlpha2, house_number_or_name: Secret<String>, postal_code: Secret<String>, state_or_province: Option<Secret<String>>, street: Option<Secret<String>>, } #[derive(Debug, Clone, Serialize)] #[serde(untagged)] pub enum PaymentMethod< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { RazorpayPaymentMethod(Box<RazorpayPaymentMethod<T>>), } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct CardDetails< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_100_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs } #[derive(Debug, Clone, Serialize)] #[serde(untagged)] pub enum PaymentMethod< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { RazorpayPaymentMethod(Box<RazorpayPaymentMethod<T>>), }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_100_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs } #[derive(Debug, Clone, Serialize)] #[serde(untagged)] pub enum PaymentMethod< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { RazorpayPaymentMethod(Box<RazorpayPaymentMethod<T>>), } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct CardDetails< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { pub number: RawCardNumber<T>, pub name: Option<Secret<String>>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Secret<String>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_100_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs } #[derive(Debug, Clone, Serialize)] #[serde(untagged)] pub enum PaymentMethod< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { RazorpayPaymentMethod(Box<RazorpayPaymentMethod<T>>), } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct CardDetails< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { pub number: RawCardNumber<T>, pub name: Option<Secret<String>>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Secret<String>, pub cvv: Option<Secret<String>>, } #[derive(Default, Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "snake_case")] pub enum AuthenticationChannel { #[default] Browser, App, } #[derive(Default, Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct AuthenticationDetails { pub authentication_channel: AuthenticationChannel, } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize)] #[serde(rename_all = "snake_case")]
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_125_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs > { pub number: RawCardNumber<T>, pub name: Option<Secret<String>>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Secret<String>, pub cvv: Option<Secret<String>>, } #[derive(Default, Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "snake_case")] pub enum AuthenticationChannel { #[default] Browser, App, }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_125_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs > { pub number: RawCardNumber<T>, pub name: Option<Secret<String>>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Secret<String>, pub cvv: Option<Secret<String>>, } #[derive(Default, Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "snake_case")] pub enum AuthenticationChannel { #[default] Browser, App, } #[derive(Default, Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct AuthenticationDetails { pub authentication_channel: AuthenticationChannel, } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct BrowserInfo { pub java_enabled: Option<bool>, pub javascript_enabled: Option<bool>, pub timezone_offset: Option<i32>, pub color_depth: Option<i32>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_125_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs > { pub number: RawCardNumber<T>, pub name: Option<Secret<String>>, pub expiry_month: Option<Secret<String>>, pub expiry_year: Secret<String>, pub cvv: Option<Secret<String>>, } #[derive(Default, Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "snake_case")] pub enum AuthenticationChannel { #[default] Browser, App, } #[derive(Default, Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct AuthenticationDetails { pub authentication_channel: AuthenticationChannel, } #[serde_with::skip_serializing_none] #[derive(Default, Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct BrowserInfo { pub java_enabled: Option<bool>, pub javascript_enabled: Option<bool>, pub timezone_offset: Option<i32>, pub color_depth: Option<i32>, pub screen_width: Option<i32>, pub screen_height: Option<i32>, pub language: Option<String>, } #[derive(Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentRequest< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { pub amount: MinorUnit, pub currency: String, pub contact: Secret<String>, pub email: Email, pub order_id: String,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_150_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub struct BrowserInfo { pub java_enabled: Option<bool>, pub javascript_enabled: Option<bool>, pub timezone_offset: Option<i32>, pub color_depth: Option<i32>, pub screen_width: Option<i32>, pub screen_height: Option<i32>, pub language: Option<String>, } #[derive(Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentRequest< T: PaymentMethodDataTypes + std::fmt::Debug
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_150_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub struct BrowserInfo { pub java_enabled: Option<bool>, pub javascript_enabled: Option<bool>, pub timezone_offset: Option<i32>, pub color_depth: Option<i32>, pub screen_width: Option<i32>, pub screen_height: Option<i32>, pub language: Option<String>, } #[derive(Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentRequest< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { pub amount: MinorUnit, pub currency: String, pub contact: Secret<String>, pub email: Email, pub order_id: String, pub method: PaymentMethodType, pub card: PaymentMethodSpecificData<T>, pub authentication: Option<AuthenticationDetails>, pub browser: Option<BrowserInfo>, pub ip: Secret<String>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_150_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub struct BrowserInfo { pub java_enabled: Option<bool>, pub javascript_enabled: Option<bool>, pub timezone_offset: Option<i32>, pub color_depth: Option<i32>, pub screen_width: Option<i32>, pub screen_height: Option<i32>, pub language: Option<String>, } #[derive(Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentRequest< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { pub amount: MinorUnit, pub currency: String, pub contact: Secret<String>, pub email: Email, pub order_id: String, pub method: PaymentMethodType, pub card: PaymentMethodSpecificData<T>, pub authentication: Option<AuthenticationDetails>, pub browser: Option<BrowserInfo>, pub ip: Secret<String>, pub referer: String, pub user_agent: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged, rename_all = "snake_case")] pub enum PaymentMethodSpecificData< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { Card(CardDetails<T>), } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum PaymentMethodType {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_175_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub method: PaymentMethodType, pub card: PaymentMethodSpecificData<T>, pub authentication: Option<AuthenticationDetails>, pub browser: Option<BrowserInfo>, pub ip: Secret<String>, pub referer: String, pub user_agent: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged, rename_all = "snake_case")] pub enum PaymentMethodSpecificData< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_175_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub method: PaymentMethodType, pub card: PaymentMethodSpecificData<T>, pub authentication: Option<AuthenticationDetails>, pub browser: Option<BrowserInfo>, pub ip: Secret<String>, pub referer: String, pub user_agent: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged, rename_all = "snake_case")] pub enum PaymentMethodSpecificData< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { Card(CardDetails<T>), } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum PaymentMethodType { Card, Wallet, Upi, Emi, Netbanking,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_175_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub method: PaymentMethodType, pub card: PaymentMethodSpecificData<T>, pub authentication: Option<AuthenticationDetails>, pub browser: Option<BrowserInfo>, pub ip: Secret<String>, pub referer: String, pub user_agent: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged, rename_all = "snake_case")] pub enum PaymentMethodSpecificData< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > { Card(CardDetails<T>), } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum PaymentMethodType { Card, Wallet, Upi, Emi, Netbanking, } pub struct RazorpayRouterData<T> { pub amount: MinorUnit, pub router_data: T, } impl<T> TryFrom<(MinorUnit, T)> for RazorpayRouterData<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from((amount, item): (MinorUnit, T)) -> Result<Self, Self::Error> { Ok(Self { amount, router_data: item, }) } } pub enum RazorpayAuthType { AuthToken(Secret<String>), ApiKeySecret {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_200_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Card, Wallet, Upi, Emi, Netbanking, } pub struct RazorpayRouterData<T> { pub amount: MinorUnit, pub router_data: T, } impl<T> TryFrom<(MinorUnit, T)> for RazorpayRouterData<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from((amount, item): (MinorUnit, T)) -> Result<Self, Self::Error> {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_200_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Card, Wallet, Upi, Emi, Netbanking, } pub struct RazorpayRouterData<T> { pub amount: MinorUnit, pub router_data: T, } impl<T> TryFrom<(MinorUnit, T)> for RazorpayRouterData<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from((amount, item): (MinorUnit, T)) -> Result<Self, Self::Error> { Ok(Self { amount, router_data: item, }) } } pub enum RazorpayAuthType { AuthToken(Secret<String>), ApiKeySecret { api_key: Secret<String>, api_secret: Secret<String>, }, }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_200_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Card, Wallet, Upi, Emi, Netbanking, } pub struct RazorpayRouterData<T> { pub amount: MinorUnit, pub router_data: T, } impl<T> TryFrom<(MinorUnit, T)> for RazorpayRouterData<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from((amount, item): (MinorUnit, T)) -> Result<Self, Self::Error> { Ok(Self { amount, router_data: item, }) } } pub enum RazorpayAuthType { AuthToken(Secret<String>), ApiKeySecret { api_key: Secret<String>, api_secret: Secret<String>, }, } impl RazorpayAuthType { pub fn generate_authorization_header(&self) -> String { let auth_type_name = match self { RazorpayAuthType::AuthToken(_) => "AuthToken", RazorpayAuthType::ApiKeySecret { .. } => "ApiKeySecret", }; info!("Type of auth Token is {}", auth_type_name); match self { RazorpayAuthType::AuthToken(token) => format!("Bearer {}", token.peek()), RazorpayAuthType::ApiKeySecret { api_key, api_secret, } => { let credentials = format!("{}:{}", api_key.peek(), api_secret.peek()); let encoded = STANDARD.encode(credentials); format!("Basic {encoded}") } } } }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_225_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs api_key: Secret<String>, api_secret: Secret<String>, }, } impl RazorpayAuthType { pub fn generate_authorization_header(&self) -> String { let auth_type_name = match self { RazorpayAuthType::AuthToken(_) => "AuthToken", RazorpayAuthType::ApiKeySecret { .. } => "ApiKeySecret", }; info!("Type of auth Token is {}", auth_type_name); match self { RazorpayAuthType::AuthToken(token) => format!("Bearer {}", token.peek()), RazorpayAuthType::ApiKeySecret {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_225_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs api_key: Secret<String>, api_secret: Secret<String>, }, } impl RazorpayAuthType { pub fn generate_authorization_header(&self) -> String { let auth_type_name = match self { RazorpayAuthType::AuthToken(_) => "AuthToken", RazorpayAuthType::ApiKeySecret { .. } => "ApiKeySecret", }; info!("Type of auth Token is {}", auth_type_name); match self { RazorpayAuthType::AuthToken(token) => format!("Bearer {}", token.peek()), RazorpayAuthType::ApiKeySecret { api_key, api_secret, } => { let credentials = format!("{}:{}", api_key.peek(), api_secret.peek()); let encoded = STANDARD.encode(credentials); format!("Basic {encoded}") } } } } impl TryFrom<&ConnectorAuthType> for RazorpayAuthType { type Error = domain_types::errors::ConnectorError; fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> { match auth_type {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_225_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs api_key: Secret<String>, api_secret: Secret<String>, }, } impl RazorpayAuthType { pub fn generate_authorization_header(&self) -> String { let auth_type_name = match self { RazorpayAuthType::AuthToken(_) => "AuthToken", RazorpayAuthType::ApiKeySecret { .. } => "ApiKeySecret", }; info!("Type of auth Token is {}", auth_type_name); match self { RazorpayAuthType::AuthToken(token) => format!("Bearer {}", token.peek()), RazorpayAuthType::ApiKeySecret { api_key, api_secret, } => { let credentials = format!("{}:{}", api_key.peek(), api_secret.peek()); let encoded = STANDARD.encode(credentials); format!("Basic {encoded}") } } } } impl TryFrom<&ConnectorAuthType> for RazorpayAuthType { type Error = domain_types::errors::ConnectorError; fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> { match auth_type { ConnectorAuthType::HeaderKey { api_key } => Ok(Self::AuthToken(api_key.to_owned())), ConnectorAuthType::SignatureKey { api_key, api_secret, .. } => Ok(Self::ApiKeySecret { api_key: api_key.to_owned(), api_secret: api_secret.to_owned(), }), ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::ApiKeySecret { api_key: api_key.to_owned(), api_secret: key1.to_owned(), }), _ => Err(domain_types::errors::ConnectorError::FailedToObtainAuthType), } } } impl< T: PaymentMethodDataTypes
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_250_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs impl TryFrom<&ConnectorAuthType> for RazorpayAuthType { type Error = domain_types::errors::ConnectorError; fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> { match auth_type { ConnectorAuthType::HeaderKey { api_key } => Ok(Self::AuthToken(api_key.to_owned())), ConnectorAuthType::SignatureKey { api_key, api_secret, .. } => Ok(Self::ApiKeySecret { api_key: api_key.to_owned(), api_secret: api_secret.to_owned(), }), ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::ApiKeySecret {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_250_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs impl TryFrom<&ConnectorAuthType> for RazorpayAuthType { type Error = domain_types::errors::ConnectorError; fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> { match auth_type { ConnectorAuthType::HeaderKey { api_key } => Ok(Self::AuthToken(api_key.to_owned())), ConnectorAuthType::SignatureKey { api_key, api_secret, .. } => Ok(Self::ApiKeySecret { api_key: api_key.to_owned(), api_secret: api_secret.to_owned(), }), ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::ApiKeySecret { api_key: api_key.to_owned(), api_secret: key1.to_owned(), }), _ => Err(domain_types::errors::ConnectorError::FailedToObtainAuthType), } } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_250_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs impl TryFrom<&ConnectorAuthType> for RazorpayAuthType { type Error = domain_types::errors::ConnectorError; fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> { match auth_type { ConnectorAuthType::HeaderKey { api_key } => Ok(Self::AuthToken(api_key.to_owned())), ConnectorAuthType::SignatureKey { api_key, api_secret, .. } => Ok(Self::ApiKeySecret { api_key: api_key.to_owned(), api_secret: api_secret.to_owned(), }), ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::ApiKeySecret { api_key: api_key.to_owned(), api_secret: key1.to_owned(), }), _ => Err(domain_types::errors::ConnectorError::FailedToObtainAuthType), } } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<(&Card<T>, Option<Secret<String>>)> for RazorpayPaymentMethod<T> { type Error = ConnectorError; fn try_from( (card, card_holder_name): (&Card<T>, Option<Secret<String>>), ) -> Result<Self, Self::Error> { let razorpay_card = RazorpayCard { number: card.card_number.clone(), expiry_month: card.card_exp_month.clone(), expiry_year: card.card_exp_year.clone(), cvc: Some(card.card_cvc.clone()), holder_name: card_holder_name, brand: card.card_network.clone(), network_payment_reference: None, }; Ok(RazorpayPaymentMethod::RazorpayCard(Box::new(razorpay_card))) } } fn extract_payment_method_and_data<
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_275_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<(&Card<T>, Option<Secret<String>>)> for RazorpayPaymentMethod<T> { type Error = ConnectorError; fn try_from( (card, card_holder_name): (&Card<T>, Option<Secret<String>>), ) -> Result<Self, Self::Error> { let razorpay_card = RazorpayCard { number: card.card_number.clone(), expiry_month: card.card_exp_month.clone(), expiry_year: card.card_exp_year.clone(),
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_275_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<(&Card<T>, Option<Secret<String>>)> for RazorpayPaymentMethod<T> { type Error = ConnectorError; fn try_from( (card, card_holder_name): (&Card<T>, Option<Secret<String>>), ) -> Result<Self, Self::Error> { let razorpay_card = RazorpayCard { number: card.card_number.clone(), expiry_month: card.card_exp_month.clone(), expiry_year: card.card_exp_year.clone(), cvc: Some(card.card_cvc.clone()), holder_name: card_holder_name, brand: card.card_network.clone(), network_payment_reference: None, }; Ok(RazorpayPaymentMethod::RazorpayCard(Box::new(razorpay_card))) } } fn extract_payment_method_and_data< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_275_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<(&Card<T>, Option<Secret<String>>)> for RazorpayPaymentMethod<T> { type Error = ConnectorError; fn try_from( (card, card_holder_name): (&Card<T>, Option<Secret<String>>), ) -> Result<Self, Self::Error> { let razorpay_card = RazorpayCard { number: card.card_number.clone(), expiry_month: card.card_exp_month.clone(), expiry_year: card.card_exp_year.clone(), cvc: Some(card.card_cvc.clone()), holder_name: card_holder_name, brand: card.card_network.clone(), network_payment_reference: None, }; Ok(RazorpayPaymentMethod::RazorpayCard(Box::new(razorpay_card))) } } fn extract_payment_method_and_data< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( payment_method_data: &PaymentMethodData<T>, customer_name: Option<String>, ) -> Result<(PaymentMethodType, PaymentMethodSpecificData<T>), domain_types::errors::ConnectorError> { match payment_method_data { PaymentMethodData::Card(card_data) => { let card_holder_name = customer_name.clone(); let card = PaymentMethodSpecificData::Card(CardDetails { number: card_data.card_number.clone(), name: card_holder_name.map(Secret::new), expiry_month: Some(card_data.card_exp_month.clone()), expiry_year: card_data.card_exp_year.clone(), cvv: Some(card_data.card_cvc.clone()), }); Ok((PaymentMethodType::Card, card)) }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_300_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( payment_method_data: &PaymentMethodData<T>, customer_name: Option<String>, ) -> Result<(PaymentMethodType, PaymentMethodSpecificData<T>), domain_types::errors::ConnectorError> { match payment_method_data { PaymentMethodData::Card(card_data) => { let card_holder_name = customer_name.clone();
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_300_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( payment_method_data: &PaymentMethodData<T>, customer_name: Option<String>, ) -> Result<(PaymentMethodType, PaymentMethodSpecificData<T>), domain_types::errors::ConnectorError> { match payment_method_data { PaymentMethodData::Card(card_data) => { let card_holder_name = customer_name.clone(); let card = PaymentMethodSpecificData::Card(CardDetails { number: card_data.card_number.clone(), name: card_holder_name.map(Secret::new), expiry_month: Some(card_data.card_exp_month.clone()), expiry_year: card_data.card_exp_year.clone(), cvv: Some(card_data.card_cvc.clone()), }); Ok((PaymentMethodType::Card, card)) } PaymentMethodData::CardRedirect(_) | PaymentMethodData::Wallet(_) | PaymentMethodData::PayLater(_) | PaymentMethodData::BankRedirect(_) | PaymentMethodData::BankDebit(_)
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_300_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, >( payment_method_data: &PaymentMethodData<T>, customer_name: Option<String>, ) -> Result<(PaymentMethodType, PaymentMethodSpecificData<T>), domain_types::errors::ConnectorError> { match payment_method_data { PaymentMethodData::Card(card_data) => { let card_holder_name = customer_name.clone(); let card = PaymentMethodSpecificData::Card(CardDetails { number: card_data.card_number.clone(), name: card_holder_name.map(Secret::new), expiry_month: Some(card_data.card_exp_month.clone()), expiry_year: card_data.card_exp_year.clone(), cvv: Some(card_data.card_cvc.clone()), }); Ok((PaymentMethodType::Card, card)) } PaymentMethodData::CardRedirect(_) | PaymentMethodData::Wallet(_) | PaymentMethodData::PayLater(_) | PaymentMethodData::BankRedirect(_) | PaymentMethodData::BankDebit(_) | PaymentMethodData::BankTransfer(_) | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::Upi(_) | PaymentMethodData::Voucher(_) | PaymentMethodData::GiftCard(_) | PaymentMethodData::CardToken(_) | PaymentMethodData::CardDetailsForNetworkTransactionId(_) | PaymentMethodData::NetworkToken(_) | PaymentMethodData::MobilePayment(_) | PaymentMethodData::OpenBanking(_) => { Err(domain_types::errors::ConnectorError::NotImplemented( "Only Card payment method is supported for Razorpay".to_string(), )) } } }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_325_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs PaymentMethodData::CardRedirect(_) | PaymentMethodData::Wallet(_) | PaymentMethodData::PayLater(_) | PaymentMethodData::BankRedirect(_) | PaymentMethodData::BankDebit(_) | PaymentMethodData::BankTransfer(_) | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::Upi(_) | PaymentMethodData::Voucher(_) | PaymentMethodData::GiftCard(_) | PaymentMethodData::CardToken(_) | PaymentMethodData::CardDetailsForNetworkTransactionId(_)
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_325_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs PaymentMethodData::CardRedirect(_) | PaymentMethodData::Wallet(_) | PaymentMethodData::PayLater(_) | PaymentMethodData::BankRedirect(_) | PaymentMethodData::BankDebit(_) | PaymentMethodData::BankTransfer(_) | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::Upi(_) | PaymentMethodData::Voucher(_) | PaymentMethodData::GiftCard(_) | PaymentMethodData::CardToken(_) | PaymentMethodData::CardDetailsForNetworkTransactionId(_) | PaymentMethodData::NetworkToken(_) | PaymentMethodData::MobilePayment(_) | PaymentMethodData::OpenBanking(_) => { Err(domain_types::errors::ConnectorError::NotImplemented( "Only Card payment method is supported for Razorpay".to_string(), )) } } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_325_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs PaymentMethodData::CardRedirect(_) | PaymentMethodData::Wallet(_) | PaymentMethodData::PayLater(_) | PaymentMethodData::BankRedirect(_) | PaymentMethodData::BankDebit(_) | PaymentMethodData::BankTransfer(_) | PaymentMethodData::Crypto(_) | PaymentMethodData::MandatePayment | PaymentMethodData::Reward | PaymentMethodData::RealTimePayment(_) | PaymentMethodData::Upi(_) | PaymentMethodData::Voucher(_) | PaymentMethodData::GiftCard(_) | PaymentMethodData::CardToken(_) | PaymentMethodData::CardDetailsForNetworkTransactionId(_) | PaymentMethodData::NetworkToken(_) | PaymentMethodData::MobilePayment(_) | PaymentMethodData::OpenBanking(_) => { Err(domain_types::errors::ConnectorError::NotImplemented( "Only Card payment method is supported for Razorpay".to_string(), )) } } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<( &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, &Card<T>, )> for RazorpayPaymentRequest<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from( value: ( &RazorpayRouterData<
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_350_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<( &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_350_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<( &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, &Card<T>, )> for RazorpayPaymentRequest<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from( value: ( &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_350_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom<( &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, &Card<T>, )> for RazorpayPaymentRequest<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from( value: ( &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, &Card<T>, ), ) -> Result<Self, Self::Error> { let (item, _card_data) = value; let amount = item.amount; let currency = item.router_data.request.currency.to_string(); let billing = item .router_data .resource_common_data .address .get_payment_billing(); let contact = billing .and_then(|billing| billing.phone.as_ref()) .and_then(|phone| phone.number.clone()) .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "contact",
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_375_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, &Card<T>, ), ) -> Result<Self, Self::Error> { let (item, _card_data) = value; let amount = item.amount; let currency = item.router_data.request.currency.to_string(); let billing = item
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_375_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, &Card<T>, ), ) -> Result<Self, Self::Error> { let (item, _card_data) = value; let amount = item.amount; let currency = item.router_data.request.currency.to_string(); let billing = item .router_data .resource_common_data .address .get_payment_billing(); let contact = billing .and_then(|billing| billing.phone.as_ref()) .and_then(|phone| phone.number.clone()) .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "contact", })?; let billing_email = item .router_data .resource_common_data
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_375_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, &Card<T>, ), ) -> Result<Self, Self::Error> { let (item, _card_data) = value; let amount = item.amount; let currency = item.router_data.request.currency.to_string(); let billing = item .router_data .resource_common_data .address .get_payment_billing(); let contact = billing .and_then(|billing| billing.phone.as_ref()) .and_then(|phone| phone.number.clone()) .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "contact", })?; let billing_email = item .router_data .resource_common_data .get_billing_email() .ok(); let email = billing_email .or(item.router_data.request.email.clone()) .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "email", })?; let order_id = item .router_data .resource_common_data .reference_id .clone() .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "order_id", })?; let (method, card) = extract_payment_method_and_data( &item.router_data.request.payment_method_data,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_400_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs })?; let billing_email = item .router_data .resource_common_data .get_billing_email() .ok(); let email = billing_email .or(item.router_data.request.email.clone()) .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "email", })?; let order_id = item
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_400_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs })?; let billing_email = item .router_data .resource_common_data .get_billing_email() .ok(); let email = billing_email .or(item.router_data.request.email.clone()) .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "email", })?; let order_id = item .router_data .resource_common_data .reference_id .clone() .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "order_id", })?; let (method, card) = extract_payment_method_and_data( &item.router_data.request.payment_method_data, item.router_data.request.customer_name.clone(), )?; let browser_info_opt = item.router_data.request.browser_info.as_ref();
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_400_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs })?; let billing_email = item .router_data .resource_common_data .get_billing_email() .ok(); let email = billing_email .or(item.router_data.request.email.clone()) .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "email", })?; let order_id = item .router_data .resource_common_data .reference_id .clone() .ok_or(domain_types::errors::ConnectorError::MissingRequiredField { field_name: "order_id", })?; let (method, card) = extract_payment_method_and_data( &item.router_data.request.payment_method_data, item.router_data.request.customer_name.clone(), )?; let browser_info_opt = item.router_data.request.browser_info.as_ref(); let authentication_channel = match browser_info_opt { Some(_) => AuthenticationChannel::Browser, None => AuthenticationChannel::App, }; let authentication = Some(AuthenticationDetails { authentication_channel, }); let browser = browser_info_opt.map(|info| BrowserInfo { java_enabled: info.java_enabled, javascript_enabled: info.java_script_enabled, timezone_offset: info.time_zone, color_depth: info.color_depth.map(|v| v as i32), screen_width: info.screen_width.map(|v| v as i32), screen_height: info.screen_height.map(|v| v as i32), language: info.language.clone(), }); let ip = item
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_425_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs item.router_data.request.customer_name.clone(), )?; let browser_info_opt = item.router_data.request.browser_info.as_ref(); let authentication_channel = match browser_info_opt { Some(_) => AuthenticationChannel::Browser, None => AuthenticationChannel::App, }; let authentication = Some(AuthenticationDetails { authentication_channel, }); let browser = browser_info_opt.map(|info| BrowserInfo {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_425_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs item.router_data.request.customer_name.clone(), )?; let browser_info_opt = item.router_data.request.browser_info.as_ref(); let authentication_channel = match browser_info_opt { Some(_) => AuthenticationChannel::Browser, None => AuthenticationChannel::App, }; let authentication = Some(AuthenticationDetails { authentication_channel, }); let browser = browser_info_opt.map(|info| BrowserInfo { java_enabled: info.java_enabled, javascript_enabled: info.java_script_enabled, timezone_offset: info.time_zone, color_depth: info.color_depth.map(|v| v as i32), screen_width: info.screen_width.map(|v| v as i32), screen_height: info.screen_height.map(|v| v as i32), language: info.language.clone(), }); let ip = item .router_data .request .get_ip_address_as_optional() .map(|ip| Secret::new(ip.expose())) .unwrap_or_else(|| Secret::new("127.0.0.1".to_string()));
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_425_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs item.router_data.request.customer_name.clone(), )?; let browser_info_opt = item.router_data.request.browser_info.as_ref(); let authentication_channel = match browser_info_opt { Some(_) => AuthenticationChannel::Browser, None => AuthenticationChannel::App, }; let authentication = Some(AuthenticationDetails { authentication_channel, }); let browser = browser_info_opt.map(|info| BrowserInfo { java_enabled: info.java_enabled, javascript_enabled: info.java_script_enabled, timezone_offset: info.time_zone, color_depth: info.color_depth.map(|v| v as i32), screen_width: info.screen_width.map(|v| v as i32), screen_height: info.screen_height.map(|v| v as i32), language: info.language.clone(), }); let ip = item .router_data .request .get_ip_address_as_optional() .map(|ip| Secret::new(ip.expose())) .unwrap_or_else(|| Secret::new("127.0.0.1".to_string())); let user_agent = item .router_data .request .browser_info .as_ref() .and_then(|info| info.get_user_agent().ok()) .unwrap_or_else(|| "Mozilla/5.0".to_string()); let referer = item .router_data .request .browser_info .as_ref() .and_then(|info| info.get_referer().ok()) .unwrap_or_else(|| "https://example.com".to_string()); Ok(RazorpayPaymentRequest { amount, currency,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_450_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs .router_data .request .get_ip_address_as_optional() .map(|ip| Secret::new(ip.expose())) .unwrap_or_else(|| Secret::new("127.0.0.1".to_string())); let user_agent = item .router_data .request .browser_info .as_ref() .and_then(|info| info.get_user_agent().ok()) .unwrap_or_else(|| "Mozilla/5.0".to_string()); let referer = item
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_450_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs .router_data .request .get_ip_address_as_optional() .map(|ip| Secret::new(ip.expose())) .unwrap_or_else(|| Secret::new("127.0.0.1".to_string())); let user_agent = item .router_data .request .browser_info .as_ref() .and_then(|info| info.get_user_agent().ok()) .unwrap_or_else(|| "Mozilla/5.0".to_string()); let referer = item .router_data .request .browser_info .as_ref() .and_then(|info| info.get_referer().ok()) .unwrap_or_else(|| "https://example.com".to_string()); Ok(RazorpayPaymentRequest { amount, currency, contact, email, order_id, method, card,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_450_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs .router_data .request .get_ip_address_as_optional() .map(|ip| Secret::new(ip.expose())) .unwrap_or_else(|| Secret::new("127.0.0.1".to_string())); let user_agent = item .router_data .request .browser_info .as_ref() .and_then(|info| info.get_user_agent().ok()) .unwrap_or_else(|| "Mozilla/5.0".to_string()); let referer = item .router_data .request .browser_info .as_ref() .and_then(|info| info.get_referer().ok()) .unwrap_or_else(|| "https://example.com".to_string()); Ok(RazorpayPaymentRequest { amount, currency, contact, email, order_id, method, card, authentication, browser, ip, referer, user_agent, }) } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< &RazorpayRouterData< &RouterDataV2<
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_475_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs contact, email, order_id, method, card, authentication, browser, ip, referer, user_agent, }) } } impl<
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_475_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs contact, email, order_id, method, card, authentication, browser, ip, referer, user_agent, }) } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_475_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs contact, email, order_id, method, card, authentication, browser, ip, referer, user_agent, }) } } impl< T: PaymentMethodDataTypes + std::fmt::Debug + std::marker::Sync + std::marker::Send + 'static + Serialize, > TryFrom< &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, > for RazorpayPaymentRequest<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from( item: &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, ) -> Result<Self, Self::Error> { match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card) => RazorpayPaymentRequest::try_from((item, card)), _ => Err(domain_types::errors::ConnectorError::NotImplemented( "Only card payments are supported".into(), )
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_500_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, > for RazorpayPaymentRequest<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from( item: &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_500_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, > for RazorpayPaymentRequest<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from( item: &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, ) -> Result<Self, Self::Error> { match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card) => RazorpayPaymentRequest::try_from((item, card)), _ => Err(domain_types::errors::ConnectorError::NotImplemented( "Only card payments are supported".into(), ) .into()), } } }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_500_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, > for RazorpayPaymentRequest<T> { type Error = error_stack::Report<domain_types::errors::ConnectorError>; fn try_from( item: &RazorpayRouterData< &RouterDataV2< Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData, >, >, ) -> Result<Self, Self::Error> { match &item.router_data.request.payment_method_data { PaymentMethodData::Card(card) => RazorpayPaymentRequest::try_from((item, card)), _ => Err(domain_types::errors::ConnectorError::NotImplemented( "Only card payments are supported".into(), ) .into()), } } } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentResponse { pub razorpay_payment_id: String, pub next: Option<Vec<NextAction>>, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct NextAction { pub action: String, pub url: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged, rename_all = "snake_case")] pub enum RazorpayResponse { PaymentResponse(Box<RazorpayPaymentResponse>), PsyncResponse(Box<RazorpayPsyncResponse>), }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_525_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs .into()), } } } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentResponse { pub razorpay_payment_id: String, pub next: Option<Vec<NextAction>>, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct NextAction {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_525_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs .into()), } } } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentResponse { pub razorpay_payment_id: String, pub next: Option<Vec<NextAction>>, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct NextAction { pub action: String, pub url: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged, rename_all = "snake_case")] pub enum RazorpayResponse { PaymentResponse(Box<RazorpayPaymentResponse>), PsyncResponse(Box<RazorpayPsyncResponse>), } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPsyncResponse {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_525_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs .into()), } } } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPaymentResponse { pub razorpay_payment_id: String, pub next: Option<Vec<NextAction>>, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct NextAction { pub action: String, pub url: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged, rename_all = "snake_case")] pub enum RazorpayResponse { PaymentResponse(Box<RazorpayPaymentResponse>), PsyncResponse(Box<RazorpayPsyncResponse>), } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPsyncResponse { pub id: String, pub entity: String, pub amount: MinorUnit, pub base_amount: i64, pub currency: String, pub base_currency: String, pub status: RazorpayStatus, pub method: PaymentMethodType, pub order_id: Option<String>, pub invoice_id: Option<String>, pub description: Option<String>, pub international: bool, pub refund_status: Option<String>, pub amount_refunded: i64, pub captured: bool, pub email: Email, pub contact: Secret<String>, pub fee: Option<i64>, pub tax: Option<i64>, pub error_code: Option<String>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_550_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPsyncResponse { pub id: String, pub entity: String, pub amount: MinorUnit, pub base_amount: i64, pub currency: String, pub base_currency: String, pub status: RazorpayStatus, pub method: PaymentMethodType, pub order_id: Option<String>, pub invoice_id: Option<String>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_550_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPsyncResponse { pub id: String, pub entity: String, pub amount: MinorUnit, pub base_amount: i64, pub currency: String, pub base_currency: String, pub status: RazorpayStatus, pub method: PaymentMethodType, pub order_id: Option<String>, pub invoice_id: Option<String>, pub description: Option<String>, pub international: bool, pub refund_status: Option<String>, pub amount_refunded: i64, pub captured: bool, pub email: Email, pub contact: Secret<String>, pub fee: Option<i64>, pub tax: Option<i64>, pub error_code: Option<String>, pub error_description: Option<String>, pub error_source: Option<String>, pub error_step: Option<String>, pub error_reason: Option<String>, pub notes: Option<HashMap<String, String>>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_550_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayPsyncResponse { pub id: String, pub entity: String, pub amount: MinorUnit, pub base_amount: i64, pub currency: String, pub base_currency: String, pub status: RazorpayStatus, pub method: PaymentMethodType, pub order_id: Option<String>, pub invoice_id: Option<String>, pub description: Option<String>, pub international: bool, pub refund_status: Option<String>, pub amount_refunded: i64, pub captured: bool, pub email: Email, pub contact: Secret<String>, pub fee: Option<i64>, pub tax: Option<i64>, pub error_code: Option<String>, pub error_description: Option<String>, pub error_source: Option<String>, pub error_step: Option<String>, pub error_reason: Option<String>, pub notes: Option<HashMap<String, String>>, pub created_at: i64, pub card_id: Option<String>, pub card: Option<SyncCardDetails>, pub upi: Option<SyncUPIDetails>, pub acquirer_data: Option<AcquirerData>, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayRefundResponse { pub id: String, pub status: RazorpayRefundStatus, pub receipt: Option<String>, pub amount: MinorUnit, pub currency: String, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)]
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_575_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub error_description: Option<String>, pub error_source: Option<String>, pub error_step: Option<String>, pub error_reason: Option<String>, pub notes: Option<HashMap<String, String>>, pub created_at: i64, pub card_id: Option<String>, pub card: Option<SyncCardDetails>, pub upi: Option<SyncUPIDetails>, pub acquirer_data: Option<AcquirerData>, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")]
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_575_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub error_description: Option<String>, pub error_source: Option<String>, pub error_step: Option<String>, pub error_reason: Option<String>, pub notes: Option<HashMap<String, String>>, pub created_at: i64, pub card_id: Option<String>, pub card: Option<SyncCardDetails>, pub upi: Option<SyncUPIDetails>, pub acquirer_data: Option<AcquirerData>, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayRefundResponse { pub id: String, pub status: RazorpayRefundStatus, pub receipt: Option<String>, pub amount: MinorUnit, pub currency: String, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayRefundRequest { pub amount: MinorUnit, }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_575_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs pub error_description: Option<String>, pub error_source: Option<String>, pub error_step: Option<String>, pub error_reason: Option<String>, pub notes: Option<HashMap<String, String>>, pub created_at: i64, pub card_id: Option<String>, pub card: Option<SyncCardDetails>, pub upi: Option<SyncUPIDetails>, pub acquirer_data: Option<AcquirerData>, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayRefundResponse { pub id: String, pub status: RazorpayRefundStatus, pub receipt: Option<String>, pub amount: MinorUnit, pub currency: String, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayRefundRequest { pub amount: MinorUnit, } impl ForeignTryFrom<RazorpayRefundStatus> for common_enums::RefundStatus { type Error = domain_types::errors::ConnectorError; fn foreign_try_from(item: RazorpayRefundStatus) -> Result<Self, Self::Error> { match item { RazorpayRefundStatus::Failed => Ok(Self::Failure), RazorpayRefundStatus::Pending | RazorpayRefundStatus::Created => Ok(Self::Pending), RazorpayRefundStatus::Processed => Ok(Self::Success), } } } impl TryFrom< &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, > for RazorpayRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from(
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_600_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde(rename_all = "snake_case")] pub struct RazorpayRefundRequest { pub amount: MinorUnit, } impl ForeignTryFrom<RazorpayRefundStatus> for common_enums::RefundStatus { type Error = domain_types::errors::ConnectorError; fn foreign_try_from(item: RazorpayRefundStatus) -> Result<Self, Self::Error> { match item { RazorpayRefundStatus::Failed => Ok(Self::Failure), RazorpayRefundStatus::Pending | RazorpayRefundStatus::Created => Ok(Self::Pending), RazorpayRefundStatus::Processed => Ok(Self::Success), } } }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_600_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde(rename_all = "snake_case")] pub struct RazorpayRefundRequest { pub amount: MinorUnit, } impl ForeignTryFrom<RazorpayRefundStatus> for common_enums::RefundStatus { type Error = domain_types::errors::ConnectorError; fn foreign_try_from(item: RazorpayRefundStatus) -> Result<Self, Self::Error> { match item { RazorpayRefundStatus::Failed => Ok(Self::Failure), RazorpayRefundStatus::Pending | RazorpayRefundStatus::Created => Ok(Self::Pending), RazorpayRefundStatus::Processed => Ok(Self::Success), } } } impl TryFrom< &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, > for RazorpayRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, ) -> Result<Self, Self::Error> { Ok(Self {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_600_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde(rename_all = "snake_case")] pub struct RazorpayRefundRequest { pub amount: MinorUnit, } impl ForeignTryFrom<RazorpayRefundStatus> for common_enums::RefundStatus { type Error = domain_types::errors::ConnectorError; fn foreign_try_from(item: RazorpayRefundStatus) -> Result<Self, Self::Error> { match item { RazorpayRefundStatus::Failed => Ok(Self::Failure), RazorpayRefundStatus::Pending | RazorpayRefundStatus::Created => Ok(Self::Pending), RazorpayRefundStatus::Processed => Ok(Self::Success), } } } impl TryFrom< &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, > for RazorpayRefundRequest { type Error = error_stack::Report<errors::ConnectorError>; fn try_from( item: &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, ) -> Result<Self, Self::Error> { Ok(Self { amount: item.amount, }) } } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncCardDetails { pub id: String, pub entity: String, pub name: String, pub last4: String, pub network: String, pub r#type: String, pub issuer: Option<String>, pub emi: bool, pub sub_type: String, }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_625_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs item: &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, ) -> Result<Self, Self::Error> { Ok(Self { amount: item.amount, }) } } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncCardDetails { pub id: String,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_625_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs item: &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, ) -> Result<Self, Self::Error> { Ok(Self { amount: item.amount, }) } } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncCardDetails { pub id: String, pub entity: String, pub name: String, pub last4: String, pub network: String, pub r#type: String, pub issuer: Option<String>, pub emi: bool, pub sub_type: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncUPIDetails { pub payer_account_type: String, pub vpa: Secret<String>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_625_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs item: &RazorpayRouterData< &RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, >, ) -> Result<Self, Self::Error> { Ok(Self { amount: item.amount, }) } } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncCardDetails { pub id: String, pub entity: String, pub name: String, pub last4: String, pub network: String, pub r#type: String, pub issuer: Option<String>, pub emi: bool, pub sub_type: String, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncUPIDetails { pub payer_account_type: String, pub vpa: Secret<String>, pub flow: String, pub bank: String, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct AcquirerData { pub auth_code: Option<String>, pub rrn: Option<Secret<String>>, pub authentication_reference_number: Option<Secret<String>>, pub bank_transaction_id: Option<String>, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum RazorpayStatus { Created, Authorized, Captured,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_650_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncUPIDetails { pub payer_account_type: String, pub vpa: Secret<String>, pub flow: String, pub bank: String, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct AcquirerData { pub auth_code: Option<String>, pub rrn: Option<Secret<String>>,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_650_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncUPIDetails { pub payer_account_type: String, pub vpa: Secret<String>, pub flow: String, pub bank: String, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct AcquirerData { pub auth_code: Option<String>, pub rrn: Option<Secret<String>>, pub authentication_reference_number: Option<Secret<String>>, pub bank_transaction_id: Option<String>, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum RazorpayStatus { Created, Authorized, Captured, Refunded, Failed, } #[derive(Default, Debug, Serialize, Deserialize)]
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_650_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct SyncUPIDetails { pub payer_account_type: String, pub vpa: Secret<String>, pub flow: String, pub bank: String, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct AcquirerData { pub auth_code: Option<String>, pub rrn: Option<Secret<String>>, pub authentication_reference_number: Option<Secret<String>>, pub bank_transaction_id: Option<String>, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum RazorpayStatus { Created, Authorized, Captured, Refunded, Failed, } #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum CaptureMethod { #[default] Automatic, Manual, ManualMultiple, Scheduled, SequentialAutomatic, } pub trait ForeignTryFrom<F>: Sized { type Error; fn foreign_try_from(from: F) -> Result<Self, Self::Error>; } fn get_authorization_razorpay_payment_status_from_action( is_manual_capture: bool, has_next_action: bool, ) -> AttemptStatus {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_675_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Refunded, Failed, } #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum CaptureMethod { #[default] Automatic, Manual, ManualMultiple, Scheduled, SequentialAutomatic, }
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_675_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Refunded, Failed, } #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum CaptureMethod { #[default] Automatic, Manual, ManualMultiple, Scheduled, SequentialAutomatic, } pub trait ForeignTryFrom<F>: Sized { type Error; fn foreign_try_from(from: F) -> Result<Self, Self::Error>; } fn get_authorization_razorpay_payment_status_from_action( is_manual_capture: bool, has_next_action: bool, ) -> AttemptStatus { if has_next_action { AttemptStatus::AuthenticationPending } else if is_manual_capture { AttemptStatus::Authorized } else {
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_675_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs Refunded, Failed, } #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum CaptureMethod { #[default] Automatic, Manual, ManualMultiple, Scheduled, SequentialAutomatic, } pub trait ForeignTryFrom<F>: Sized { type Error; fn foreign_try_from(from: F) -> Result<Self, Self::Error>; } fn get_authorization_razorpay_payment_status_from_action( is_manual_capture: bool, has_next_action: bool, ) -> AttemptStatus { if has_next_action { AttemptStatus::AuthenticationPending } else if is_manual_capture { AttemptStatus::Authorized } else { AttemptStatus::Charged } } fn get_psync_razorpay_payment_status( is_manual_capture: bool, razorpay_status: RazorpayStatus, ) -> AttemptStatus { match razorpay_status { RazorpayStatus::Created => AttemptStatus::Pending, RazorpayStatus::Authorized => { if is_manual_capture { AttemptStatus::Authorized } else { AttemptStatus::Charged } } RazorpayStatus::Captured => AttemptStatus::Charged, RazorpayStatus::Refunded => AttemptStatus::AutoRefunded, RazorpayStatus::Failed => AttemptStatus::Failure,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_700_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs if has_next_action { AttemptStatus::AuthenticationPending } else if is_manual_capture { AttemptStatus::Authorized } else { AttemptStatus::Charged } } fn get_psync_razorpay_payment_status( is_manual_capture: bool, razorpay_status: RazorpayStatus, ) -> AttemptStatus { match razorpay_status { RazorpayStatus::Created => AttemptStatus::Pending,
{ "chunk": null, "crate": "connector-integration", "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_3490651234547846205_700_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs if has_next_action { AttemptStatus::AuthenticationPending } else if is_manual_capture { AttemptStatus::Authorized } else { AttemptStatus::Charged } } fn get_psync_razorpay_payment_status( is_manual_capture: bool, razorpay_status: RazorpayStatus, ) -> AttemptStatus { match razorpay_status { RazorpayStatus::Created => AttemptStatus::Pending, RazorpayStatus::Authorized => { if is_manual_capture { AttemptStatus::Authorized } else { AttemptStatus::Charged } } RazorpayStatus::Captured => AttemptStatus::Charged, RazorpayStatus::Refunded => AttemptStatus::AutoRefunded, RazorpayStatus::Failed => AttemptStatus::Failure, } } impl ForeignTryFrom<(
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 30, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 700, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_700_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs if has_next_action { AttemptStatus::AuthenticationPending } else if is_manual_capture { AttemptStatus::Authorized } else { AttemptStatus::Charged } } fn get_psync_razorpay_payment_status( is_manual_capture: bool, razorpay_status: RazorpayStatus, ) -> AttemptStatus { match razorpay_status { RazorpayStatus::Created => AttemptStatus::Pending, RazorpayStatus::Authorized => { if is_manual_capture { AttemptStatus::Authorized } else { AttemptStatus::Charged } } RazorpayStatus::Captured => AttemptStatus::Charged, RazorpayStatus::Refunded => AttemptStatus::AutoRefunded, RazorpayStatus::Failed => AttemptStatus::Failure, } } impl ForeignTryFrom<( RazorpayRefundResponse, RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, u16, )> for RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, http_code): ( RazorpayRefundResponse, RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?; let refunds_response_data = RefundsResponseData { connector_refund_id: response.id, refund_status: status, status_code: http_code,
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 50, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 700, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_725_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs } } impl ForeignTryFrom<( RazorpayRefundResponse, RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, u16, )> for RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, http_code): ( RazorpayRefundResponse,
{ "chunk": null, "crate": "connector-integration", "enum_name": null, "file_size": null, "for_type": null, "function_name": null, "is_async": null, "is_pub": null, "lines": 15, "method_name": null, "num_enums": null, "num_items": null, "num_structs": null, "repo": "connector-service", "start_line": 725, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_725_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs } } impl ForeignTryFrom<( RazorpayRefundResponse, RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, u16, )> for RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, http_code): ( RazorpayRefundResponse, RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?; let refunds_response_data = RefundsResponseData { connector_refund_id: response.id, refund_status: status, status_code: http_code, }; Ok(Self { resource_common_data: RefundFlowData { status,
{ "chunk": null, "crate": "connector-integration", "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": 725, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_725_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs } } impl ForeignTryFrom<( RazorpayRefundResponse, RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, u16, )> for RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, http_code): ( RazorpayRefundResponse, RouterDataV2<RSync, RefundFlowData, RefundSyncData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?; let refunds_response_data = RefundsResponseData { connector_refund_id: response.id, refund_status: status, status_code: http_code, }; Ok(Self { resource_common_data: RefundFlowData { status, ..data.resource_common_data }, response: Ok(refunds_response_data), ..data }) } } impl ForeignTryFrom<( RazorpayRefundResponse, RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, )> for RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, http_code): ( RazorpayRefundResponse,
{ "chunk": null, "crate": "connector-integration", "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": 725, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_750_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs }; Ok(Self { resource_common_data: RefundFlowData { status, ..data.resource_common_data }, response: Ok(refunds_response_data), ..data }) } } impl ForeignTryFrom<(
{ "chunk": null, "crate": "connector-integration", "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": 750, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_750_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs }; Ok(Self { resource_common_data: RefundFlowData { status, ..data.resource_common_data }, response: Ok(refunds_response_data), ..data }) } } impl ForeignTryFrom<( RazorpayRefundResponse, RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, )> for RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, http_code): ( RazorpayRefundResponse, RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?;
{ "chunk": null, "crate": "connector-integration", "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": 750, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_750_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs }; Ok(Self { resource_common_data: RefundFlowData { status, ..data.resource_common_data }, response: Ok(refunds_response_data), ..data }) } } impl ForeignTryFrom<( RazorpayRefundResponse, RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, )> for RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, http_code): ( RazorpayRefundResponse, RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?; let refunds_response_data = RefundsResponseData { connector_refund_id: response.id, refund_status: status, status_code: http_code, }; Ok(Self { resource_common_data: RefundFlowData { status, ..data.resource_common_data }, response: Ok(refunds_response_data), ..data }) } } impl<F, Req> ForeignTryFrom<(
{ "chunk": null, "crate": "connector-integration", "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": 750, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_775_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?; let refunds_response_data = RefundsResponseData { connector_refund_id: response.id, refund_status: status, status_code: http_code, }; Ok(Self { resource_common_data: RefundFlowData { status,
{ "chunk": null, "crate": "connector-integration", "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": 775, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_775_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?; let refunds_response_data = RefundsResponseData { connector_refund_id: response.id, refund_status: status, status_code: http_code, }; Ok(Self { resource_common_data: RefundFlowData { status, ..data.resource_common_data }, response: Ok(refunds_response_data), ..data }) } } impl<F, Req> ForeignTryFrom<( RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool,
{ "chunk": null, "crate": "connector-integration", "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": 775, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_775_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs RouterDataV2<Refund, RefundFlowData, RefundsData, RefundsResponseData>, u16, ), ) -> Result<Self, Self::Error> { let status = common_enums::RefundStatus::foreign_try_from(response.status)?; let refunds_response_data = RefundsResponseData { connector_refund_id: response.id, refund_status: status, status_code: http_code, }; Ok(Self { resource_common_data: RefundFlowData { status, ..data.resource_common_data }, response: Ok(refunds_response_data), ..data }) } } impl<F, Req> ForeignTryFrom<( RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool, Option<common_enums::PaymentMethodType>, )> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, _http_code, _capture_method, _is_multiple_capture_psync_flow, _pmt): ( RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool, Option<common_enums::PaymentMethodType>, ), ) -> Result<Self, Self::Error> { let is_manual_capture = false; match response { RazorpayResponse::PaymentResponse(payment_response) => { let status =
{ "chunk": null, "crate": "connector-integration", "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": 775, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_800_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool, Option<common_enums::PaymentMethodType>, )> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, _http_code, _capture_method, _is_multiple_capture_psync_flow, _pmt): ( RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16,
{ "chunk": null, "crate": "connector-integration", "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": 800, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_800_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool, Option<common_enums::PaymentMethodType>, )> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, _http_code, _capture_method, _is_multiple_capture_psync_flow, _pmt): ( RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool, Option<common_enums::PaymentMethodType>, ), ) -> Result<Self, Self::Error> { let is_manual_capture = false; match response { RazorpayResponse::PaymentResponse(payment_response) => { let status = get_authorization_razorpay_payment_status_from_action(is_manual_capture, true); let redirect_url = payment_response .next .as_ref() .and_then(|next_actions| next_actions.first())
{ "chunk": null, "crate": "connector-integration", "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": 800, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_800_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool, Option<common_enums::PaymentMethodType>, )> for RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData> { type Error = domain_types::errors::ConnectorError; fn foreign_try_from( (response, data, _http_code, _capture_method, _is_multiple_capture_psync_flow, _pmt): ( RazorpayResponse, RouterDataV2<F, PaymentFlowData, Req, PaymentsResponseData>, u16, Option<common_enums::CaptureMethod>, bool, Option<common_enums::PaymentMethodType>, ), ) -> Result<Self, Self::Error> { let is_manual_capture = false; match response { RazorpayResponse::PaymentResponse(payment_response) => { let status = get_authorization_razorpay_payment_status_from_action(is_manual_capture, true); let redirect_url = payment_response .next .as_ref() .and_then(|next_actions| next_actions.first()) .map(|action| action.url.clone()) .ok_or_else( || domain_types::errors::ConnectorError::MissingRequiredField { field_name: "next.url", }, )?; let form_fields = HashMap::new(); let payment_response_data = PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId( payment_response.razorpay_payment_id.clone(), ), redirection_data: Some(Box::new(RedirectForm::Form { endpoint: redirect_url, method: Method::Get, form_fields, })), connector_metadata: None, network_txn_id: None,
{ "chunk": null, "crate": "connector-integration", "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": 800, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_825_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs get_authorization_razorpay_payment_status_from_action(is_manual_capture, true); let redirect_url = payment_response .next .as_ref() .and_then(|next_actions| next_actions.first()) .map(|action| action.url.clone()) .ok_or_else( || domain_types::errors::ConnectorError::MissingRequiredField { field_name: "next.url", }, )?; let form_fields = HashMap::new(); let payment_response_data = PaymentsResponseData::TransactionResponse {
{ "chunk": null, "crate": "connector-integration", "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": 825, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_825_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs get_authorization_razorpay_payment_status_from_action(is_manual_capture, true); let redirect_url = payment_response .next .as_ref() .and_then(|next_actions| next_actions.first()) .map(|action| action.url.clone()) .ok_or_else( || domain_types::errors::ConnectorError::MissingRequiredField { field_name: "next.url", }, )?; let form_fields = HashMap::new(); let payment_response_data = PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId( payment_response.razorpay_payment_id.clone(), ), redirection_data: Some(Box::new(RedirectForm::Form { endpoint: redirect_url, method: Method::Get, form_fields, })), connector_metadata: None, network_txn_id: None, connector_response_reference_id: data.resource_common_data.reference_id.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, };
{ "chunk": null, "crate": "connector-integration", "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": 825, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_825_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs get_authorization_razorpay_payment_status_from_action(is_manual_capture, true); let redirect_url = payment_response .next .as_ref() .and_then(|next_actions| next_actions.first()) .map(|action| action.url.clone()) .ok_or_else( || domain_types::errors::ConnectorError::MissingRequiredField { field_name: "next.url", }, )?; let form_fields = HashMap::new(); let payment_response_data = PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId( payment_response.razorpay_payment_id.clone(), ), redirection_data: Some(Box::new(RedirectForm::Form { endpoint: redirect_url, method: Method::Get, form_fields, })), connector_metadata: None, network_txn_id: None, connector_response_reference_id: data.resource_common_data.reference_id.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(payment_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data }) } RazorpayResponse::PsyncResponse(psync_response) => { let status = get_psync_razorpay_payment_status(is_manual_capture, psync_response.status); let psync_response_data = PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(psync_response.id), redirection_data: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: data.resource_common_data.reference_id.clone(),
{ "chunk": null, "crate": "connector-integration", "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": 825, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_850_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs connector_response_reference_id: data.resource_common_data.reference_id.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(payment_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data })
{ "chunk": null, "crate": "connector-integration", "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": 850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_850_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs connector_response_reference_id: data.resource_common_data.reference_id.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(payment_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data }) } RazorpayResponse::PsyncResponse(psync_response) => { let status = get_psync_razorpay_payment_status(is_manual_capture, psync_response.status); let psync_response_data = PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(psync_response.id), redirection_data: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: data.resource_common_data.reference_id.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None;
{ "chunk": null, "crate": "connector-integration", "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": 850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_850_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs connector_response_reference_id: data.resource_common_data.reference_id.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(payment_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data }) } RazorpayResponse::PsyncResponse(psync_response) => { let status = get_psync_razorpay_payment_status(is_manual_capture, psync_response.status); let psync_response_data = PaymentsResponseData::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(psync_response.id), redirection_data: None, connector_metadata: None, network_txn_id: None, connector_response_reference_id: data.resource_common_data.reference_id.clone(), incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(psync_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data }) } } } } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged)] pub enum RazorpayErrorResponse { StandardError { error: RazorpayError }, SimpleError { message: String }, }
{ "chunk": null, "crate": "connector-integration", "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": 850, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_875_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(psync_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data }) }
{ "chunk": null, "crate": "connector-integration", "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": 875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_875_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(psync_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data }) } } } } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged)] pub enum RazorpayErrorResponse { StandardError { error: RazorpayError }, SimpleError { message: String }, } #[serde_with::skip_serializing_none] #[derive(Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayError {
{ "chunk": null, "crate": "connector-integration", "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": 875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_875_50
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs incremental_authorization_allowed: None, mandate_reference: None, status_code: _http_code, }; let error = None; Ok(Self { response: error.map_or_else(|| Ok(psync_response_data), Err), resource_common_data: PaymentFlowData { status, ..data.resource_common_data }, ..data }) } } } } #[derive(Debug, Serialize, Deserialize)] #[serde(untagged)] pub enum RazorpayErrorResponse { StandardError { error: RazorpayError }, SimpleError { message: String }, } #[serde_with::skip_serializing_none] #[derive(Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayError { pub code: String, pub description: String, pub source: Option<String>, pub step: Option<String>, pub reason: Option<String>, pub metadata: Option<Metadata>, } #[serde_with::skip_serializing_none] #[derive(Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct Metadata { pub order_id: Option<String>, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayOrderRequest { pub amount: MinorUnit,
{ "chunk": null, "crate": "connector-integration", "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": 875, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_900_15
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde_with::skip_serializing_none] #[derive(Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayError { pub code: String, pub description: String, pub source: Option<String>, pub step: Option<String>, pub reason: Option<String>, pub metadata: Option<Metadata>, } #[serde_with::skip_serializing_none] #[derive(Debug, Default, Serialize, Deserialize)]
{ "chunk": null, "crate": "connector-integration", "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": 900, "struct_name": null, "total_crates": null, "trait_name": null }
connector-service_snippet_3490651234547846205_900_30
clm
snippet
// connector-service/backend/connector-integration/src/connectors/razorpay/transformers.rs #[serde_with::skip_serializing_none] #[derive(Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayError { pub code: String, pub description: String, pub source: Option<String>, pub step: Option<String>, pub reason: Option<String>, pub metadata: Option<Metadata>, } #[serde_with::skip_serializing_none] #[derive(Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct Metadata { pub order_id: Option<String>, } #[serde_with::skip_serializing_none] #[derive(Debug, Serialize)] #[serde(rename_all = "snake_case")] pub struct RazorpayOrderRequest { pub amount: MinorUnit, pub currency: String, pub receipt: String, pub partial_payment: Option<bool>, pub first_payment_min_amount: Option<MinorUnit>, #[serde(skip_serializing_if = "Option::is_none")]
{ "chunk": null, "crate": "connector-integration", "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": 900, "struct_name": null, "total_crates": null, "trait_name": null }