-
Notifications
You must be signed in to change notification settings - Fork 192
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
Feature: add support to server validations for PayPal Donations gateway #7641
Feature: add support to server validations for PayPal Donations gateway #7641
Conversation
…om:impress-org/givewp into refactor/paypal-form-validations-GIVE-2043
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 find, @glaubersilva! Leveraging the validation endpoint used by the multi-step form is a good idea. Glad to see that we do not need to refactor shared PayPal code to resolve this issue.
There are a couple of non-blocking comments for you consideration.
src/DonationForms/resources/app/utilities/generateRequestErrors.ts
Outdated
Show resolved
Hide resolved
src/DonationForms/resources/app/utilities/generateRequestErrors.ts
Outdated
Show resolved
Hide resolved
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.
Passed QA tests
Resolves GIVE-2043
Description
This PR adds a request to validate the donation form on the server side when the donor clicks on the PayPal Donations smart buttons, this way we can prevent the creation of donations on the PayPal side if the form has some invalid data with custom validation rules that only can be triggered on the server side.
Also, it removes the work around implemented a while ago to validate the billing address block before creating the PayPal donation, this is not more necessary now that we have the validations being triggered on the server-side.
This change can potentially prevent any future problem related to validations not being triggered for the PayPal Donations gateway because now we can ensure that all validations on both sides (client and server) will always be triggered before the payment process.
Affects
The PayPal Donations gateway.
Visuals
Testing Instructions
Pre-review Checklist
@unreleased
tags included in DocBlocks