Skip to content

Commit

Permalink
auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweta Sharma authored and Sweta Sharma committed Nov 8, 2024
1 parent 5d118a0 commit c3f7bbf
Showing 1 changed file with 0 additions and 135 deletions.
135 changes: 0 additions & 135 deletions crates/router/src/connector/klarna/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,112 +274,6 @@ impl TryFrom<&KlarnaRouterData<&types::PaymentsAuthorizeRouterData>> for KlarnaP
let payment_method_data = request.payment_method_data.clone();
let payment_experience = request.payment_experience;
let payment_method_type = request.payment_method_type;
// match request.order_details.clone() {
// match payment_method_data {
// domain::PaymentMethodData::PayLater(domain::PayLaterData::KlarnaSdk { token }) => {
// match (payment_experience, payment_method_type) {
// (
// common_enums::PaymentExperience::InvokeSdkClient,
// common_enums::PaymentMethodType::Klarna,
// ) => {
// println!("klarna payments called");


// Ok(KlarnaPaymentsRequest::SDK(KlarnaSDKRequest{
// purchase_country: item.router_data.get_billing_country()?,
// purchase_currency: request.currency,
// order_amount: item.amount,
// order_lines: order_details
// .iter()
// .map(|data| OrderLines {
// name: data.product_name.clone(),
// quantity: data.quantity,
// unit_price: data.amount,
// total_amount: i64::from(data.quantity) * (data.amount),
// })
// .collect(),
// merchant_reference1: Some(
// item.router_data.connector_request_reference_id.clone(),
// ),
// merchant_reference2: item
// .router_data
// .request
// .merchant_order_reference_id
// .clone(),
// auto_capture: request.is_auto_capture()?,
// shipping_address: get_address_info(
// item.router_data.get_optional_shipping(),
// )
// .transpose()?,
// }))
// }
// (None, None) => todo!(),
// (None, Some(_)) => todo!(),
// (Some(_), None) => todo!(),
// (Some(_), Some(_)) => todo!(),
// }
// }
// domain::PaymentMethodData::PayLater(domain::PayLaterData::KlarnaCheckout {}) => {
// match (payment_experience, payment_method_type) {
// (
// common_enums::PaymentExperience::InvokeSdkClient,
// common_enums::PaymentMethodType::KlarnaCheckout,
// ) => {
// println!("klarna SDK called");
// Ok(KlarnaPaymentsRequest::Checkout(KlarnaCheckoutRequest{
// purchase_country: item.router_data.get_billing_country()?,
// purchase_currency: request.currency,
// order_amount: item.amount,
// order_lines: order_details
// .iter()
// .map(|data| OrderLines {
// name: data.product_name.clone(),
// quantity: data.quantity,
// unit_price: data.amount,
// total_amount: i64::from(data.quantity) * (data.amount),
// })
// .collect(),

// merchant_urls: item
// .router_data
// .request
// .merchant_urls
// .clone(),
// auto_capture: request.is_auto_capture()?,
// shipping_address: get_address_info(
// item.router_data.get_optional_shipping(),
// )
// .transpose()?,
// }))
// }
// (None, None) => todo!(),
// (None, Some(_)) => todo!(),
// (Some(_), None) => todo!(),
// (Some(_), Some(_)) => todo!(),
// }
// }
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::Card(card) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardDetailsForNetworkTransactionId(card_details_for_network_transaction_id) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardRedirect(card_redirect_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::Wallet(wallet_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::PayLater(pay_later_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankRedirect(bank_redirect_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankDebit(bank_debit_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::BankTransfer(bank_transfer_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::Crypto(crypto_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::MandatePayment => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::Reward => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::RealTimePayment(real_time_payment_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::Upi(upi_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::Voucher(voucher_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::GiftCard(gift_card_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardToken(card_token) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::OpenBanking(open_banking_data) => todo!(),
// hyperswitch_domain_models::payment_method_data::PaymentMethodData::NetworkToken(network_token_data) => todo!(),



// }

match payment_method_data {
domain::PaymentMethodData::PayLater(domain::PayLaterData::KlarnaSdk { token }) => {
Expand Down Expand Up @@ -484,35 +378,6 @@ impl TryFrom<&KlarnaRouterData<&types::PaymentsAuthorizeRouterData>> for KlarnaP
hyperswitch_domain_models::payment_method_data::PaymentMethodData::OpenBanking(open_banking_data) => todo!(),
hyperswitch_domain_models::payment_method_data::PaymentMethodData::NetworkToken(network_token_data) => todo!(),
}





// match request.order_details.clone() {
// Some(order_details) => Ok(Self {
// purchase_country: item.router_data.get_billing_country()?,
// purchase_currency: request.currency,
// order_amount: item.amount,
// order_lines: order_details
// .iter()
// .map(|data| OrderLines {
// name: data.product_name.clone(),
// quantity: data.quantity,
// unit_price: data.amount,
// total_amount: i64::from(data.quantity) * (data.amount),
// })
// .collect(),
// merchant_reference1: Some(item.router_data.connector_request_reference_id.clone()),
// merchant_reference2: item.router_data.request.merchant_order_reference_id.clone(),
// auto_capture: request.is_auto_capture()?,
// shipping_address: get_address_info(item.router_data.get_optional_shipping())
// .transpose()?,
// }),
// None => Err(report!(errors::ConnectorError::MissingRequiredField {
// field_name: "order_details"
// })),
// }

}
}
Expand Down

0 comments on commit c3f7bbf

Please sign in to comment.