feat(payment_methods): added kv support for payment_methods table (#4311)

Co-authored-by: Akshay S <akshay.s@Akshay-Subramanian-D66TQ6D97K.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
akshay-97
2024-04-10 19:29:50 +05:30
committed by GitHub
parent 9448673c1c
commit eb3cecdd74
35 changed files with 1017 additions and 315 deletions

View File

@ -38,6 +38,7 @@ pub trait PaymentMethodRetrieve {
payment_intent: &PaymentIntent,
card_token_data: Option<&CardToken>,
customer: &Option<domain::Customer>,
storage_scheme: common_enums::enums::MerchantStorageScheme,
) -> RouterResult<storage::PaymentMethodDataWithId>;
}
@ -122,6 +123,7 @@ impl PaymentMethodRetrieve for Oss {
payment_intent: &PaymentIntent,
card_token_data: Option<&CardToken>,
customer: &Option<domain::Customer>,
storage_scheme: common_enums::enums::MerchantStorageScheme,
) -> RouterResult<storage::PaymentMethodDataWithId> {
let token = match token_data {
storage::PaymentTokenData::TemporaryGeneric(generic_token) => {
@ -172,6 +174,8 @@ impl PaymentMethodRetrieve for Oss {
.unwrap_or(&card_token.token),
payment_intent,
card_token_data,
merchant_key_store,
storage_scheme,
)
.await
.map(|card| Some((card, enums::PaymentMethod::Card)))?
@ -201,6 +205,8 @@ impl PaymentMethodRetrieve for Oss {
.unwrap_or(&card_token.token),
payment_intent,
card_token_data,
merchant_key_store,
storage_scheme,
)
.await
.map(|card| Some((card, enums::PaymentMethod::Card)))?