refactor: pass customer object to make_pm_data (#3246)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Chethan Rao
2024-01-09 20:06:28 +05:30
committed by GitHub
parent eba789640b
commit 36c32c377a
17 changed files with 100 additions and 21 deletions

View File

@ -43,6 +43,7 @@ pub trait PaymentMethodRetrieve {
token: &storage::PaymentTokenData,
payment_intent: &PaymentIntent,
card_token_data: Option<&CardToken>,
customer: &Option<domain::Customer>,
) -> RouterResult<Option<(payments::PaymentMethodData, enums::PaymentMethod)>>;
}
@ -126,6 +127,7 @@ impl PaymentMethodRetrieve for Oss {
token_data: &storage::PaymentTokenData,
payment_intent: &PaymentIntent,
card_token_data: Option<&CardToken>,
customer: &Option<domain::Customer>,
) -> RouterResult<Option<(payments::PaymentMethodData, enums::PaymentMethod)>> {
match token_data {
storage::PaymentTokenData::TemporaryGeneric(generic_token) => {
@ -178,6 +180,7 @@ impl PaymentMethodRetrieve for Oss {
merchant_key_store,
auth_token,
payment_intent,
customer,
)
.await
}