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

ci: add tests that make use of locker #6735

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

Conversation

pixincreate
Copy link
Member

@pixincreate pixincreate commented Dec 4, 2024

Type of Change

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

Description

This PR introduces necessary refactoring to add support for locker specific tests. This includes addition of delete payment method (which is restricted to work only on hosted environments and not local given tartarus is unavailable and is complicated to setup things) but not limited to:

  • fixes:
    • fix reports not being generated
    • fix multiple credential not picking proper api keys
  • refactoring:
    • move configs that makes use of response custom under getCustomExchange
  • misc:
    • clarify ntid files to make them meaningful
    • update dependencies
    • update cypress credential to support stripe multiple api keys
  • feat:
    • add multiple credential support for stripe
    • add ntid support for stripe with another api key
    • add recurring mit payment endpoint to ntid connector agnostic flows

Additional Changes

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

Motivation and Context

How did you test it?

delete payment method:

local hosted
image image
5xx is expected since this requires locker to be set up locally which is not optimal 2xx is expected since locker is already setup

ntid with mit based on payment token:

cybersource stripe
image image
adyen bluesnap cybersource stripe
image image image image
adyen ntid failure has been addressed in #6851. #6735 has been soft cherry-picked and the tests have been run against local stripe with multiple credential support (ntid)

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

@pixincreate pixincreate self-assigned this Dec 4, 2024
@pixincreate pixincreate added the A-CI-CD Area: Continuous Integration/Deployment label Dec 4, 2024
@pixincreate pixincreate added this to the December 2024 Release milestone Dec 4, 2024
@pixincreate pixincreate marked this pull request as ready for review December 4, 2024 08:40
@pixincreate pixincreate requested a review from a team as a code owner December 4, 2024 08:40
@likhinbopanna
Copy link
Contributor

Can you handle all the connectors for the connector agnostic change ?

@pixincreate
Copy link
Member Author

good catch. by the looks of it (re: stripe), this will require a bit of time and a bit of refactoring in mca create call since we're creating mca independently multiple times in connector agnostic.

@pixincreate
Copy link
Member Author

marking this pr as draft since there exist a lot of blockers when working with ntid flows

@pixincreate pixincreate marked this pull request as draft December 5, 2024 17:56
@pixincreate pixincreate marked this pull request as ready for review December 15, 2024 18:06
@pixincreate pixincreate changed the title ci: add locker specific missing tests ci: add locker tests Dec 16, 2024
@pixincreate pixincreate changed the title ci: add locker tests ci: add tests that make use of locker Dec 16, 2024
@pixincreate pixincreate requested a review from a team as a code owner December 16, 2024 10:24
MITAutoCapture: getCustomExchange({
Configs: {
CONNECTOR_CREDENTIAL: {
specName: ["connectorAgnostic"],
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 use of this specName: ["connectorAgnostic"] array?
when do you use this specName config, is there a way to make it intuitive and self explanatory?

Copy link
Member Author

@pixincreate pixincreate Dec 17, 2024

Choose a reason for hiding this comment

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

glad you asked!

we pass specName within Configs when we want to restrict a connector credential to a specific request / exchange.

in this case, connectorAgnostic file (00024) will have connector_2 passed in every MITAutoCapture call that is made. and in mandates, if used, connector_2 will not be passed and hence the default will be sent (connector_1).

edit:

i intentionally made it an array because it allows us to pass multiple files...

fixtures.businessProfile.bpCreate,
globalState,
"profile" + i
{ nextConnector: true }
Copy link
Contributor

Choose a reason for hiding this comment

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

This object makes only 2 creds to work right ?

Copy link
Member Author

@pixincreate pixincreate Dec 17, 2024

Choose a reason for hiding this comment

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

yes. keeping scalibility in mind, i've made it an object. so, once the need arrives, we can directly make it accept more credentials without much hassle as explained the other day

jagan-jaya
jagan-jaya previously approved these changes Dec 18, 2024
this is allow us to see the error message directly in the screenshot
without us manually running the test
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.12.18.0
  fix(payment_methods): card_network and card_scheme should be consistent (#6849)
  fix(core): Populate off_session based on payments request (#6855)
@pixincreate
Copy link
Member Author

pixincreate commented Dec 19, 2024

blocked until an issue with ntid is fixed where stripe is getting affected.

edit: fixed with #6899

@pixincreate pixincreate mentioned this pull request Dec 19, 2024
14 tasks
@pixincreate pixincreate added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Dec 19, 2024
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  refactor(dynamic_routing): add col payment_method_type in dynamic_routing_stats (#6853)
  refactor(customers_v2): include minor fixes for customer v2 flows (#6876)
  fix: cypress reports generation (#6894)
  fix(connector): Paypal BankRedirects (Ideal/EPS)  (#6864)
  chore(version): 2024.12.19.1
  fix(connector): [UNIFIED_AUTHENTICATION_SERVICE] change url path to `pre_authentication_processing` in pre-auth flow (#6885)
  refactor(users): move roles schema to global interface (#6862)
  feat(payment_methods): add support to pass apple pay recurring details to obtain apple pay merchant token (#6770)
  feat(payments): [Payment links] Add config for changing button text for payment links (#6860)
  feat(core): added customer phone_number and email to session token response for click to pay (#6863)
  FEAT(klarna): Klarna Kustom Checkout Integration (#6839)
  feat(users): handle email url for users in different tenancies (#6809)
  chore(version): 2024.12.19.0
  refactor(dynamic_routing): update the authentication for update config to include JWT type (#6785)
  chore(env): remove unified_authentication_service base_url from integ, sandbox and production toml (#6865)
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  fix(connector): Update mandate PMT configs for Mandate Supported Connectors (#6903)
  fix(connector): [STRIPE] fix stripe mandate (#6899)
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.12.23.0
  feat(connector): [JPMORGAN] add Payment flows for cards (#6668)
  refactor(grpc): send `x-tenant-id` and `x-request-id` in grpc headers (#6904)
  feat(payment_methods_v2): Added Ephemeral auth for v2 (#6813)
  chore(cypress): payout - fix test cases for adyenplatform bank (#6887)
  refactor(connector): [Airwallex] add device_data in payment request (#6881)
  feat(router): add db interface for `/relay` (#6879)
  feat(payments_v2): implement payments capture v2 (#6722)
  feat(router): add /relay endpoint (#6870)
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 S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants