Skip to content
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

Merged
merged 9 commits into from
Dec 16, 2024

Conversation

glaubersilva
Copy link
Contributor

@glaubersilva glaubersilva commented Dec 6, 2024

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

image

Testing Instructions

  1. Add the billing address block to a donation form;
  2. Leave some required address fields empty;
  3. Try to create a test donation using the PayPal Donations gateway;
  4. You should have the donation blocked and see some error messages next to the empty fields.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@glaubersilva glaubersilva self-assigned this Dec 6, 2024
@glaubersilva glaubersilva marked this pull request as ready for review December 9, 2024 13:54
Copy link
Member

@kjohnson kjohnson left a 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.

Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed QA tests

@glaubersilva glaubersilva merged commit e199944 into develop Dec 16, 2024
20 checks passed
@glaubersilva glaubersilva deleted the refactor/paypal-form-validations-GIVE-2043 branch December 16, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants