Repository navigation
Fix the PayPal payment page findings: cancelled wallet attempts and 3D Secure card captures - #828
Merged
mpysiak merged 3 commits intoOct 19, 2026
Conversation
mpysiak
approved these changes
Oct 19, 2026
This file contains hidden or 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.
Fixes for the QA observations on the payment page after Payment Requests refactor. When a buyer closes the PayPal window, the shop now shows a message and makes no needless PayPal calls. The shop also no longer skips the capture of a card paid with 3D Secure. Checking that last case turned up a regression in the first commit, fixed here in the third.
What changes
PaymentCaptureProcessorused to patch the order (amount, shipping address) and try the capture without checking the order first. Each attempt the buyer left unapproved cost two PATCH calls, a 422ORDER_NOT_APPROVEDcapture and apaypal.ERRORlog entry before the follow-up read cancelled it. The processor now reads the order first and patches and captures it only when it can be captured. Any other order goes to the handler as read. The 422 issues it already accepted are still accepted, in case the order changes between the read and the capture. A successful capture now costs one extra read.CREATEDafter 3D Secure is captured. After a successful 3D Secure authentication (Y/Y/POSSIBLE), PayPal leaves a card-fields order inCREATED, notAPPROVED. ACREATEDorder now blocks the capture only for payment sources the buyer approves in the PayPal window (PayPal, Pay Later, Venmo), where that status means the attempt was abandoned. Card and wallet orders leftCREATEDare captured.onCancelonly unlocked the button, so the buyer stayed on an unchanged page. The create-order endpoint now also returns acancel_url: the attempt's pay URL withpayer_cancelled, as the bank redirect already uses. On cancel, the wallet buttons go to that URL. The capture reads the unapproved order, cancels the attempt and sends the buyer back to a fresh payment page with "PayPal payment has been cancelled".