Skip to content

Commit

Permalink
fix(core): populate billing_address for payment with pm_id (#6411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakilmostak authored Oct 24, 2024
1 parent ecaf700 commit 8e58b56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/router/src/core/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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?;
Expand Down
1 change: 1 addition & 0 deletions crates/router/src/core/payments/tokenization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
Expand Down

0 comments on commit 8e58b56

Please sign in to comment.