juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.63k stars 1.36k forks source link

5915 verify url fixed #6182

Closed Ankesh2004 closed 1 month ago

Ankesh2004 commented 1 month ago

Type of Change

Description

This PR refactors the verifyReturnUrl function to validate the redirection_url and ensure that the payment status is either succeeded or processing. If the status is invalid, the test will now fail, preventing false positives in redirection tests like 3DS or bank redirects.

Key Changes:

Additional Changes

Motivation and Context

This change improves the reliability of Cypress redirection tests by ensuring that the final redirection URL reflects a valid payment status, preventing false positives and ensuring tests behave as expected for flows like 3DS and bank redirects.

How did you test it?

Checklist

semanticdiff-com[bot] commented 1 month ago

Review changes with SemanticDiff.

Analyzed 2 of 2 files.

Overall, the semantic diff is 2% smaller than the GitHub diff.

Filename Status
:heavy_check_mark: cypress-tests/cypress/support/redirectionHandler.js Analyzed
:heavy_check_mark: cypress-tests/cypress/e2e/ConnectorTest/redirection_test.cy.js 1.85% smaller