mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 05:17:02 +08:00
fix(core): populate billing_address for payment with pm_id (#6411)
This commit is contained in:
@ -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,
|
||||
};
|
||||
|
||||
@ -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?;
|
||||
|
||||
@ -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")?;
|
||||
|
||||
Reference in New Issue
Block a user