Skip to content

Commit

Permalink
fix(pm_auth): Resolved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarthak1799 committed Feb 8, 2024
1 parent 2f6f8ee commit 3b907ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions crates/router/src/core/payment_methods/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2834,8 +2834,7 @@ async fn get_bank_account_connector_details(

let pm_type = pm
.payment_method_type
.ok_or(errors::ApiErrorResponse::InternalServerError)
.into_report()
.get_required_value("payment_method_type")
.attach_printable("PaymentMethodType not found")?;

let token_data = BankAccountTokenData {
Expand Down
9 changes: 7 additions & 2 deletions crates/router/src/core/pm_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,12 @@ pub async fn retrieve_payment_method_from_auth_service(

let name = address
.as_ref()
.and_then(|addr| addr.first_name.clone().map(|name| name.into_inner()));
.and_then(|addr| addr.first_name.clone().map(|name| name.into_inner()))
.ok_or(errors::ApiErrorResponse::GenericNotFoundError {
message: "billing_first_name not found".to_string(),
})
.into_report()
.attach_printable("billing_first_name not found")?;

let address_details = address.clone().map(|addr| {
let line1 = addr.line1.map(|line1| line1.into_inner());
Expand Down Expand Up @@ -742,7 +747,7 @@ pub async fn retrieve_payment_method_from_auth_service(
.get_required_value("email")?;

let billing_details = BankDebitBilling {
name: name.unwrap_or_default(),
name,
email,
address: address_details,
};
Expand Down

0 comments on commit 3b907ac

Please sign in to comment.