feat(connectors): [Iatapay] add payment methods (#4968)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: SamraatBansal <55536657+SamraatBansal@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2024-06-13 09:15:09 +05:30
committed by GitHub
parent 27ca8be0da
commit 0e059e7d84
74 changed files with 588 additions and 43 deletions

View File

@ -92,6 +92,9 @@ fn get_dir_value_payment_method(
api_enums::PaymentMethodType::OnlineBankingThailand => {
Ok(dirval!(BankRedirectType = OnlineBankingThailand))
}
api_enums::PaymentMethodType::LocalBankRedirect => {
Ok(dirval!(BankRedirectType = LocalBankRedirect))
}
api_enums::PaymentMethodType::TouchNGo => Ok(dirval!(WalletType = TouchNGo)),
api_enums::PaymentMethodType::Atome => Ok(dirval!(PayLaterType = Atome)),
api_enums::PaymentMethodType::Boleto => Ok(dirval!(VoucherType = Boleto)),
@ -135,6 +138,10 @@ fn get_dir_value_payment_method(
api_enums::PaymentMethodType::UpiIntent => Ok(dirval!(UpiType = UpiIntent)),
api_enums::PaymentMethodType::UpiCollect => Ok(dirval!(UpiType = UpiCollect)),
api_enums::PaymentMethodType::Mifinity => Ok(dirval!(WalletType = Mifinity)),
api_enums::PaymentMethodType::Fps => Ok(dirval!(RealTimePaymentType = Fps)),
api_enums::PaymentMethodType::DuitNow => Ok(dirval!(RealTimePaymentType = DuitNow)),
api_enums::PaymentMethodType::PromptPay => Ok(dirval!(RealTimePaymentType = PromptPay)),
api_enums::PaymentMethodType::VietQr => Ok(dirval!(RealTimePaymentType = VietQr)),
}
}
@ -402,6 +409,7 @@ fn global_vec_pmt(
global_vector.append(collect_global_variants!(BankDebitType));
global_vector.append(collect_global_variants!(CryptoType));
global_vector.append(collect_global_variants!(RewardType));
global_vector.append(collect_global_variants!(RealTimePaymentType));
global_vector.append(collect_global_variants!(UpiType));
global_vector.append(collect_global_variants!(VoucherType));
global_vector.append(collect_global_variants!(GiftCardType));

View File

@ -98,6 +98,7 @@ impl IntoDirValue for api_enums::PaymentMethod {
Self::BankDebit => Ok(dirval!(PaymentMethod = BankDebit)),
Self::BankTransfer => Ok(dirval!(PaymentMethod = BankTransfer)),
Self::Reward => Ok(dirval!(PaymentMethod = Reward)),
Self::RealTimePayment => Ok(dirval!(PaymentMethod = RealTimePayment)),
Self::Upi => Ok(dirval!(PaymentMethod = Upi)),
Self::Voucher => Ok(dirval!(PaymentMethod = Voucher)),
Self::GiftCard => Ok(dirval!(PaymentMethod = GiftCard)),
@ -154,6 +155,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
| api_enums::PaymentMethod::Wallet
| api_enums::PaymentMethod::Crypto
| api_enums::PaymentMethod::Reward
| api_enums::PaymentMethod::RealTimePayment
| api_enums::PaymentMethod::Upi
| api_enums::PaymentMethod::Voucher
| api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError(
@ -170,6 +172,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
| api_enums::PaymentMethod::Wallet
| api_enums::PaymentMethod::Crypto
| api_enums::PaymentMethod::Reward
| api_enums::PaymentMethod::RealTimePayment
| api_enums::PaymentMethod::Upi
| api_enums::PaymentMethod::Voucher
| api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError(
@ -187,6 +190,7 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
| api_enums::PaymentMethod::Wallet
| api_enums::PaymentMethod::Crypto
| api_enums::PaymentMethod::Reward
| api_enums::PaymentMethod::RealTimePayment
| api_enums::PaymentMethod::Upi
| api_enums::PaymentMethod::Voucher
| api_enums::PaymentMethod::GiftCard => Err(KgraphError::ContextConstructionError(
@ -243,6 +247,9 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
api_enums::PaymentMethodType::OnlineBankingFpx => {
Ok(dirval!(BankRedirectType = OnlineBankingFpx))
}
api_enums::PaymentMethodType::LocalBankRedirect => {
Ok(dirval!(BankRedirectType = LocalBankRedirect))
}
api_enums::PaymentMethodType::OnlineBankingThailand => {
Ok(dirval!(BankRedirectType = OnlineBankingThailand))
}
@ -289,6 +296,10 @@ impl IntoDirValue for (api_enums::PaymentMethodType, api_enums::PaymentMethod) {
}
api_enums::PaymentMethodType::Venmo => Ok(dirval!(WalletType = Venmo)),
api_enums::PaymentMethodType::Mifinity => Ok(dirval!(WalletType = Mifinity)),
api_enums::PaymentMethodType::Fps => Ok(dirval!(RealTimePaymentType = Fps)),
api_enums::PaymentMethodType::DuitNow => Ok(dirval!(RealTimePaymentType = DuitNow)),
api_enums::PaymentMethodType::PromptPay => Ok(dirval!(RealTimePaymentType = PromptPay)),
api_enums::PaymentMethodType::VietQr => Ok(dirval!(RealTimePaymentType = VietQr)),
}
}
}