mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 03:13:56 +08:00
feat(connector): [ACI] cypress added (#9502)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
pub(super) const FAILURE_CODES: [&str; 501] = [
|
pub(super) const FAILURE_CODES: [&str; 502] = [
|
||||||
"100.370.100",
|
"100.370.100",
|
||||||
"100.370.110",
|
"100.370.110",
|
||||||
"100.370.111",
|
"100.370.111",
|
||||||
@ -500,6 +500,7 @@ pub(super) const FAILURE_CODES: [&str; 501] = [
|
|||||||
"800.800.102",
|
"800.800.102",
|
||||||
"800.800.202",
|
"800.800.202",
|
||||||
"800.800.302",
|
"800.800.302",
|
||||||
|
"100.390.100",
|
||||||
];
|
];
|
||||||
|
|
||||||
pub(super) const SUCCESSFUL_CODES: [&str; 16] = [
|
pub(super) const SUCCESSFUL_CODES: [&str; 16] = [
|
||||||
|
|||||||
@ -136,7 +136,8 @@ pub struct AciCancelRequest {
|
|||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct AciMandateRequest {
|
pub struct AciMandateRequest {
|
||||||
pub entity_id: Secret<String>,
|
pub entity_id: Secret<String>,
|
||||||
pub payment_brand: PaymentBrand,
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub payment_brand: Option<PaymentBrand>,
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub payment_details: PaymentDetails,
|
pub payment_details: PaymentDetails,
|
||||||
}
|
}
|
||||||
@ -395,7 +396,7 @@ impl TryFrom<(Card, Option<Secret<String>>)> for PaymentDetails {
|
|||||||
) -> Result<Self, Self::Error> {
|
) -> Result<Self, Self::Error> {
|
||||||
let card_expiry_year = card_data.get_expiry_year_4_digit();
|
let card_expiry_year = card_data.get_expiry_year_4_digit();
|
||||||
|
|
||||||
let payment_brand = get_aci_payment_brand(card_data.card_network, false)?;
|
let payment_brand = get_aci_payment_brand(card_data.card_network, false).ok();
|
||||||
|
|
||||||
Ok(Self::AciCard(Box::new(CardDetails {
|
Ok(Self::AciCard(Box::new(CardDetails {
|
||||||
card_number: card_data.card_number,
|
card_number: card_data.card_number,
|
||||||
@ -541,7 +542,8 @@ pub struct CardDetails {
|
|||||||
#[serde(rename = "card.cvv")]
|
#[serde(rename = "card.cvv")]
|
||||||
pub card_cvv: Secret<String>,
|
pub card_cvv: Secret<String>,
|
||||||
#[serde(rename = "paymentBrand")]
|
#[serde(rename = "paymentBrand")]
|
||||||
pub payment_brand: PaymentBrand,
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub payment_brand: Option<PaymentBrand>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
@ -879,16 +881,20 @@ impl TryFrom<&RouterData<SetupMandate, SetupMandateRequestData, PaymentsResponse
|
|||||||
|
|
||||||
let (payment_brand, payment_details) = match &item.request.payment_method_data {
|
let (payment_brand, payment_details) = match &item.request.payment_method_data {
|
||||||
PaymentMethodData::Card(card_data) => {
|
PaymentMethodData::Card(card_data) => {
|
||||||
let brand = get_aci_payment_brand(card_data.card_network.clone(), false)?;
|
let brand = get_aci_payment_brand(card_data.card_network.clone(), false).ok();
|
||||||
match brand {
|
match brand.as_ref() {
|
||||||
PaymentBrand::Visa
|
Some(PaymentBrand::Visa)
|
||||||
| PaymentBrand::Mastercard
|
| Some(PaymentBrand::Mastercard)
|
||||||
| PaymentBrand::AmericanExpress => {}
|
| Some(PaymentBrand::AmericanExpress) => (),
|
||||||
_ => Err(errors::ConnectorError::NotSupported {
|
Some(_) => {
|
||||||
message: "Payment method not supported for mandate setup".to_string(),
|
return Err(errors::ConnectorError::NotSupported {
|
||||||
connector: "ACI",
|
message: "Payment method not supported for mandate setup".to_string(),
|
||||||
})?,
|
connector: "ACI",
|
||||||
}
|
}
|
||||||
|
.into());
|
||||||
|
}
|
||||||
|
None => (),
|
||||||
|
};
|
||||||
|
|
||||||
let details = PaymentDetails::AciCard(Box::new(CardDetails {
|
let details = PaymentDetails::AciCard(Box::new(CardDetails {
|
||||||
card_number: card_data.card_number.clone(),
|
card_number: card_data.card_number.clone(),
|
||||||
@ -1150,13 +1156,13 @@ pub struct AciCaptureResponse {
|
|||||||
currency: String,
|
currency: String,
|
||||||
descriptor: String,
|
descriptor: String,
|
||||||
result: AciCaptureResult,
|
result: AciCaptureResult,
|
||||||
result_details: AciCaptureResultDetails,
|
result_details: Option<AciCaptureResultDetails>,
|
||||||
build_number: String,
|
build_number: String,
|
||||||
timestamp: String,
|
timestamp: String,
|
||||||
ndc: Secret<String>,
|
ndc: Secret<String>,
|
||||||
source: Secret<String>,
|
source: Option<Secret<String>>,
|
||||||
payment_method: String,
|
payment_method: Option<String>,
|
||||||
short_id: String,
|
short_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)]
|
#[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)]
|
||||||
@ -1171,22 +1177,22 @@ pub struct AciCaptureResult {
|
|||||||
pub struct AciCaptureResultDetails {
|
pub struct AciCaptureResultDetails {
|
||||||
extended_description: String,
|
extended_description: String,
|
||||||
#[serde(rename = "clearingInstituteName")]
|
#[serde(rename = "clearingInstituteName")]
|
||||||
clearing_institute_name: String,
|
clearing_institute_name: Option<String>,
|
||||||
connector_tx_i_d1: String,
|
connector_tx_i_d1: Option<String>,
|
||||||
connector_tx_i_d3: String,
|
connector_tx_i_d3: Option<String>,
|
||||||
connector_tx_i_d2: String,
|
connector_tx_i_d2: Option<String>,
|
||||||
acquirer_response: String,
|
acquirer_response: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, Deserialize)]
|
#[derive(Debug, Default, Clone, Deserialize)]
|
||||||
pub enum AciCaptureStatus {
|
pub enum AciStatus {
|
||||||
Succeeded,
|
Succeeded,
|
||||||
Failed,
|
Failed,
|
||||||
#[default]
|
#[default]
|
||||||
Pending,
|
Pending,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FromStr for AciCaptureStatus {
|
impl FromStr for AciStatus {
|
||||||
type Err = error_stack::Report<errors::ConnectorError>;
|
type Err = error_stack::Report<errors::ConnectorError>;
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
if FAILURE_CODES.contains(&s) {
|
if FAILURE_CODES.contains(&s) {
|
||||||
@ -1203,11 +1209,11 @@ impl FromStr for AciCaptureStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn map_aci_capture_status(item: AciCaptureStatus) -> enums::AttemptStatus {
|
fn map_aci_capture_status(item: AciStatus) -> enums::AttemptStatus {
|
||||||
match item {
|
match item {
|
||||||
AciCaptureStatus::Succeeded => enums::AttemptStatus::Charged,
|
AciStatus::Succeeded => enums::AttemptStatus::Charged,
|
||||||
AciCaptureStatus::Failed => enums::AttemptStatus::Failure,
|
AciStatus::Failed => enums::AttemptStatus::Failure,
|
||||||
AciCaptureStatus::Pending => enums::AttemptStatus::Pending,
|
AciStatus::Pending => enums::AttemptStatus::Pending,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1218,8 +1224,7 @@ impl<F, T> TryFrom<ResponseRouterData<F, AciCaptureResponse, T, PaymentsResponse
|
|||||||
fn try_from(
|
fn try_from(
|
||||||
item: ResponseRouterData<F, AciCaptureResponse, T, PaymentsResponseData>,
|
item: ResponseRouterData<F, AciCaptureResponse, T, PaymentsResponseData>,
|
||||||
) -> Result<Self, Self::Error> {
|
) -> Result<Self, Self::Error> {
|
||||||
let status =
|
let status = map_aci_capture_status(AciStatus::from_str(&item.response.result.code)?);
|
||||||
map_aci_capture_status(AciCaptureStatus::from_str(&item.response.result.code)?);
|
|
||||||
let response = if status == enums::AttemptStatus::Failure {
|
let response = if status == enums::AttemptStatus::Failure {
|
||||||
Err(ErrorResponse {
|
Err(ErrorResponse {
|
||||||
code: item.response.result.code.clone(),
|
code: item.response.result.code.clone(),
|
||||||
@ -1254,6 +1259,69 @@ impl<F, T> TryFrom<ResponseRouterData<F, AciCaptureResponse, T, PaymentsResponse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Default, Clone, Deserialize, PartialEq, Eq, Serialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct AciVoidResponse {
|
||||||
|
id: String,
|
||||||
|
referenced_id: String,
|
||||||
|
payment_type: AciPaymentType,
|
||||||
|
amount: StringMajorUnit,
|
||||||
|
currency: String,
|
||||||
|
descriptor: String,
|
||||||
|
result: AciCaptureResult,
|
||||||
|
result_details: Option<AciCaptureResultDetails>,
|
||||||
|
build_number: String,
|
||||||
|
timestamp: String,
|
||||||
|
ndc: Secret<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_aci_void_status(item: AciStatus) -> enums::AttemptStatus {
|
||||||
|
match item {
|
||||||
|
AciStatus::Succeeded => enums::AttemptStatus::Voided,
|
||||||
|
AciStatus::Failed => enums::AttemptStatus::VoidFailed,
|
||||||
|
AciStatus::Pending => enums::AttemptStatus::VoidInitiated,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<F, T> TryFrom<ResponseRouterData<F, AciVoidResponse, T, PaymentsResponseData>>
|
||||||
|
for RouterData<F, T, PaymentsResponseData>
|
||||||
|
{
|
||||||
|
type Error = error_stack::Report<errors::ConnectorError>;
|
||||||
|
fn try_from(
|
||||||
|
item: ResponseRouterData<F, AciVoidResponse, T, PaymentsResponseData>,
|
||||||
|
) -> Result<Self, Self::Error> {
|
||||||
|
let status = map_aci_void_status(AciStatus::from_str(&item.response.result.code)?);
|
||||||
|
let response = if status == enums::AttemptStatus::Failure {
|
||||||
|
Err(ErrorResponse {
|
||||||
|
code: item.response.result.code.clone(),
|
||||||
|
message: item.response.result.description.clone(),
|
||||||
|
reason: Some(item.response.result.description),
|
||||||
|
status_code: item.http_code,
|
||||||
|
attempt_status: Some(status),
|
||||||
|
connector_transaction_id: Some(item.response.id.clone()),
|
||||||
|
..Default::default()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
Ok(PaymentsResponseData::TransactionResponse {
|
||||||
|
resource_id: ResponseId::ConnectorTransactionId(item.response.id.clone()),
|
||||||
|
redirection_data: Box::new(None),
|
||||||
|
mandate_reference: Box::new(None),
|
||||||
|
connector_metadata: None,
|
||||||
|
network_txn_id: None,
|
||||||
|
connector_response_reference_id: Some(item.response.referenced_id.clone()),
|
||||||
|
incremental_authorization_allowed: None,
|
||||||
|
charges: None,
|
||||||
|
})
|
||||||
|
};
|
||||||
|
Ok(Self {
|
||||||
|
status,
|
||||||
|
response,
|
||||||
|
reference_id: Some(item.response.referenced_id),
|
||||||
|
..item.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Serialize)]
|
#[derive(Default, Debug, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct AciRefundRequest {
|
pub struct AciRefundRequest {
|
||||||
|
|||||||
@ -2,27 +2,27 @@ import { customerAcceptance } from "./Commons";
|
|||||||
|
|
||||||
const successfulNo3DSCardDetails = {
|
const successfulNo3DSCardDetails = {
|
||||||
card_number: "4242424242424242",
|
card_number: "4242424242424242",
|
||||||
card_exp_month: "10",
|
card_exp_month: "01",
|
||||||
card_exp_year: "2050",
|
card_exp_year: "2045",
|
||||||
card_holder_name: "morino",
|
card_holder_name: "morino",
|
||||||
card_cvc: "737",
|
card_cvc: "737",
|
||||||
};
|
};
|
||||||
|
|
||||||
const successfulThreeDSTestCardDetails = {
|
const successfulThreeDSTestCardDetails = {
|
||||||
card_number: "4111111111111111",
|
card_number: "5386024192625914",
|
||||||
card_exp_month: "10",
|
card_exp_month: "01",
|
||||||
card_exp_year: "2050",
|
card_exp_year: "2045",
|
||||||
card_holder_name: "morino",
|
card_holder_name: "morino",
|
||||||
card_cvc: "737",
|
card_cvc: "737",
|
||||||
};
|
};
|
||||||
|
|
||||||
// This card details will fail because of card expiryYear
|
// This card details will fail because of card expiryYear
|
||||||
const failedNo3DSCardDetails = {
|
const failedNo3DSCardDetails = {
|
||||||
card_number: "4242424242424242",
|
card_number: "4012001037461114",
|
||||||
card_exp_month: "01",
|
card_exp_month: "01",
|
||||||
card_exp_year: "35",
|
card_exp_year: "35",
|
||||||
card_holder_name: "joseph Doe",
|
card_holder_name: "joseph Doe",
|
||||||
card_cvc: "123",
|
card_cvc: "737",
|
||||||
};
|
};
|
||||||
|
|
||||||
const singleUseMandateData = {
|
const singleUseMandateData = {
|
||||||
@ -30,7 +30,7 @@ const singleUseMandateData = {
|
|||||||
mandate_type: {
|
mandate_type: {
|
||||||
single_use: {
|
single_use: {
|
||||||
amount: 8000,
|
amount: 8000,
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -40,7 +40,7 @@ const multiUseMandateData = {
|
|||||||
mandate_type: {
|
mandate_type: {
|
||||||
multi_use: {
|
multi_use: {
|
||||||
amount: 8000,
|
amount: 8000,
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -67,7 +67,7 @@ export const connectorDetails = {
|
|||||||
card_pm: {
|
card_pm: {
|
||||||
PaymentIntent: {
|
PaymentIntent: {
|
||||||
Request: {
|
Request: {
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
customer_acceptance: null,
|
customer_acceptance: null,
|
||||||
setup_future_usage: "on_session",
|
setup_future_usage: "on_session",
|
||||||
},
|
},
|
||||||
@ -79,13 +79,28 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
PaymentIntentOffSession: {
|
||||||
|
Request: {
|
||||||
|
amount: 6000,
|
||||||
|
authentication_type: "no_three_ds",
|
||||||
|
currency: "EUR",
|
||||||
|
customer_acceptance: null,
|
||||||
|
setup_future_usage: "off_session",
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_payment_method",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
No3DSAutoCapture: {
|
No3DSAutoCapture: {
|
||||||
Request: {
|
Request: {
|
||||||
payment_method: "card",
|
payment_method: "card",
|
||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulNo3DSCardDetails,
|
card: successfulNo3DSCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
customer_acceptance: null,
|
customer_acceptance: null,
|
||||||
setup_future_usage: "on_session",
|
setup_future_usage: "on_session",
|
||||||
},
|
},
|
||||||
@ -98,31 +113,62 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
No3DSManualCapture: {
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulNo3DSCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
customer_acceptance: null,
|
||||||
|
setup_future_usage: "on_session",
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_capture",
|
||||||
|
payment_method: "card",
|
||||||
|
attempt_count: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
"3DSAutoCapture": {
|
"3DSAutoCapture": {
|
||||||
Configs: {
|
|
||||||
TRIGGER_SKIP: true,
|
|
||||||
},
|
|
||||||
Request: {
|
Request: {
|
||||||
payment_method: "card",
|
payment_method: "card",
|
||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulNo3DSCardDetails,
|
card: successfulThreeDSTestCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
customer_acceptance: null,
|
customer_acceptance: null,
|
||||||
setup_future_usage: "on_session",
|
setup_future_usage: "on_session",
|
||||||
},
|
},
|
||||||
Response: {
|
Response: {
|
||||||
status: 200,
|
status: 200,
|
||||||
body: {
|
body: {
|
||||||
status: "succeeded",
|
status: "requires_customer_action",
|
||||||
payment_method: "card",
|
},
|
||||||
attempt_count: 1,
|
},
|
||||||
|
},
|
||||||
|
"3DSManualCapture": {
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulThreeDSTestCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
customer_acceptance: null,
|
||||||
|
setup_future_usage: "on_session",
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_customer_action",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
PaymentIntentWithShippingCost: {
|
PaymentIntentWithShippingCost: {
|
||||||
Request: {
|
Request: {
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
shipping_cost: 50,
|
shipping_cost: 50,
|
||||||
amount: 6000,
|
amount: 6000,
|
||||||
},
|
},
|
||||||
@ -139,7 +185,7 @@ export const connectorDetails = {
|
|||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulNo3DSCardDetails,
|
card: successfulNo3DSCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
customer_acceptance: null,
|
customer_acceptance: null,
|
||||||
setup_future_usage: "on_session",
|
setup_future_usage: "on_session",
|
||||||
},
|
},
|
||||||
@ -194,6 +240,17 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
PartialCapture: {
|
||||||
|
Request: {
|
||||||
|
amount_to_capture: 2000,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "partially_captured",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
manualPaymentRefund: {
|
manualPaymentRefund: {
|
||||||
Request: {
|
Request: {
|
||||||
amount: 6000,
|
amount: 6000,
|
||||||
@ -225,7 +282,7 @@ export const connectorDetails = {
|
|||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulThreeDSTestCardDetails,
|
card: successfulThreeDSTestCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
mandate_data: singleUseMandateData,
|
mandate_data: singleUseMandateData,
|
||||||
},
|
},
|
||||||
Response: {
|
Response: {
|
||||||
@ -235,6 +292,25 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MandateSingleUse3DSManualCapture: {
|
||||||
|
Configs: {
|
||||||
|
TRIGGER_SKIP: true,
|
||||||
|
},
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulThreeDSTestCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
mandate_data: singleUseMandateData,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_capture",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
MandateSingleUseNo3DSAutoCapture: {
|
MandateSingleUseNo3DSAutoCapture: {
|
||||||
Configs: {
|
Configs: {
|
||||||
TRIGGER_SKIP: true,
|
TRIGGER_SKIP: true,
|
||||||
@ -244,7 +320,7 @@ export const connectorDetails = {
|
|||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulNo3DSCardDetails,
|
card: successfulNo3DSCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
mandate_data: singleUseMandateData,
|
mandate_data: singleUseMandateData,
|
||||||
},
|
},
|
||||||
Response: {
|
Response: {
|
||||||
@ -254,7 +330,45 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MandateSingleUseNo3DSManualCapture: {
|
||||||
|
Configs: {
|
||||||
|
TRIGGER_SKIP: true,
|
||||||
|
},
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulNo3DSCardDetails,
|
||||||
|
},
|
||||||
|
currency: "USD",
|
||||||
|
mandate_data: singleUseMandateData,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_capture",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
MandateMultiUseNo3DSAutoCapture: {
|
MandateMultiUseNo3DSAutoCapture: {
|
||||||
|
Configs: {
|
||||||
|
TRIGGER_SKIP: true,
|
||||||
|
},
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulNo3DSCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
mandate_data: multiUseMandateData,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "succeeded",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MandateMultiUseNo3DSManualCapture: {
|
||||||
Configs: {
|
Configs: {
|
||||||
TRIGGER_SKIP: true,
|
TRIGGER_SKIP: true,
|
||||||
},
|
},
|
||||||
@ -269,7 +383,7 @@ export const connectorDetails = {
|
|||||||
Response: {
|
Response: {
|
||||||
status: 200,
|
status: 200,
|
||||||
body: {
|
body: {
|
||||||
status: "succeeded",
|
status: "requires_capture",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -282,7 +396,7 @@ export const connectorDetails = {
|
|||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulThreeDSTestCardDetails,
|
card: successfulThreeDSTestCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
mandate_data: multiUseMandateData,
|
mandate_data: multiUseMandateData,
|
||||||
},
|
},
|
||||||
Response: {
|
Response: {
|
||||||
@ -292,15 +406,38 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ZeroAuthMandate: {
|
MandateMultiUse3DSManualCapture: {
|
||||||
|
Configs: {
|
||||||
|
TRIGGER_SKIP: true,
|
||||||
|
},
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulThreeDSTestCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
mandate_data: multiUseMandateData,
|
||||||
|
},
|
||||||
Response: {
|
Response: {
|
||||||
status: 501,
|
status: 200,
|
||||||
body: {
|
body: {
|
||||||
error: {
|
status: "requires_capture",
|
||||||
type: "invalid_request",
|
},
|
||||||
message: "Setup Mandate flow for Aci is not implemented",
|
},
|
||||||
code: "IR_00",
|
},
|
||||||
},
|
ZeroAuthMandate: {
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulNo3DSCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
mandate_data: singleUseMandateData,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "succeeded",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -308,7 +445,7 @@ export const connectorDetails = {
|
|||||||
Request: {
|
Request: {
|
||||||
amount: 0,
|
amount: 0,
|
||||||
setup_future_usage: "off_session",
|
setup_future_usage: "off_session",
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
},
|
},
|
||||||
Response: {
|
Response: {
|
||||||
status: 200,
|
status: 200,
|
||||||
@ -328,13 +465,9 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Response: {
|
Response: {
|
||||||
status: 501,
|
status: 200,
|
||||||
body: {
|
body: {
|
||||||
error: {
|
status: "succeeded",
|
||||||
type: "invalid_request",
|
|
||||||
message: "Setup Mandate flow for Aci is not implemented",
|
|
||||||
code: "IR_00",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -344,7 +477,7 @@ export const connectorDetails = {
|
|||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulNo3DSCardDetails,
|
card: successfulNo3DSCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
setup_future_usage: "on_session",
|
setup_future_usage: "on_session",
|
||||||
customer_acceptance: customerAcceptance,
|
customer_acceptance: customerAcceptance,
|
||||||
},
|
},
|
||||||
@ -355,6 +488,23 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
SaveCardUseNo3DSManualCapture: {
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulNo3DSCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
setup_future_usage: "on_session",
|
||||||
|
customer_acceptance: customerAcceptance,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_capture",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
SaveCardUseNo3DSAutoCaptureOffSession: {
|
SaveCardUseNo3DSAutoCaptureOffSession: {
|
||||||
Configs: {
|
Configs: {
|
||||||
TRIGGER_SKIP: true,
|
TRIGGER_SKIP: true,
|
||||||
@ -375,6 +525,25 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
SaveCardUseNo3DSManualCaptureOffSession: {
|
||||||
|
Configs: {
|
||||||
|
TRIGGER_SKIP: true,
|
||||||
|
},
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulNo3DSCardDetails,
|
||||||
|
},
|
||||||
|
setup_future_usage: "off_session",
|
||||||
|
customer_acceptance: customerAcceptance,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_capture",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
SaveCardUse3DSAutoCaptureOffSession: {
|
SaveCardUse3DSAutoCaptureOffSession: {
|
||||||
Configs: {
|
Configs: {
|
||||||
TRIGGER_SKIP: true,
|
TRIGGER_SKIP: true,
|
||||||
@ -407,15 +576,12 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
PaymentMethodIdMandateNo3DSAutoCapture: {
|
PaymentMethodIdMandateNo3DSAutoCapture: {
|
||||||
Configs: {
|
|
||||||
TRIGGER_SKIP: true,
|
|
||||||
},
|
|
||||||
Request: {
|
Request: {
|
||||||
payment_method: "card",
|
payment_method: "card",
|
||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulNo3DSCardDetails,
|
card: successfulNo3DSCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
mandate_data: null,
|
mandate_data: null,
|
||||||
customer_acceptance: customerAcceptance,
|
customer_acceptance: customerAcceptance,
|
||||||
},
|
},
|
||||||
@ -426,20 +592,74 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
PaymentMethodIdMandate3DSAutoCapture: {
|
PaymentMethodIdMandateNo3DSManualCapture: {
|
||||||
Configs: {
|
Request: {
|
||||||
TRIGGER_SKIP: true,
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulNo3DSCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
mandate_data: null,
|
||||||
|
customer_acceptance: customerAcceptance,
|
||||||
},
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_capture",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
PaymentMethodIdMandate3DSAutoCapture: {
|
||||||
Request: {
|
Request: {
|
||||||
payment_method: "card",
|
payment_method: "card",
|
||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
card: successfulThreeDSTestCardDetails,
|
card: successfulThreeDSTestCardDetails,
|
||||||
},
|
},
|
||||||
currency: "USD",
|
currency: "EUR",
|
||||||
mandate_data: null,
|
mandate_data: null,
|
||||||
authentication_type: "three_ds",
|
authentication_type: "three_ds",
|
||||||
customer_acceptance: customerAcceptance,
|
customer_acceptance: customerAcceptance,
|
||||||
},
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_customer_action",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
PaymentMethodIdMandate3DSManualCapture: {
|
||||||
|
Request: {
|
||||||
|
payment_method: "card",
|
||||||
|
payment_method_data: {
|
||||||
|
card: successfulThreeDSTestCardDetails,
|
||||||
|
},
|
||||||
|
currency: "EUR",
|
||||||
|
mandate_data: null,
|
||||||
|
authentication_type: "three_ds",
|
||||||
|
customer_acceptance: customerAcceptance,
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_customer_action",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MITManualCapture: {
|
||||||
|
Request: {
|
||||||
|
currency: "EUR",
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
status: "requires_capture",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MITAutoCapture: {
|
||||||
|
Request: {
|
||||||
|
currency: "EUR",
|
||||||
|
},
|
||||||
Response: {
|
Response: {
|
||||||
status: 200,
|
status: 200,
|
||||||
body: {
|
body: {
|
||||||
@ -448,6 +668,9 @@ export const connectorDetails = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
No3DSFailPayment: {
|
No3DSFailPayment: {
|
||||||
|
Configs: {
|
||||||
|
TRIGGER_SKIP: true,
|
||||||
|
},
|
||||||
Request: {
|
Request: {
|
||||||
payment_method: "card",
|
payment_method: "card",
|
||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
@ -460,9 +683,8 @@ export const connectorDetails = {
|
|||||||
status: 200,
|
status: 200,
|
||||||
body: {
|
body: {
|
||||||
status: "failed",
|
status: "failed",
|
||||||
error_code: "200.300.404",
|
error_code: "100.390.112",
|
||||||
error_message:
|
error_message: "Technical Error in 3D system",
|
||||||
"Field is card.expiryYear and the message is must match ^[0-9]{4}$",
|
|
||||||
unified_code: "UE_9000",
|
unified_code: "UE_9000",
|
||||||
unified_message: "Something went wrong",
|
unified_message: "Something went wrong",
|
||||||
},
|
},
|
||||||
|
|||||||
@ -900,6 +900,18 @@ function threeDsRedirection(redirectionUrl, expectedUrl, connectorId) {
|
|||||||
connectorId,
|
connectorId,
|
||||||
({ connectorId, constants, expectedUrl }) => {
|
({ connectorId, constants, expectedUrl }) => {
|
||||||
switch (connectorId) {
|
switch (connectorId) {
|
||||||
|
case "aci":
|
||||||
|
cy.get('form[name="challengeForm"]', {
|
||||||
|
timeout: constants.WAIT_TIME,
|
||||||
|
})
|
||||||
|
.should("exist")
|
||||||
|
.then(() => {
|
||||||
|
cy.get("#outcomeSelect")
|
||||||
|
.select("Approve")
|
||||||
|
.should("have.value", "Y");
|
||||||
|
cy.get('button[type="submit"]').click();
|
||||||
|
});
|
||||||
|
break;
|
||||||
case "adyen":
|
case "adyen":
|
||||||
cy.get("iframe")
|
cy.get("iframe")
|
||||||
.its("0.contentDocument.body")
|
.its("0.contentDocument.body")
|
||||||
|
|||||||
Reference in New Issue
Block a user