Skip to content

Commit

Permalink
refactor(connector): [Airwallex] Remove default case handling (#2703)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hangsaai authored Oct 27, 2023
1 parent 3578db7 commit 4138c8f
Showing 1 changed file with 41 additions and 5 deletions.
46 changes: 41 additions & 5 deletions crates/router/src/connector/airwallex/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,18 @@ impl TryFrom<&AirwallexRouterData<&types::PaymentsAuthorizeRouterData>>
}))
}
api::PaymentMethodData::Wallet(ref wallet_data) => get_wallet_details(wallet_data),
_ => Err(errors::ConnectorError::NotImplemented(
"Unknown payment method".to_string(),
api::PaymentMethodData::PayLater(_)
| api::PaymentMethodData::BankRedirect(_)
| api::PaymentMethodData::BankDebit(_)
| api::PaymentMethodData::BankTransfer(_)
| api::PaymentMethodData::CardRedirect(_)
| api::PaymentMethodData::Crypto(_)
| api::PaymentMethodData::MandatePayment
| api::PaymentMethodData::Reward
| api::PaymentMethodData::Upi(_)
| api::PaymentMethodData::Voucher(_)
| api::PaymentMethodData::GiftCard(_) => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("airwallex"),
)),
}?;

Expand Down Expand Up @@ -215,9 +225,35 @@ fn get_wallet_details(
payment_method_type: AirwallexPaymentType::Googlepay,
}))
}
_ => Err(errors::ConnectorError::NotImplemented(
"Payment method".to_string(),
))?,
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::ApplePay(_)
| 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::NotImplemented(
utils::get_unimplemented_payment_method_error_message("airwallex"),
))?
}
};
Ok(wallet_details)
}
Expand Down

0 comments on commit 4138c8f

Please sign in to comment.