Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(core): bump UCS to tag 2026.06.19.0 and emit Adyen applicationInfo (#16707) (#12786)

10X-GRACE4c9f1852cac3
diff --git a/Cargo.lock b/Cargo.lock
index 30f9e43111..6438d3c95a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2264,7 +2264,7 @@ dependencies = [
[[package]]
name = "config_patch_derive"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.06.12.2#131ee8aec3d67d05c2826ceb6e6ff7e35d16050a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.06.23.1#2a748b69578e5d61c4586b30aabddad0ed7fd88a"
dependencies = [
"proc-macro2",
"quote",
@@ -3981,7 +3981,7 @@ checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57"
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.06.12.2#131ee8aec3d67d05c2826ceb6e6ff7e35d16050a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.06.23.1#2a748b69578e5d61c4586b30aabddad0ed7fd88a"
dependencies = [
"axum 0.8.4",
"bytes 1.10.1",
@@ -8176,7 +8176,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.06.12.2#131ee8aec3d67d05c2826ceb6e6ff7e35d16050a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.06.23.1#2a748b69578e5d61c4586b30aabddad0ed7fd88a"
dependencies = [
"grpc-api-types",
]
@@ -11010,7 +11010,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.06.12.2#131ee8aec3d67d05c2826ceb6e6ff7e35d16050a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.06.23.1#2a748b69578e5d61c4586b30aabddad0ed7fd88a"
dependencies = [
"bytes 1.10.1",
"error-stack 0.4.1",
@@ -11026,7 +11026,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.06.12.2#131ee8aec3d67d05c2826ceb6e6ff7e35d16050a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.06.23.1#2a748b69578e5d61c4586b30aabddad0ed7fd88a"
dependencies = [
"serde",
"strum 0.26.3",
@@ -11037,7 +11037,7 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.06.12.2#131ee8aec3d67d05c2826ceb6e6ff7e35d16050a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.06.23.1#2a748b69578e5d61c4586b30aabddad0ed7fd88a"
dependencies = [
"anyhow",
"base64 0.21.7",
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index 407b0b3fc8..a1626a62c9 100644
--- a/crates/external_services/Cargo.toml
+++ b/crates/external_services/Cargo.toml
@@ -80,7 +80,7 @@ http = "0.2.12"
url = { version = "2.5.4", features = ["serde"] }
quick-xml = { version = "0.31.0", features = ["serialize"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.06.12.2", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.06.23.1", package = "rust-grpc-client" }
open-feature = { version = "0.2.5", optional = true }
superposition_provider = { version = "0.102.0", optional = true }
superposition_types = "0.102.0"
diff --git a/crates/external_services/src/grpc_client/unified_connector_service.rs b/crates/external_services/src/grpc_client/unified_connector_service.rs
index 3df6929f28..c629351180 100644
--- a/crates/external_services/src/grpc_client/unified_connector_service.rs
+++ b/crates/external_services/src/grpc_client/unified_connector_service.rs
@@ -813,24 +813,26 @@ impl UnifiedConnectorServiceClient {
build_unified_connector_service_grpc_headers(connector_auth_metadata, grpc_headers)?;
*request.metadata_mut() = metadata;
- self.recurring_payment_service_client
- .clone()
- .charge(request)
- .await
- .map_err(|error| {
- error_stack::Report::new(UnifiedConnectorServiceError::from_grpc_error(
- &error,
- &connector_name,
- ))
- })
- .inspect_err(|error| {
- logger::error!(
- grpc_error=?error,
- method="recurring_payment_charge",
- connector_name=?connector_name,
- "UCS recurring payment charge gRPC call failed"
- )
- })
+ Box::pin(
+ self.recurring_payment_service_client
+ .clone()
+ .charge(request),
+ )
+ .await
+ .map_err(|error| {
+ error_stack::Report::new(UnifiedConnectorServiceError::from_grpc_error(
+ &error,
+ &connector_name,
+ ))
+ })
+ .inspect_err(|error| {
+ logger::error!(
+ grpc_error=?error,
+ method="recurring_payment_charge",
+ connector_name=?connector_name,
+ "UCS recurring payment charge gRPC call failed"
+ )
+ })
}
/// Performs Payment Cancel/Void
diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.toml
index fd8dcd698c..0d2303463d 100644
--- a/crates/hyperswitch_interfaces/Cargo.toml
+++ b/crates/hyperswitch_interfaces/Cargo.toml
@@ -33,7 +33,7 @@ time = "0.3.41"
tonic = "0.14"
url = { version = "2.5.4", features = ["serde"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.06.12.2", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.06.23.1", package = "rust-grpc-client" }
tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }
# First party crates
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index 92f1385580..22f5393f37 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -91,8 +91,8 @@ ring = "0.17.14"
rust_decimal = { version = "1.37.1", features = ["serde-with-float", "serde-with-str"] }
rust-i18n = { git = "https://github.com/kashif-m/rust-i18n", rev = "f2d8096aaaff7a87a847c35a5394c269f75e077a" }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.06.12.2", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.06.12.2", package = "ucs_cards" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.06.23.1", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.06.23.1", package = "ucs_cards" }
rustc-hash = "1.1.0"
rustls = "0.22"
rustls-pemfile = "2"
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index b901f4cd61..e9ffd02f0e 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -182,6 +182,11 @@ impl
let address = payments_grpc::PaymentAddress::foreign_try_from(router_data.address.clone())?;
Ok(Self {
+ split_payments: router_data
+ .request
+ .split_payments
+ .as_ref()
+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),
merchant_payment_method_id: Some(router_data.connector_request_reference_id.clone()),
amount: router_data
.request
@@ -292,6 +297,14 @@ impl
.map(ConnectorState::foreign_from);
Ok(Self {
+ split_payments: router_data
+ .request
+ .split_payments
+ .as_ref()
+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),
+ domain_data: None,
+ mit_category: None,
+ surcharge_amount: None,
amount: Some(payments_grpc::Money {
minor_amount: router_data.request.minor_amount.get_amount_as_i64(),
currency: currency.into(),
@@ -403,6 +416,25 @@ impl
.map(Into::into),
l2_l3_data: None,
merchant_request_id: None,
+ partner_merchant_identifier_details: router_data
+ .request
+ .partner_merchant_identifier_details
+ .as_ref()
+ .map(|details| payments_grpc::PartnerMerchantIdentifierDetails {
+ partner_details: details.partner_details.as_ref().map(|p| {
+ payments_grpc::PartnerApplicationDetails {
+ name: p.name.clone(),
+ version: p.version.clone(),
+ integrator: p.integrator.clone(),
+ }
+ }),
+ merchant_details: details.merchant_details.as_ref().map(|m| {
+ payments_grpc::MerchantApplicationDetails {
+ name: m.name.clone(),
+ version: m.version.clone(),
+ }
+ }),
+ }),
})
}
}
@@ -515,6 +547,10 @@ impl
.map(ConnectorState::foreign_from);
Ok(Self {
+ split_payments: None,
+ domain_data: None,
+ mit_category: None,
+ surcharge_amount: None,
amount: Some(payments_grpc::Money {
minor_amount: router_data.request.minor_amount.get_amount_as_i64(),
currency: currency.into(),
@@ -599,6 +635,7 @@ impl
l2_l3_data: None,
connector_order_id: None,
merchant_request_id: None,
+ partner_merchant_identifier_details: None,
})
}
}
@@ -673,6 +710,11 @@ impl
let address = payments_grpc::PaymentAddress::foreign_try_from(router_data.address.clone())?;
Ok(Self {
+ split_payments: router_data
+ .request
+ .split_payments
+ .as_ref()
+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),
merchant_customer_id: router_data
.customer_id
.as_ref()
@@ -687,11 +729,7 @@ impl
.email
.clone()
.map(|e| e.expose().expose().into()),
- phone_number: router_data
- .request
- .phone
- .as_ref()
- .map(|phone| phone.peek().to_string()),
+ phone_number: router_data.request.phone.clone(),
address: Some(address),
metadata: None,
connector_feature_data: None,
@@ -745,6 +783,11 @@ impl transformers::ForeignTryFrom<&RouterData<PSync, PaymentsSyncData, PaymentsR
.transpose()?;
Ok(Self {
+ split_payments: router_data
+ .request
+ .split_payments
+ .as_ref()
+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),
connector_transaction_id,
merchant_transaction_id,
encoded_data: router_data.request.encoded_data.clone(),
@@ -1288,6 +1331,10 @@ impl
.transpose()?;
Ok(Self {
+ split_payments: None,
+ domain_data: None,
+ mit_category: None,
+ surcharge_amount: None,
amount: Some(payments_grpc::Money {
minor_amount: router_data.request.minor_amount.get_amount_as_i64(),
currency: currency.into(),
@@ -1364,6 +1411,7 @@ impl
connector_order_id: None,
l2_l3_data: None,
merchant_request_id: None,
+ partner_merchant_identifier_details: None,
})
}
}
@@ -1437,6 +1485,14 @@ impl
.map(ConnectorState::foreign_from);
Ok(Self {
+ split_payments: router_data
+ .request
+ .split_payments
+ .as_ref()
+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),
+ domain_data: None,
+ mit_category: None,
+ surcharge_amount: None,
amount: Some(payments_grpc::Money {
minor_amount: router_data.request.minor_amount.get_amount_as_i64(),
currency: currency.into(),
@@ -1548,6 +1604,7 @@ impl
connector_order_id: None,
l2_l3_data: None,
merchant_request_id: None,
+ partner_merchant_identifier_details: None,
})
}
}
@@ -1613,6 +1670,14 @@ impl
.transpose()?;
Ok(Self {
+ split_payments: router_data
+ .request
+ .split_payments
+ .as_ref()
+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),
+ domain_data: None,
+ mit_category: None,
+ surcharge_amount: None,
amount: Some(payments_grpc::Money {
minor_amount: router_data.request.minor_amount.get_amount_as_i64(),
currency: currency.into(),
@@ -1712,6 +1777,7 @@ impl
connector_order_id: None,
l2_l3_data: None,
merchant_request_id: None,
+ partner_merchant_identifier_details: None,
})
}
}
@@ -1769,6 +1835,7 @@ impl
.map(ConnectorState::foreign_from);
Ok(Self {
+ mit_category: None,
merchant_recurring_payment_id: router_data.connector_request_reference_id.clone(),
amount: Some(payments_grpc::Money {
minor_amount: router_data.request.minor_amount.get_amount_as_i64(),
@@ -1991,6 +2058,11 @@ impl
payments_grpc::AdditionalPaymentData::foreign_from(additional_payment_data)
});
Ok(Self {
+ split_payments: router_data
+ .request
+ .split_payments
+ .as_ref()
+ .map(payments_grpc::SplitPaymentsDetails::foreign_from),
merchant_charge_id: Some(router_data.connector_request_reference_id.clone()),
payment_method,
connector_recurring_payment_id,
@@ -2087,6 +2159,25 @@ impl
customer_document_details: to_grpc_customer_document_details(router_data),
}),
additional_payment_data,
+ partner_merchant_identifier_details: router_data
+ .request
+ .partner_merchant_identifier_details
+ .as_ref()
+ .map(|details| payments_grpc::PartnerMerchantIdentifierDetails {
+ partner_details: details.partner_details.as_ref().map(|p| {
+ payments_grpc::PartnerApplicationDetails {
+ name: p.name.clone(),
+ version: p.version.clone(),
+ integrator: p.integrator.clone(),
+ }
+ }),
+ merchant_details: details.merchant_details.as_ref().map(|m| {
+ payments_grpc::MerchantApplicationDetails {
+ name: m.name.clone(),
+ version: m.version.clone(),
+ }
+ }),
+ }),
})
}
}
@@ -2516,11 +2607,11 @@ impl
mandate_reference: Box::new(response.mandate_reference.map(hyperswitch_domain_models::router_response_types::MandateReference::foreign_try_from).transpose()?),
connector_metadata,
network_txn_id: response.network_transaction_id.clone(),
- network_txn_link_id: None,
+ network_txn_link_id: response.network_txn_link_id.clone(),
connector_response_reference_id: response.merchant_transaction_id.clone(),
incremental_authorization_allowed: response.incremental_authorization_allowed,
authentication_data: None,
- charges: None,
+ charges: response.splits.map(common_types::payments::ConnectorChargeResponseData::foreign_try_from).transpose()?,
},
status,
))
@@ -2627,7 +2718,7 @@ impl transformers::ForeignTryFrom<(payments_grpc::PaymentServiceCaptureResponse,
connector_response_reference_id: response.merchant_capture_id.clone(),
incremental_authorization_allowed: response.incremental_authorization_allowed,
authentication_data: None,
- charges: None,
+ charges: response.splits.map(common_types::payments::ConnectorChargeResponseData::foreign_try_from).transpose()?,
},
status,
))
@@ -2821,7 +2912,7 @@ impl
connector_response_reference_id: Some(response.merchant_recurring_payment_id.clone()),
incremental_authorization_allowed: response.incremental_authorization_allowed,
authentication_data: None,
- charges: None,
+ charges: response.splits.map(common_types::payments::ConnectorChargeResponseData::foreign_try_from).transpose()?,
},
status,
))
@@ -3039,6 +3130,147 @@ impl transformers::ForeignTryFrom<common_enums::Currency> for payments_grpc::Cur
}
}
+impl transformers::ForeignTryFrom<payments_grpc::PaymentChargeType>
+ for common_enums::PaymentChargeType
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(
+ charge_type: payments_grpc::PaymentChargeType,
+ ) -> Result<Self, Self::Error> {
+ match charge_type {
+ payments_grpc::PaymentChargeType::StripeDirect => {
+ Ok(Self::Stripe(common_enums::StripeChargeType::Direct))
+ }
+ payments_grpc::PaymentChargeType::StripeDestination => {
+ Ok(Self::Stripe(common_enums::StripeChargeType::Destination))
+ }
+ payments_grpc::PaymentChargeType::Unspecified => Err(error_stack::Report::new(
+ UnifiedConnectorServiceError::ParsingFailed,
+ )
+ .attach_printable("Received unspecified PaymentChargeType from gRPC")),
+ }
+ }
+}
+
+impl transformers::ForeignTryFrom<payments_grpc::AdyenSplitType> for common_enums::AdyenSplitType {
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(split_type: payments_grpc::AdyenSplitType) -> Result<Self, Self::Error> {
+ match split_type {
+ payments_grpc::AdyenSplitType::Unspecified => Err(error_stack::Report::new(
+ UnifiedConnectorServiceError::ParsingFailed,
+ )
+ .attach_printable("Received unspecified AdyenSplitType from gRPC")),
+ payments_grpc::AdyenSplitType::BalanceAccount => Ok(Self::BalanceAccount),
+ payments_grpc::AdyenSplitType::AcquiringFees => Ok(Self::AcquiringFees),
+ payments_grpc::AdyenSplitType::PaymentFee => Ok(Self::PaymentFee),
+ payments_grpc::AdyenSplitType::AdyenFees => Ok(Self::AdyenFees),
+ payments_grpc::AdyenSplitType::AdyenCommission => Ok(Self::AdyenCommission),
+ payments_grpc::AdyenSplitType::AdyenMarkup => Ok(Self::AdyenMarkup),
+ payments_grpc::AdyenSplitType::Interchange => Ok(Self::Interchange),
+ payments_grpc::AdyenSplitType::SchemeFee => Ok(Self::SchemeFee),
+ payments_grpc::AdyenSplitType::Commission => Ok(Self::Commission),
+ payments_grpc::AdyenSplitType::TopUp => Ok(Self::TopUp),
+ payments_grpc::AdyenSplitType::Vat => Ok(Self::Vat),
+ }
+ }
+}
+
+impl transformers::ForeignTryFrom<payments_grpc::AdyenSplitItem>
+ for common_types::domain::AdyenSplitItem
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(item: payments_grpc::AdyenSplitItem) -> Result<Self, Self::Error> {
+ Ok(Self {
+ amount: item.amount.map(MinorUnit::new),
+ split_type: common_enums::AdyenSplitType::foreign_try_from(
+ payments_grpc::AdyenSplitType::try_from(item.split_type).map_err(|_| {
+ error_stack::Report::new(UnifiedConnectorServiceError::ParsingFailed)
+ .attach_printable(format!(
+ "Invalid AdyenSplitType value: {}",
+ item.split_type
+ ))
+ })?,
+ )?,
+ account: item.account,
+ reference: item.reference,
+ description: item.description,
+ })
+ }
+}
+
+impl transformers::ForeignTryFrom<payments_grpc::AdyenSplitData>
+ for common_types::domain::AdyenSplitData
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(data: payments_grpc::AdyenSplitData) -> Result<Self, Self::Error> {
+ Ok(Self {
+ store: data.store,
+ split_items: data
+ .split_items
+ .into_iter()
+ .map(common_types::domain::AdyenSplitItem::foreign_try_from)
+ .collect::<Result<Vec<_>, _>>()?,
+ })
+ }
+}
+
+impl transformers::ForeignTryFrom<payments_grpc::StripeSplitResponseData>
+ for common_types::payments::StripeChargeResponseData
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(
+ stripe: payments_grpc::StripeSplitResponseData,
+ ) -> Result<Self, Self::Error> {
+ Ok(Self {
+ charge_id: stripe.charge_id,
+ charge_type: common_enums::PaymentChargeType::foreign_try_from(
+ payments_grpc::PaymentChargeType::try_from(stripe.charge_type).map_err(|_| {
+ error_stack::Report::new(UnifiedConnectorServiceError::ParsingFailed)
+ .attach_printable(format!(
+ "Invalid PaymentChargeType value: {:?}",
+ stripe.charge_type
+ ))
+ })?,
+ )?,
+ application_fees: stripe.application_fees.map(MinorUnit::new),
+ transfer_account_id: stripe.transfer_account_id,
+ on_behalf_of: stripe.on_behalf_of,
+ })
+ }
+}
+
+impl transformers::ForeignTryFrom<payments_grpc::ConnectorSplitResponseData>
+ for common_types::payments::ConnectorChargeResponseData
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(
+ split_data: payments_grpc::ConnectorSplitResponseData,
+ ) -> Result<Self, Self::Error> {
+ match split_data.split_response_type {
+ Some(payments_grpc::connector_split_response_data::SplitResponseType::StripeSplitResponse(stripe)) => {
+ Ok(Self::StripeSplitPayment(
+ common_types::payments::StripeChargeResponseData::foreign_try_from(stripe)?,
+ ))
+ }
+ Some(payments_grpc::connector_split_response_data::SplitResponseType::AdyenSplitResponse(adyen)) => {
+ Ok(Self::AdyenSplitPayment(
+ common_types::domain::AdyenSplitData::foreign_try_from(adyen)?,
+ ))
+ }
+ None => Err(error_stack::Report::new(
+ UnifiedConnectorServiceError::ParsingFailed,
+ )
+ .attach_printable("ConnectorSplitResponseData has no split_response_type")),
+ }
+ }
+}
+
impl transformers::ForeignTryFrom<payments_grpc::Currency> for common_enums::Currency {
type Error = error_stack::Report<UnifiedConnectorServiceError>;
@@ -5903,6 +6135,11 @@ impl transformers::ForeignTryFrom<&RouterData<Execute, RefundsData, RefundsRespo
.map(|payment_method_type| payment_method_type.into());
Ok(Self {
+ split_refunds: router_data
+ .request
+ .split_refunds
+ .as_ref()
+ .map(payments_grpc::SplitRefundsDetails::foreign_from),
merchant_refund_id: Some(router_data.request.refund_id.clone()),
connector_transaction_id: router_data.request.connector_transaction_id.clone(),
payment_amount: router_data.request.payment_amount,
@@ -5977,6 +6214,11 @@ impl transformers::ForeignTryFrom<&RouterData<RSync, RefundsData, RefundsRespons
.map(|payment_method_type| payment_method_type.into());
Ok(Self {
+ split_refunds: router_data
+ .request
+ .split_refunds
+ .as_ref()
+ .map(payments_grpc::SplitRefundsDetails::foreign_from),
merchant_refund_id: Some(router_data.connector_request_reference_id.clone()),
connector_transaction_id: router_data.request.connector_transaction_id.clone(),
refund_id: router_data.request.connector_refund_id.clone().ok_or(
@@ -6322,7 +6564,7 @@ impl transformers::ForeignTryFrom<(payments_grpc::PaymentServiceVoidResponse, At
connector_response_reference_id: response.merchant_void_id.clone(),
incremental_authorization_allowed: response.incremental_authorization_allowed,
authentication_data: None,
- charges: None,
+ charges: response.splits.map(common_types::payments::ConnectorChargeResponseData::foreign_try_from).transpose()?,
},
status,
))
@@ -6395,7 +6637,7 @@ impl ForeignFrom<&router_request_types::CustomerDetails> for payments_grpc::Cust
connector_customer_id: None,
name: customer.name.clone().map(|s| s.expose()),
email: customer.email.clone().map(|e| e.expose().expose().into()),
- phone_number: customer.phone.clone().map(|s| s.expose()),
+ phone_number: customer.phone.clone(),
phone_country_code: customer.phone_country_code.clone(),
first_name: None,
last_name: None,
@@ -7588,3 +7830,176 @@ impl ForeignFrom<AdditionalPaymentData> for payments_grpc::AdditionalPaymentData
}
}
}
+
+// ============================================================================
+// SPLIT REFUND TYPES
+// ============================================================================
+
+impl ForeignFrom<&router_request_types::SplitRefundsRequest>
+ for payments_grpc::SplitRefundsDetails
+{
+ fn foreign_from(split_refunds: &router_request_types::SplitRefundsRequest) -> Self {
+ let split_refund_type = match split_refunds {
+ router_request_types::SplitRefundsRequest::StripeSplitRefund(stripe) => Some(
+ payments_grpc::split_refunds_details::SplitRefundType::StripeSplitRefund(
+ payments_grpc::StripeSplitRefundData::foreign_from(stripe),
+ ),
+ ),
+ router_request_types::SplitRefundsRequest::AdyenSplitRefund(adyen) => Some(
+ payments_grpc::split_refunds_details::SplitRefundType::AdyenSplitRefund(
+ payments_grpc::AdyenSplitData::foreign_from(adyen),
+ ),
+ ),
+ router_request_types::SplitRefundsRequest::XenditSplitRefund(_) => None,
+ };
+ Self { split_refund_type }
+ }
+}
+
+impl ForeignFrom<&router_request_types::StripeSplitRefund>
+ for payments_grpc::StripeSplitRefundData
+{
+ fn foreign_from(stripe: &router_request_types::StripeSplitRefund) -> Self {
+ Self {
+ charge_id: stripe.charge_id.clone(),
+ transfer_account_id: stripe.transfer_account_id.clone(),
+ charge_type: payments_grpc::PaymentChargeType::foreign_from(&stripe.charge_type).into(),
+ options: Some(payments_grpc::ChargeRefundsOptions::foreign_from(
+ &stripe.options,
+ )),
+ }
+ }
+}
+
+impl ForeignFrom<&api_models::enums::PaymentChargeType> for payments_grpc::PaymentChargeType {
+ fn foreign_from(charge_type: &api_models::enums::PaymentChargeType) -> Self {
+ match charge_type {
+ api_models::enums::PaymentChargeType::Stripe(
+ common_enums::StripeChargeType::Direct,
+ ) => Self::StripeDirect,
+ api_models::enums::PaymentChargeType::Stripe(
+ common_enums::StripeChargeType::Destination,
+ ) => Self::StripeDestination,
+ }
+ }
+}
+
+impl ForeignFrom<&router_request_types::ChargeRefundsOptions>
+ for payments_grpc::ChargeRefundsOptions
+{
+ fn foreign_from(options: &router_request_types::ChargeRefundsOptions) -> Self {
+ let charge_option = match options {
+ router_request_types::ChargeRefundsOptions::Destination(dest) => Some(
+ payments_grpc::charge_refunds_options::ChargeOption::Destination(
+ payments_grpc::DestinationChargeRefund::foreign_from(dest),
+ ),
+ ),
+ router_request_types::ChargeRefundsOptions::Direct(direct) => {
+ Some(payments_grpc::charge_refunds_options::ChargeOption::Direct(
+ payments_grpc::DirectChargeRefund::foreign_from(direct),
+ ))
+ }
+ };
+ Self { charge_option }
+ }
+}
+
+impl ForeignFrom<&router_request_types::DestinationChargeRefund>
+ for payments_grpc::DestinationChargeRefund
+{
+ fn foreign_from(dest: &router_request_types::DestinationChargeRefund) -> Self {
+ Self {
+ revert_platform_fee: dest.revert_platform_fee,
+ revert_transfer: dest.revert_transfer,
+ }
+ }
+}
+
+impl ForeignFrom<&router_request_types::DirectChargeRefund> for payments_grpc::DirectChargeRefund {
+ fn foreign_from(direct: &router_request_types::DirectChargeRefund) -> Self {
+ Self {
+ revert_platform_fee: direct.revert_platform_fee,
+ }
+ }
+}
+
+impl ForeignFrom<&common_types::domain::AdyenSplitData> for payments_grpc::AdyenSplitData {
+ fn foreign_from(adyen: &common_types::domain::AdyenSplitData) -> Self {
+ Self {
+ store: adyen.store.clone(),
+ split_items: adyen
+ .split_items
+ .iter()
+ .map(payments_grpc::AdyenSplitItem::foreign_from)
+ .collect(),
+ }
+ }
+}
+
+impl ForeignFrom<&common_types::domain::AdyenSplitItem> for payments_grpc::AdyenSplitItem {
+ fn foreign_from(item: &common_types::domain::AdyenSplitItem) -> Self {
+ Self {
+ amount: item.amount.map(|a| a.get_amount_as_i64()),
+ split_type: payments_grpc::AdyenSplitType::foreign_from(&item.split_type).into(),
+ account: item.account.clone(),
+ reference: item.reference.clone(),
+ description: item.description.clone(),
+ }
+ }
+}
+
+impl ForeignFrom<&common_enums::AdyenSplitType> for payments_grpc::AdyenSplitType {
+ fn foreign_from(split_type: &common_enums::AdyenSplitType) -> Self {
+ match split_type {
+ common_enums::AdyenSplitType::BalanceAccount => Self::BalanceAccount,
+ common_enums::AdyenSplitType::AcquiringFees => Self::AcquiringFees,
+ common_enums::AdyenSplitType::PaymentFee => Self::PaymentFee,
+ common_enums::AdyenSplitType::AdyenFees => Self::AdyenFees,
+ common_enums::AdyenSplitType::AdyenCommission => Self::AdyenCommission,
+ common_enums::AdyenSplitType::AdyenMarkup => Self::AdyenMarkup,
+ common_enums::AdyenSplitType::Interchange => Self::Interchange,
+ common_enums::AdyenSplitType::SchemeFee => Self::SchemeFee,
+ common_enums::AdyenSplitType::Commission => Self::Commission,
+ common_enums::AdyenSplitType::TopUp => Self::TopUp,
+ common_enums::AdyenSplitType::Vat => Self::Vat,
+ }
+ }
+}
+
+// ============================================================================
+// SPLIT PAYMENT TYPES
+// ============================================================================
+
+impl ForeignFrom<&common_types::payments::SplitPaymentsRequest>
+ for payments_grpc::SplitPaymentsDetails
+{
+ fn foreign_from(split_payments: &common_types::payments::SplitPaymentsRequest) -> Self {
+ let split_payment_type = match split_payments {
+ common_types::payments::SplitPaymentsRequest::StripeSplitPayment(stripe) => Some(
+ payments_grpc::split_payments_details::SplitPaymentType::StripeSplitPayment(
+ payments_grpc::StripeSplitPaymentData::foreign_from(stripe),
+ ),
+ ),
+ common_types::payments::SplitPaymentsRequest::AdyenSplitPayment(adyen) => Some(
+ payments_grpc::split_payments_details::SplitPaymentType::AdyenSplitPayment(
+ payments_grpc::AdyenSplitData::foreign_from(adyen),
+ ),
+ ),
+ common_types::payments::SplitPaymentsRequest::XenditSplitPayment(_) => None,
+ };
+ Self { split_payment_type }
+ }
+}
+
+impl ForeignFrom<&common_types::payments::StripeSplitPaymentRequest>
+ for payments_grpc::StripeSplitPaymentData
+{
+ fn foreign_from(stripe: &common_types::payments::StripeSplitPaymentRequest) -> Self {
+ Self {
+ charge_type: payments_grpc::PaymentChargeType::foreign_from(&stripe.charge_type).into(),
+ application_fees: stripe.application_fees.map(|fee| fee.get_amount_as_i64()),
+ transfer_account_id: stripe.transfer_account_id.clone(),
+ on_behalf_of: stripe.on_behalf_of.clone(),
+ }
+ }
+}