From c3f7bbf98d3b305a02790fc93fa0a0edb8d78360 Mon Sep 17 00:00:00 2001 From: Sweta Sharma Date: Fri, 8 Nov 2024 23:13:01 +0530 Subject: [PATCH] auth --- .../src/connector/klarna/transformers.rs | 135 ------------------ 1 file changed, 135 deletions(-) diff --git a/crates/router/src/connector/klarna/transformers.rs b/crates/router/src/connector/klarna/transformers.rs index ab3aeeaa8070..ab47997e0adc 100644 --- a/crates/router/src/connector/klarna/transformers.rs +++ b/crates/router/src/connector/klarna/transformers.rs @@ -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 }) => { @@ -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" - // })), - // } } }