feat(pm_auth): pm_auth service migration (#3047)

Co-authored-by: Sarthak Soni <76486416+Sarthak1799@users.noreply.github.com>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sarthak Soni <sarthak.soni@juspay.in>
This commit is contained in:
Chethan Rao
2023-12-06 20:48:41 +05:30
committed by GitHub
parent 294b04bcdd
commit 9c1c44a706
40 changed files with 2492 additions and 25 deletions

View File

@ -11,12 +11,12 @@ pub use api_models::{
pub use common_utils::request::RequestBody;
use data_models::payments::{payment_attempt::PaymentAttempt, PaymentIntent};
use diesel_models::enums;
use error_stack::IntoReport;
use crate::{
core::{
errors::{self, RouterResult},
errors::RouterResult,
payments::helpers,
pm_auth::{self as core_pm_auth},
},
routes::AppState,
types::{
@ -172,11 +172,14 @@ impl PaymentMethodRetrieve for Oss {
.map(|card| Some((card, enums::PaymentMethod::Card)))
}
storage::PaymentTokenData::AuthBankDebit(_) => {
Err(errors::ApiErrorResponse::NotImplemented {
message: errors::NotImplementedMessage::Default,
})
.into_report()
storage::PaymentTokenData::AuthBankDebit(auth_token) => {
core_pm_auth::retrieve_payment_method_from_auth_service(
state,
merchant_key_store,
auth_token,
payment_intent,
)
.await
}
}
}