-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(router): include the pre-routing connectors in Apple Pay retries #4952
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
vspecky
previously approved these changes
Jun 13, 2024
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.
LGTM
Sarthak1799
reviewed
Jun 13, 2024
vspecky
approved these changes
Jun 13, 2024
Sarthak1799
approved these changes
Jun 13, 2024
pixincreate
added a commit
that referenced
this pull request
Jun 13, 2024
…outs * 'main' of github.com:juspay/hyperswitch: feat(router): include the pre-routing connectors in Apple Pay retries (#4952) fix(cypress): Add `jwt_token` and `cookie` for routing test (#4953) feat(connectors): [Iatapay] add payment methods (#4968) chore(version): 2024.06.13.0 feat(payouts): make payout_type optional in payouts table (#4954) feat(connector): [BOA/CYB] Make billTo fields optional (#4951) fix(core): fix the multitenancy prefix in routing cache (#4963) refactor(connector): [Mifinity]Move destination_account_number from pmd to Mifinity Metadata (#4962) refactor(payment_methods): Enable deletion of default Payment Methods (#4942)
ShankarSinghC
added a commit
that referenced
this pull request
Jun 14, 2024
14 tasks
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
Currently for apple pay pre-routing is done before the session call and only one connector is decided based on the routing logic. Now since we want to enable auto retries for apple pay we need to consider all the connectors form the routing rule and construct a list of it. After which this connectors should be filtered out with the connectors that supports apple pay simplified flow.
Once this is done there will be a list of connectors with which apple pay retries can we performed.
Additional Changes
Motivation and Context
How did you test it?
-> Create merchant account
-> Enable auto retries for the specific
merchant_id
-> Set the maximum retry counts for the auto retries enabled
merchant_id
-> Configure the error code and error message in the gsm
-> Create merchant connector accounts (enable apple pay simplified if you wish to retry the failed apple pay payment with it)
metadata for simplified flow
-> Configure the routing rules for the configured connectors
-> Create a apple pay payment with confirm false
-> List payment methods for merchant
-> Confirm the payment with
payment_id
-> Retrieve the payment with the
payment_id
.In the above response we can see that apple payment got failed with stripe and it was auto retried with adyen based on the configured routing rule.
-> The routing rule configured during test is as shown below
![image](https://private-user-images.githubusercontent.com/83439957/339049304-c7916e7f-f3f8-4529-b90c-aafc67de28a9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMxOTk1MTAsIm5iZiI6MTcyMzE5OTIxMCwicGF0aCI6Ii84MzQzOTk1Ny8zMzkwNDkzMDQtYzc5MTZlN2YtZjNmOC00NTI5LWI5MGMtYWFmYzY3ZGUyOGE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA5VDEwMjY1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc1NTc4MmZmNDczMTdkNDRiOGNmOTE4NmI3MDhlMDlhYzc2M2QyODkxNzIyYmI3ZDg1ZmY3Y2NhZmYyMjYxYzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.S4cDgj8SwM6ZoENaJyh82n4otwjfdRIWuqFkaTwiXKY)
-> Below is entry of the pre-routing in the payment attempt table
"apple_pay": [{"connector": "stripe", "merchant_c
onnector_id": "mca_eF7yV3fNcAZ2wmGlKORq"}, {"connector": "cybersource", "merchant_connector_id": "mca_YAgldl8pmWD7mlqKrPlj"}, {"connector": "adyen", "merchant_connector_id": "mca_rkYJzRw3mSpDnPr25huU"}, {"connector": "rapyd", "merchant_connector_id": "mca_Vjg1fbX8FKP2ywlU4kOq"}],
-> The order of apple pay retryable connector as below. As per the routing rules the stripe comes in the first of the list followed by adyen, as apple pay simplified flow is configured only for stripe and adyen.
![image](https://private-user-images.githubusercontent.com/83439957/339050631-220ebe4b-95f4-4dfa-ac9c-65202c399e96.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMxOTk1MTAsIm5iZiI6MTcyMzE5OTIxMCwicGF0aCI6Ii84MzQzOTk1Ny8zMzkwNTA2MzEtMjIwZWJlNGItOTVmNC00ZGZhLWFjOWMtNjUyMDJjMzk5ZTk2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA5VDEwMjY1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTczYzY0OTM3MWM5ZjhlMWQ5ZjRhMzNiYjY3OTNkNjAwY2YwNDJlMjY1YmE1NWEwMWRiOGY0MzQ0YzA2ZTJjZTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wL7HERNTujvFBTKMdMkDSCS1hvDr1DLY5H5aOEDVsNs)
Checklist
cargo +nightly fmt --all
cargo clippy