fix(core): card_network details Missing in Customer Payment Methods List for External 3DS Authentication Payments (#6739)

This commit is contained in:
awasthi21
2024-12-06 13:41:26 +05:30
committed by GitHub
parent 512ae85c81
commit 15f873bd12
2 changed files with 16 additions and 13 deletions

View File

@ -639,12 +639,14 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
} else { } else {
None None
}; };
payment_attempt.payment_method_data = additional_pm_data_from_locker // Only set `payment_attempt.payment_method_data` if `additional_pm_data_from_locker` is not None
.as_ref() if let Some(additional_pm_data) = additional_pm_data_from_locker.as_ref() {
.map(Encode::encode_to_value) payment_attempt.payment_method_data = Some(
.transpose() Encode::encode_to_value(additional_pm_data)
.change_context(errors::ApiErrorResponse::InternalServerError) .change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed to encode additional pm data")?; .attach_printable("Failed to encode additional pm data")?,
);
}
payment_attempt.payment_method = payment_method.or(payment_attempt.payment_method); payment_attempt.payment_method = payment_method.or(payment_attempt.payment_method);

View File

@ -531,13 +531,14 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Pa
} else { } else {
None None
}; };
// Only set `payment_attempt.payment_method_data` if `additional_pm_data_from_locker` is not None
payment_attempt.payment_method_data = additional_pm_data_from_locker if let Some(additional_pm_data) = additional_pm_data_from_locker.as_ref() {
.as_ref() payment_attempt.payment_method_data = Some(
.map(Encode::encode_to_value) Encode::encode_to_value(additional_pm_data)
.transpose() .change_context(errors::ApiErrorResponse::InternalServerError)
.change_context(errors::ApiErrorResponse::InternalServerError) .attach_printable("Failed to encode additional pm data")?,
.attach_printable("Failed to encode additional pm data")?; );
}
let amount = payment_attempt.get_total_amount().into(); let amount = payment_attempt.get_total_amount().into();
payment_attempt.connector_mandate_detail = payment_attempt.connector_mandate_detail =