-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(core): Constraint Graph for Payment Methods List #5081
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
prajjwalkumar17
added
A-constraint-graph
Area: Constraint Graph
A-core
Area: Core flows
labels
Jun 26, 2024
…methods in case of connector found in configs
pixincreate
reviewed
Jul 4, 2024
Comment on lines
1
to
4
import apiKeyCreateBody from "../../fixtures/create-api-key-body.json"; | ||
import createConnectorBody from "../../fixtures/create-connector-body.json"; | ||
import getConnectorDetails from "../PaymentMethodListUtils/utils"; | ||
import merchantCreateBody from "../../fixtures/merchant-create-body.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it is better to until #5180 is merged as it helps reduce complexities.
...tests/cypress/e2e/PaymentMethodListTest/00004-PaymentMethodListNoConfigCurrencyCountry.cy.js
Outdated
Show resolved
Hide resolved
cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListConfigCurrency.cy.js
Outdated
Show resolved
Hide resolved
vspecky
approved these changes
Jul 8, 2024
Raise a seperate PR for minor refactors discussed, rest LGTM! |
Sakilmostak
approved these changes
Jul 8, 2024
Gnanasundari24
approved these changes
Jul 9, 2024
Gnanasundari24
approved these changes
Jul 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Adds CGraphing for Merchant Pms with all the possible filters applicable as described below.
Testing Scenarios
Cypress Tests
Addressed in this PR:
1 Creation of Constraint Graph for Merchant Payment Method List:
Created a Constraint Graph with the following filters/Nodes:
From configs and MCA:
From Req:
After Applying all these Filters and creating a Graph for a Merchant MCA with 2 PMT enabled (Credit and Debit) with one connector(Cybersource), We will get a graph equivalent to this
Henceforth, we will verify the constraints by constructing Context from our PaymentIntent and PaymentAttempt.
PM List for Merchant curl:
2 Moka Caching of Pm Filter Graph:
We have even implemented Moka(In memory) Cashing mechanism for our CGraph to minimize the latency. So for every request first the cache value will be checked if present, derived and used else CGraph will be constructed and the cache will be refreshed.
Additional Changes
Motivation and Context
How did you test it?
Testing requires creation/refactoring of our configs:
The configs followed are as follows:-
Flow followed
Request 1: mca create request (Cybersource)
Request 2: mca create request (Stripe)
Request 3: Payment Create Request (with
capture_method = manual
)Request 4: List Merchant Payment Methods
Response
Google pay won't come as we have added in configs allowed country as CN
Payment Type Card(Credit) also won't come as the configs for credit has
not_available_flows = manual
Bug Resolution Testcase
Config of Adyen
MCA(Adyen) creation without allowed_currencies/countries
List PM Response
Card shouldn't include credit as we have changed the allowed country as IQ(Iraq) but the intent created is from USA.
AfterPayClearPay shouldn't be present as well, as it is only for GBP currency in our case we have USD.
Checklist
cargo +nightly fmt --all
cargo clippy