Skip to content

Commit

Permalink
refactor(connector): [PowerTranz] refactor powertranz payments to rem…
Browse files Browse the repository at this point in the history
…ove default cases (#2547)
  • Loading branch information
Himanshu-370 authored Oct 22, 2023
1 parent b39bdbf commit 664093d
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions crates/router/src/connector/powertranz/transformers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use api_models::payments::Card;
use common_utils::pii::Email;
use diesel_models::enums::RefundStatus;
use error_stack::IntoReport;
use masking::Secret;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
Expand Down Expand Up @@ -101,9 +102,22 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PowertranzPaymentsRequest
fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> {
let source = match item.request.payment_method_data.clone() {
api::PaymentMethodData::Card(card) => Ok(Source::from(&card)),
_ => Err(errors::ConnectorError::NotImplemented(
"Payment method".to_string(),
)),
api::PaymentMethodData::Wallet(_)
| 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: "powertranz",
})
.into_report(),
}?;
// let billing_address = get_address_details(&item.address.billing, &item.request.email);
// let shipping_address = get_address_details(&item.address.shipping, &item.request.email);
Expand Down

0 comments on commit 664093d

Please sign in to comment.