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

Add support for next gen form in PayPal Commerce payment gateway #6872

Conversation

ravinderk
Copy link
Collaborator

@ravinderk ravinderk commented Aug 15, 2023

Description

This pull request improves PayPal Donations compatibility with Next Gen donation forms.

List of improvements:

  • Move recurring donation-related code to recurring add-on https://github.com/impress-org/give-recurring/pull/1188
  • Add format data validation and error handling for smart buttons. The donation form validates when the donor clicks on the donate button but PayPal smart buttons have different payment flows. Donors can process the payment on the client site after that on the server we use donation or subscription ID to complete donations, for this reason, form validation checks do not trigger. We trigger format validation checks manually when the donor clicks on any PayPal smart button.
  • PayPal donations support two payment method smart buttons and hosted card fields. I implemented an admin setting to control the payment method display in the donation form (Feat: display Paypal payment method type as per admin setting #6835). I added logic to handle this.
  • Refactor code to use PayPalCommerceGateway as the main payment gateway class.
  • Implement 3D secure validation for hosted card fields.

Affects

This pull request affects donations processing with next-gen donation forms with PayPal donations.

Testing Instructions

Note:

  1. PayPal donations support recurring donations with hosted card fields only in v2 donation forms. You can process subscriptions with next-gen donation forms with PayPal smart buttons.
  2. Use this pull request for subscription testing: https://github.com/impress-org/give-recurring/pull/1188

Testing credit cards: https://developer.paypal.com/tools/sandbox/card-testing/

  • PayPal donations display in next-gen forms based on the Payment Field Type setting value
  • Donors should able to process one-time and recurring donations with next-gen donation forms
  • Donors should be able to cancel donations
  • PayPal donations should be compatible with v2 and next-gen donation forms.

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

@ravinderk ravinderk self-assigned this Aug 16, 2023
@ravinderk ravinderk force-pushed the feat/paypal-donation-add-support-visual-form-builder branch from e1cbbd3 to 539a0d8 Compare August 18, 2023 05:16
@ravinderk ravinderk changed the base branch from develop to epic/givewp-3.0 August 18, 2023 05:54
i find that if give_payment_mode is not send to server then fee recovery addon throw fatal error.
@ravinderk ravinderk marked this pull request as ready for review August 23, 2023 18:22
@ravinderk
Copy link
Collaborator Author

@JasonTheAdams I am working with @jonwaldstein on a known issue about scrolling to the error field or message: slack discussion

But I think you can continue to review.

@JasonTheAdams
Copy link
Contributor

JasonTheAdams commented Aug 23, 2023

@ravinderk Cool. I'd actually prefer @jonwaldstein to review this since he's more familiar with the existing PayPal Donations v3 integration.

@JasonTheAdams JasonTheAdams requested review from jonwaldstein and removed request for JasonTheAdams August 23, 2023 20:10
@ravinderk
Copy link
Collaborator Author

@jonwaldstein I added a few fixes to scroll to an invalid field and error message: d949003 2ab5ec8

@jonwaldstein
Copy link
Contributor

@ravinderk can you help me understand what these improvements to PayPal donation are? I have no idea what these updates are for. I might also need to call upon @kjohnson to help test this out because he added the initial v3 support for PayPal donations and is much more familiar with this particular gateway integration than me.

@ravinderk
Copy link
Collaborator Author

@ravinderk can you help me understand what these improvements to PayPal donation are? I have no idea what these updates are for. I might also need to call upon @kjohnson to help test this out because he added the initial v3 support for PayPal donations and is much more familiar with this particular gateway integration than me.

@jonwaldstein I added the list of improvements in the pull request description and requested a review from @kjohnson.

@ravinderk
Copy link
Collaborator Author

@kjohnson Pr is ready to review again

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.

@ravinderk thanks for making those changes. Let's get this to QA.

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 manual QA tests.

@JasonTheAdams JasonTheAdams merged commit 301f1a6 into epic/givewp-3.0 Sep 1, 2023
20 checks passed
@JasonTheAdams JasonTheAdams deleted the feat/paypal-donation-add-support-visual-form-builder branch September 1, 2023 16:33
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 manual QA tests.

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.

5 participants