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(ucs): Add account_funded_transactions support in HS <> Prism (#13921)

Shubhodip pala3befca3fb9c
diff --git a/Cargo.lock b/Cargo.lock
index 1bb995a4cb..280bb16484 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2287,7 +2287,7 @@ dependencies = [
[[package]]
name = "config_patch_derive"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.08.28.0#3bea51390626fc87df551c625d70fb1f1b8e604a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.08.31.1#b7ea7bd23aaf3b1d66f288cf053c6adf7174b3d6"
dependencies = [
"proc-macro2",
"quote",
@@ -4261,7 +4261,7 @@ checksum = "32619942b8be646939eaf3db0602b39f5229b74575b67efc897811ded1db4e57"
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.08.28.0#3bea51390626fc87df551c625d70fb1f1b8e604a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.08.31.1#b7ea7bd23aaf3b1d66f288cf053c6adf7174b3d6"
dependencies = [
"axum 0.8.4",
"bytes 1.10.1",
@@ -8581,7 +8581,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.08.28.0#3bea51390626fc87df551c625d70fb1f1b8e604a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.08.31.1#b7ea7bd23aaf3b1d66f288cf053c6adf7174b3d6"
dependencies = [
"grpc-api-types",
]
@@ -11421,7 +11421,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.08.28.0#3bea51390626fc87df551c625d70fb1f1b8e604a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.08.31.1#b7ea7bd23aaf3b1d66f288cf053c6adf7174b3d6"
dependencies = [
"bytes 1.10.1",
"error-stack 0.4.1",
@@ -11437,7 +11437,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.08.28.0#3bea51390626fc87df551c625d70fb1f1b8e604a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.08.31.1#b7ea7bd23aaf3b1d66f288cf053c6adf7174b3d6"
dependencies = [
"serde",
"strum 0.26.3",
@@ -11448,7 +11448,7 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.08.28.0#3bea51390626fc87df551c625d70fb1f1b8e604a"
+source = "git+https://github.com/juspay/connector-service?tag=2026.08.31.1#b7ea7bd23aaf3b1d66f288cf053c6adf7174b3d6"
dependencies = [
"anyhow",
"base64 0.21.7",
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index 1afcf31cf7..a3b5ed5d86 100644
--- a/crates/external_services/Cargo.toml
+++ b/crates/external_services/Cargo.toml
@@ -94,7 +94,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.08.28.0", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.08.31.1", package = "rust-grpc-client" }
open-feature = { version = "0.2.5", optional = true }
bytes = { version = "1.10.1", optional = true }
superposition_provider = { version = "0.115.5", optional = true }
diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.toml
index 94bdcfbde6..aeb7f6aee3 100644
--- a/crates/hyperswitch_interfaces/Cargo.toml
+++ b/crates/hyperswitch_interfaces/Cargo.toml
@@ -35,7 +35,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.08.28.0", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.08.31.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 b7f8dae3e5..cbdc6c9e11 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -243,8 +243,8 @@ rust_decimal = { version = "1.37.1", features = [
] }
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.08.28.0", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.08.28.0", package = "ucs_cards" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.08.31.1", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.08.31.1", package = "ucs_cards" }
rustc-hash = "1.1.0"
rustls = { version = "0.23", default-features = false, features = [
"aws-lc-rs",
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index a3b28f9eeb..e986bd5b64 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -7,8 +7,9 @@ use api_models::payments::{
GpayBillingAddressFormat, GpayBillingAddressParameters, GpayMerchantInfo,
GpaySessionTokenResponse, GpayShippingAddressParameters, GpayTokenParameters,
GpayTokenizationSpecification, GpayTransactionInfo, NextActionCall, PaypalFlow,
- PaypalSessionTokenResponse, PaypalTransactionInfo, SdkNextAction, SecretInfoToInitiateSdk,
- SessionToken, ThirdPartySdkSessionResponse,
+ PaypalSessionTokenResponse, PaypalTransactionInfo, RecipientAccount, RecipientBankAccount,
+ RecipientDetails, SdkNextAction, SecretInfoToInitiateSdk, SessionToken,
+ ThirdPartySdkSessionResponse,
};
use common_enums::{AttemptStatus, AuthenticationType, AuthorizationStatus, RefundStatus};
use common_utils::{
@@ -49,7 +50,9 @@ use router_env::tracing;
use time::{Duration, OffsetDateTime};
use unified_connector_service_cards::{CardNumber, NetworkToken};
use unified_connector_service_client::payments::{
- self as payments_grpc, client_authentication_token_data, ConnectorState,
+ self as payments_grpc, client_authentication_token_data,
+ recipient_account::AccountType as RecipientAccountType,
+ recipient_bank_account::BankAccountType as RecipientBankAccountType, ConnectorState,
EventServiceHandleRequest, EventServiceParseRequest,
};
@@ -251,6 +254,139 @@ fn to_grpc_customer_document_details<F, Req, Res>(
.map(payments_grpc::CustomerDocumentDetails::foreign_from)
}
+fn format_date_of_birth(
+ dob: &Secret<time::Date>,
+) -> error_stack::Result<Secret<String>, UnifiedConnectorServiceError> {
+ dob.peek()
+ .format(&time::format_description::well_known::Iso8601::DATE)
+ .map(Secret::new)
+ .change_context(UnifiedConnectorServiceError::RequestEncodingFailed)
+ .attach_printable("failed to format customer date of birth")
+}
+
+impl ForeignFrom<&api_models::payments::AddressDetails> for payments_grpc::Address {
+ fn foreign_from(details: &api_models::payments::AddressDetails) -> Self {
+ let country_alpha2_code = details
+ .country
+ .as_ref()
+ .and_then(|c| payments_grpc::CountryAlpha2::from_str_name(&c.to_string()))
+ .map(|c| c.into());
+
+ Self {
+ first_name: details.first_name.clone(),
+ last_name: details.last_name.clone(),
+ line1: details.line1.clone(),
+ line2: details.line2.clone(),
+ line3: details.line3.clone(),
+ city: details.city.as_ref().map(|s| s.clone().into()),
+ state: details.state.clone(),
+ zip_code: details.zip.clone(),
+ country_alpha2_code,
+ email: None,
+ phone_number: None,
+ phone_country_code: None,
+ }
+ }
+}
+
+impl transformers::ForeignTryFrom<&RecipientDetails> for payments_grpc::RecipientDetails {
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(details: &RecipientDetails) -> Result<Self, Self::Error> {
+ let account = details
+ .account
+ .as_ref()
+ .map(payments_grpc::RecipientAccount::foreign_try_from)
+ .transpose()?;
+
+ Ok(Self {
+ account,
+ phone_number: details.phone_number.clone(),
+ tax_id: details.tax_id.clone(),
+ address: details
+ .address
+ .as_ref()
+ .map(payments_grpc::Address::foreign_from),
+ })
+ }
+}
+
+impl transformers::ForeignTryFrom<&RecipientAccount> for payments_grpc::RecipientAccount {
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(account: &RecipientAccount) -> Result<Self, Self::Error> {
+ let account_type = match account {
+ RecipientAccount::BankAccount(bank_account) => {
+ let bank_account_type = match bank_account {
+ RecipientBankAccount::Iban { iban } => {
+ RecipientBankAccountType::Iban(payments_grpc::RecipientBankAccountIban {
+ iban: Some(iban.clone()),
+ })
+ }
+ RecipientBankAccount::RoutingNumber {
+ account_number,
+ routing_number,
+ } => RecipientBankAccountType::RoutingNumber(
+ payments_grpc::RecipientBankAccountRoutingNumber {
+ account_number: Some(account_number.clone()),
+ routing_number: Some(routing_number.clone()),
+ },
+ ),
+ RecipientBankAccount::Bic {
+ account_number,
+ bic,
+ } => RecipientBankAccountType::Bic(payments_grpc::RecipientBankAccountBic {
+ account_number: Some(account_number.clone()),
+ bic: Some(bic.clone()),
+ }),
+ RecipientBankAccount::AccountNumber { account_number } => {
+ RecipientBankAccountType::AccountNumber(
+ payments_grpc::RecipientBareAccountNumber {
+ account_number: Some(account_number.clone()),
+ },
+ )
+ }
+ RecipientBankAccount::TruncatedPan { card_isin, last4 } => {
+ RecipientBankAccountType::TruncatedPan(
+ payments_grpc::RecipientBankAccountTruncatedPan {
+ card_isin: Some(card_isin.clone()),
+ last4: Some(last4.clone()),
+ },
+ )
+ }
+ };
+ RecipientAccountType::BankAccount(payments_grpc::RecipientBankAccount {
+ bank_account_type: Some(bank_account_type),
+ })
+ }
+ RecipientAccount::Card { card_number } => {
+ let ucs_card_number = CardNumber::from_str(&card_number.get_card_no())
+ .change_context(UnifiedConnectorServiceError::RequestEncodingFailed)
+ .attach_printable(
+ "Failed to convert recipient card number to UCS CardNumber",
+ )?;
+ RecipientAccountType::CardNumber(ucs_card_number)
+ }
+ RecipientAccount::Wallet { wallet_id } => {
+ RecipientAccountType::WalletId(wallet_id.clone())
+ }
+ RecipientAccount::Email { email } => {
+ RecipientAccountType::Email(Secret::new(email.peek().to_string()))
+ }
+ RecipientAccount::Phone { phone_number } => {
+ RecipientAccountType::PhoneNumber(phone_number.clone())
+ }
+ RecipientAccount::SocialNetwork { social_network_id } => {
+ RecipientAccountType::SocialNetworkId(social_network_id.clone())
+ }
+ };
+
+ Ok(Self {
+ account_type: Some(account_type),
+ })
+ }
+}
+
impl transformers::ForeignTryFrom<&payments_grpc::AccessToken> for AccessToken {
type Error = error_stack::Report<UnifiedConnectorServiceError>;
@@ -349,6 +485,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
state: router_data
.access_token
@@ -477,6 +618,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
browser_info,
session_token: router_data.session_token.clone(),
@@ -574,6 +720,13 @@ impl
}),
// TODO: Populate currency_conversion_data when Dynamic Currency Conversion (DCC) is implemented
currency_conversion_data: None,
+ is_account_funding_transaction: router_data.request.is_account_funded_transaction,
+ recipient_details: router_data
+ .request
+ .recipient_details
+ .as_ref()
+ .map(payments_grpc::RecipientDetails::foreign_try_from)
+ .transpose()?,
})
}
}
@@ -742,6 +895,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
browser_info,
session_token: router_data.session_token.clone(),
@@ -813,6 +971,13 @@ impl
partner_merchant_identifier_details: None,
// TODO: Populate currency_conversion_data when Dynamic Currency Conversion (DCC) is implemented
currency_conversion_data: None,
+ is_account_funding_transaction: router_data.request.is_account_funded_transaction,
+ recipient_details: router_data
+ .request
+ .recipient_details
+ .as_ref()
+ .map(payments_grpc::RecipientDetails::foreign_try_from)
+ .transpose()?,
})
}
}
@@ -1130,6 +1295,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
};
@@ -1221,6 +1391,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
authentication_data,
@@ -1332,6 +1507,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
authentication_data,
@@ -1436,6 +1616,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
authentication_data: None,
@@ -1531,6 +1716,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
authentication_data: None,
@@ -1634,6 +1824,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
enrolled_for_3ds: router_data.request.enrolled_for_3ds,
@@ -1731,6 +1926,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
enrolled_for_3ds: router_data.request.enrolled_for_3ds,
@@ -1935,6 +2135,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
browser_info,
locale: None,
@@ -1988,6 +2193,13 @@ impl
partner_merchant_identifier_details: None,
// TODO: Populate currency_conversion_data when Dynamic Currency Conversion (DCC) is implemented
currency_conversion_data: None,
+ is_account_funding_transaction: router_data.request.is_account_funded_transaction,
+ recipient_details: router_data
+ .request
+ .recipient_details
+ .as_ref()
+ .map(payments_grpc::RecipientDetails::foreign_try_from)
+ .transpose()?,
})
}
}
@@ -2113,6 +2325,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
capture_method: capture_method.map(|capture_method| capture_method.into()),
webhook_url: router_data.request.webhook_url.clone(),
@@ -2186,6 +2403,13 @@ impl
partner_merchant_identifier_details: None,
// TODO: Populate currency_conversion_data when Dynamic Currency Conversion (DCC) is implemented
currency_conversion_data: None,
+ is_account_funding_transaction: router_data.request.is_account_funded_transaction,
+ recipient_details: router_data
+ .request
+ .recipient_details
+ .as_ref()
+ .map(payments_grpc::RecipientDetails::foreign_try_from)
+ .transpose()?,
})
}
}
@@ -2296,6 +2520,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
browser_info,
locale: None,
@@ -2362,6 +2591,8 @@ impl
partner_merchant_identifier_details: None,
// TODO: Populate currency_conversion_data when Dynamic Currency Conversion (DCC) is implemented
currency_conversion_data: None,
+ is_account_funding_transaction: None,
+ recipient_details: None,
})
}
}
@@ -2452,6 +2683,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
address: Some(address),
auth_type: auth_type.into(),
@@ -2536,6 +2772,13 @@ impl
}
}),
}),
+ is_account_funding_transaction: router_data.request.is_account_funded_transaction,
+ recipient_details: router_data
+ .request
+ .recipient_details
+ .as_ref()
+ .map(payments_grpc::RecipientDetails::foreign_try_from)
+ .transpose()?,
})
}
}
@@ -2800,6 +3043,11 @@ impl
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
additional_payment_data,
partner_merchant_identifier_details: router_data
@@ -2832,6 +3080,13 @@ impl
.map(payments_grpc::PaymentChannel::foreign_try_from)
.transpose()?
.map(|payment_channel| payment_channel.into()),
+ is_account_funding_transaction: router_data.request.is_account_funded_transaction,
+ recipient_details: router_data
+ .request
+ .recipient_details
+ .as_ref()
+ .map(payments_grpc::RecipientDetails::foreign_try_from)
+ .transpose()?,
})
}
}
@@ -2894,6 +3149,11 @@ impl transformers::ForeignTryFrom<&RouterData<Session, PaymentsSessionData, Paym
phone_number: None,
phone_country_code: None,
customer_document_details: to_grpc_customer_document_details(router_data),
+ date_of_birth: router_data
+ .customer_date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
}),
return_url: None,
metadata: None,
@@ -7909,9 +8169,15 @@ impl ForeignFrom<common_enums::PayoutSendPriority> for payments_grpc::payout_enu
}
#[cfg(feature = "payouts")]
-impl ForeignFrom<&router_request_types::CustomerDetails> for payments_grpc::Customer {
- fn foreign_from(customer: &router_request_types::CustomerDetails) -> Self {
- Self {
+impl transformers::ForeignTryFrom<&router_request_types::CustomerDetails>
+ for payments_grpc::Customer
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(
+ customer: &router_request_types::CustomerDetails,
+ ) -> Result<Self, Self::Error> {
+ Ok(Self {
id: customer
.customer_id
.clone()
@@ -7925,7 +8191,12 @@ impl ForeignFrom<&router_request_types::CustomerDetails> for payments_grpc::Cust
last_name: None,
salutation: None,
customer_document_details: None,
- }
+ date_of_birth: customer
+ .date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
+ })
}
}
@@ -8024,7 +8295,8 @@ impl
.request
.customer_details
.as_ref()
- .map(payments_grpc::Customer::foreign_from);
+ .map(payments_grpc::Customer::foreign_try_from)
+ .transpose()?;
let priority = router_data
.request
@@ -8081,6 +8353,7 @@ impl
.map(payments_grpc::SourceBankData::foreign_try_from)
.transpose()?,
description: router_data.description.clone(),
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8117,6 +8390,7 @@ impl
connector_feature_data,
connector_payout_id: router_data.request.connector_payout_id.clone(),
access_token: router_data.access_token.clone().map(|at| at.token),
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8153,7 +8427,8 @@ impl
.request
.customer_details
.as_ref()
- .map(payments_grpc::Customer::foreign_from)
+ .map(payments_grpc::Customer::foreign_try_from)
+ .transpose()?
.ok_or(
error_stack::Report::new(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "customer",
@@ -8191,6 +8466,7 @@ impl
address: Some(address),
customer: Some(customer),
source_bank_data,
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8227,7 +8503,8 @@ impl
.request
.customer_details
.as_ref()
- .map(payments_grpc::Customer::foreign_from)
+ .map(payments_grpc::Customer::foreign_try_from)
+ .transpose()?
.ok_or(
error_stack::Report::new(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "customer",
@@ -8278,6 +8555,7 @@ impl
.map(payments_grpc::SourceBankData::foreign_try_from)
.transpose()?,
description: router_data.description.clone(),
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8315,7 +8593,8 @@ impl
.request
.customer_details
.as_ref()
- .map(payments_grpc::Customer::foreign_from)
+ .map(payments_grpc::Customer::foreign_try_from)
+ .transpose()?
.ok_or(
error_stack::Report::new(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "customer",
@@ -8337,6 +8616,7 @@ impl
customer: Some(customer),
access_token: router_data.access_token.clone().map(|at| at.token),
browser_info,
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8366,7 +8646,8 @@ impl
.request
.customer_details
.as_ref()
- .map(payments_grpc::Customer::foreign_from)
+ .map(payments_grpc::Customer::foreign_try_from)
+ .transpose()?
.ok_or(
error_stack::Report::new(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "customer",
@@ -8399,6 +8680,7 @@ impl
router_data.request.entity_type,
),
),
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8442,7 +8724,8 @@ impl
.request
.customer_details
.as_ref()
- .map(payments_grpc::Customer::foreign_from)
+ .map(payments_grpc::Customer::foreign_try_from)
+ .transpose()?
.ok_or(
error_stack::Report::new(UnifiedConnectorServiceError::MissingRequiredField {
field_name: "customer",
@@ -8459,6 +8742,7 @@ impl
amount: Some(money),
customer: Some(customer),
access_token: router_data.access_token.clone().map(|at| at.token),
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8493,6 +8777,7 @@ impl
.as_ref()
.map(payments_grpc::SourceBankData::foreign_try_from)
.transpose()?,
+ merchant_request_id: Some(router_data.connector_request_reference_id.clone()),
})
}
}
@@ -8673,18 +8958,16 @@ impl transformers::ForeignTryFrom<&api_models::payouts::PayoutMethodData>
.to_string(),
),
))?,
- api_models::payouts::Bank::Payshap(_) => Err(error_stack::Report::new(
- UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
- "Payshap bank transfer not supported for Unified Connector Service"
- .to_string(),
- ),
- ))?,
- api_models::payouts::Bank::PayshapProxy(_) => Err(error_stack::Report::new(
- UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
- "PayshapProxy bank transfer not supported for Unified Connector Service"
- .to_string(),
- ),
- ))?,
+ api_models::payouts::Bank::Payshap(payshap) => {
+ payments_grpc::payout_method::PayoutMethodData::Payshap(
+ payments_grpc::PayshapBankTransferPayout::foreign_try_from(payshap)?,
+ )
+ }
+ api_models::payouts::Bank::PayshapProxy(payshap_proxy) => {
+ payments_grpc::payout_method::PayoutMethodData::PayshapProxy(
+ payments_grpc::PayshapProxyBankTransferPayout::foreign_from(payshap_proxy),
+ )
+ }
},
api_models::payouts::PayoutMethodData::BankTransfer(bank_transfer) => {
match bank_transfer {
@@ -8734,18 +9017,16 @@ impl transformers::ForeignTryFrom<&api_models::payouts::PayoutMethodData>
),
))?
}
- api_models::payouts::BankTransfer::Payshap(_) => Err(error_stack::Report::new(
- UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
- "Payshap bank transfer not supported for Unified Connector Service"
- .to_string(),
- ),
- ))?,
- api_models::payouts::BankTransfer::PayshapProxy(_) => Err(error_stack::Report::new(
- UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
- "PayshapProxy bank transfer not supported for Unified Connector Service"
- .to_string(),
- ),
- ))?,
+ api_models::payouts::BankTransfer::Payshap(payshap) => {
+ payments_grpc::payout_method::PayoutMethodData::Payshap(
+ payments_grpc::PayshapBankTransferPayout::foreign_try_from(payshap)?,
+ )
+ }
+ api_models::payouts::BankTransfer::PayshapProxy(payshap_proxy) => {
+ payments_grpc::payout_method::PayoutMethodData::PayshapProxy(
+ payments_grpc::PayshapProxyBankTransferPayout::foreign_from(payshap_proxy),
+ )
+ }
}
}
api_models::payouts::PayoutMethodData::Wallet(wallet) => match wallet {
@@ -9091,12 +9372,16 @@ impl transformers::ForeignTryFrom<&api_models::payouts::BankTransfer>
.to_string(),
),
))?,
- api_models::payouts::BankTransfer::Payshap(_)
- | api_models::payouts::BankTransfer::PayshapProxy(_) => Err(error_stack::Report::new(
- UnifiedConnectorServiceError::RequestEncodingFailedWithReason(
- "PayShap bank transfer not supported for Unified Connector Service".to_string(),
+ api_models::payouts::BankTransfer::Payshap(payshap) => {
+ Some(payments_grpc::source_bank_data::SourceBankData::Payshap(
+ payments_grpc::PayshapBankTransferPayout::foreign_try_from(payshap)?,
+ ))
+ }
+ api_models::payouts::BankTransfer::PayshapProxy(payshap_proxy) => Some(
+ payments_grpc::source_bank_data::SourceBankData::PayshapProxy(
+ payments_grpc::PayshapProxyBankTransferPayout::foreign_from(payshap_proxy),
),
- ))?,
+ ),
};
Ok(Self { source_bank_data })
}
@@ -9124,6 +9409,40 @@ impl ForeignFrom<&api_models::payouts::PixEmvBankTransfer>
}
}
+#[cfg(feature = "payouts")]
+impl transformers::ForeignTryFrom<&api_models::payouts::PayshapBankTransfer>
+ for payments_grpc::PayshapBankTransferPayout
+{
+ type Error = error_stack::Report<UnifiedConnectorServiceError>;
+
+ fn foreign_try_from(
+ item: &api_models::payouts::PayshapBankTransfer,
+ ) -> Result<Self, Self::Error> {
+ let bank_name = item
+ .bank_name
+ .map(payments_grpc::BankNames::foreign_try_from)
+ .transpose()?;
+
+ Ok(Self {
+ bank_account_number: Some(item.bank_account_number.clone()),
+ account_holder_name: item.account_holder_name.clone(),
+ bank_name: bank_name.map(Into::into),
+ })
+ }
+}
+
+#[cfg(feature = "payouts")]
+impl ForeignFrom<&api_models::payouts::PayshapProxyBankTransfer>
+ for payments_grpc::PayshapProxyBankTransferPayout
+{
+ fn foreign_from(item: &api_models::payouts::PayshapProxyBankTransfer) -> Self {
+ Self {
+ cellphone: item.cellphone.clone(),
+ shap_id: item.shap_id.clone(),
+ }
+ }
+}
+
use hyperswitch_domain_models::{
router_flow_types::payments::CalculateSurcharge,
router_request_types::PaymentsSurchargeCalculationData,