fix(core): populate billing_address for payment with pm_id (#6411)

This commit is contained in:
Sakil Mostak
2024-10-24 20:57:46 +05:30
committed by GitHub
parent ecaf700996
commit 8e58b56b43
3 changed files with 5 additions and 2 deletions

View File

@ -753,6 +753,7 @@ pub(crate) async fn get_payment_method_create_request(
payment_method_type: Option<storage_enums::PaymentMethodType>,
customer_id: &Option<id_type::CustomerId>,
billing_name: Option<Secret<String>>,
payment_method_billing_address: Option<&api_models::payments::Address>,
) -> RouterResult<payment_methods::PaymentMethodCreate> {
match payment_method_data {
Some(pm_data) => match payment_method {
@ -787,7 +788,7 @@ pub(crate) async fn get_payment_method_create_request(
.map(|card_network| card_network.to_string()),
client_secret: None,
payment_method_data: None,
billing: None,
billing: payment_method_billing_address.cloned(),
connector_mandate_details: None,
network_transaction_id: None,
};

View File

@ -1047,6 +1047,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
where
F: 'b + Clone + Send + Sync,
{
let payment_method_billing_address = payment_data.address.get_payment_method_billing();
let billing_name = resp
.address
.get_payment_method_billing()
@ -1079,7 +1080,7 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
resp.request.payment_method_type,
key_store,
billing_name,
None,
payment_method_billing_address,
business_profile,
))
.await?;

View File

@ -180,6 +180,7 @@ where
payment_method_type,
&customer_id.clone(),
billing_name,
payment_method_billing_address,
)
.await?;
let customer_id = customer_id.to_owned().get_required_value("customer_id")?;