-
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
RPP - Connect the duplicate payment prevention service (Verification) #7450
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.43 MB ℹ️ View Unchanged
|
Ref p1697184565184799/1697109799.887649-slack-C05997J5PCG
27d5539
to
e519d52
Compare
I am going to add tests as well as fix Psalm errors. But it's ready to continue having more reviews. @RadoslavGeorgiev @Automattic/gamma @marcinbot |
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.
Great work, @htdat! 👏
I essentially only have nitpicks about some spaces here and there, but code-wise this looks great. I'm about to start testing, but wanted to share those first.
Question: Should we call remove_session_processing_order
when transitioning from ProcessedState
to CompletedState
?
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.
A couple of comments regarding tests.
tests/unit/src/Internal/Service/DuplicatePaymentPreventionServiceTest.php
Outdated
Show resolved
Hide resolved
tests/unit/src/Internal/Service/DuplicatePaymentPreventionServiceTest.php
Show resolved
Hide resolved
@RadoslavGeorgiev - thanks for your detailed review. I've addressed all your feedback and resolved most conversations, and keep open for two conversations that you might have other feedback. |
For test_clean_up_when_detecting_duplicate_order
…e to CompletedState
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.
Excellent work, @htdat!
Thank you for addressing my comments! I went through manual tests as well, and everything worked like a charm.
Fixes #7411
Changes proposed in this Pull Request
DuplicatePaymentPreventionService
class insrc
and keep most of logics from the legacy one.src
service.DuplicateOrderDetectedState
when a duplicate order is detected.Intent_Status::AUTHORIZED_STATUSES
andis_authorized()
for intent abstraction.SessionService
insrc
with the purpose of easily handling session data (sometimes, it's null while other times, it's really the expected instance ofWC_Session
). This will also be useful when other features will use it, such as Fraud relevant features.src
files.Testing instructions
At this stage, we can only test for:
Ensure that you're using the latest versions of Dev Tools and enable New Payment Process Factors.
Ideally, add Xdebug breakpoints in the new code in InitialState.php and the new service php file to confirm new code really executed.
For testing duplicate orders
Basically, follow test instruction and result of this PR #5247 with a note:
For testing duplicate payments
Basically, follow test instruction and result of this PR #5346 with a note:
Remaining TODO(s) for this PR:
N/A
Finished TODOs for this PR
Logger
as dependency per RPP / Housekeeping / Logger #7428check_payment_intent_attached_to_order_succeeded
andcheck_against_session_processing_order
#6712npm 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