mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
fix(connector): [Datatrans] Handling for 4-Digit YYYY input and Correct 3DS Routing to no_3ds (#5410)
This commit is contained in:
@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use crate::{
|
use crate::{
|
||||||
connector::{
|
connector::{
|
||||||
utils as connector_utils,
|
utils as connector_utils,
|
||||||
utils::{PaymentsAuthorizeRequestData, RouterData},
|
utils::{CardData, PaymentsAuthorizeRequestData},
|
||||||
},
|
},
|
||||||
core::errors,
|
core::errors,
|
||||||
types::{
|
types::{
|
||||||
@ -158,21 +158,15 @@ impl TryFrom<&DatatransRouterData<&types::PaymentsAuthorizeRouterData>>
|
|||||||
fn try_from(
|
fn try_from(
|
||||||
item: &DatatransRouterData<&types::PaymentsAuthorizeRouterData>,
|
item: &DatatransRouterData<&types::PaymentsAuthorizeRouterData>,
|
||||||
) -> Result<Self, Self::Error> {
|
) -> Result<Self, Self::Error> {
|
||||||
if item.router_data.is_three_ds() {
|
|
||||||
return Err(errors::ConnectorError::NotImplemented(
|
|
||||||
"Three_ds payments through Datatrans".to_string(),
|
|
||||||
)
|
|
||||||
.into());
|
|
||||||
};
|
|
||||||
match item.router_data.request.payment_method_data.clone() {
|
match item.router_data.request.payment_method_data.clone() {
|
||||||
domain::PaymentMethodData::Card(req_card) => Ok(Self {
|
domain::PaymentMethodData::Card(req_card) => Ok(Self {
|
||||||
amount: item.amount,
|
amount: item.amount,
|
||||||
currency: item.router_data.request.currency,
|
currency: item.router_data.request.currency,
|
||||||
card: PlainCardDetails {
|
card: PlainCardDetails {
|
||||||
res_type: "PLAIN".to_string(),
|
res_type: "PLAIN".to_string(),
|
||||||
number: req_card.card_number,
|
number: req_card.card_number.clone(),
|
||||||
expiry_month: req_card.card_exp_month,
|
expiry_month: req_card.card_exp_month.clone(),
|
||||||
expiry_year: req_card.card_exp_year,
|
expiry_year: req_card.get_card_expiry_year_2_digit()?,
|
||||||
},
|
},
|
||||||
refno: item.router_data.connector_request_reference_id.clone(),
|
refno: item.router_data.connector_request_reference_id.clone(),
|
||||||
auto_settle: matches!(
|
auto_settle: matches!(
|
||||||
|
|||||||
Reference in New Issue
Block a user