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

feat(cypress): add multiple creds and flags support #6588

Open
wants to merge 89 commits into
base: main
Choose a base branch
from

Conversation

pixincreate
Copy link
Member

@pixincreate pixincreate commented Nov 17, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR introduces 2 new features:

  • Multiple credentials for a connector
  • Configuration flags

closes #6645 (check this issue for detailed documentation / flow / explanation)

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

  • We need to run tests against multiple connector api keys for a single connector
  • We also need configuration flag support to selectively grant a test certain features / options

How did you test it?

Only Cybersource with multiple creds (takes only from first connector_1):

image

Cybersource with multiple creds (along with incremental auth):

image

(incremental auth fails from the connector's end and hence 4 failures)

Stripe:

image

Wise:

image

PML:

image

have disabled incremental auth from executing:

image

trustpay refunds (multiple creds):

image

i commented iDEAL redirections to check, error is being thrown from connector's end and there's nothing much i can do:

image image image

Checklist

  • I formatted the code prettier . --write
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

Copy link

semanticdiff-com bot commented Nov 17, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  cypress-tests/cypress/e2e/PaymentUtils/Elavon.js  100% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js  100% smaller
  cypress-tests/cypress/fixtures/create-ntid-mit.json  100% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Commons.js  88% smaller
  cypress-tests/cypress/e2e/PaymentTest/00021-UPI.cy.js  67% smaller
  cypress-tests/cypress/e2e/PaymentTest/00009-RefundPayment.cy.js  63% smaller
  cypress-tests/cypress/e2e/PaymentTest/00007-VoidPayment.cy.js  60% smaller
  cypress-tests/cypress/e2e/PaymentTest/00022-Variations.cy.js  59% smaller
  cypress-tests/cypress/support/commands.js  58% smaller
  cypress-tests/cypress/e2e/PaymentTest/00004-NoThreeDSAutoCapture.cy.js  56% smaller
  cypress-tests/cypress/e2e/PaymentTest/00023-PaymentMethods.cy.js  54% smaller
  cypress-tests/cypress/e2e/PaymentTest/00024-ConnectorAgnostic.cy.js  54% smaller
  cypress-tests/cypress/e2e/RoutingTest/00003-Retries.cy.js  53% smaller
  cypress-tests/cypress/e2e/RoutingTest/00002-RuleBasedRouting.cy.js  50% smaller
  cypress-tests/cypress/e2e/RoutingTest/00000-PriorityRouting.cy.js  49% smaller
  cypress-tests/cypress/e2e/PaymentTest/00006-NoThreeDSManualCapture.cy.js  49% smaller
  cypress-tests/cypress/e2e/PaymentTest/00014-SaveCardFlow.cy.js  48% smaller
  cypress-tests/cypress/e2e/PaymentTest/00015-ZeroAuthMandate.cy.js  48% smaller
  cypress-tests/cypress/e2e/PaymentTest/00010-SyncRefund.cy.js  47% smaller
  cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js  46% smaller
  cypress-tests/cypress/e2e/PaymentTest/00013-ListAndRevokeMandate.cy.js  46% smaller
  cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js  46% smaller
  cypress-tests/cypress/e2e/RoutingTest/00001-VolumeBasedRouting.cy.js  45% smaller
  cypress-tests/cypress/e2e/PaymentTest/00012-CreateMultiuseMandate.cy.js  44% smaller
  cypress-tests/cypress/e2e/PaymentTest/00011-CreateSingleuseMandate.cy.js  44% smaller
  cypress-tests/cypress/e2e/PaymentTest/00008-SyncPayment.cy.js  43% smaller
  cypress-tests/cypress/e2e/PaymentTest/00016-ThreeDSManualCapture.cy.js  42% smaller
  cypress-tests/cypress/e2e/PaymentTest/00005-ThreeDSAutoCapture.cy.js  40% smaller
  cypress-tests/cypress/e2e/PaymentTest/00019-MandatesUsingPMID.cy.js  40% smaller
  cypress-tests/cypress/e2e/PaymentTest/00020-MandatesUsingNTID.cy.js  36% smaller
  cypress-tests/cypress/e2e/PaymentTest/00017-BankTransfers.cy.js  32% smaller
  cypress-tests/cypress/e2e/PayoutTest/00005-SavePayout.cy.js  30% smaller
  cypress-tests/cypress/e2e/RoutingUtils/Utils.js  30% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Utils.js  27% smaller
  cypress-tests/cypress/e2e/PaymentTest/00018-BankRedirect.cy.js  25% smaller
  cypress-tests/cypress.config.js  21% smaller
  cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js  20% smaller
  cypress-tests/package.json  16% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Paybox.js  13% smaller
  cypress-tests/package-lock.json  13% smaller
  cypress-tests/cypress/support/redirectionHandler.js  11% smaller
  cypress-tests/cypress/e2e/PayoutUtils/Utils.js  6% smaller
  cypress-tests/cypress/e2e/PayoutTest/00004-BankTransfer.cy.js  2% smaller
  .github/workflows/cypress-tests-runner.yml Unsupported file format
  cypress-tests/.gitignore Unsupported file format
  cypress-tests/.prettierrc Unsupported file format
  cypress-tests/.prettierrc.json  0% smaller
  cypress-tests/cypress.env.json  0% smaller
  cypress-tests/cypress/e2e/PaymentMethodListUtils/Commons.js  0% smaller
  cypress-tests/cypress/e2e/PaymentMethodListUtils/Stripe.js  0% smaller
  cypress-tests/cypress/e2e/PaymentMethodListUtils/Utils.js  0% smaller
  cypress-tests/cypress/e2e/PaymentTest/00001-AccountCreate.cy.js  0% smaller
  cypress-tests/cypress/e2e/PaymentTest/00003-ConnectorCreate.cy.js  0% smaller
  cypress-tests/cypress/e2e/PaymentTest/00025-ConfigTest.cy.js  0% smaller
  cypress-tests/cypress/e2e/PaymentTest/00026-IncrementalAuth.cy.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Nexixpay.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Nmi.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Noon.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Paypal.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js  0% smaller
  cypress-tests/cypress/e2e/PaymentUtils/WellsFargo.js  0% smaller
  cypress-tests/cypress/e2e/PayoutUtils/Commons.js  0% smaller
  cypress-tests/cypress/e2e/RoutingUtils/Commons.js  0% smaller
  cypress-tests/cypress/utils/featureFlags.js  0% smaller
  cypress-tests/eslint.config.js  0% smaller

@pixincreate pixincreate self-assigned this Nov 17, 2024
@pixincreate pixincreate added A-CI-CD Area: Continuous Integration/Deployment C-feature Category: Feature request or enhancement labels Nov 17, 2024
@pixincreate pixincreate added this to the November 2024 Release milestone Nov 22, 2024
@pixincreate pixincreate marked this pull request as ready for review November 22, 2024 17:38
@pixincreate pixincreate requested a review from a team as a code owner November 22, 2024 17:38
@pixincreate pixincreate force-pushed the multiple-cred-cypress branch 2 times, most recently from d061ad6 to 22feccb Compare November 25, 2024 15:37
pixincreate and others added 5 commits December 2, 2024 14:34
this is a huge change! this will make it possible for us to select
connector based on the need. say, trustpay refunds only work on a
specific connector credential, pass the spec name, done.
…ed-cypress

* 'main' of github.com:juspay/hyperswitch:
  feat(payment_methods_v2): implement a barebones version of list customer payment methods v2 (#6649)
  ci: update ntid card expiry (#6714)
  chore(version): 2024.12.02.1
  fix(openapi): Revert Standardise API naming scheme for V2 Dashboard Changes (#6712)
jagan-jaya
jagan-jaya previously approved these changes Dec 2, 2024
SanchithHegde
SanchithHegde previously approved these changes Dec 2, 2024
jagan-jaya
jagan-jaya previously approved these changes Dec 2, 2024
});

it("retrieve-payment-call-test", () => {
cy.retrievePaymentCallTest(globalState);
const data = getConnectorDetails(globalState.get("connectorId"))[
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the need of this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

glad you asked. data exist only to fetch the Configs and nothing else. in the support/commands.js (image attached below), we're extracting Configs from data. this is done specifically keeping CONNECTOR_CREDENTIAL in mind so that we can pass mca_id directly which is used in verification (assertion check).

image

the entire field can be removed if we stop doing mca_id check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we not verifying the payment status ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. remove this mca_id check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI-CD Area: Continuous Integration/Deployment C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Multiple credential support for a connector in Cypress
4 participants