Skip to content

Commit

Permalink
no3ds not support test support
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrudul Vajpayee authored and Mrudul Vajpayee committed Nov 29, 2024
1 parent 26496f9 commit 3e810f8
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,15 +534,23 @@ impl TryFrom<&NexixpayRouterData<&PaymentsAuthorizeRouterData>> for NexixpayPaym

match item.router_data.request.payment_method_data {
PaymentMethodData::Card(ref req_card) => {
Ok(Self::NexixpayNonMandatePaymentRequest(Box::new(
NexixpayNonMandatePaymentRequest {
card: NexixpayCard {
pan: req_card.card_number.clone(),
expiry_date: req_card.get_expiry_date_as_mmyy()?,
if item.router_data.is_three_ds() {
Ok(Self::NexixpayNonMandatePaymentRequest(Box::new(
NexixpayNonMandatePaymentRequest {
card: NexixpayCard {
pan: req_card.card_number.clone(),
expiry_date: req_card.get_expiry_date_as_mmyy()?,
},
recurrence: recurrence_request_obj,
},
recurrence: recurrence_request_obj,
},
)))
)))
} else {
Err(errors::ConnectorError::NotSupported {
message: "No threeds is not supported".to_string(),
connector: "nexixpay",
}
.into())
}
}
PaymentMethodData::CardRedirect(_)
| PaymentMethodData::Wallet(_)
Expand Down
99 changes: 65 additions & 34 deletions cypress-tests/cypress/e2e/PaymentUtils/Nexixpay.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const multiUseMandateData = {
},
mandate_type: {
multi_use: {
amount: 3545,
amount: 8000,
currency: "EUR",
},
},
Expand All @@ -44,7 +44,7 @@ const singleUseMandateData = {
},
mandate_type: {
multi_use: {
amount: 3545,
amount: 8000,
currency: "EUR",
},
},
Expand Down Expand Up @@ -72,7 +72,7 @@ export const connectorDetails = {
PaymentIntent: {
Request: {
currency: "EUR",
amount: 3545,
amount: 6500,
customer_acceptance: null,
setup_future_usage: "on_session",
billing: {
Expand All @@ -96,6 +96,22 @@ export const connectorDetails = {
},
},
},
PaymentIntentOffSession: {
Request: {
currency: "EUR",
amount: 6500,
authentication_type: "no_three_ds",
customer_acceptance: null,
setup_future_usage: "off_session",
},
Response: {
status: 200,
body: {
status: "requires_payment_method",
setup_future_usage: "off_session",
},
},
},
"3DSManualCapture": {
Request: {
payment_method: "card",
Expand Down Expand Up @@ -167,7 +183,6 @@ export const connectorDetails = {
No3DSManualCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulNo3DSCardDetails,
},
Expand All @@ -189,9 +204,13 @@ export const connectorDetails = {
},
},
Response: {
status: 200,
status: 501,
body: {
status: "requires_customer_action",
error: {
type: "invalid_request",
message: "No threeds is not supported",
code: "IR_00",
},
},
},
},
Expand Down Expand Up @@ -219,11 +238,15 @@ export const connectorDetails = {
},
},
Response: {
status: 200,
status: 501,
body: {
status: "requires_customer_action",
error: {
type: "invalid_request",
message: "No threeds is not supported",
code: "IR_00",
},
},
},
}
},
Capture: {
Request: {
Expand All @@ -237,9 +260,9 @@ export const connectorDetails = {
status: 200,
body: {
status: "processing",
amount: 3545,
amount_capturable: 0,
amount_received: 3545,
amount: 6500,
amount_capturable: 6500,
amount_received: null,
},
},
},
Expand All @@ -249,8 +272,8 @@ export const connectorDetails = {
status: 200,
body: {
status: "processing",
amount: 3545,
amount_capturable: 0,
amount: 6500,
amount_capturable: 6500,
amount_received: 100,
},
},
Expand Down Expand Up @@ -312,7 +335,6 @@ export const connectorDetails = {
MandateMultiUse3DSAutoCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulThreeDSTestCardDetails,
},
Expand Down Expand Up @@ -343,7 +365,6 @@ export const connectorDetails = {
MandateMultiUse3DSManualCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulThreeDSTestCardDetails,
},
Expand Down Expand Up @@ -375,7 +396,6 @@ export const connectorDetails = {
MandateMultiUseNo3DSAutoCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulNo3DSCardDetails,
},
Expand All @@ -396,16 +416,19 @@ export const connectorDetails = {
},
},
Response: {
status: 200,
status: 501,
body: {
status: "requires_customer_action",
error: {
type: "invalid_request",
message: "No threeds is not supported",
code: "IR_00",
},
},
},
}
},
MandateMultiUseNo3DSManualCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulNo3DSCardDetails,
},
Expand All @@ -426,16 +449,19 @@ export const connectorDetails = {
},
},
Response: {
status: 200,
status: 501,
body: {
status: "requires_customer_action",
error: {
type: "invalid_request",
message: "No threeds is not supported",
code: "IR_00",
},
},
},
}
},
MandateSingleUse3DSAutoCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulThreeDSTestCardDetails,
},
Expand Down Expand Up @@ -465,7 +491,6 @@ export const connectorDetails = {
MandateSingleUse3DSManualCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulThreeDSTestCardDetails,
},
Expand Down Expand Up @@ -495,7 +520,6 @@ export const connectorDetails = {
MandateSingleUseNo3DSAutoCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulNo3DSCardDetails,
},
Expand All @@ -516,16 +540,19 @@ export const connectorDetails = {
},
},
Response: {
status: 200,
status: 501,
body: {
status: "requires_customer_action",
error: {
type: "invalid_request",
message: "No threeds is not supported",
code: "IR_00",
},
},
},
}
},
MandateSingleUseNo3DSManualCapture: {
Request: {
payment_method: "card",
amount: 3545,
payment_method_data: {
card: successfulNo3DSCardDetails,
},
Expand All @@ -546,11 +573,15 @@ export const connectorDetails = {
},
},
Response: {
status: 200,
status: 501,
body: {
status: "requires_customer_action",
error: {
type: "invalid_request",
message: "No threeds is not supported",
code: "IR_00",
},
},
},
}
},
},
};

0 comments on commit 3e810f8

Please sign in to comment.