-
Notifications
You must be signed in to change notification settings - Fork 69
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
Revert route validation #9009
Revert route validation #9009
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
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.
Looks good @brucealdridge 🌟
I've tested the following on a live (non-local) site in test mode against production WCPay-server.
- Charge authorization & capture
- View charge
- View, update (challenged) and close (accept) dispute.
- Note: I have not tested against a
du_
dispute ID – unsure how to generate one of these - Looking at the code, however, this PR should fix the issue.
- Note: I have not tested against a
- Get file, content, and detail (Upload and view logo in card reader receipt settings)
- View fraud detail (blocked payment transaction details)
- In person payments
- Charge timeline
This reverts commit bbdbafb.
6d96965
to
56f080e
Compare
This PR reverts #8901 which introduced stricter REST route validation of unique object IDs. Restoring the validation of these URLs to the state in WooPayments 7.7.0. The original PR increased validation with stricter object ID's checking moving from `\w+` to `[A-Za-z0-9]+` regex. Charges and disputes also had specific prefixes required `(ch|py|pi)_` and `(dispute|dp)_`. After the release of WooPayments 7.8.0 reports came in that confirmed dispute objects can also have a prefix of `du_`. Due to the original PR, these disputes were unable to viewed or responded to. As per [Stripe docs](https://docs.stripe.com/upgrades#what-changes-does-stripe-consider-to-be-backwards-compatible), changing ID prefixes is considered backwards compatible: > Stripe considers the following changes to be backwards-compatible: > Changing the length or format of opaque strings, such as object IDs, error messages, and other human-readable strings. > This includes adding or removing fixed prefixes (such as ch_ on charge IDs).⚠️
Fixes #9008
Changes proposed in this Pull Request
This PR reverts #8901 which introduced stricter REST route validation of unique object IDs. Restoring the validation of these URLs to the state in WooPayments 7.7.0.
The original PR increased validation with stricter object ID's checking moving from
\w+
to[A-Za-z0-9]+
regex.Charges and disputes also had specific prefixes required
(ch|py|pi)_
and(dispute|dp)_
.After the release of WooPayments 7.8.0 reports came in that confirmed dispute objects can also have a prefix of
du_
. Due to the original PR, these disputes were unable to viewed or responded to.As per Stripe docs, changing ID prefixes is considered backwards compatible:
Testing instructions
Test the various routes that are affected by this PR.
NB: As the validation state is reverting to a known working state in WooPayments 7.7, not all of these scenarios need to be tested.
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge