id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
connector-service_snippet_-239682093767531356_3375_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub state: Option<Secret<String>>,
#[serde(rename = "shipping[name]")]
pub name: Option<Secret<String>>,
#[serde(rename = "shipping[phone]")]
pub phone: Option<Secret<String>>,
}
#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize)]
pub struct StripeBillingAddress {
#[serde(rename = "payment_method_data[billing_details][email]")]
pub email: Option<Email>,
#[serde(rename = "payment_method_data[billing_details][address][country]")]
pub country: Option<common_enums::CountryAlpha2>,
#[serde(rename = "payment_method_data[billing_details][name]")]
pub name: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][city]")]
pub city: Option<String>,
#[serde(rename = "payment_method_data[billing_details][address][line1]")]
pub address_line1: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][line2]")]
pub address_line2: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][postal_code]")]
pub zip_code: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][state]")]
pub state: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][phone]")]
pub phone: Option<Secret<String>>,
}
#[derive(Debug, Clone, serde::Deserialize, Eq, PartialEq)]
| {
"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": 3375,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3375_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub state: Option<Secret<String>>,
#[serde(rename = "shipping[name]")]
pub name: Option<Secret<String>>,
#[serde(rename = "shipping[phone]")]
pub phone: Option<Secret<String>>,
}
#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize)]
pub struct StripeBillingAddress {
#[serde(rename = "payment_method_data[billing_details][email]")]
pub email: Option<Email>,
#[serde(rename = "payment_method_data[billing_details][address][country]")]
pub country: Option<common_enums::CountryAlpha2>,
#[serde(rename = "payment_method_data[billing_details][name]")]
pub name: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][city]")]
pub city: Option<String>,
#[serde(rename = "payment_method_data[billing_details][address][line1]")]
pub address_line1: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][line2]")]
pub address_line2: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][postal_code]")]
pub zip_code: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][address][state]")]
pub state: Option<Secret<String>>,
#[serde(rename = "payment_method_data[billing_details][phone]")]
pub phone: Option<Secret<String>>,
}
#[derive(Debug, Clone, serde::Deserialize, Eq, PartialEq)]
pub struct StripeRedirectResponse {
pub payment_intent: Option<String>,
pub payment_intent_client_secret: Option<Secret<String>>,
pub source_redirect_slug: Option<String>,
pub redirect_status: Option<StripePaymentStatus>,
pub source_type: Option<Secret<String>>,
}
#[derive(Debug, Serialize)]
pub struct CancelRequest {
cancellation_reason: Option<String>,
}
#[derive(Debug, Serialize)]
pub struct UpdateMetadataRequest {
#[serde(flatten)]
pub metadata: HashMap<String, String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
| {
"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": 3375,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3400_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "payment_method_data[billing_details][phone]")]
pub phone: Option<Secret<String>>,
}
#[derive(Debug, Clone, serde::Deserialize, Eq, PartialEq)]
pub struct StripeRedirectResponse {
pub payment_intent: Option<String>,
pub payment_intent_client_secret: Option<Secret<String>>,
pub source_redirect_slug: Option<String>,
pub redirect_status: Option<StripePaymentStatus>,
pub source_type: Option<Secret<String>>,
}
#[derive(Debug, Serialize)]
pub struct CancelRequest {
| {
"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": 3400,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3400_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "payment_method_data[billing_details][phone]")]
pub phone: Option<Secret<String>>,
}
#[derive(Debug, Clone, serde::Deserialize, Eq, PartialEq)]
pub struct StripeRedirectResponse {
pub payment_intent: Option<String>,
pub payment_intent_client_secret: Option<Secret<String>>,
pub source_redirect_slug: Option<String>,
pub redirect_status: Option<StripePaymentStatus>,
pub source_type: Option<Secret<String>>,
}
#[derive(Debug, Serialize)]
pub struct CancelRequest {
cancellation_reason: Option<String>,
}
#[derive(Debug, Serialize)]
pub struct UpdateMetadataRequest {
#[serde(flatten)]
pub metadata: HashMap<String, String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
#[non_exhaustive]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
pub enum StripePaymentMethodOptions {
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": 3400,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3400_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "payment_method_data[billing_details][phone]")]
pub phone: Option<Secret<String>>,
}
#[derive(Debug, Clone, serde::Deserialize, Eq, PartialEq)]
pub struct StripeRedirectResponse {
pub payment_intent: Option<String>,
pub payment_intent_client_secret: Option<Secret<String>>,
pub source_redirect_slug: Option<String>,
pub redirect_status: Option<StripePaymentStatus>,
pub source_type: Option<Secret<String>>,
}
#[derive(Debug, Serialize)]
pub struct CancelRequest {
cancellation_reason: Option<String>,
}
#[derive(Debug, Serialize)]
pub struct UpdateMetadataRequest {
#[serde(flatten)]
pub metadata: HashMap<String, String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
#[non_exhaustive]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
pub enum StripePaymentMethodOptions {
Card {
mandate_options: Option<StripeMandateOptions>,
#[serde(rename = "payment_method_options[card][network_transaction_id]")]
network_transaction_id: Option<Secret<String>>,
#[serde(flatten)]
mit_exemption: Option<MitExemption>, // To be used for MIT mandate txns
},
Klarna {},
Affirm {},
AfterpayClearpay {},
AmazonPay {},
Eps {},
Giropay {},
Ideal {},
Sofort {},
#[serde(rename = "us_bank_account")]
Ach {},
#[serde(rename = "sepa_debit")]
Sepa {},
#[serde(rename = "au_becs_debit")]
Becs {},
| {
"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": 3400,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3425_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[non_exhaustive]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
pub enum StripePaymentMethodOptions {
Card {
mandate_options: Option<StripeMandateOptions>,
#[serde(rename = "payment_method_options[card][network_transaction_id]")]
network_transaction_id: Option<Secret<String>>,
#[serde(flatten)]
mit_exemption: Option<MitExemption>, // To be used for MIT mandate txns
},
Klarna {},
Affirm {},
AfterpayClearpay {},
AmazonPay {},
| {
"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": 3425,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3425_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[non_exhaustive]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
pub enum StripePaymentMethodOptions {
Card {
mandate_options: Option<StripeMandateOptions>,
#[serde(rename = "payment_method_options[card][network_transaction_id]")]
network_transaction_id: Option<Secret<String>>,
#[serde(flatten)]
mit_exemption: Option<MitExemption>, // To be used for MIT mandate txns
},
Klarna {},
Affirm {},
AfterpayClearpay {},
AmazonPay {},
Eps {},
Giropay {},
Ideal {},
Sofort {},
#[serde(rename = "us_bank_account")]
Ach {},
#[serde(rename = "sepa_debit")]
Sepa {},
#[serde(rename = "au_becs_debit")]
Becs {},
#[serde(rename = "bacs_debit")]
Bacs {},
Bancontact {},
WechatPay {},
Alipay {},
| {
"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": 3425,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3425_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[non_exhaustive]
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
pub enum StripePaymentMethodOptions {
Card {
mandate_options: Option<StripeMandateOptions>,
#[serde(rename = "payment_method_options[card][network_transaction_id]")]
network_transaction_id: Option<Secret<String>>,
#[serde(flatten)]
mit_exemption: Option<MitExemption>, // To be used for MIT mandate txns
},
Klarna {},
Affirm {},
AfterpayClearpay {},
AmazonPay {},
Eps {},
Giropay {},
Ideal {},
Sofort {},
#[serde(rename = "us_bank_account")]
Ach {},
#[serde(rename = "sepa_debit")]
Sepa {},
#[serde(rename = "au_becs_debit")]
Becs {},
#[serde(rename = "bacs_debit")]
Bacs {},
Bancontact {},
WechatPay {},
Alipay {},
#[serde(rename = "p24")]
Przelewy24 {},
CustomerBalance {},
Multibanco {},
Blik {},
Cashapp {},
}
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct MitExemption {
#[serde(rename = "payment_method_options[card][mit_exemption][network_transaction_id]")]
pub network_transaction_id: Secret<String>,
}
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(untagged)]
pub enum LatestAttempt {
PaymentIntentAttempt(Box<LatestPaymentAttempt>),
SetupAttempt(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": 3425,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3450_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "bacs_debit")]
Bacs {},
Bancontact {},
WechatPay {},
Alipay {},
#[serde(rename = "p24")]
Przelewy24 {},
CustomerBalance {},
Multibanco {},
Blik {},
Cashapp {},
}
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct MitExemption {
| {
"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": 3450,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3450_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "bacs_debit")]
Bacs {},
Bancontact {},
WechatPay {},
Alipay {},
#[serde(rename = "p24")]
Przelewy24 {},
CustomerBalance {},
Multibanco {},
Blik {},
Cashapp {},
}
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct MitExemption {
#[serde(rename = "payment_method_options[card][mit_exemption][network_transaction_id]")]
pub network_transaction_id: Secret<String>,
}
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(untagged)]
pub enum LatestAttempt {
PaymentIntentAttempt(Box<LatestPaymentAttempt>),
SetupAttempt(String),
}
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct LatestPaymentAttempt {
pub payment_method_options: Option<StripePaymentMethodOptions>,
pub payment_method_details: Option<StripePaymentMethodDetailsResponse>,
}
| {
"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": 3450,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3450_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "bacs_debit")]
Bacs {},
Bancontact {},
WechatPay {},
Alipay {},
#[serde(rename = "p24")]
Przelewy24 {},
CustomerBalance {},
Multibanco {},
Blik {},
Cashapp {},
}
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct MitExemption {
#[serde(rename = "payment_method_options[card][mit_exemption][network_transaction_id]")]
pub network_transaction_id: Secret<String>,
}
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(untagged)]
pub enum LatestAttempt {
PaymentIntentAttempt(Box<LatestPaymentAttempt>),
SetupAttempt(String),
}
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct LatestPaymentAttempt {
pub payment_method_options: Option<StripePaymentMethodOptions>,
pub payment_method_details: Option<StripePaymentMethodDetailsResponse>,
}
// #[derive(Deserialize, Debug, Clone, Eq, PartialEq)]
// pub struct Card
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Default, Eq, PartialEq)]
pub struct StripeMandateOptions {
reference: Secret<String>, // Extendable, But only important field to be captured
}
/// Represents the capture request body for stripe connector.
#[derive(Debug, Serialize, Clone, Copy)]
pub struct CaptureRequest {
/// If amount_to_capture is None stripe captures the amount in the payment intent.
amount_to_capture: Option<MinorUnit>,
}
impl TryFrom<MinorUnit> for CaptureRequest {
type Error = error_stack::Report<ConnectorError>;
fn try_from(capture_amount: MinorUnit) -> Result<Self, Self::Error> {
Ok(Self {
amount_to_capture: Some(capture_amount),
})
| {
"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": 3450,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3475_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct LatestPaymentAttempt {
pub payment_method_options: Option<StripePaymentMethodOptions>,
pub payment_method_details: Option<StripePaymentMethodDetailsResponse>,
}
// #[derive(Deserialize, Debug, Clone, Eq, PartialEq)]
// pub struct Card
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Default, Eq, PartialEq)]
pub struct StripeMandateOptions {
reference: Secret<String>, // Extendable, But only important field to be captured
}
/// Represents the capture request body for stripe connector.
#[derive(Debug, Serialize, Clone, Copy)]
pub struct CaptureRequest {
| {
"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": 3475,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3475_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct LatestPaymentAttempt {
pub payment_method_options: Option<StripePaymentMethodOptions>,
pub payment_method_details: Option<StripePaymentMethodDetailsResponse>,
}
// #[derive(Deserialize, Debug, Clone, Eq, PartialEq)]
// pub struct Card
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Default, Eq, PartialEq)]
pub struct StripeMandateOptions {
reference: Secret<String>, // Extendable, But only important field to be captured
}
/// Represents the capture request body for stripe connector.
#[derive(Debug, Serialize, Clone, Copy)]
pub struct CaptureRequest {
/// If amount_to_capture is None stripe captures the amount in the payment intent.
amount_to_capture: Option<MinorUnit>,
}
impl TryFrom<MinorUnit> for CaptureRequest {
type Error = error_stack::Report<ConnectorError>;
fn try_from(capture_amount: MinorUnit) -> Result<Self, Self::Error> {
Ok(Self {
amount_to_capture: Some(capture_amount),
})
}
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventDataResource {
| {
"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": 3475,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3475_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct LatestPaymentAttempt {
pub payment_method_options: Option<StripePaymentMethodOptions>,
pub payment_method_details: Option<StripePaymentMethodDetailsResponse>,
}
// #[derive(Deserialize, Debug, Clone, Eq, PartialEq)]
// pub struct Card
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Default, Eq, PartialEq)]
pub struct StripeMandateOptions {
reference: Secret<String>, // Extendable, But only important field to be captured
}
/// Represents the capture request body for stripe connector.
#[derive(Debug, Serialize, Clone, Copy)]
pub struct CaptureRequest {
/// If amount_to_capture is None stripe captures the amount in the payment intent.
amount_to_capture: Option<MinorUnit>,
}
impl TryFrom<MinorUnit> for CaptureRequest {
type Error = error_stack::Report<ConnectorError>;
fn try_from(capture_amount: MinorUnit) -> Result<Self, Self::Error> {
Ok(Self {
amount_to_capture: Some(capture_amount),
})
}
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventDataResource {
pub object: Value,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventObjectResource {
pub data: WebhookEventDataResource,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEvent {
#[serde(rename = "type")]
pub event_type: WebhookEventType,
#[serde(rename = "data")]
pub event_data: WebhookEventData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventTypeBody {
#[serde(rename = "type")]
pub event_type: WebhookEventType,
| {
"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": 3475,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3500_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventDataResource {
pub object: Value,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventObjectResource {
pub data: WebhookEventDataResource,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEvent {
| {
"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": 3500,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3500_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventDataResource {
pub object: Value,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventObjectResource {
pub data: WebhookEventDataResource,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEvent {
#[serde(rename = "type")]
pub event_type: WebhookEventType,
#[serde(rename = "data")]
pub event_data: WebhookEventData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventTypeBody {
#[serde(rename = "type")]
pub event_type: WebhookEventType,
#[serde(rename = "data")]
pub event_data: WebhookStatusData,
}
#[derive(Debug, 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": 3500,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3500_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventDataResource {
pub object: Value,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventObjectResource {
pub data: WebhookEventDataResource,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEvent {
#[serde(rename = "type")]
pub event_type: WebhookEventType,
#[serde(rename = "data")]
pub event_data: WebhookEventData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventTypeBody {
#[serde(rename = "type")]
pub event_type: WebhookEventType,
#[serde(rename = "data")]
pub event_data: WebhookStatusData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventData {
#[serde(rename = "object")]
pub event_object: WebhookEventObjectData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookStatusData {
#[serde(rename = "object")]
pub event_object: WebhookStatusObjectData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookStatusObjectData {
pub status: Option<WebhookEventStatus>,
pub payment_method_details: Option<WebhookPaymentMethodDetails>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum WebhookPaymentMethodType {
| {
"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": 3500,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3525_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "data")]
pub event_data: WebhookStatusData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventData {
#[serde(rename = "object")]
pub event_object: WebhookEventObjectData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookStatusData {
#[serde(rename = "object")]
pub event_object: WebhookStatusObjectData,
}
| {
"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": 3525,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3525_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "data")]
pub event_data: WebhookStatusData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventData {
#[serde(rename = "object")]
pub event_object: WebhookEventObjectData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookStatusData {
#[serde(rename = "object")]
pub event_object: WebhookStatusObjectData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookStatusObjectData {
pub status: Option<WebhookEventStatus>,
pub payment_method_details: Option<WebhookPaymentMethodDetails>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum WebhookPaymentMethodType {
AchCreditTransfer,
MultibancoBankTransfers,
#[serde(other)]
Unknown,
}
| {
"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": 3525,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3525_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "data")]
pub event_data: WebhookStatusData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookEventData {
#[serde(rename = "object")]
pub event_object: WebhookEventObjectData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookStatusData {
#[serde(rename = "object")]
pub event_object: WebhookStatusObjectData,
}
#[derive(Debug, Deserialize)]
pub struct WebhookStatusObjectData {
pub status: Option<WebhookEventStatus>,
pub payment_method_details: Option<WebhookPaymentMethodDetails>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum WebhookPaymentMethodType {
AchCreditTransfer,
MultibancoBankTransfers,
#[serde(other)]
Unknown,
}
#[derive(Debug, Deserialize)]
pub struct WebhookPaymentMethodDetails {
#[serde(rename = "type")]
pub payment_method: WebhookPaymentMethodType,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WebhookEventObjectData {
pub id: String,
pub object: WebhookEventObjectType,
pub amount: Option<MinorUnit>,
#[serde(default, deserialize_with = "convert_uppercase")]
pub currency: common_enums::Currency,
pub payment_intent: Option<String>,
pub client_secret: Option<Secret<String>>,
pub reason: Option<String>,
#[serde(with = "common_utils::custom_serde::timestamp")]
pub created: PrimitiveDateTime,
pub evidence_details: Option<EvidenceDetails>,
| {
"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": 3525,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3550_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
AchCreditTransfer,
MultibancoBankTransfers,
#[serde(other)]
Unknown,
}
#[derive(Debug, Deserialize)]
pub struct WebhookPaymentMethodDetails {
#[serde(rename = "type")]
pub payment_method: WebhookPaymentMethodType,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WebhookEventObjectData {
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": 3550,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3550_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
AchCreditTransfer,
MultibancoBankTransfers,
#[serde(other)]
Unknown,
}
#[derive(Debug, Deserialize)]
pub struct WebhookPaymentMethodDetails {
#[serde(rename = "type")]
pub payment_method: WebhookPaymentMethodType,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WebhookEventObjectData {
pub id: String,
pub object: WebhookEventObjectType,
pub amount: Option<MinorUnit>,
#[serde(default, deserialize_with = "convert_uppercase")]
pub currency: common_enums::Currency,
pub payment_intent: Option<String>,
pub client_secret: Option<Secret<String>>,
pub reason: Option<String>,
#[serde(with = "common_utils::custom_serde::timestamp")]
pub created: PrimitiveDateTime,
pub evidence_details: Option<EvidenceDetails>,
pub status: Option<WebhookEventStatus>,
pub metadata: Option<StripeMetadata>,
pub last_payment_error: Option<ErrorDetails>,
}
| {
"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": 3550,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3550_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
AchCreditTransfer,
MultibancoBankTransfers,
#[serde(other)]
Unknown,
}
#[derive(Debug, Deserialize)]
pub struct WebhookPaymentMethodDetails {
#[serde(rename = "type")]
pub payment_method: WebhookPaymentMethodType,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WebhookEventObjectData {
pub id: String,
pub object: WebhookEventObjectType,
pub amount: Option<MinorUnit>,
#[serde(default, deserialize_with = "convert_uppercase")]
pub currency: common_enums::Currency,
pub payment_intent: Option<String>,
pub client_secret: Option<Secret<String>>,
pub reason: Option<String>,
#[serde(with = "common_utils::custom_serde::timestamp")]
pub created: PrimitiveDateTime,
pub evidence_details: Option<EvidenceDetails>,
pub status: Option<WebhookEventStatus>,
pub metadata: Option<StripeMetadata>,
pub last_payment_error: Option<ErrorDetails>,
}
#[derive(Debug, Clone, Serialize, Deserialize, strum::Display)]
#[serde(rename_all = "snake_case")]
pub enum WebhookEventObjectType {
PaymentIntent,
Dispute,
Charge,
Source,
Refund,
}
#[derive(Debug, Deserialize)]
pub enum WebhookEventType {
#[serde(rename = "payment_intent.payment_failed")]
PaymentIntentFailed,
#[serde(rename = "payment_intent.succeeded")]
PaymentIntentSucceed,
#[serde(rename = "charge.dispute.created")]
DisputeCreated,
#[serde(rename = "charge.dispute.closed")]
DisputeClosed,
| {
"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": 3550,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3575_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub status: Option<WebhookEventStatus>,
pub metadata: Option<StripeMetadata>,
pub last_payment_error: Option<ErrorDetails>,
}
#[derive(Debug, Clone, Serialize, Deserialize, strum::Display)]
#[serde(rename_all = "snake_case")]
pub enum WebhookEventObjectType {
PaymentIntent,
Dispute,
Charge,
Source,
Refund,
}
| {
"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": 3575,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3575_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub status: Option<WebhookEventStatus>,
pub metadata: Option<StripeMetadata>,
pub last_payment_error: Option<ErrorDetails>,
}
#[derive(Debug, Clone, Serialize, Deserialize, strum::Display)]
#[serde(rename_all = "snake_case")]
pub enum WebhookEventObjectType {
PaymentIntent,
Dispute,
Charge,
Source,
Refund,
}
#[derive(Debug, Deserialize)]
pub enum WebhookEventType {
#[serde(rename = "payment_intent.payment_failed")]
PaymentIntentFailed,
#[serde(rename = "payment_intent.succeeded")]
PaymentIntentSucceed,
#[serde(rename = "charge.dispute.created")]
DisputeCreated,
#[serde(rename = "charge.dispute.closed")]
DisputeClosed,
#[serde(rename = "charge.dispute.updated")]
DisputeUpdated,
#[serde(rename = "charge.dispute.funds_reinstated")]
ChargeDisputeFundsReinstated,
#[serde(rename = "charge.dispute.funds_withdrawn")]
| {
"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": 3575,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3575_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub status: Option<WebhookEventStatus>,
pub metadata: Option<StripeMetadata>,
pub last_payment_error: Option<ErrorDetails>,
}
#[derive(Debug, Clone, Serialize, Deserialize, strum::Display)]
#[serde(rename_all = "snake_case")]
pub enum WebhookEventObjectType {
PaymentIntent,
Dispute,
Charge,
Source,
Refund,
}
#[derive(Debug, Deserialize)]
pub enum WebhookEventType {
#[serde(rename = "payment_intent.payment_failed")]
PaymentIntentFailed,
#[serde(rename = "payment_intent.succeeded")]
PaymentIntentSucceed,
#[serde(rename = "charge.dispute.created")]
DisputeCreated,
#[serde(rename = "charge.dispute.closed")]
DisputeClosed,
#[serde(rename = "charge.dispute.updated")]
DisputeUpdated,
#[serde(rename = "charge.dispute.funds_reinstated")]
ChargeDisputeFundsReinstated,
#[serde(rename = "charge.dispute.funds_withdrawn")]
ChargeDisputeFundsWithdrawn,
#[serde(rename = "charge.expired")]
ChargeExpired,
#[serde(rename = "charge.failed")]
ChargeFailed,
#[serde(rename = "charge.pending")]
ChargePending,
#[serde(rename = "charge.captured")]
ChargeCaptured,
#[serde(rename = "charge.refund.updated")]
ChargeRefundUpdated,
#[serde(rename = "charge.succeeded")]
ChargeSucceeded,
#[serde(rename = "charge.updated")]
ChargeUpdated,
#[serde(rename = "charge.refunded")]
ChargeRefunded,
#[serde(rename = "payment_intent.canceled")]
PaymentIntentCanceled,
#[serde(rename = "payment_intent.created")]
| {
"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": 3575,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3600_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "charge.dispute.updated")]
DisputeUpdated,
#[serde(rename = "charge.dispute.funds_reinstated")]
ChargeDisputeFundsReinstated,
#[serde(rename = "charge.dispute.funds_withdrawn")]
ChargeDisputeFundsWithdrawn,
#[serde(rename = "charge.expired")]
ChargeExpired,
#[serde(rename = "charge.failed")]
ChargeFailed,
#[serde(rename = "charge.pending")]
ChargePending,
#[serde(rename = "charge.captured")]
ChargeCaptured,
#[serde(rename = "charge.refund.updated")]
| {
"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": 3600,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3600_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "charge.dispute.updated")]
DisputeUpdated,
#[serde(rename = "charge.dispute.funds_reinstated")]
ChargeDisputeFundsReinstated,
#[serde(rename = "charge.dispute.funds_withdrawn")]
ChargeDisputeFundsWithdrawn,
#[serde(rename = "charge.expired")]
ChargeExpired,
#[serde(rename = "charge.failed")]
ChargeFailed,
#[serde(rename = "charge.pending")]
ChargePending,
#[serde(rename = "charge.captured")]
ChargeCaptured,
#[serde(rename = "charge.refund.updated")]
ChargeRefundUpdated,
#[serde(rename = "charge.succeeded")]
ChargeSucceeded,
#[serde(rename = "charge.updated")]
ChargeUpdated,
#[serde(rename = "charge.refunded")]
ChargeRefunded,
#[serde(rename = "payment_intent.canceled")]
PaymentIntentCanceled,
#[serde(rename = "payment_intent.created")]
PaymentIntentCreated,
#[serde(rename = "payment_intent.processing")]
PaymentIntentProcessing,
#[serde(rename = "payment_intent.requires_action")]
PaymentIntentRequiresAction,
| {
"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": 3600,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3600_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "charge.dispute.updated")]
DisputeUpdated,
#[serde(rename = "charge.dispute.funds_reinstated")]
ChargeDisputeFundsReinstated,
#[serde(rename = "charge.dispute.funds_withdrawn")]
ChargeDisputeFundsWithdrawn,
#[serde(rename = "charge.expired")]
ChargeExpired,
#[serde(rename = "charge.failed")]
ChargeFailed,
#[serde(rename = "charge.pending")]
ChargePending,
#[serde(rename = "charge.captured")]
ChargeCaptured,
#[serde(rename = "charge.refund.updated")]
ChargeRefundUpdated,
#[serde(rename = "charge.succeeded")]
ChargeSucceeded,
#[serde(rename = "charge.updated")]
ChargeUpdated,
#[serde(rename = "charge.refunded")]
ChargeRefunded,
#[serde(rename = "payment_intent.canceled")]
PaymentIntentCanceled,
#[serde(rename = "payment_intent.created")]
PaymentIntentCreated,
#[serde(rename = "payment_intent.processing")]
PaymentIntentProcessing,
#[serde(rename = "payment_intent.requires_action")]
PaymentIntentRequiresAction,
#[serde(rename = "payment_intent.amount_capturable_updated")]
PaymentIntentAmountCapturableUpdated,
#[serde(rename = "source.chargeable")]
SourceChargeable,
#[serde(rename = "source.transaction.created")]
SourceTransactionCreated,
#[serde(rename = "payment_intent.partially_funded")]
PaymentIntentPartiallyFunded,
#[serde(other)]
Unknown,
}
#[derive(Debug, Clone, Serialize, strum::Display, Deserialize, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum WebhookEventStatus {
WarningNeedsResponse,
WarningClosed,
WarningUnderReview,
Won,
Lost,
| {
"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": 3600,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3625_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
PaymentIntentCreated,
#[serde(rename = "payment_intent.processing")]
PaymentIntentProcessing,
#[serde(rename = "payment_intent.requires_action")]
PaymentIntentRequiresAction,
#[serde(rename = "payment_intent.amount_capturable_updated")]
PaymentIntentAmountCapturableUpdated,
#[serde(rename = "source.chargeable")]
SourceChargeable,
#[serde(rename = "source.transaction.created")]
SourceTransactionCreated,
#[serde(rename = "payment_intent.partially_funded")]
PaymentIntentPartiallyFunded,
#[serde(other)]
Unknown,
| {
"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": 3625,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3625_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
PaymentIntentCreated,
#[serde(rename = "payment_intent.processing")]
PaymentIntentProcessing,
#[serde(rename = "payment_intent.requires_action")]
PaymentIntentRequiresAction,
#[serde(rename = "payment_intent.amount_capturable_updated")]
PaymentIntentAmountCapturableUpdated,
#[serde(rename = "source.chargeable")]
SourceChargeable,
#[serde(rename = "source.transaction.created")]
SourceTransactionCreated,
#[serde(rename = "payment_intent.partially_funded")]
PaymentIntentPartiallyFunded,
#[serde(other)]
Unknown,
}
#[derive(Debug, Clone, Serialize, strum::Display, Deserialize, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum WebhookEventStatus {
WarningNeedsResponse,
WarningClosed,
WarningUnderReview,
Won,
Lost,
NeedsResponse,
UnderReview,
ChargeRefunded,
Succeeded,
RequiresPaymentMethod,
| {
"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": 3625,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3625_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
PaymentIntentCreated,
#[serde(rename = "payment_intent.processing")]
PaymentIntentProcessing,
#[serde(rename = "payment_intent.requires_action")]
PaymentIntentRequiresAction,
#[serde(rename = "payment_intent.amount_capturable_updated")]
PaymentIntentAmountCapturableUpdated,
#[serde(rename = "source.chargeable")]
SourceChargeable,
#[serde(rename = "source.transaction.created")]
SourceTransactionCreated,
#[serde(rename = "payment_intent.partially_funded")]
PaymentIntentPartiallyFunded,
#[serde(other)]
Unknown,
}
#[derive(Debug, Clone, Serialize, strum::Display, Deserialize, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum WebhookEventStatus {
WarningNeedsResponse,
WarningClosed,
WarningUnderReview,
Won,
Lost,
NeedsResponse,
UnderReview,
ChargeRefunded,
Succeeded,
RequiresPaymentMethod,
RequiresConfirmation,
RequiresAction,
Processing,
RequiresCapture,
Canceled,
Chargeable,
Failed,
#[serde(other)]
Unknown,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct EvidenceDetails {
#[serde(with = "common_utils::custom_serde::timestamp")]
pub due_by: PrimitiveDateTime,
}
#[derive(Debug, Deserialize)]
pub struct StripeGpayToken {
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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3625,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3650_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
NeedsResponse,
UnderReview,
ChargeRefunded,
Succeeded,
RequiresPaymentMethod,
RequiresConfirmation,
RequiresAction,
Processing,
RequiresCapture,
Canceled,
Chargeable,
Failed,
#[serde(other)]
Unknown,
}
| {
"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": 3650,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3650_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
NeedsResponse,
UnderReview,
ChargeRefunded,
Succeeded,
RequiresPaymentMethod,
RequiresConfirmation,
RequiresAction,
Processing,
RequiresCapture,
Canceled,
Chargeable,
Failed,
#[serde(other)]
Unknown,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct EvidenceDetails {
#[serde(with = "common_utils::custom_serde::timestamp")]
pub due_by: PrimitiveDateTime,
}
#[derive(Debug, Deserialize)]
pub struct StripeGpayToken {
pub id: String,
}
#[derive(Debug, Serialize)]
pub struct StripeFileRequest {
pub purpose: &'static str,
| {
"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": 3650,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3650_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
NeedsResponse,
UnderReview,
ChargeRefunded,
Succeeded,
RequiresPaymentMethod,
RequiresConfirmation,
RequiresAction,
Processing,
RequiresCapture,
Canceled,
Chargeable,
Failed,
#[serde(other)]
Unknown,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct EvidenceDetails {
#[serde(with = "common_utils::custom_serde::timestamp")]
pub due_by: PrimitiveDateTime,
}
#[derive(Debug, Deserialize)]
pub struct StripeGpayToken {
pub id: String,
}
#[derive(Debug, Serialize)]
pub struct StripeFileRequest {
pub purpose: &'static str,
#[serde(skip)]
pub file: Vec<u8>,
#[serde(skip)]
pub file_key: String,
#[serde(skip)]
pub file_type: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct FileUploadResponse {
#[serde(rename = "id")]
pub file_id: String,
}
#[derive(Debug, Serialize)]
pub struct Evidence {
#[serde(rename = "evidence[access_activity_log]")]
pub access_activity_log: Option<String>,
#[serde(rename = "evidence[billing_address]")]
pub billing_address: 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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3650,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3675_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
#[derive(Debug, Serialize)]
pub struct StripeFileRequest {
pub purpose: &'static str,
#[serde(skip)]
pub file: Vec<u8>,
#[serde(skip)]
pub file_key: String,
#[serde(skip)]
pub file_type: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct FileUploadResponse {
| {
"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": 3675,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3675_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
#[derive(Debug, Serialize)]
pub struct StripeFileRequest {
pub purpose: &'static str,
#[serde(skip)]
pub file: Vec<u8>,
#[serde(skip)]
pub file_key: String,
#[serde(skip)]
pub file_type: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct FileUploadResponse {
#[serde(rename = "id")]
pub file_id: String,
}
#[derive(Debug, Serialize)]
pub struct Evidence {
#[serde(rename = "evidence[access_activity_log]")]
pub access_activity_log: Option<String>,
#[serde(rename = "evidence[billing_address]")]
pub billing_address: Option<Secret<String>>,
#[serde(rename = "evidence[cancellation_policy]")]
pub cancellation_policy: Option<String>,
#[serde(rename = "evidence[cancellation_policy_disclosure]")]
pub cancellation_policy_disclosure: Option<String>,
#[serde(rename = "evidence[cancellation_rebuttal]")]
| {
"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": 3675,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3675_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
#[derive(Debug, Serialize)]
pub struct StripeFileRequest {
pub purpose: &'static str,
#[serde(skip)]
pub file: Vec<u8>,
#[serde(skip)]
pub file_key: String,
#[serde(skip)]
pub file_type: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct FileUploadResponse {
#[serde(rename = "id")]
pub file_id: String,
}
#[derive(Debug, Serialize)]
pub struct Evidence {
#[serde(rename = "evidence[access_activity_log]")]
pub access_activity_log: Option<String>,
#[serde(rename = "evidence[billing_address]")]
pub billing_address: Option<Secret<String>>,
#[serde(rename = "evidence[cancellation_policy]")]
pub cancellation_policy: Option<String>,
#[serde(rename = "evidence[cancellation_policy_disclosure]")]
pub cancellation_policy_disclosure: Option<String>,
#[serde(rename = "evidence[cancellation_rebuttal]")]
pub cancellation_rebuttal: Option<String>,
#[serde(rename = "evidence[customer_communication]")]
pub customer_communication: Option<String>,
#[serde(rename = "evidence[customer_email_address]")]
pub customer_email_address: Option<Secret<String, pii::EmailStrategy>>,
#[serde(rename = "evidence[customer_name]")]
pub customer_name: Option<Secret<String>>,
#[serde(rename = "evidence[customer_purchase_ip]")]
pub customer_purchase_ip: Option<Secret<String, pii::IpAddress>>,
#[serde(rename = "evidence[customer_signature]")]
pub customer_signature: Option<Secret<String>>,
#[serde(rename = "evidence[product_description]")]
pub product_description: Option<String>,
#[serde(rename = "evidence[receipt]")]
pub receipt: Option<Secret<String>>,
#[serde(rename = "evidence[refund_policy]")]
pub refund_policy: Option<String>,
#[serde(rename = "evidence[refund_policy_disclosure]")]
pub refund_policy_disclosure: Option<String>,
#[serde(rename = "evidence[refund_refusal_explanation]")]
| {
"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": 3675,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3700_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "evidence[cancellation_policy]")]
pub cancellation_policy: Option<String>,
#[serde(rename = "evidence[cancellation_policy_disclosure]")]
pub cancellation_policy_disclosure: Option<String>,
#[serde(rename = "evidence[cancellation_rebuttal]")]
pub cancellation_rebuttal: Option<String>,
#[serde(rename = "evidence[customer_communication]")]
pub customer_communication: Option<String>,
#[serde(rename = "evidence[customer_email_address]")]
pub customer_email_address: Option<Secret<String, pii::EmailStrategy>>,
#[serde(rename = "evidence[customer_name]")]
pub customer_name: Option<Secret<String>>,
#[serde(rename = "evidence[customer_purchase_ip]")]
pub customer_purchase_ip: Option<Secret<String, pii::IpAddress>>,
#[serde(rename = "evidence[customer_signature]")]
| {
"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": 3700,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3700_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "evidence[cancellation_policy]")]
pub cancellation_policy: Option<String>,
#[serde(rename = "evidence[cancellation_policy_disclosure]")]
pub cancellation_policy_disclosure: Option<String>,
#[serde(rename = "evidence[cancellation_rebuttal]")]
pub cancellation_rebuttal: Option<String>,
#[serde(rename = "evidence[customer_communication]")]
pub customer_communication: Option<String>,
#[serde(rename = "evidence[customer_email_address]")]
pub customer_email_address: Option<Secret<String, pii::EmailStrategy>>,
#[serde(rename = "evidence[customer_name]")]
pub customer_name: Option<Secret<String>>,
#[serde(rename = "evidence[customer_purchase_ip]")]
pub customer_purchase_ip: Option<Secret<String, pii::IpAddress>>,
#[serde(rename = "evidence[customer_signature]")]
pub customer_signature: Option<Secret<String>>,
#[serde(rename = "evidence[product_description]")]
pub product_description: Option<String>,
#[serde(rename = "evidence[receipt]")]
pub receipt: Option<Secret<String>>,
#[serde(rename = "evidence[refund_policy]")]
pub refund_policy: Option<String>,
#[serde(rename = "evidence[refund_policy_disclosure]")]
pub refund_policy_disclosure: Option<String>,
#[serde(rename = "evidence[refund_refusal_explanation]")]
pub refund_refusal_explanation: Option<String>,
#[serde(rename = "evidence[service_date]")]
pub service_date: Option<String>,
#[serde(rename = "evidence[service_documentation]")]
pub service_documentation: 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": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3700,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3700_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[serde(rename = "evidence[cancellation_policy]")]
pub cancellation_policy: Option<String>,
#[serde(rename = "evidence[cancellation_policy_disclosure]")]
pub cancellation_policy_disclosure: Option<String>,
#[serde(rename = "evidence[cancellation_rebuttal]")]
pub cancellation_rebuttal: Option<String>,
#[serde(rename = "evidence[customer_communication]")]
pub customer_communication: Option<String>,
#[serde(rename = "evidence[customer_email_address]")]
pub customer_email_address: Option<Secret<String, pii::EmailStrategy>>,
#[serde(rename = "evidence[customer_name]")]
pub customer_name: Option<Secret<String>>,
#[serde(rename = "evidence[customer_purchase_ip]")]
pub customer_purchase_ip: Option<Secret<String, pii::IpAddress>>,
#[serde(rename = "evidence[customer_signature]")]
pub customer_signature: Option<Secret<String>>,
#[serde(rename = "evidence[product_description]")]
pub product_description: Option<String>,
#[serde(rename = "evidence[receipt]")]
pub receipt: Option<Secret<String>>,
#[serde(rename = "evidence[refund_policy]")]
pub refund_policy: Option<String>,
#[serde(rename = "evidence[refund_policy_disclosure]")]
pub refund_policy_disclosure: Option<String>,
#[serde(rename = "evidence[refund_refusal_explanation]")]
pub refund_refusal_explanation: Option<String>,
#[serde(rename = "evidence[service_date]")]
pub service_date: Option<String>,
#[serde(rename = "evidence[service_documentation]")]
pub service_documentation: Option<String>,
#[serde(rename = "evidence[shipping_address]")]
pub shipping_address: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_carrier]")]
pub shipping_carrier: Option<String>,
#[serde(rename = "evidence[shipping_date]")]
pub shipping_date: Option<String>,
#[serde(rename = "evidence[shipping_documentation]")]
pub shipping_documentation: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_tracking_number]")]
pub shipping_tracking_number: Option<Secret<String>>,
#[serde(rename = "evidence[uncategorized_file]")]
pub uncategorized_file: Option<String>,
#[serde(rename = "evidence[uncategorized_text]")]
pub uncategorized_text: Option<String>,
pub submit: bool,
}
// Mandates for bank redirects - ideal happens through sepa direct debit in stripe
fn mandatory_parameters_for_sepa_bank_debit_mandates(
billing_details: &Option<StripeBillingAddress>,
| {
"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": 3700,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3725_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub refund_refusal_explanation: Option<String>,
#[serde(rename = "evidence[service_date]")]
pub service_date: Option<String>,
#[serde(rename = "evidence[service_documentation]")]
pub service_documentation: Option<String>,
#[serde(rename = "evidence[shipping_address]")]
pub shipping_address: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_carrier]")]
pub shipping_carrier: Option<String>,
#[serde(rename = "evidence[shipping_date]")]
pub shipping_date: Option<String>,
#[serde(rename = "evidence[shipping_documentation]")]
pub shipping_documentation: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_tracking_number]")]
pub shipping_tracking_number: 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": 3725,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3725_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub refund_refusal_explanation: Option<String>,
#[serde(rename = "evidence[service_date]")]
pub service_date: Option<String>,
#[serde(rename = "evidence[service_documentation]")]
pub service_documentation: Option<String>,
#[serde(rename = "evidence[shipping_address]")]
pub shipping_address: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_carrier]")]
pub shipping_carrier: Option<String>,
#[serde(rename = "evidence[shipping_date]")]
pub shipping_date: Option<String>,
#[serde(rename = "evidence[shipping_documentation]")]
pub shipping_documentation: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_tracking_number]")]
pub shipping_tracking_number: Option<Secret<String>>,
#[serde(rename = "evidence[uncategorized_file]")]
pub uncategorized_file: Option<String>,
#[serde(rename = "evidence[uncategorized_text]")]
pub uncategorized_text: Option<String>,
pub submit: bool,
}
// Mandates for bank redirects - ideal happens through sepa direct debit in stripe
fn mandatory_parameters_for_sepa_bank_debit_mandates(
billing_details: &Option<StripeBillingAddress>,
is_customer_initiated_mandate_payment: Option<bool>,
) -> Result<StripeBillingAddress, ConnectorError> {
let billing_name = billing_details
.clone()
.and_then(|billing_data| billing_data.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": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3725,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3725_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
pub refund_refusal_explanation: Option<String>,
#[serde(rename = "evidence[service_date]")]
pub service_date: Option<String>,
#[serde(rename = "evidence[service_documentation]")]
pub service_documentation: Option<String>,
#[serde(rename = "evidence[shipping_address]")]
pub shipping_address: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_carrier]")]
pub shipping_carrier: Option<String>,
#[serde(rename = "evidence[shipping_date]")]
pub shipping_date: Option<String>,
#[serde(rename = "evidence[shipping_documentation]")]
pub shipping_documentation: Option<Secret<String>>,
#[serde(rename = "evidence[shipping_tracking_number]")]
pub shipping_tracking_number: Option<Secret<String>>,
#[serde(rename = "evidence[uncategorized_file]")]
pub uncategorized_file: Option<String>,
#[serde(rename = "evidence[uncategorized_text]")]
pub uncategorized_text: Option<String>,
pub submit: bool,
}
// Mandates for bank redirects - ideal happens through sepa direct debit in stripe
fn mandatory_parameters_for_sepa_bank_debit_mandates(
billing_details: &Option<StripeBillingAddress>,
is_customer_initiated_mandate_payment: Option<bool>,
) -> Result<StripeBillingAddress, ConnectorError> {
let billing_name = billing_details
.clone()
.and_then(|billing_data| billing_data.name.clone());
let billing_email = billing_details
.clone()
.and_then(|billing_data| billing_data.email.clone());
match is_customer_initiated_mandate_payment {
Some(true) => Ok(StripeBillingAddress {
name: Some(billing_name.ok_or(ConnectorError::MissingRequiredField {
field_name: "billing_name",
})?),
email: Some(billing_email.ok_or(ConnectorError::MissingRequiredField {
field_name: "billing_email",
})?),
..StripeBillingAddress::default()
}),
Some(false) | None => Ok(StripeBillingAddress {
name: billing_name,
email: billing_email,
..StripeBillingAddress::default()
}),
| {
"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": 3725,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3750_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
is_customer_initiated_mandate_payment: Option<bool>,
) -> Result<StripeBillingAddress, ConnectorError> {
let billing_name = billing_details
.clone()
.and_then(|billing_data| billing_data.name.clone());
let billing_email = billing_details
.clone()
.and_then(|billing_data| billing_data.email.clone());
match is_customer_initiated_mandate_payment {
Some(true) => Ok(StripeBillingAddress {
name: Some(billing_name.ok_or(ConnectorError::MissingRequiredField {
field_name: "billing_name",
})?),
| {
"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": 3750,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3750_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
is_customer_initiated_mandate_payment: Option<bool>,
) -> Result<StripeBillingAddress, ConnectorError> {
let billing_name = billing_details
.clone()
.and_then(|billing_data| billing_data.name.clone());
let billing_email = billing_details
.clone()
.and_then(|billing_data| billing_data.email.clone());
match is_customer_initiated_mandate_payment {
Some(true) => Ok(StripeBillingAddress {
name: Some(billing_name.ok_or(ConnectorError::MissingRequiredField {
field_name: "billing_name",
})?),
email: Some(billing_email.ok_or(ConnectorError::MissingRequiredField {
field_name: "billing_email",
})?),
..StripeBillingAddress::default()
}),
Some(false) | None => Ok(StripeBillingAddress {
name: billing_name,
email: billing_email,
..StripeBillingAddress::default()
}),
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DisputeObj {
| {
"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": 3750,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3750_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
is_customer_initiated_mandate_payment: Option<bool>,
) -> Result<StripeBillingAddress, ConnectorError> {
let billing_name = billing_details
.clone()
.and_then(|billing_data| billing_data.name.clone());
let billing_email = billing_details
.clone()
.and_then(|billing_data| billing_data.email.clone());
match is_customer_initiated_mandate_payment {
Some(true) => Ok(StripeBillingAddress {
name: Some(billing_name.ok_or(ConnectorError::MissingRequiredField {
field_name: "billing_name",
})?),
email: Some(billing_email.ok_or(ConnectorError::MissingRequiredField {
field_name: "billing_email",
})?),
..StripeBillingAddress::default()
}),
Some(false) | None => Ok(StripeBillingAddress {
name: billing_name,
email: billing_email,
..StripeBillingAddress::default()
}),
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DisputeObj {
#[serde(rename = "id")]
pub dispute_id: String,
pub status: String,
}
fn get_transaction_metadata(
merchant_metadata: Option<Secret<Value>>,
order_id: String,
) -> HashMap<String, String> {
let mut meta_data = HashMap::from([("metadata[order_id]".to_string(), order_id)]);
let mut request_hash_map = HashMap::new();
if let Some(metadata) = merchant_metadata {
let hashmap: HashMap<String, Value> =
serde_json::from_str(&metadata.peek().to_string()).unwrap_or(HashMap::new());
for (key, value) in hashmap {
request_hash_map.insert(format!("metadata[{key}]"), value.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": 3750,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3775_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DisputeObj {
#[serde(rename = "id")]
pub dispute_id: String,
pub status: String,
}
fn get_transaction_metadata(
merchant_metadata: Option<Secret<Value>>,
order_id: String,
) -> HashMap<String, String> {
let mut meta_data = HashMap::from([("metadata[order_id]".to_string(), order_id)]);
| {
"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": 3775,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3775_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DisputeObj {
#[serde(rename = "id")]
pub dispute_id: String,
pub status: String,
}
fn get_transaction_metadata(
merchant_metadata: Option<Secret<Value>>,
order_id: String,
) -> HashMap<String, String> {
let mut meta_data = HashMap::from([("metadata[order_id]".to_string(), order_id)]);
let mut request_hash_map = HashMap::new();
if let Some(metadata) = merchant_metadata {
let hashmap: HashMap<String, Value> =
serde_json::from_str(&metadata.peek().to_string()).unwrap_or(HashMap::new());
for (key, value) in hashmap {
request_hash_map.insert(format!("metadata[{key}]"), value.to_string());
}
meta_data.extend(request_hash_map)
};
meta_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": 3775,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3775_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct DisputeObj {
#[serde(rename = "id")]
pub dispute_id: String,
pub status: String,
}
fn get_transaction_metadata(
merchant_metadata: Option<Secret<Value>>,
order_id: String,
) -> HashMap<String, String> {
let mut meta_data = HashMap::from([("metadata[order_id]".to_string(), order_id)]);
let mut request_hash_map = HashMap::new();
if let Some(metadata) = merchant_metadata {
let hashmap: HashMap<String, Value> =
serde_json::from_str(&metadata.peek().to_string()).unwrap_or(HashMap::new());
for (key, value) in hashmap {
request_hash_map.insert(format!("metadata[{key}]"), value.to_string());
}
meta_data.extend(request_hash_map)
};
meta_data
}
fn get_stripe_payments_response_data(
response: &Option<ErrorDetails>,
http_code: u16,
response_id: String,
) -> Box<Result<PaymentsResponseData, domain_types::router_data::ErrorResponse>> {
let (code, error_message) = match response {
Some(error_details) => (
error_details
.code
.to_owned()
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
error_details
.message
.to_owned()
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
),
None => (
consts::NO_ERROR_CODE.to_string(),
consts::NO_ERROR_MESSAGE.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": 3775,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3800_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
meta_data.extend(request_hash_map)
};
meta_data
}
fn get_stripe_payments_response_data(
response: &Option<ErrorDetails>,
http_code: u16,
response_id: String,
) -> Box<Result<PaymentsResponseData, domain_types::router_data::ErrorResponse>> {
let (code, error_message) = match response {
Some(error_details) => (
error_details
.code
.to_owned()
| {
"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": 3800,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3800_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
meta_data.extend(request_hash_map)
};
meta_data
}
fn get_stripe_payments_response_data(
response: &Option<ErrorDetails>,
http_code: u16,
response_id: String,
) -> Box<Result<PaymentsResponseData, domain_types::router_data::ErrorResponse>> {
let (code, error_message) = match response {
Some(error_details) => (
error_details
.code
.to_owned()
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
error_details
.message
.to_owned()
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
),
None => (
consts::NO_ERROR_CODE.to_string(),
consts::NO_ERROR_MESSAGE.to_string(),
),
};
Box::new(Err(domain_types::router_data::ErrorResponse {
code,
message: error_message.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": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3800,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3800_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
meta_data.extend(request_hash_map)
};
meta_data
}
fn get_stripe_payments_response_data(
response: &Option<ErrorDetails>,
http_code: u16,
response_id: String,
) -> Box<Result<PaymentsResponseData, domain_types::router_data::ErrorResponse>> {
let (code, error_message) = match response {
Some(error_details) => (
error_details
.code
.to_owned()
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
error_details
.message
.to_owned()
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
),
None => (
consts::NO_ERROR_CODE.to_string(),
consts::NO_ERROR_MESSAGE.to_string(),
),
};
Box::new(Err(domain_types::router_data::ErrorResponse {
code,
message: error_message.clone(),
reason: response.clone().and_then(|res| {
res.decline_code
.clone()
.map(|decline_code| {
format!("message - {error_message}, decline_code - {decline_code}")
})
.or(Some(error_message.clone()))
}),
status_code: http_code,
attempt_status: None,
connector_transaction_id: Some(response_id),
network_advice_code: response
.as_ref()
.and_then(|res| res.network_advice_code.clone()),
network_decline_code: response
.as_ref()
.and_then(|res| res.network_decline_code.clone()),
network_error_message: response
.as_ref()
.and_then(|res| res.decline_code.clone().or(res.advice_code.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": 3800,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3825_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
};
Box::new(Err(domain_types::router_data::ErrorResponse {
code,
message: error_message.clone(),
reason: response.clone().and_then(|res| {
res.decline_code
.clone()
.map(|decline_code| {
format!("message - {error_message}, decline_code - {decline_code}")
})
.or(Some(error_message.clone()))
}),
status_code: http_code,
attempt_status: 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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3825,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3825_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
};
Box::new(Err(domain_types::router_data::ErrorResponse {
code,
message: error_message.clone(),
reason: response.clone().and_then(|res| {
res.decline_code
.clone()
.map(|decline_code| {
format!("message - {error_message}, decline_code - {decline_code}")
})
.or(Some(error_message.clone()))
}),
status_code: http_code,
attempt_status: None,
connector_transaction_id: Some(response_id),
network_advice_code: response
.as_ref()
.and_then(|res| res.network_advice_code.clone()),
network_decline_code: response
.as_ref()
.and_then(|res| res.network_decline_code.clone()),
network_error_message: response
.as_ref()
.and_then(|res| res.decline_code.clone().or(res.advice_code.clone())),
}))
}
pub fn construct_charge_response<T>(
charge_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": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3825,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3825_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
};
Box::new(Err(domain_types::router_data::ErrorResponse {
code,
message: error_message.clone(),
reason: response.clone().and_then(|res| {
res.decline_code
.clone()
.map(|decline_code| {
format!("message - {error_message}, decline_code - {decline_code}")
})
.or(Some(error_message.clone()))
}),
status_code: http_code,
attempt_status: None,
connector_transaction_id: Some(response_id),
network_advice_code: response
.as_ref()
.and_then(|res| res.network_advice_code.clone()),
network_decline_code: response
.as_ref()
.and_then(|res| res.network_decline_code.clone()),
network_error_message: response
.as_ref()
.and_then(|res| res.decline_code.clone().or(res.advice_code.clone())),
}))
}
pub fn construct_charge_response<T>(
charge_id: String,
request: &T,
) -> Option<domain_types::connector_types::ConnectorChargeResponseData>
where
T: SplitPaymentData,
{
let charge_request = request.get_split_payment_data();
if let Some(domain_types::connector_types::SplitPaymentsRequest::StripeSplitPayment(
stripe_split_payment,
)) = charge_request
{
let stripe_charge_response = domain_types::connector_types::StripeChargeResponseData {
charge_id: Some(charge_id),
charge_type: stripe_split_payment.charge_type,
application_fees: stripe_split_payment.application_fees,
transfer_account_id: stripe_split_payment.transfer_account_id,
};
Some(
domain_types::connector_types::ConnectorChargeResponseData::StripeSplitPayment(
stripe_charge_response,
),
| {
"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": 3825,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3850_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}))
}
pub fn construct_charge_response<T>(
charge_id: String,
request: &T,
) -> Option<domain_types::connector_types::ConnectorChargeResponseData>
where
T: SplitPaymentData,
{
let charge_request = request.get_split_payment_data();
if let Some(domain_types::connector_types::SplitPaymentsRequest::StripeSplitPayment(
stripe_split_payment,
)) = charge_request
{
| {
"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": 3850,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3850_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}))
}
pub fn construct_charge_response<T>(
charge_id: String,
request: &T,
) -> Option<domain_types::connector_types::ConnectorChargeResponseData>
where
T: SplitPaymentData,
{
let charge_request = request.get_split_payment_data();
if let Some(domain_types::connector_types::SplitPaymentsRequest::StripeSplitPayment(
stripe_split_payment,
)) = charge_request
{
let stripe_charge_response = domain_types::connector_types::StripeChargeResponseData {
charge_id: Some(charge_id),
charge_type: stripe_split_payment.charge_type,
application_fees: stripe_split_payment.application_fees,
transfer_account_id: stripe_split_payment.transfer_account_id,
};
Some(
domain_types::connector_types::ConnectorChargeResponseData::StripeSplitPayment(
stripe_charge_response,
),
)
} else {
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": 3850,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3850_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}))
}
pub fn construct_charge_response<T>(
charge_id: String,
request: &T,
) -> Option<domain_types::connector_types::ConnectorChargeResponseData>
where
T: SplitPaymentData,
{
let charge_request = request.get_split_payment_data();
if let Some(domain_types::connector_types::SplitPaymentsRequest::StripeSplitPayment(
stripe_split_payment,
)) = charge_request
{
let stripe_charge_response = domain_types::connector_types::StripeChargeResponseData {
charge_id: Some(charge_id),
charge_type: stripe_split_payment.charge_type,
application_fees: stripe_split_payment.application_fees,
transfer_account_id: stripe_split_payment.transfer_account_id,
};
Some(
domain_types::connector_types::ConnectorChargeResponseData::StripeSplitPayment(
stripe_charge_response,
),
)
} else {
None
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
&RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>,
> for StripeSplitPaymentRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
_item: &RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3850,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3875_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
)
} else {
None
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
| {
"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": 3875,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3875_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
)
} else {
None
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
&RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>,
> for StripeSplitPaymentRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
_item: &RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
charge_type: 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": 3875,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3875_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
)
} else {
None
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
&RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>,
> for StripeSplitPaymentRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
_item: &RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
charge_type: None,
transfer_account_id: None,
application_fees: None,
})
}
}
pub(super) fn transform_headers_for_connect_platform(
charge_type: common_enums::PaymentChargeType,
transfer_account_id: Secret<String>,
header: &mut Vec<(String, Maskable<String>)>,
) {
if let common_enums::PaymentChargeType::Stripe(common_enums::StripeChargeType::Direct) =
charge_type
{
let mut customer_account_header = vec![(
STRIPE_COMPATIBLE_CONNECT_ACCOUNT.to_string(),
transfer_account_id.into_masked(),
)];
header.append(&mut customer_account_header);
}
| {
"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": 3875,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3900_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
PaymentsResponseData,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
charge_type: None,
transfer_account_id: None,
application_fees: None,
})
}
}
pub(super) fn transform_headers_for_connect_platform(
charge_type: common_enums::PaymentChargeType,
transfer_account_id: Secret<String>,
header: &mut Vec<(String, Maskable<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": 3900,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3900_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
PaymentsResponseData,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
charge_type: None,
transfer_account_id: None,
application_fees: None,
})
}
}
pub(super) fn transform_headers_for_connect_platform(
charge_type: common_enums::PaymentChargeType,
transfer_account_id: Secret<String>,
header: &mut Vec<(String, Maskable<String>)>,
) {
if let common_enums::PaymentChargeType::Stripe(common_enums::StripeChargeType::Direct) =
charge_type
{
let mut customer_account_header = vec![(
STRIPE_COMPATIBLE_CONNECT_ACCOUNT.to_string(),
transfer_account_id.into_masked(),
)];
header.append(&mut customer_account_header);
}
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PaymentSyncResponse {
| {
"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": 3900,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3900_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
PaymentsResponseData,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
charge_type: None,
transfer_account_id: None,
application_fees: None,
})
}
}
pub(super) fn transform_headers_for_connect_platform(
charge_type: common_enums::PaymentChargeType,
transfer_account_id: Secret<String>,
header: &mut Vec<(String, Maskable<String>)>,
) {
if let common_enums::PaymentChargeType::Stripe(common_enums::StripeChargeType::Direct) =
charge_type
{
let mut customer_account_header = vec![(
STRIPE_COMPATIBLE_CONNECT_ACCOUNT.to_string(),
transfer_account_id.into_masked(),
)];
header.append(&mut customer_account_header);
}
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PaymentSyncResponse {
PaymentIntentSyncResponse(PaymentIntentSyncResponse),
SetupMandateResponse(SetupMandateResponse),
}
impl<F> TryFrom<ResponseRouterData<PaymentSyncResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentSyncResponse, Self>) -> Result<Self, Self::Error> {
let id = item.router_data.request.connector_transaction_id.clone();
match id.get_connector_transaction_id() {
Ok(x) if x.starts_with("set") => match item.response {
PaymentSyncResponse::SetupMandateResponse(setup_intent_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: setup_intent_response,
router_data: item.router_data,
http_code: item.http_code,
})
}
_ => Err(errors::ConnectorError::ResponseDeserializationFailed)?,
| {
"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": 3900,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3925_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PaymentSyncResponse {
PaymentIntentSyncResponse(PaymentIntentSyncResponse),
SetupMandateResponse(SetupMandateResponse),
}
impl<F> TryFrom<ResponseRouterData<PaymentSyncResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentSyncResponse, Self>) -> Result<Self, Self::Error> {
let id = item.router_data.request.connector_transaction_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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3925,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3925_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PaymentSyncResponse {
PaymentIntentSyncResponse(PaymentIntentSyncResponse),
SetupMandateResponse(SetupMandateResponse),
}
impl<F> TryFrom<ResponseRouterData<PaymentSyncResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentSyncResponse, Self>) -> Result<Self, Self::Error> {
let id = item.router_data.request.connector_transaction_id.clone();
match id.get_connector_transaction_id() {
Ok(x) if x.starts_with("set") => match item.response {
PaymentSyncResponse::SetupMandateResponse(setup_intent_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: setup_intent_response,
router_data: item.router_data,
http_code: item.http_code,
})
}
_ => Err(errors::ConnectorError::ResponseDeserializationFailed)?,
},
Ok(_) => match item.response {
PaymentSyncResponse::PaymentIntentSyncResponse(payment_intent_sync_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: payment_intent_sync_response,
| {
"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": 3925,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3925_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PaymentSyncResponse {
PaymentIntentSyncResponse(PaymentIntentSyncResponse),
SetupMandateResponse(SetupMandateResponse),
}
impl<F> TryFrom<ResponseRouterData<PaymentSyncResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentSyncResponse, Self>) -> Result<Self, Self::Error> {
let id = item.router_data.request.connector_transaction_id.clone();
match id.get_connector_transaction_id() {
Ok(x) if x.starts_with("set") => match item.response {
PaymentSyncResponse::SetupMandateResponse(setup_intent_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: setup_intent_response,
router_data: item.router_data,
http_code: item.http_code,
})
}
_ => Err(errors::ConnectorError::ResponseDeserializationFailed)?,
},
Ok(_) => match item.response {
PaymentSyncResponse::PaymentIntentSyncResponse(payment_intent_sync_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: payment_intent_sync_response,
router_data: item.router_data,
http_code: item.http_code,
})
}
_ => Err(errors::ConnectorError::ResponseDeserializationFailed)?,
},
Err(err) => Err(err).change_context(ConnectorError::MissingConnectorTransactionID),
}
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsAuthorizeResponse(PaymentIntentResponse);
impl<
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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 3925,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3950_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
},
Ok(_) => match item.response {
PaymentSyncResponse::PaymentIntentSyncResponse(payment_intent_sync_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: payment_intent_sync_response,
router_data: item.router_data,
http_code: item.http_code,
})
}
_ => Err(errors::ConnectorError::ResponseDeserializationFailed)?,
},
Err(err) => Err(err).change_context(ConnectorError::MissingConnectorTransactionID),
}
}
}
| {
"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": 3950,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3950_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
},
Ok(_) => match item.response {
PaymentSyncResponse::PaymentIntentSyncResponse(payment_intent_sync_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: payment_intent_sync_response,
router_data: item.router_data,
http_code: item.http_code,
})
}
_ => Err(errors::ConnectorError::ResponseDeserializationFailed)?,
},
Err(err) => Err(err).change_context(ConnectorError::MissingConnectorTransactionID),
}
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsAuthorizeResponse(PaymentIntentResponse);
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> TryFrom<ResponseRouterData<PaymentsAuthorizeResponse, Self>>
for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
| {
"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": 3950,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3950_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
},
Ok(_) => match item.response {
PaymentSyncResponse::PaymentIntentSyncResponse(payment_intent_sync_response) => {
RouterDataV2::try_from(ResponseRouterData {
response: payment_intent_sync_response,
router_data: item.router_data,
http_code: item.http_code,
})
}
_ => Err(errors::ConnectorError::ResponseDeserializationFailed)?,
},
Err(err) => Err(err).change_context(ConnectorError::MissingConnectorTransactionID),
}
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsAuthorizeResponse(PaymentIntentResponse);
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> TryFrom<ResponseRouterData<PaymentsAuthorizeResponse, Self>>
for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<PaymentsAuthorizeResponse, Self>,
) -> Result<Self, Self::Error> {
let currency_enum =
common_enums::Currency::from_str(item.response.0.currency.to_uppercase().as_str())
.change_context(errors::ConnectorError::ParsingFailed)?;
let amount_in_minor_unit =
StripeAmountConvertor::convert_back(item.response.0.amount, currency_enum)?;
let response_integrity_object = AuthoriseIntegrityObject {
amount: amount_in_minor_unit,
currency: currency_enum,
};
let new_router_data = RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.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": 3950,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3975_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
+ Serialize,
> TryFrom<ResponseRouterData<PaymentsAuthorizeResponse, Self>>
for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<PaymentsAuthorizeResponse, Self>,
) -> Result<Self, Self::Error> {
let currency_enum =
common_enums::Currency::from_str(item.response.0.currency.to_uppercase().as_str())
.change_context(errors::ConnectorError::ParsingFailed)?;
let amount_in_minor_unit =
StripeAmountConvertor::convert_back(item.response.0.amount, currency_enum)?;
| {
"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": 3975,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3975_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
+ Serialize,
> TryFrom<ResponseRouterData<PaymentsAuthorizeResponse, Self>>
for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<PaymentsAuthorizeResponse, Self>,
) -> Result<Self, Self::Error> {
let currency_enum =
common_enums::Currency::from_str(item.response.0.currency.to_uppercase().as_str())
.change_context(errors::ConnectorError::ParsingFailed)?;
let amount_in_minor_unit =
StripeAmountConvertor::convert_back(item.response.0.amount, currency_enum)?;
let response_integrity_object = AuthoriseIntegrityObject {
amount: amount_in_minor_unit,
currency: currency_enum,
};
let new_router_data = RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = Some(response_integrity_object);
router_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": 3975,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_3975_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
+ Serialize,
> TryFrom<ResponseRouterData<PaymentsAuthorizeResponse, Self>>
for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<PaymentsAuthorizeResponse, Self>,
) -> Result<Self, Self::Error> {
let currency_enum =
common_enums::Currency::from_str(item.response.0.currency.to_uppercase().as_str())
.change_context(errors::ConnectorError::ParsingFailed)?;
let amount_in_minor_unit =
StripeAmountConvertor::convert_back(item.response.0.amount, currency_enum)?;
let response_integrity_object = AuthoriseIntegrityObject {
amount: amount_in_minor_unit,
currency: currency_enum,
};
let new_router_data = RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = Some(response_integrity_object);
router_data
})
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsCaptureResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsCaptureResponse, Self>>
for RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<PaymentsCaptureResponse, Self>,
) -> Result<Self, Self::Error> {
let currency_enum =
common_enums::Currency::from_str(item.response.0.currency.to_uppercase().as_str())
.change_context(errors::ConnectorError::ParsingFailed)?;
let capture_amount_in_minor_unit = item
.response
| {
"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": 3975,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4000_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = Some(response_integrity_object);
router_data
})
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsCaptureResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsCaptureResponse, Self>>
for RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, 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": 4000,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4000_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = Some(response_integrity_object);
router_data
})
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsCaptureResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsCaptureResponse, Self>>
for RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<PaymentsCaptureResponse, Self>,
) -> Result<Self, Self::Error> {
let currency_enum =
common_enums::Currency::from_str(item.response.0.currency.to_uppercase().as_str())
.change_context(errors::ConnectorError::ParsingFailed)?;
let capture_amount_in_minor_unit = item
.response
.0
.amount_received
.map(|amount| StripeAmountConvertor::convert_back(amount, currency_enum))
.transpose()?;
| {
"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": 4000,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4000_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = Some(response_integrity_object);
router_data
})
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsCaptureResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsCaptureResponse, Self>>
for RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<PaymentsCaptureResponse, Self>,
) -> Result<Self, Self::Error> {
let currency_enum =
common_enums::Currency::from_str(item.response.0.currency.to_uppercase().as_str())
.change_context(errors::ConnectorError::ParsingFailed)?;
let capture_amount_in_minor_unit = item
.response
.0
.amount_received
.map(|amount| StripeAmountConvertor::convert_back(amount, currency_enum))
.transpose()?;
let response_integrity_object =
capture_amount_in_minor_unit.map(|amount_to_capture| CaptureIntegrityObject {
amount_to_capture,
currency: currency_enum,
});
let new_router_data = RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = response_integrity_object;
router_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": 4000,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4025_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
.0
.amount_received
.map(|amount| StripeAmountConvertor::convert_back(amount, currency_enum))
.transpose()?;
let response_integrity_object =
capture_amount_in_minor_unit.map(|amount_to_capture| CaptureIntegrityObject {
amount_to_capture,
currency: currency_enum,
});
let new_router_data = RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 4025,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4025_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
.0
.amount_received
.map(|amount| StripeAmountConvertor::convert_back(amount, currency_enum))
.transpose()?;
let response_integrity_object =
capture_amount_in_minor_unit.map(|amount_to_capture| CaptureIntegrityObject {
amount_to_capture,
currency: currency_enum,
});
let new_router_data = RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = response_integrity_object;
router_data
})
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsVoidResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsVoidResponse, Self>>
for RouterDataV2<Void, PaymentFlowData, PaymentVoidData, 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": 4025,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4025_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
.0
.amount_received
.map(|amount| StripeAmountConvertor::convert_back(amount, currency_enum))
.transpose()?;
let response_integrity_object =
capture_amount_in_minor_unit.map(|amount_to_capture| CaptureIntegrityObject {
amount_to_capture,
currency: currency_enum,
});
let new_router_data = RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
.change_context(ConnectorError::ResponseHandlingFailed);
new_router_data.map(|mut router_data| {
router_data.request.integrity_object = response_integrity_object;
router_data
})
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsVoidResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsVoidResponse, Self>>
for RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentsVoidResponse, Self>) -> Result<Self, Self::Error> {
RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
| {
"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": 4025,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4050_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsVoidResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsVoidResponse, Self>>
for RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentsVoidResponse, Self>) -> Result<Self, Self::Error> {
RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 4050,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4050_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsVoidResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsVoidResponse, Self>>
for RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentsVoidResponse, Self>) -> Result<Self, Self::Error> {
RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for CancelRequest
| {
"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": 4050,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4050_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Debug, Deserialize, Serialize)]
pub struct PaymentsVoidResponse(PaymentIntentResponse);
impl TryFrom<ResponseRouterData<PaymentsVoidResponse, Self>>
for RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<PaymentsVoidResponse, Self>) -> Result<Self, Self::Error> {
RouterDataV2::try_from(ResponseRouterData {
response: item.response.0,
router_data: item.router_data,
http_code: item.http_code,
})
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for CancelRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
cancellation_reason: item.router_data.request.cancellation_reason.clone(),
})
}
}
impl<
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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 4050,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4075_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for CancelRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
cancellation_reason: item.router_data.request.cancellation_reason.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": 4075,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4075_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for CancelRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
cancellation_reason: item.router_data.request.cancellation_reason.clone(),
})
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, 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": 4075,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4075_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for CancelRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
Ok(Self {
cancellation_reason: item.router_data.request.cancellation_reason.clone(),
})
}
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
> for CaptureRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let amount_to_capture = StripeAmountConvertor::convert(
item.router_data.request.minor_amount_to_capture,
item.router_data.request.currency,
)?;
Ok(Self {
amount_to_capture: Some(amount_to_capture),
})
}
}
| {
"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": 4075,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4100_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
+ Serialize,
>
TryFrom<
StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
> for CaptureRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
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": 4100,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4100_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
+ Serialize,
>
TryFrom<
StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
> for CaptureRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let amount_to_capture = StripeAmountConvertor::convert(
item.router_data.request.minor_amount_to_capture,
item.router_data.request.currency,
)?;
Ok(Self {
amount_to_capture: Some(amount_to_capture),
})
}
}
#[derive(Debug, Serialize)]
#[serde(untagged)]
pub enum StripeRefundRequest {
RefundRequest(RefundRequest),
| {
"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": 4100,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4100_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
+ Serialize,
>
TryFrom<
StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
> for CaptureRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let amount_to_capture = StripeAmountConvertor::convert(
item.router_data.request.minor_amount_to_capture,
item.router_data.request.currency,
)?;
Ok(Self {
amount_to_capture: Some(amount_to_capture),
})
}
}
#[derive(Debug, Serialize)]
#[serde(untagged)]
pub enum StripeRefundRequest {
RefundRequest(RefundRequest),
ChargeRefundRequest(ChargeRefundRequest),
}
impl<
F,
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<StripeRouterData<RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>, T>>
for StripeRefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 4100,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4125_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Debug, Serialize)]
#[serde(untagged)]
pub enum StripeRefundRequest {
RefundRequest(RefundRequest),
ChargeRefundRequest(ChargeRefundRequest),
}
impl<
F,
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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 4125,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4125_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Debug, Serialize)]
#[serde(untagged)]
pub enum StripeRefundRequest {
RefundRequest(RefundRequest),
ChargeRefundRequest(ChargeRefundRequest),
}
impl<
F,
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<StripeRouterData<RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>, T>>
for StripeRefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let refund_amount = StripeAmountConvertor::convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.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": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 4125,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4125_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
#[derive(Debug, Serialize)]
#[serde(untagged)]
pub enum StripeRefundRequest {
RefundRequest(RefundRequest),
ChargeRefundRequest(ChargeRefundRequest),
}
impl<
F,
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<StripeRouterData<RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>, T>>
for StripeRefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: StripeRouterData<
RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let refund_amount = StripeAmountConvertor::convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)?;
match item.router_data.request.split_refunds.as_ref() {
Some(domain_types::connector_types::SplitRefundsRequest::StripeSplitRefund(_)) => {
Ok(StripeRefundRequest::ChargeRefundRequest(
ChargeRefundRequest::try_from(&item.router_data)?,
))
}
_ => Ok(StripeRefundRequest::RefundRequest(RefundRequest::try_from(
(&item.router_data, refund_amount),
)?)),
}
}
}
impl<F>
TryFrom<(
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
MinorUnit,
)> for RefundRequest
{
| {
"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": 4125,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4150_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
>,
) -> Result<Self, Self::Error> {
let refund_amount = StripeAmountConvertor::convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)?;
match item.router_data.request.split_refunds.as_ref() {
Some(domain_types::connector_types::SplitRefundsRequest::StripeSplitRefund(_)) => {
Ok(StripeRefundRequest::ChargeRefundRequest(
ChargeRefundRequest::try_from(&item.router_data)?,
))
}
_ => Ok(StripeRefundRequest::RefundRequest(RefundRequest::try_from(
(&item.router_data, refund_amount),
)?)),
| {
"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": 4150,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4150_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
>,
) -> Result<Self, Self::Error> {
let refund_amount = StripeAmountConvertor::convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)?;
match item.router_data.request.split_refunds.as_ref() {
Some(domain_types::connector_types::SplitRefundsRequest::StripeSplitRefund(_)) => {
Ok(StripeRefundRequest::ChargeRefundRequest(
ChargeRefundRequest::try_from(&item.router_data)?,
))
}
_ => Ok(StripeRefundRequest::RefundRequest(RefundRequest::try_from(
(&item.router_data, refund_amount),
)?)),
}
}
}
impl<F>
TryFrom<(
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
MinorUnit,
)> for RefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
(item, refund_amount): (
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
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": 4150,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4150_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
>,
) -> Result<Self, Self::Error> {
let refund_amount = StripeAmountConvertor::convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)?;
match item.router_data.request.split_refunds.as_ref() {
Some(domain_types::connector_types::SplitRefundsRequest::StripeSplitRefund(_)) => {
Ok(StripeRefundRequest::ChargeRefundRequest(
ChargeRefundRequest::try_from(&item.router_data)?,
))
}
_ => Ok(StripeRefundRequest::RefundRequest(RefundRequest::try_from(
(&item.router_data, refund_amount),
)?)),
}
}
}
impl<F>
TryFrom<(
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
MinorUnit,
)> for RefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
(item, refund_amount): (
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
MinorUnit,
),
) -> Result<Self, Self::Error> {
let payment_intent = item.request.connector_transaction_id.clone();
Ok(Self {
amount: Some(refund_amount),
payment_intent,
meta_data: StripeMetadata {
order_id: Some(item.request.refund_id.clone()),
is_refund_id_as_reference: Some("true".to_string()),
},
})
}
}
impl<F> TryFrom<&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>>
for ChargeRefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: &RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
| {
"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": 4150,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4175_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
type Error = error_stack::Report<ConnectorError>;
fn try_from(
(item, refund_amount): (
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
MinorUnit,
),
) -> Result<Self, Self::Error> {
let payment_intent = item.request.connector_transaction_id.clone();
Ok(Self {
amount: Some(refund_amount),
payment_intent,
meta_data: StripeMetadata {
order_id: Some(item.request.refund_id.clone()),
is_refund_id_as_reference: Some("true".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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 4175,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4175_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
type Error = error_stack::Report<ConnectorError>;
fn try_from(
(item, refund_amount): (
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
MinorUnit,
),
) -> Result<Self, Self::Error> {
let payment_intent = item.request.connector_transaction_id.clone();
Ok(Self {
amount: Some(refund_amount),
payment_intent,
meta_data: StripeMetadata {
order_id: Some(item.request.refund_id.clone()),
is_refund_id_as_reference: Some("true".to_string()),
},
})
}
}
impl<F> TryFrom<&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>>
for ChargeRefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: &RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
) -> Result<Self, Self::Error> {
let amount = item.request.minor_refund_amount;
match item.request.split_refunds.as_ref() {
None => Err(ConnectorError::MissingRequiredField {
field_name: "split_refunds",
| {
"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": 4175,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4175_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
type Error = error_stack::Report<ConnectorError>;
fn try_from(
(item, refund_amount): (
&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
MinorUnit,
),
) -> Result<Self, Self::Error> {
let payment_intent = item.request.connector_transaction_id.clone();
Ok(Self {
amount: Some(refund_amount),
payment_intent,
meta_data: StripeMetadata {
order_id: Some(item.request.refund_id.clone()),
is_refund_id_as_reference: Some("true".to_string()),
},
})
}
}
impl<F> TryFrom<&RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>>
for ChargeRefundRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: &RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
) -> Result<Self, Self::Error> {
let amount = item.request.minor_refund_amount;
match item.request.split_refunds.as_ref() {
None => Err(ConnectorError::MissingRequiredField {
field_name: "split_refunds",
}
.into()),
Some(split_refunds) => match split_refunds {
domain_types::connector_types::SplitRefundsRequest::StripeSplitRefund(
stripe_refund,
) => {
let (refund_application_fee, reverse_transfer) = match &stripe_refund.options {
domain_types::connector_types::ChargeRefundsOptions::Direct(
domain_types::connector_types::DirectChargeRefund {
revert_platform_fee,
},
) => (Some(*revert_platform_fee), None),
domain_types::connector_types::ChargeRefundsOptions::Destination(
domain_types::connector_types::DestinationChargeRefund {
revert_platform_fee,
revert_transfer,
},
) => (Some(*revert_platform_fee), Some(*revert_transfer)),
};
| {
"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": 4175,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4200_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
) -> Result<Self, Self::Error> {
let amount = item.request.minor_refund_amount;
match item.request.split_refunds.as_ref() {
None => Err(ConnectorError::MissingRequiredField {
field_name: "split_refunds",
}
.into()),
Some(split_refunds) => match split_refunds {
domain_types::connector_types::SplitRefundsRequest::StripeSplitRefund(
stripe_refund,
) => {
let (refund_application_fee, reverse_transfer) = match &stripe_refund.options {
domain_types::connector_types::ChargeRefundsOptions::Direct(
domain_types::connector_types::DirectChargeRefund {
| {
"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": 4200,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_-239682093767531356_4200_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/stripe/transformers.rs
) -> Result<Self, Self::Error> {
let amount = item.request.minor_refund_amount;
match item.request.split_refunds.as_ref() {
None => Err(ConnectorError::MissingRequiredField {
field_name: "split_refunds",
}
.into()),
Some(split_refunds) => match split_refunds {
domain_types::connector_types::SplitRefundsRequest::StripeSplitRefund(
stripe_refund,
) => {
let (refund_application_fee, reverse_transfer) = match &stripe_refund.options {
domain_types::connector_types::ChargeRefundsOptions::Direct(
domain_types::connector_types::DirectChargeRefund {
revert_platform_fee,
},
) => (Some(*revert_platform_fee), None),
domain_types::connector_types::ChargeRefundsOptions::Destination(
domain_types::connector_types::DestinationChargeRefund {
revert_platform_fee,
revert_transfer,
},
) => (Some(*revert_platform_fee), Some(*revert_transfer)),
};
Ok(Self {
charge: stripe_refund.charge_id.clone(),
refund_application_fee,
reverse_transfer,
| {
"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": 4200,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.