Skip to content

Commit

Permalink
refactor(connector): [nmi] refactor nmi and handled variants errors (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cioraz authored Oct 6, 2023
1 parent 2897b6e commit f364a06
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions crates/router/src/connector/nmi/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,51 @@ impl TryFrom<&api_models::payments::PaymentMethodData> for PaymentMethod {
api_models::payments::WalletData::ApplePay(ref applepay_data) => {
Ok(Self::from(applepay_data))
}
_ => Err(errors::ConnectorError::NotImplemented(
"Payment Method".to_string(),
))
.into_report(),
api_models::payments::WalletData::AliPayQr(_)
| api_models::payments::WalletData::AliPayRedirect(_)
| api_models::payments::WalletData::AliPayHkRedirect(_)
| api_models::payments::WalletData::MomoRedirect(_)
| api_models::payments::WalletData::KakaoPayRedirect(_)
| api_models::payments::WalletData::GoPayRedirect(_)
| api_models::payments::WalletData::GcashRedirect(_)
| api_models::payments::WalletData::ApplePayRedirect(_)
| api_models::payments::WalletData::ApplePayThirdPartySdk(_)
| api_models::payments::WalletData::DanaRedirect {}
| api_models::payments::WalletData::GooglePayRedirect(_)
| api_models::payments::WalletData::GooglePayThirdPartySdk(_)
| api_models::payments::WalletData::MbWayRedirect(_)
| api_models::payments::WalletData::MobilePayRedirect(_)
| api_models::payments::WalletData::PaypalRedirect(_)
| api_models::payments::WalletData::PaypalSdk(_)
| api_models::payments::WalletData::SamsungPay(_)
| api_models::payments::WalletData::TwintRedirect {}
| api_models::payments::WalletData::VippsRedirect {}
| api_models::payments::WalletData::TouchNGoRedirect(_)
| api_models::payments::WalletData::WeChatPayRedirect(_)
| api_models::payments::WalletData::WeChatPayQr(_)
| api_models::payments::WalletData::CashappQr(_)
| api_models::payments::WalletData::SwishQr(_) => {
Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "nmi",
})
.into_report()
}
},
_ => Err(errors::ConnectorError::NotImplemented(
"Payment Method".to_string(),
))
api::PaymentMethodData::CardRedirect(_)
| api::PaymentMethodData::PayLater(_)
| api::PaymentMethodData::BankRedirect(_)
| api::PaymentMethodData::BankDebit(_)
| api::PaymentMethodData::BankTransfer(_)
| api::PaymentMethodData::Crypto(_)
| api::PaymentMethodData::MandatePayment
| api::PaymentMethodData::Reward
| api::PaymentMethodData::Upi(_)
| api::PaymentMethodData::Voucher(_)
| api::PaymentMethodData::GiftCard(_) => Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "nmi",
})
.into_report(),
}
}
Expand Down

0 comments on commit f364a06

Please sign in to comment.