fix(router): conditionally store saved cards with cvc in temp locker based on config (#7773)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2025-04-30 17:04:05 +05:30
committed by GitHub
parent d7d02e2516
commit 9f94900ccd

View File

@ -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>>(