Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(cypress): Fiuu connector configuration changes #7297

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
59ded4c
refactor(cypress): add payment confirmation response with shipping co…
arindam-sahoo Feb 18, 2025
0f17afb
refactor(cypress): update refund response status for Fiuu connector
arindam-sahoo Feb 19, 2025
76f1156
chore(cypress): run formatter and address lints
hyperswitch-bot[bot] Feb 19, 2025
5eda0e5
refactor(cypress): add billing email to payment method data and remov…
arindam-sahoo Feb 19, 2025
82bf281
Merge branch 'fiuu-cypress-fixes' of github.com:juspay/hyperswitch in…
arindam-sahoo Feb 19, 2025
7f81dbe
refactor(cypress): update billing email for Save Card No3DS Flows
arindam-sahoo Feb 19, 2025
37867e8
refactor(cypress): update billing email for Save Card No3DS Flows
arindam-sahoo Feb 19, 2025
0c9888c
Merge branch 'fiuu-cypress-fixes' of github.com:juspay/hyperswitch in…
arindam-sahoo Feb 19, 2025
323b324
refactor(cypress): update Refund request and response structure in Fi…
arindam-sahoo Feb 19, 2025
b3f6b71
refactor(cypress): clean up Refund request structure in Fiuu.js
arindam-sahoo Feb 19, 2025
a742749
chore(cypress): run formatter and address lints
hyperswitch-bot[bot] Feb 19, 2025
0bef3bf
refactor(cypress): add ZeroAuthMandate request and response configs
arindam-sahoo Feb 19, 2025
902594e
Merge branch 'fiuu-cypress-fixes' of github.com:juspay/hyperswitch in…
arindam-sahoo Feb 19, 2025
ec4b39a
refactor(cypress): update Fiuu.js to handle failed currency validatio…
arindam-sahoo Feb 19, 2025
bdabf1a
refactor(cypress): add ZeroAuthPaymentIntent and ZeroAuthConfirmPayme…
arindam-sahoo Feb 19, 2025
5083f92
refactor(cypress): remove 'fiuu' from payment modifiers exception
arindam-sahoo Feb 20, 2025
eae7f74
refactor(cypress): remove status 200 from failed currency validation …
arindam-sahoo Feb 20, 2025
71c3fa9
refactor(cypress): update connector_transaction_id validation for fai…
arindam-sahoo Feb 20, 2025
3576e72
chore(cypress): run formatter and address lints
hyperswitch-bot[bot] Feb 20, 2025
a39b59c
refactor(cypress): update response status to 400 for failed currency …
arindam-sahoo Feb 24, 2025
ad6afdc
Merge branch 'fiuu-cypress-fixes' of github.com:juspay/hyperswitch in…
arindam-sahoo Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 88 additions & 6 deletions cypress-tests/cypress/e2e/configs/Payment/Fiuu.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const connectorDetails = {
amount_to_capture: 6000,
},
Response: {
status: 200,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove status code check ?

status: 400,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the status code is 400 , how are you expecting succeeded status below response

body: {
status: "succeeded",
amount: 6000,
Expand Down Expand Up @@ -172,7 +172,6 @@ export const connectorDetails = {
amount: 6000,
},
Response: {
status: 200,
body: {
status: "pending",
},
Expand Down Expand Up @@ -234,6 +233,9 @@ export const connectorDetails = {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
email: "[email protected]",
Copy link
Contributor Author

@arindam-sahoo arindam-sahoo Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the billing.email, the following Response Body was yielded

{
  "error": { 
    "code": "IR_04",
    "message": "Missing required param: payment_method_data.billing.email",
    "type": "invalid_request"
  }
}

},
},
currency: "USD",
mandate_data: singleUseMandateData,
Expand All @@ -250,6 +252,9 @@ export const connectorDetails = {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
email: "[email protected]",
},
},
currency: "USD",
mandate_data: singleUseMandateData,
Expand Down Expand Up @@ -296,6 +301,9 @@ export const connectorDetails = {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
email: "[email protected]",
},
},
currency: "USD",
mandate_data: multiUseMandateData,
Expand Down Expand Up @@ -342,7 +350,7 @@ export const connectorDetails = {
MITAutoCapture: {
Request: {},
Response: {
status: 200,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

status: 400,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even here it will be 200 status code right ?

body: {
status: "failed",
error_code: "The currency not allow for the RecordType",
Expand Down Expand Up @@ -569,9 +577,10 @@ export const connectorDetails = {
setup_future_usage: "off_session",
},
Response: {
status: 200,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

status: 400,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here ?

body: {
status: "succeeded",
status: "failed",
error_message: "The currency not allow for the RecordType",
},
},
},
Expand All @@ -582,7 +591,8 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
status: "requires_capture",
status: "failed",
error_message: "The currency not allow for the RecordType",
},
},
},
Expand Down Expand Up @@ -701,5 +711,77 @@ export const connectorDetails = {
},
},
},
PaymentConfirmWithShippingCost: {
Response: {
status: 200,
body: {
status: "succeeded",
shipping_cost: 50,
amount_received: 6050,
amount: 6000,
net_amount: 6050,
},
},
},
ZeroAuthMandate: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
mandate_data: singleUseMandateData,
},
Response: {
status: 200,
body: {
status: "processing",
},
},
},
SaveCardConfirmAutoCaptureOffSessionWithoutBilling: {
Request: {
setup_future_usage: "off_session",
billing: null,
},
Response: {
status: 200,
body: {
status: "failed",
error_message: "The currency not allow for the RecordType",
},
},
},
ZeroAuthPaymentIntent: {
Request: {
amount: 0,
setup_future_usage: "off_session",
currency: "USD",
},
Response: {
status: 200,
body: {
status: "requires_payment_method",
setup_future_usage: "off_session",
},
},
},
ZeroAuthConfirmPayment: {
Request: {
payment_type: "setup_mandate",
payment_method: "card",
payment_method_type: "credit",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
},
Response: {
status: 200,
body: {
status: "processing",
setup_future_usage: "off_session",
},
},
},
},
};
1 change: 0 additions & 1 deletion cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function normalize(input) {
paybox: "Paybox",
paypal: "Paypal",
wellsfargo: "Wellsfargo",
fiuu: "Fiuu",
noon: "Noon",
// Add more known exceptions here
};
Expand Down
17 changes: 13 additions & 4 deletions cypress-tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -2725,10 +2725,19 @@ Cypress.Commands.add(
response.body.payment_method_id,
"payment_method_id"
).to.include("pm_").and.to.not.be.null;
expect(
response.body.connector_transaction_id,
"connector_transaction_id"
).to.not.be.null;

if (response.body.status === "failed") {
expect(
response.body.connector_transaction_id,
"connector_transaction_id"
).to.be.null;
} else {
expect(
response.body.connector_transaction_id,
"connector_transaction_id"
).to.not.be.null;
}

expect(
response.body.payment_method_status,
"payment_method_status"
Expand Down
Loading