Skip to content

Magento 2.2 Paypal Can't Accept Checkout Agreements Before Routing to PayPal #11885

Closed
@Silarn

Description

@Silarn

This could potentially be a module conflict, but after stepping through and inspecting the checkout code I can't find any obvious third-party interference.

When going through standard checkout and selecting PayPal Express at the payment step, there is an agreements checkbox present. However, checking this box does nothing as the agreements data is not parsed and passed to the set-payment-information API. This triggers the CheckoutAgreements validation plugin which fails to validate with no agreements data.

When I override the PayPal JS to add the agreements data to the paymentData before sending to the API, it passes validation but then fails because PayPal doesn't allow setting extension data.

The only way I was able to work around the problem was by overriding the validation classes and skipping validation when the method was PayPal Express.

I was not experiencing this issue on prior versions of Magento 2, nor does it make sense to have agreements here since you must accept them again during the review step.

Preconditions

  1. Magento 2.2 (maybe earlier?)
  2. PHP 7.0 or 7.1
  3. PayPal Express enabled in-checkout payment methods
  4. Checkout Agreements created and required

Steps to reproduce

  1. Attempt to check out with PayPal Express with the agreements box checked
    (It does not seem to matter whether or not in-context is enabled - though for in-context the flow is even worse as it opens the pop-up window and then fails the payment submission leaving the window open in a failed state.)

Expected result

  1. Proceed to PayPal Express checkout as normal

Actual result

  1. A validation error is returned whether or not the agreement box is checked (though the JS validation will fail without it anyway).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions