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): conditionally store saved cards with cvc in temp locker based on config (#7773)

AkshayaFoiger9f94900ccdce
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 962475acd2..edd62680d2 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -2637,6 +2637,21 @@ pub async fn make_pm_data<'a, F: Clone, R, D>(
if let Some(vault_operation) = updated_vault_operation {
payment_data.set_vault_operation(vault_operation);
}
+
+ // Temporarily store payment method data along with the cvc in redis for saved card payments, if required by the connector based on its configs
+ if payment_data.token.is_none() {
+ let (_, payment_token) = payment_methods::retrieve_payment_method_core(
+ &Some(payment_method_data.clone()),
+ state,
+ &payment_data.payment_intent,
+ &payment_data.payment_attempt,
+ merchant_key_store,
+ Some(business_profile),
+ )
+ .await?;
+
+ payment_data.token = payment_token;
+ }
};
Ok::<_, error_stack::Report<errors::ApiErrorResponse>>(