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

fix(router): adding connector_customer_id for external vault proxy (#9263)

Shivansh Mathur87ff43f26c57
diff --git a/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs b/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs
index a96127a123..7d40bb81c2 100644
--- a/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs
+++ b/crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs
@@ -312,14 +312,28 @@ impl<F: Clone + Send + Sync> Domain<F, ExternalVaultProxyPaymentsRequest, Paymen
{
async fn get_customer_details<'a>(
&'a self,
- _state: &SessionState,
- _payment_data: &mut PaymentConfirmData<F>,
- _merchant_key_store: &domain::MerchantKeyStore,
- _storage_scheme: storage_enums::MerchantStorageScheme,
+ state: &SessionState,
+ payment_data: &mut PaymentConfirmData<F>,
+ merchant_key_store: &domain::MerchantKeyStore,
+ storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<(BoxedConfirmOperation<'a, F>, Option<domain::Customer>), errors::StorageError>
{
- // TODO: Implement external vault specific customer details retrieval
- Ok((Box::new(self), None))
+ match payment_data.payment_intent.customer_id.clone() {
+ Some(id) => {
+ let customer = state
+ .store
+ .find_customer_by_global_id(
+ &state.into(),
+ &id,
+ merchant_key_store,
+ storage_scheme,
+ )
+ .await?;
+
+ Ok((Box::new(self), Some(customer)))
+ }
+ None => Ok((Box::new(self), None)),
+ }
}
#[instrument(skip_all)]