id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
connector-service_snippet_814751693867000820_25_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
) -> Result<common_enums::Currency, errors::ConnectorError> {
if currency == common_enums::Currency::USD {
Ok(currency)
} else {
Err(errors::ConnectorError::NotSupported {
message: format!("currency {currency} is not supported for this merchant account"),
connector: "Helcim",
})?
}
}
// Auth Struct
pub struct HelcimAuthType {
pub(super) api_key: Secret<String>,
}
impl TryFrom<&ConnectorAuthType> for HelcimAuthType {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {
match auth_type {
ConnectorAuthType::HeaderKey { api_key } => Ok(Self {
api_key: api_key.to_owned(),
}),
_ => Err(errors::ConnectorError::FailedToObtainAuthType.into()),
}
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsRequest<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::Currency,
ip_address: Secret<String, pii::IpAddress>,
card_data: HelcimCard<T>,
invoice: HelcimInvoice,
billing_address: HelcimBillingAddress,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
| {
"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": 25,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_50_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsRequest<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_50_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsRequest<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::Currency,
ip_address: Secret<String, pii::IpAddress>,
card_data: HelcimCard<T>,
invoice: HelcimInvoice,
billing_address: HelcimBillingAddress,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimBillingAddress {
name: Secret<String>,
street1: Secret<String>,
postal_code: Secret<String>,
#[serde(skip_serializing_if = "Option::is_none")]
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_50_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsRequest<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::Currency,
ip_address: Secret<String, pii::IpAddress>,
card_data: HelcimCard<T>,
invoice: HelcimInvoice,
billing_address: HelcimBillingAddress,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimBillingAddress {
name: Secret<String>,
street1: Secret<String>,
postal_code: Secret<String>,
#[serde(skip_serializing_if = "Option::is_none")]
street2: Option<Secret<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
city: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
email: Option<common_utils::pii::Email>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimInvoice {
invoice_number: String,
line_items: Vec<HelcimLineItems>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimLineItems {
description: String,
quantity: u8,
price: FloatMajorUnit,
| {
"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": 50,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_75_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
pub struct HelcimBillingAddress {
name: Secret<String>,
street1: Secret<String>,
postal_code: Secret<String>,
#[serde(skip_serializing_if = "Option::is_none")]
street2: Option<Secret<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
city: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
email: Option<common_utils::pii::Email>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimInvoice {
| {
"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": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_75_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
pub struct HelcimBillingAddress {
name: Secret<String>,
street1: Secret<String>,
postal_code: Secret<String>,
#[serde(skip_serializing_if = "Option::is_none")]
street2: Option<Secret<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
city: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
email: Option<common_utils::pii::Email>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimInvoice {
invoice_number: String,
line_items: Vec<HelcimLineItems>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimLineItems {
description: String,
quantity: u8,
price: FloatMajorUnit,
total: FloatMajorUnit,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_75_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
pub struct HelcimBillingAddress {
name: Secret<String>,
street1: Secret<String>,
postal_code: Secret<String>,
#[serde(skip_serializing_if = "Option::is_none")]
street2: Option<Secret<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
city: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
email: Option<common_utils::pii::Email>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimInvoice {
invoice_number: String,
line_items: Vec<HelcimLineItems>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimLineItems {
description: String,
quantity: u8,
price: FloatMajorUnit,
total: FloatMajorUnit,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCard<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
card_number: RawCardNumber<T>,
card_expiry: Secret<String>,
card_c_v_v: Secret<String>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 75,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_100_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
total: FloatMajorUnit,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCard<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
card_number: RawCardNumber<T>,
card_expiry: 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": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_100_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
total: FloatMajorUnit,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCard<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
card_number: RawCardNumber<T>,
card_expiry: Secret<String>,
card_c_v_v: Secret<String>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<
Authorize,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_100_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
total: FloatMajorUnit,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCard<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
card_number: RawCardNumber<T>,
card_expiry: Secret<String>,
card_c_v_v: Secret<String>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimPaymentsRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
T,
>,
) -> Result<Self, Self::Error> {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 100,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_125_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
>
TryFrom<
HelcimRouterData<
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimPaymentsRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_125_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
>
TryFrom<
HelcimRouterData<
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimPaymentsRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
T,
>,
) -> Result<Self, Self::Error> {
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
card_number: card.card_number.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": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_125_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
>
TryFrom<
HelcimRouterData<
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimPaymentsRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
T,
>,
) -> Result<Self, Self::Error> {
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
let billing_address = HelcimBillingAddress {
name: req_address.get_full_name()?,
street1: req_address.get_line1()?.to_owned(),
postal_code: req_address.get_zip()?.to_owned(),
street2: req_address.line2.clone(),
city: req_address.city.clone(),
email: item.router_data.request.email.clone(),
};
let ip_address = item.router_data.request.get_ip_address()?;
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 125,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_150_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_150_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
let billing_address = HelcimBillingAddress {
name: req_address.get_full_name()?,
street1: req_address.get_line1()?.to_owned(),
postal_code: req_address.get_zip()?.to_owned(),
street2: req_address.line2.clone(),
city: req_address.city.clone(),
email: item.router_data.request.email.clone(),
};
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_150_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
let billing_address = HelcimBillingAddress {
name: req_address.get_full_name()?,
street1: req_address.get_line1()?.to_owned(),
postal_code: req_address.get_zip()?.to_owned(),
street2: req_address.line2.clone(),
city: req_address.city.clone(),
email: item.router_data.request.email.clone(),
};
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
.clone()
.unwrap_or("No Description".to_string()),
quantity: 1,
price: amount,
total: amount,
}];
let invoice = HelcimInvoice {
invoice_number: item
.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": 150,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_175_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_175_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
.clone()
.unwrap_or("No Description".to_string()),
quantity: 1,
price: amount,
total: amount,
}];
let invoice = HelcimInvoice {
invoice_number: item
.router_data
.resource_common_data
.connector_request_reference_id
.clone(),
line_items,
};
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_175_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
.clone()
.unwrap_or("No Description".to_string()),
quantity: 1,
price: amount,
total: amount,
}];
let invoice = HelcimInvoice {
invoice_number: item
.router_data
.resource_common_data
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
ecommerce: None,
})
}
}
// PaymentsResponse
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub enum HelcimPaymentStatus {
Approved,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 175,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_200_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.resource_common_data
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 200,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_200_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.resource_common_data
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
ecommerce: None,
})
}
}
// PaymentsResponse
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub enum HelcimPaymentStatus {
Approved,
Declined,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 200,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_200_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.resource_common_data
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
ecommerce: None,
})
}
}
// PaymentsResponse
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub enum HelcimPaymentStatus {
Approved,
Declined,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum HelcimTransactionType {
Purchase,
PreAuth,
Capture,
Verify,
Reverse,
}
impl From<HelcimPaymentsResponse> for common_enums::AttemptStatus {
fn from(item: HelcimPaymentsResponse) -> Self {
match item.transaction_type {
HelcimTransactionType::Purchase | HelcimTransactionType::Verify => match item.status {
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::Failure,
},
HelcimTransactionType::PreAuth => match item.status {
HelcimPaymentStatus::Approved => Self::Authorized,
HelcimPaymentStatus::Declined => Self::AuthorizationFailed,
},
HelcimTransactionType::Capture => match item.status {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 200,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_225_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
Declined,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum HelcimTransactionType {
Purchase,
PreAuth,
Capture,
Verify,
Reverse,
}
impl From<HelcimPaymentsResponse> for common_enums::AttemptStatus {
fn from(item: HelcimPaymentsResponse) -> Self {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_225_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
Declined,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum HelcimTransactionType {
Purchase,
PreAuth,
Capture,
Verify,
Reverse,
}
impl From<HelcimPaymentsResponse> for common_enums::AttemptStatus {
fn from(item: HelcimPaymentsResponse) -> Self {
match item.transaction_type {
HelcimTransactionType::Purchase | HelcimTransactionType::Verify => match item.status {
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::Failure,
},
HelcimTransactionType::PreAuth => match item.status {
HelcimPaymentStatus::Approved => Self::Authorized,
HelcimPaymentStatus::Declined => Self::AuthorizationFailed,
},
HelcimTransactionType::Capture => match item.status {
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::CaptureFailed,
},
HelcimTransactionType::Reverse => match item.status {
HelcimPaymentStatus::Approved => Self::Voided,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_225_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
Declined,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum HelcimTransactionType {
Purchase,
PreAuth,
Capture,
Verify,
Reverse,
}
impl From<HelcimPaymentsResponse> for common_enums::AttemptStatus {
fn from(item: HelcimPaymentsResponse) -> Self {
match item.transaction_type {
HelcimTransactionType::Purchase | HelcimTransactionType::Verify => match item.status {
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::Failure,
},
HelcimTransactionType::PreAuth => match item.status {
HelcimPaymentStatus::Approved => Self::Authorized,
HelcimPaymentStatus::Declined => Self::AuthorizationFailed,
},
HelcimTransactionType::Capture => match item.status {
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::CaptureFailed,
},
HelcimTransactionType::Reverse => match item.status {
HelcimPaymentStatus::Approved => Self::Voided,
HelcimPaymentStatus::Declined => Self::VoidFailed,
},
}
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
invoice_number: Option<String>,
#[serde(rename = "type")]
transaction_type: HelcimTransactionType,
#[serde(skip_serializing_if = "Option::is_none")]
errors: Option<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct HelcimMetaData {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 225,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_250_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::CaptureFailed,
},
HelcimTransactionType::Reverse => match item.status {
HelcimPaymentStatus::Approved => Self::Voided,
HelcimPaymentStatus::Declined => Self::VoidFailed,
},
}
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsResponse {
status: HelcimPaymentStatus,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 250,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_250_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::CaptureFailed,
},
HelcimTransactionType::Reverse => match item.status {
HelcimPaymentStatus::Approved => Self::Voided,
HelcimPaymentStatus::Declined => Self::VoidFailed,
},
}
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
invoice_number: Option<String>,
#[serde(rename = "type")]
transaction_type: HelcimTransactionType,
#[serde(skip_serializing_if = "Option::is_none")]
errors: Option<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct HelcimMetaData {
pub preauth_transaction_id: String,
}
impl<
T: PaymentMethodDataTypes
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 250,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_250_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
HelcimPaymentStatus::Approved => Self::Charged,
HelcimPaymentStatus::Declined => Self::CaptureFailed,
},
HelcimTransactionType::Reverse => match item.status {
HelcimPaymentStatus::Approved => Self::Voided,
HelcimPaymentStatus::Declined => Self::VoidFailed,
},
}
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimPaymentsResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
invoice_number: Option<String>,
#[serde(rename = "type")]
transaction_type: HelcimTransactionType,
#[serde(skip_serializing_if = "Option::is_none")]
errors: Option<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct HelcimMetaData {
pub preauth_transaction_id: String,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
>,
> for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 250,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_275_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
pub preauth_transaction_id: String,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 275,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_275_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
pub preauth_transaction_id: String,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
>,
> for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 275,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_275_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
pub preauth_transaction_id: String,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
>,
> for RouterDataV2<Authorize, PaymentFlowData, PaymentsAuthorizeData<T>, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
//PreAuth Transaction ID is stored in connector metadata
//Initially resource_id is stored as NoResponseID for manual capture
//After Capture Transaction is completed it is updated to store the Capture ID
let is_auto_capture = item.router_data.request.is_auto_capture()?;
let resource_id = if is_auto_capture {
ResponseId::ConnectorTransactionId(item.response.transaction_id.to_string())
} else {
ResponseId::NoResponseId
};
let connector_metadata = if !is_auto_capture {
Some(serde_json::json!(HelcimMetaData {
preauth_transaction_id: item.response.transaction_id.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": 275,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_300_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
item: ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
//PreAuth Transaction ID is stored in connector metadata
//Initially resource_id is stored as NoResponseID for manual capture
//After Capture Transaction is completed it is updated to store the Capture ID
let is_auto_capture = item.router_data.request.is_auto_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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 300,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_300_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
item: ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
//PreAuth Transaction ID is stored in connector metadata
//Initially resource_id is stored as NoResponseID for manual capture
//After Capture Transaction is completed it is updated to store the Capture ID
let is_auto_capture = item.router_data.request.is_auto_capture()?;
let resource_id = if is_auto_capture {
ResponseId::ConnectorTransactionId(item.response.transaction_id.to_string())
} else {
ResponseId::NoResponseId
};
let connector_metadata = if !is_auto_capture {
Some(serde_json::json!(HelcimMetaData {
preauth_transaction_id: item.response.transaction_id.to_string(),
}))
} 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": 300,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_300_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
item: ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
Authorize,
PaymentFlowData,
PaymentsAuthorizeData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
//PreAuth Transaction ID is stored in connector metadata
//Initially resource_id is stored as NoResponseID for manual capture
//After Capture Transaction is completed it is updated to store the Capture ID
let is_auto_capture = item.router_data.request.is_auto_capture()?;
let resource_id = if is_auto_capture {
ResponseId::ConnectorTransactionId(item.response.transaction_id.to_string())
} else {
ResponseId::NoResponseId
};
let connector_metadata = if !is_auto_capture {
Some(serde_json::json!(HelcimMetaData {
preauth_transaction_id: item.response.transaction_id.to_string(),
}))
} else {
None
};
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id,
redirection_data: None,
connector_metadata,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.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": 300,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_325_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}))
} else {
None
};
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id,
redirection_data: None,
connector_metadata,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: 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": 325,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_325_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}))
} else {
None
};
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id,
redirection_data: None,
connector_metadata,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, 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": 325,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_325_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}))
} else {
None
};
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id,
redirection_data: None,
connector_metadata,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
match item.router_data.request.sync_type {
SyncRequestType::SinglePaymentSync => {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_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": 325,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_350_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
match item.router_data.request.sync_type {
SyncRequestType::SinglePaymentSync => {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 350,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_350_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
match item.router_data.request.sync_type {
SyncRequestType::SinglePaymentSync => {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 350,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_350_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
match item.router_data.request.sync_type {
SyncRequestType::SinglePaymentSync => {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
SyncRequestType::MultipleCaptureSync(_) => {
Err(errors::ConnectorError::NotImplemented(
"manual multiple capture sync".to_string(),
)
.into())
// let capture_sync_response_list =
// utils::construct_captures_response_hashmap(vec![item.response]);
// Ok(Self {
// response: Ok(PaymentsResponseData::MultipleCaptureResponse {
// capture_sync_response_list,
// }),
// ..item.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": 350,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_375_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
SyncRequestType::MultipleCaptureSync(_) => {
Err(errors::ConnectorError::NotImplemented(
"manual multiple capture sync".to_string(),
)
.into())
// let capture_sync_response_list =
// utils::construct_captures_response_hashmap(vec![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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 375,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_375_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
SyncRequestType::MultipleCaptureSync(_) => {
Err(errors::ConnectorError::NotImplemented(
"manual multiple capture sync".to_string(),
)
.into())
// let capture_sync_response_list =
// utils::construct_captures_response_hashmap(vec![item.response]);
// Ok(Self {
// response: Ok(PaymentsResponseData::MultipleCaptureResponse {
// capture_sync_response_list,
// }),
// ..item.router_data
// })
}
}
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCaptureRequest {
pre_auth_transaction_id: u64,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 375,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_375_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
SyncRequestType::MultipleCaptureSync(_) => {
Err(errors::ConnectorError::NotImplemented(
"manual multiple capture sync".to_string(),
)
.into())
// let capture_sync_response_list =
// utils::construct_captures_response_hashmap(vec![item.response]);
// Ok(Self {
// response: Ok(PaymentsResponseData::MultipleCaptureResponse {
// capture_sync_response_list,
// }),
// ..item.router_data
// })
}
}
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCaptureRequest {
pre_auth_transaction_id: u64,
amount: FloatMajorUnit,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
> for HelcimCaptureRequest
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 375,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_400_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCaptureRequest {
pre_auth_transaction_id: u64,
amount: FloatMajorUnit,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 400,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_400_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCaptureRequest {
pre_auth_transaction_id: u64,
amount: FloatMajorUnit,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
> for HelcimCaptureRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
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": 400,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_400_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimCaptureRequest {
pre_auth_transaction_id: u64,
amount: FloatMajorUnit,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
> for HelcimCaptureRequest
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount_to_capture,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
Ok(Self {
pre_auth_transaction_id: item
.router_data
.request
.get_connector_transaction_id()?
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 400,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_425_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount_to_capture,
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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 425,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_425_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount_to_capture,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
Ok(Self {
pre_auth_transaction_id: item
.router_data
.request
.get_connector_transaction_id()?
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
amount,
ip_address,
ecommerce: 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": 425,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_425_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_amount_to_capture,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
Ok(Self {
pre_auth_transaction_id: item
.router_data
.request
.get_connector_transaction_id()?
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
amount,
ip_address,
ecommerce: None,
})
}
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.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": 425,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_450_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
amount,
ip_address,
ecommerce: None,
})
}
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.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": 450,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_450_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
amount,
ip_address,
ecommerce: None,
})
}
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 450,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_450_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
amount,
ip_address,
ecommerce: None,
})
}
}
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimVoidRequest {
card_transaction_id: u64,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 450,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_475_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 475,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_475_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimVoidRequest {
card_transaction_id: u64,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 475,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_475_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimVoidRequest {
card_transaction_id: u64,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for HelcimVoidRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let ip_address = item.router_data.request.get_ip_address()?;
Ok(Self {
card_transaction_id: item
.router_data
.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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 475,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_500_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for HelcimVoidRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 500,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_500_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for HelcimVoidRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let ip_address = item.router_data.request.get_ip_address()?;
Ok(Self {
card_transaction_id: item
.router_data
.request
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
ip_address,
ecommerce: 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": 500,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_500_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
> for HelcimVoidRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<Void, PaymentFlowData, PaymentVoidData, PaymentsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let ip_address = item.router_data.request.get_ip_address()?;
Ok(Self {
card_transaction_id: item
.router_data
.request
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
ip_address,
ecommerce: None,
})
}
}
// Old void implementation removed - using the updated one above
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentVoidData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.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": 500,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_525_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
ip_address,
ecommerce: None,
})
}
}
// Old void implementation removed - using the updated one above
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentVoidData, 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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 525,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_525_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
ip_address,
ecommerce: None,
})
}
}
// Old void implementation removed - using the updated one above
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentVoidData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: 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": 525,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_525_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
ip_address,
ecommerce: None,
})
}
}
// Old void implementation removed - using the updated one above
impl<F> TryFrom<ResponseRouterData<HelcimPaymentsResponse, Self>>
for RouterDataV2<F, PaymentFlowData, PaymentVoidData, PaymentsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<HelcimPaymentsResponse, Self>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
// SetupMandate Request
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimSetupMandateRequest<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 525,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_550_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 550,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_550_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
// SetupMandate Request
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimSetupMandateRequest<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::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": 550,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_550_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: None,
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
// SetupMandate Request
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimSetupMandateRequest<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::Currency,
ip_address: Secret<String, pii::IpAddress>,
card_data: HelcimCard<T>,
invoice: HelcimInvoice,
billing_address: HelcimBillingAddress,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
// SetupMandate TryFrom implementation
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 550,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_575_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::Currency,
ip_address: Secret<String, pii::IpAddress>,
card_data: HelcimCard<T>,
invoice: HelcimInvoice,
billing_address: HelcimBillingAddress,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
// SetupMandate TryFrom implementation
impl<
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 575,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_575_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::Currency,
ip_address: Secret<String, pii::IpAddress>,
card_data: HelcimCard<T>,
invoice: HelcimInvoice,
billing_address: HelcimBillingAddress,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
// SetupMandate TryFrom implementation
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 575,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_575_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ 'static
+ Serialize,
> {
amount: FloatMajorUnit,
currency: common_enums::Currency,
ip_address: Secret<String, pii::IpAddress>,
card_data: HelcimCard<T>,
invoice: HelcimInvoice,
billing_address: HelcimBillingAddress,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
// SetupMandate TryFrom implementation
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
HelcimRouterData<
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimSetupMandateRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
T,
>,
) -> Result<Self, Self::Error> {
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".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": 575,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_600_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimSetupMandateRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<
SetupMandate,
PaymentFlowData,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 600,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_600_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimSetupMandateRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
T,
>,
) -> Result<Self, Self::Error> {
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 600,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_600_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
T,
>,
> for HelcimSetupMandateRequest<T>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
T,
>,
) -> Result<Self, Self::Error> {
let card_data = match &item.router_data.request.payment_method_data {
PaymentMethodData::Card(card) => HelcimCard {
card_expiry: card
.get_card_expiry_month_year_2_digit_with_delimiter("".to_string())?,
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
let billing_address = HelcimBillingAddress {
name: req_address.get_full_name()?,
street1: req_address.get_line1()?.to_owned(),
postal_code: req_address.get_zip()?.to_owned(),
street2: req_address.line2.clone(),
city: req_address.city.clone(),
email: item.router_data.request.email.clone(),
};
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 600,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_625_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
let billing_address = HelcimBillingAddress {
name: req_address.get_full_name()?,
street1: req_address.get_line1()?.to_owned(),
postal_code: req_address.get_zip()?.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": 625,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_625_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
let billing_address = HelcimBillingAddress {
name: req_address.get_full_name()?,
street1: req_address.get_line1()?.to_owned(),
postal_code: req_address.get_zip()?.to_owned(),
street2: req_address.line2.clone(),
city: req_address.city.clone(),
email: item.router_data.request.email.clone(),
};
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data
.request
.minor_amount
.unwrap_or(common_utils::types::MinorUnit::new(0)),
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 625,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_625_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
card_number: card.card_number.clone(),
card_c_v_v: card.card_cvc.clone(),
},
_ => return Err(ConnectorError::NotImplemented("payment method".into()).into()),
};
let req_address = item
.router_data
.resource_common_data
.get_billing_address()?;
let billing_address = HelcimBillingAddress {
name: req_address.get_full_name()?,
street1: req_address.get_line1()?.to_owned(),
postal_code: req_address.get_zip()?.to_owned(),
street2: req_address.line2.clone(),
city: req_address.city.clone(),
email: item.router_data.request.email.clone(),
};
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data
.request
.minor_amount
.unwrap_or(common_utils::types::MinorUnit::new(0)),
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
.clone()
.unwrap_or("Setup Mandate".to_string()),
quantity: 1,
price: amount,
total: amount,
}];
let invoice = HelcimInvoice {
invoice_number: item
.router_data
.resource_common_data
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 625,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_650_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.convert(
item.router_data
.request
.minor_amount
.unwrap_or(common_utils::types::MinorUnit::new(0)),
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
.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": 650,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_650_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.convert(
item.router_data
.request
.minor_amount
.unwrap_or(common_utils::types::MinorUnit::new(0)),
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
.clone()
.unwrap_or("Setup Mandate".to_string()),
quantity: 1,
price: amount,
total: amount,
}];
let invoice = HelcimInvoice {
invoice_number: item
.router_data
.resource_common_data
.connector_request_reference_id
.clone(),
line_items,
};
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 650,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_650_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.convert(
item.router_data
.request
.minor_amount
.unwrap_or(common_utils::types::MinorUnit::new(0)),
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
let line_items = vec![HelcimLineItems {
description: item
.router_data
.resource_common_data
.description
.clone()
.unwrap_or("Setup Mandate".to_string()),
quantity: 1,
price: amount,
total: amount,
}];
let invoice = HelcimInvoice {
invoice_number: item
.router_data
.resource_common_data
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
ecommerce: None,
})
}
}
// SetupMandate Response implementation
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 650,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_675_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
ecommerce: 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": 675,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_675_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
ecommerce: None,
})
}
}
// SetupMandate Response implementation
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 675,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_675_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector_request_reference_id
.clone(),
line_items,
};
let currency = check_currency(item.router_data.request.currency)?;
Ok(Self {
amount,
currency,
ip_address,
card_data,
invoice,
billing_address,
ecommerce: None,
})
}
}
// SetupMandate Response implementation
impl<
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
>
for RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<
HelcimPaymentsResponse,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 675,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_700_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
>
for RouterDataV2<
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 700,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_700_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
>
for RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 700,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_700_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ 'static
+ Serialize,
>
TryFrom<
ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
>
for RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(
item: ResponseRouterData<
HelcimPaymentsResponse,
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
let mandate_reference = MandateReference {
connector_mandate_id: Some(item.response.transaction_id.to_string()),
payment_method_id: None,
};
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: Some(Box::new(mandate_reference)),
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 700,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_725_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
let mandate_reference = MandateReference {
connector_mandate_id: Some(item.response.transaction_id.to_string()),
payment_method_id: None,
};
Ok(Self {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 725,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_725_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
let mandate_reference = MandateReference {
connector_mandate_id: Some(item.response.transaction_id.to_string()),
payment_method_id: None,
};
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: Some(Box::new(mandate_reference)),
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 725,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_725_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
RouterDataV2<
SetupMandate,
PaymentFlowData,
SetupMandateRequestData<T>,
PaymentsResponseData,
>,
>,
) -> Result<Self, Self::Error> {
let status = common_enums::AttemptStatus::from(item.response.clone());
let mandate_reference = MandateReference {
connector_mandate_id: Some(item.response.transaction_id.to_string()),
payment_method_id: None,
};
Ok(Self {
response: Ok(PaymentsResponseData::TransactionResponse {
resource_id: ResponseId::ConnectorTransactionId(
item.response.transaction_id.to_string(),
),
redirection_data: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: item.response.invoice_number.clone(),
incremental_authorization_allowed: None,
mandate_reference: Some(Box::new(mandate_reference)),
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
// REFUND:
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimRefundRequest {
amount: FloatMajorUnit,
original_transaction_id: u64,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
F,
T: PaymentMethodDataTypes
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 725,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_750_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
// REFUND:
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimRefundRequest {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 750,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_750_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
// REFUND:
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimRefundRequest {
amount: FloatMajorUnit,
original_transaction_id: u64,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
F,
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 750,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_750_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
status_code: item.http_code,
}),
resource_common_data: PaymentFlowData {
status,
..item.router_data.resource_common_data
},
..item.router_data
})
}
}
// REFUND:
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HelcimRefundRequest {
amount: FloatMajorUnit,
original_transaction_id: u64,
ip_address: Secret<String, pii::IpAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
ecommerce: Option<bool>,
}
impl<
F,
T: PaymentMethodDataTypes
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<HelcimRouterData<RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>, T>>
for HelcimRefundRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let original_transaction_id = item
.router_data
.request
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?;
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 750,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_775_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<HelcimRouterData<RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>, T>>
for HelcimRefundRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 775,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_775_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<HelcimRouterData<RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>, T>>
for HelcimRefundRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let original_transaction_id = item
.router_data
.request
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?;
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.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": 775,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_775_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
+ std::fmt::Debug
+ std::marker::Sync
+ std::marker::Send
+ 'static
+ Serialize,
>
TryFrom<HelcimRouterData<RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>, T>>
for HelcimRefundRequest
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: HelcimRouterData<
RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>,
T,
>,
) -> Result<Self, Self::Error> {
let original_transaction_id = item
.router_data
.request
.connector_transaction_id
.parse::<u64>()
.change_context(errors::ConnectorError::RequestEncodingFailed)?;
let ip_address = item.router_data.request.get_ip_address()?;
let amount = item
.connector
.amount_converter
.convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
Ok(Self {
amount,
original_transaction_id,
ip_address,
ecommerce: None,
})
}
}
// Old implementation removed - using the updated one above
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum HelcimRefundTransactionType {
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": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 775,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_800_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector
.amount_converter
.convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
Ok(Self {
amount,
original_transaction_id,
ip_address,
ecommerce: 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": 800,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_800_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector
.amount_converter
.convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
Ok(Self {
amount,
original_transaction_id,
ip_address,
ecommerce: None,
})
}
}
// Old implementation removed - using the updated one above
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum HelcimRefundTransactionType {
Refund,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RefundResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 800,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_800_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
.connector
.amount_converter
.convert(
item.router_data.request.minor_refund_amount,
item.router_data.request.currency,
)
.change_context(errors::ConnectorError::AmountConversionFailed)?;
Ok(Self {
amount,
original_transaction_id,
ip_address,
ecommerce: None,
})
}
}
// Old implementation removed - using the updated one above
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum HelcimRefundTransactionType {
Refund,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RefundResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
#[serde(rename = "type")]
transaction_type: HelcimRefundTransactionType,
}
impl From<RefundResponse> for common_enums::RefundStatus {
fn from(item: RefundResponse) -> Self {
match item.transaction_type {
HelcimRefundTransactionType::Refund => match item.status {
HelcimPaymentStatus::Approved => Self::Success,
HelcimPaymentStatus::Declined => Self::Failure,
},
}
}
}
impl<F> TryFrom<ResponseRouterData<RefundResponse, Self>>
for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<RefundResponse, Self>) -> Result<Self, Self::Error> {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 800,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_825_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RefundResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
#[serde(rename = "type")]
transaction_type: HelcimRefundTransactionType,
}
impl From<RefundResponse> for common_enums::RefundStatus {
fn from(item: RefundResponse) -> Self {
match item.transaction_type {
HelcimRefundTransactionType::Refund => match item.status {
HelcimPaymentStatus::Approved => Self::Success,
HelcimPaymentStatus::Declined => Self::Failure,
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 825,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_825_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RefundResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
#[serde(rename = "type")]
transaction_type: HelcimRefundTransactionType,
}
impl From<RefundResponse> for common_enums::RefundStatus {
fn from(item: RefundResponse) -> Self {
match item.transaction_type {
HelcimRefundTransactionType::Refund => match item.status {
HelcimPaymentStatus::Approved => Self::Success,
HelcimPaymentStatus::Declined => Self::Failure,
},
}
}
}
impl<F> TryFrom<ResponseRouterData<RefundResponse, Self>>
for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<RefundResponse, Self>) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_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": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 825,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_825_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RefundResponse {
status: HelcimPaymentStatus,
transaction_id: u64,
#[serde(rename = "type")]
transaction_type: HelcimRefundTransactionType,
}
impl From<RefundResponse> for common_enums::RefundStatus {
fn from(item: RefundResponse) -> Self {
match item.transaction_type {
HelcimRefundTransactionType::Refund => match item.status {
HelcimPaymentStatus::Approved => Self::Success,
HelcimPaymentStatus::Declined => Self::Failure,
},
}
}
}
impl<F> TryFrom<ResponseRouterData<RefundResponse, Self>>
for RouterDataV2<F, RefundFlowData, RefundsData, RefundsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<RefundResponse, Self>) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_code: item.http_code,
}),
..item.router_data
})
}
}
impl<F> TryFrom<ResponseRouterData<RefundResponse, Self>>
for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<RefundResponse, Self>) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_code: item.http_code,
}),
..item.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": 825,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_850_15 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_code: item.http_code,
}),
..item.router_data
})
}
}
impl<F> TryFrom<ResponseRouterData<RefundResponse, Self>>
for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData>
{
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": 15,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 850,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_850_30 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_code: item.http_code,
}),
..item.router_data
})
}
}
impl<F> TryFrom<ResponseRouterData<RefundResponse, Self>>
for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<RefundResponse, Self>) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_code: item.http_code,
}),
..item.router_data
})
}
}
#[derive(Debug, strum::Display, Deserialize, Serialize)]
#[serde(untagged)]
pub enum HelcimErrorTypes {
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 30,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 850,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
connector-service_snippet_814751693867000820_850_50 | clm | snippet | // connector-service/backend/connector-integration/src/connectors/helcim/transformers.rs
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_code: item.http_code,
}),
..item.router_data
})
}
}
impl<F> TryFrom<ResponseRouterData<RefundResponse, Self>>
for RouterDataV2<F, RefundFlowData, RefundSyncData, RefundsResponseData>
{
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: ResponseRouterData<RefundResponse, Self>) -> Result<Self, Self::Error> {
Ok(Self {
response: Ok(RefundsResponseData {
connector_refund_id: item.response.transaction_id.to_string(),
refund_status: common_enums::RefundStatus::from(item.response),
status_code: item.http_code,
}),
..item.router_data
})
}
}
#[derive(Debug, strum::Display, Deserialize, Serialize)]
#[serde(untagged)]
pub enum HelcimErrorTypes {
StringType(String),
JsonType(serde_json::Value),
}
#[derive(Debug, Deserialize, Serialize)]
pub struct HelcimPaymentsErrorResponse {
pub errors: HelcimErrorTypes,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum HelcimErrorResponse {
Payment(HelcimPaymentsErrorResponse),
General(String),
}
// Type aliases for different flow responses to avoid duplicate struct generation
pub type HelcimPaymentsSyncResponse = HelcimPaymentsResponse;
pub type HelcimPaymentsCaptureResponse = HelcimPaymentsResponse;
pub type HelcimPaymentsVoidResponse = HelcimPaymentsResponse;
| {
"chunk": null,
"crate": "connector-integration",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": 50,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "connector-service",
"start_line": 850,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.