-
Notifications
You must be signed in to change notification settings - Fork 213
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: Use async pos payments main #2869
Open
pmzandbergen
wants to merge
4
commits into
Adyen:main
Choose a base branch
from
pmzandbergen:issue/2867-use-async-pos-payments-main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat: Use async pos payments main #2869
pmzandbergen
wants to merge
4
commits into
Adyen:main
from
pmzandbergen:issue/2867-use-async-pos-payments-main
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
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.
Description
Using an asynchronous call to initiate POS payment request, followed by synchronous status calls. Polls every ~2 seconds for the status until it's final.
Tested scenarios
a. Cancel payment, check result (OK)
b. Approve payment, check result (OK)
I've created functional tests for our PWA platform. Didn't test the Magento frontend. Since it's already checking for the "In Progress" string if the POS payment request fails, it should be working. Please add the necessary unit / functional tests if desired.
We could exchange the status requests for a request with a more reasonable timeout (e.g. 30 seconds) which gives a response as soon as the notification has been received by the webhook, or when it hits the timeout (in which case the client should retry). This would eliminate the 2 seconds delay and provide a quicker response. Since this requires more changes, I have left it at that for now.
Note: If I would have implemented the Adyen (POS) API directly in a custom module things would probably have been organized a bit different in order to create a more robust solution (see comments in the created issue).
Fixes #2867