Description
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
- Magento 2.2 (maybe earlier?)
- PHP 7.0 or 7.1
- PayPal Express enabled in-checkout payment methods
- Checkout Agreements created and required
Steps to reproduce
- 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
- Proceed to PayPal Express checkout as normal
Actual result
- A validation error is returned whether or not the agreement box is checked (though the JS validation will fail without it anyway).