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

Input returned by PayPal Checkout causes JSON error and causes conflicts. #876

Open
ryanr14 opened this issue Jul 6, 2021 · 0 comments
Open

Comments

@ryanr14
Copy link
Member

ryanr14 commented Jul 6, 2021

Describe the bug

Hi there, this comes from the WordPress.org forums for this plugin. I was curious what your thoughts would be for this.

WS optin nonce cause Paypal Checkout to fail.

I have an issue with the optin on the checkout page for Paypal only (Stripe works) where the hidden input field with a nonce added by Sendinblue causes the following error with Paypal checkout due to malformed Json. The response of the xhr call via Paypal indeed returns the following raw response:

<input type="hidden" class="ws_opt_in_nonce" name="ws_opt_in_nonce" value= "91eed72c0a"> {"success":true,"data":{"token":"EC-95612932HX675794C"}}

As you can see the input is returned by Paypal causing a malformed json error resulting the following error:

create_order_error {err: "SyntaxError: Unexpected token < in JSON at positio…bility,messages&commit=true&currency=EUR:2:128921", timestamp: "1625481094169", referer: "www.paypal.com", sdkCorrelationID: "a082f9f50c502", sessionID: "uid_1dd075158a_mta6mze6mdq", …}

This occurs despite the response returning “success”.

It has to do with the way form inputs are serialized by PayPal. Any ideas on how to fix? The plugin I am using is Sendinblue Marketing. It may be because the hidden field nonce is appended to the the top of the form.

To reproduce

  1. Install PayPal Checkout and Sendinblue plugin.
  2. Attempt to cheeckout
  3. See error
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

No branches or pull requests

1 participant