Skip to content

Commit

Permalink
refactor(cypress): make amount configurable (#7219)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate authored Feb 12, 2025
1 parent b38a958 commit 055f628
Show file tree
Hide file tree
Showing 46 changed files with 596 additions and 1,176 deletions.
52 changes: 18 additions & 34 deletions cypress-tests/cypress/e2e/configs/Payment/Adyen.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const successfulThreeDSTestCardDetails = {
const failedNo3DSCardDetails = {
card_number: "4242424242424242",
card_exp_month: "01",
card_exp_year: "25",
card_exp_year: "35",
card_holder_name: "joseph Doe",
card_cvc: "123",
};
Expand Down Expand Up @@ -75,7 +75,7 @@ export const connectorDetails = {
},
PaymentIntentOffSession: {
Request: {
amount: 6500,
amount: 6000,
authentication_type: "no_three_ds",
currency: "USD",
customer_acceptance: null,
Expand All @@ -98,7 +98,7 @@ export const connectorDetails = {
body: {
status: "requires_payment_method",
shipping_cost: 50,
amount: 6500,
amount: 6000,
},
},
},
Expand All @@ -116,9 +116,9 @@ export const connectorDetails = {
body: {
status: "succeeded",
shipping_cost: 50,
amount_received: 6550,
amount: 6500,
net_amount: 6550,
amount_received: 6050,
amount: 6000,
net_amount: 6050,
},
},
},
Expand Down Expand Up @@ -212,32 +212,29 @@ export const connectorDetails = {
},
Capture: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount_to_capture: 6000,
},
Response: {
status: 200,
body: {
status: "processing",
amount: 6500,
amount_capturable: 6500,
amount: 6000,
amount_capturable: 6000,
amount_received: 0,
},
},
},

PartialCapture: {
Request: {},
Request: {
amount_to_capture: 2000,
},
Response: {
status: 200,
body: {
status: "processing",
amount: 6500,
amount_capturable: 6500,
amount: 6000,
amount_capturable: 6000,
amount_received: 0,
},
},
Expand All @@ -259,7 +256,7 @@ export const connectorDetails = {
}),
Refund: {
Request: {
currency: "USD",
amount: 6000,
},
Response: {
status: 200,
Expand All @@ -270,7 +267,7 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
currency: "USD",
amount: 2000,
},
Response: {
status: 200,
Expand All @@ -281,12 +278,7 @@ export const connectorDetails = {
},
manualPaymentRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount: 6000,
},
Response: {
status: 400,
Expand All @@ -302,12 +294,7 @@ export const connectorDetails = {
},
manualPaymentPartialRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount: 2000,
},
Response: {
status: 400,
Expand All @@ -322,9 +309,6 @@ export const connectorDetails = {
},
},
SyncRefund: {
Request: {
currency: "USD",
},
Response: {
status: 200,
body: {
Expand Down
65 changes: 17 additions & 48 deletions cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const connectorDetails = {
PaymentIntentOffSession: {
Request: {
currency: "USD",
amount: 6500,
amount: 6000,
authentication_type: "no_three_ds",
customer_acceptance: null,
setup_future_usage: "off_session",
Expand All @@ -89,7 +89,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_payment_method",
amount: 6500,
amount: 6000,
shipping_cost: 50,
},
},
Expand All @@ -108,9 +108,9 @@ export const connectorDetails = {
body: {
status: "succeeded",
shipping_cost: 50,
amount_received: 6550,
amount: 6500,
net_amount: 6550,
amount_received: 6050,
amount: 6000,
net_amount: 6050,
},
},
},
Expand Down Expand Up @@ -172,32 +172,29 @@ export const connectorDetails = {
},
Capture: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount_to_capture: 6000,
},
Response: {
status: 200,
body: {
status: "succeeded",
amount: 6500,
amount: 6000,
amount_capturable: 0,
amount_received: 6500,
amount_received: 6000,
},
},
},
PartialCapture: {
Request: {},
Request: {
amount_to_capture: 2000,
},
Response: {
status: 200,
body: {
status: "partially_captured",
amount: 6500,
amount: 6000,
amount_capturable: 0,
amount_received: 100,
amount_received: 2000,
},
},
},
Expand All @@ -212,12 +209,7 @@ export const connectorDetails = {
},
Refund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount: 6000,
},
Response: {
status: 200,
Expand All @@ -229,12 +221,7 @@ export const connectorDetails = {

PartialRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount: 2000,
},
Response: {
status: 200,
Expand All @@ -245,12 +232,7 @@ export const connectorDetails = {
},
manualPaymentRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount: 6000,
},
Response: {
status: 200,
Expand All @@ -261,12 +243,7 @@ export const connectorDetails = {
},
manualPaymentPartialRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
amount: 2000,
},
Response: {
status: 200,
Expand All @@ -276,14 +253,6 @@ export const connectorDetails = {
},
},
SyncRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
customer_acceptance: null,
},
Response: {
status: 200,
body: {
Expand Down
Loading

0 comments on commit 055f628

Please sign in to comment.