-
Notifications
You must be signed in to change notification settings - Fork 13
Ensure that the order is not marked as 'On Hold' when saving the card fails after a successful payment. #427
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
base: trunk
Are you sure you want to change the base?
Conversation
…a successful charge.
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.
Pull request overview
This PR addresses an edge case in the Square payment gateway where orders were incorrectly marked as "On Hold" when payment succeeded but subsequent card tokenization failed. The fix adds a condition to skip the on-hold status update for tokenize_after_sale() scenarios, instead only adding an informational order note about the tokenization failure.
Key changes:
- Modified error handling in
maybe_tokenize()to excludetokenize_after_sale()cases from marking orders as on-hold - Added comprehensive documentation explaining the tokenization failure handling strategy
- Ensures successfully paid orders maintain their correct processing status even when card saving fails
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <[email protected]>
|
Note: E2E failure is known and already handled in other PR. |



All Submissions:
Changes proposed in this Pull Request:
This PR introduces changes to prevent the order from being marked as "On Hold" when the order amount is successfully charged but card tokenization fails on Square’s side. This situation occurs when a customer completes checkout with the "Save payment method" option selected.
Currently, the plugin marks the order as "On Hold" to draw the merchant’s attention to the card tokenization failure. This PR updates that behavior by skipping the order status update and instead only adding an order note to report the tokenization failure.
Note
For subscriptions, if card saving/tokenization fails, future renewal payments will fail because the card details are not stored. The customer will need to add or update the payment method for the subscription at that time.
Closes https://linear.app/a8c/issue/SQUARE-208/store-then-charge-cards
Steps to test the changes in this Pull Request:
This issue cannot be reproduced directly and must be simulated based on the steps provided below:
Changelog entry