JSON Error Unexpected Token Paypal Payments Pro
-
Hello,
I seem to be struggling with a similar error to many other users but I can’t find the particular fix for my issue.
I’m running WooCommerce 2.4.6 with Paypal for WooCommerce 1.1.6.3.7 and on the checkout page when I click ‘place order’ I’m getting an error of:
SyntaxError: JSON Parse error: Unrecognized token ‘<‘
I have read a potential fix is to stop WP from debugging but this doesn’t seem to have fixed the problem.
The website in question is https://www.specialistskincare.co.uk.
If I need to check the error log can you please tell me which error log this is i.e. the WooCommerce log?
Thank you
Chrishttps://www.ads-software.com/plugins/paypal-for-woocommerce/
-
The 3D Secure stuff comes from our plugin, not WooCommerce. So, unfortunately that won’t help.
I’m pretty sure the WooThemes PayPal Pro plugin they provide has a working 3DSecure, though. If you can’t wait you may just want to go that route.
Hi,
I am having the same issue, which I can see is a reported bug that you are in the process of fixing in the new version.
I wanted to ask if you have an estimated time for the new version to be released with the 3d secure bug fixed?
Many thanks
Laura
Hi Laura,
We’re hoping to get 1.2 released within a week or two, and then we’ll probably follow that up with a 1.2.1 that fixes this issue.
This issue has been resolved in the dev branch on GitHub. It will be included in the 1.2.0 release that is coming soon. If you’d like to grab it early you can download it here.
Hi @angelleye
I just installed the fix – it hasnt resolved my issue (same as OP’s, so assuming his issue isnt fixed either) – any update on when the new 1.2 will be released?
Thanks in advance.
We would need to see exactly what the error is, which you can find using Firebug. The adjustments we made resolved it in the themes where it was happening in our tests, so this must be something different.
Hi @angelleye
Here it is
<!DOCTYPE html> <html class=" yes-js js_active js" lang="en-US" xmlns:fb="https://ogp.me/ns/fb#" xmlns:og="https://ogp.me/ns#" prefix="og: https://ogp.me/ns#" data-useragent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0"> <head> <body class="page page-id-12 page-parent page-template-default logged-in admin-bar woocommerce-checkout woocommerce-page antialiased breadcrumb-normal full-width bg-full-size customize-support" style=""> <iframe id="q8ff45c7feb20cf205a204abc7002cc5aed6c382e-container" class="HB-Bar hb-animated hb-large hb-bar-top remains-in-place hellobar hb-animateIn" frameborder="0" src="about:blank" name="q8ff45c7feb20cf205a204abc7002cc5aed6c382e-container-0" style="display: inline; max-height: 58px;" scrolling="no"> <div id="hellobar-pusher" class="hb-large" style="height: 50px;"></div> <div id="wrapper" class="box-shadow"> <div class="header-wrapper before-sticky"> <div id="main-content" class="site-main hfeed light"> <div class="row"> <div class="page-wrapper page-checkout"> <div class="row"> <div id="content" class="large-12 columns" role="main"> <div class="checkout-breadcrumb"> <div class="woocommerce"> <div class="row"> <form class="checkout woocommerce-checkout" enctype="multipart/form-data" action="https://thefidgetfactory.com/checkout/" method="post" name="checkout" style="position: static;"> <div class="woocommerce-error">SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data</div> <div class="row"> </form> </div> </div> </div> </div> </div> <footer class="footer-wrapper" role="contentinfo"> </div> <a id="top-link" class="animated fadeInUp" href="#top"> <div id="jPanelMenu" class="mfp-hide"> <script> <script> <script src="https://thefidgetfactory.com/wp-includes/js/admin-bar.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/select2/select2.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/frontend/country-select.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/frontend/address-i18n.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/frontend/checkout.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/frontend/cart-fragments.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="https://thefidgetfactory.com/wp-content/plugins/yith-woocommerce-ajax-search/assets/js/yith-autocomplete.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="https://thefidgetfactory.com/wp-content/themes/flatsome/js/flatsome.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script type="text/javascript"> <script src="https://thefidgetfactory.com/wp-content/plugins/paypal-for-woocommerce/assets/js/angelleye-frontend.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="https://thefidgetfactory.com/wp-content/plugins/popover/js/public.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="https://thefidgetfactory.com/wp-includes/js/wp-embed.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="https://thefidgetfactory.com/wp-content/plugins/yith-woocommerce-ajax-search/assets/js/devbridge-jquery-autocomplete.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/jquery-payment/jquery.payment.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script src="//thefidgetfactory.com/wp-content/plugins/woocommerce/assets/js/frontend/credit-card-form.min.js?ver=3f0ea572419f2ebea87a8a9437801131" type="text/javascript"> <script async="async" charset="utf-8" type="text/javascript" src="//my.hellobar.com/7d2411523e114a596c965512682855527319fb91.js"> <script type="text/javascript"> <div id="wpadminbar" class=""> <p class="TK"> <script type="text/javascript"> <span class="select2-hidden-accessible" role="status" aria-live="polite"></span> </body> </html>
That is showing us that the failure is happening with the JSON response on line 1, which most likely means there is a PHP notice getting included with that result, which makes it invalid.
So in Firebug what you’d need to do is go into the Console when you submit the form, and then look at the POST response data. You’ll have to click the little + next to it to see the actual data.
Again, we’ll probably see some sort of a PHP notice in there and that’s what we need details on.
Hi Support,
I’m setting up a new site using Payments Pro and am getting the same error on checkout: https://mcgilldesigngroup.qnetau.com/dev/
If I disable PayPal for WooCommerce and use the PayPal standard the error disappears, so I don’t believe it’s another third-party plugin.
I’ve copied below what I believe is the POST response data from Firebug.
I’d appreciate any advice you can offer on how to fix this. I’ve tried debugging using Woocommerce’s advice (https://mikejolley.com/2015/11/12/debugging-unexpected-token-in-woocommerce-2-4/) without any results.
thanks in advance
{“result”:”success”,”messages”:””,”reload”:”false”,”fragments”:{“.woocommerce-checkout-review-order-table”
:”<table class=\”shop_table woocommerce-checkout-review-order-table\”>\n\t<thead>\n\t\t<tr>\n\t\t\t<th
class=\”product-name\”>Product<\/th>\n\t\t\t<th class=\”product-total\”>Total<\/th>\n\t\t<\/tr>\n\t
<\/thead>\n\t<tbody>\n\t\t\t\t\t\t\t<tr class=\”cart_item\”>\n\t\t\t\t\t\t<td class=\”product-name\”
>\n\t\t\t\t\t\t\tWine Dogs USA \t\t\t\t\t\t\t <strong class=\”product-quantity\”>× 2<\/strong
>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/td>\n\t\t\t\t\t\t<td class=\”product-total\”>\n\t\t\t\t\t\t\t<span class
=\”amount\”>$58.00<\/span>\t\t\t\t\t\t<\/td>\n\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t<\/tbody>\n\t<tfoot>
\n\n\t\t<tr class=\”cart-subtotal\”>\n\t\t\t<th>Subtotal<\/th>\n\t\t\t<td><span class=\”amount\”>$
;58.00<\/span><\/td>\n\t\t<\/tr>\n\n\t\t\n\t\t\n\t\t\t\n\t\t\t<tr class=\”shipping\”>\n\t<th>Shipping
and Handling<\/th>\n\t<td data-title=\”Shipping\”>\n\t\t\t\t\tWeight Based Shipping: <span class=\”amount
\”>$15.00<\/span> <input type=\”hidden\” name=\”shipping_method[0]\” data-index=\”0\” id=\”shipping_method_0
\” value=\”main\” class=\”shipping_method\” \/>\t\t\n\t\t \n <!– Remove Shipping Calculator
in here and added to cart.php –>\n\t\t\t\t\t\t\t\t<\/td>\n<\/tr>\n\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t
\n\t\t<tr class=\”order-total\”>\n\t\t\t<th>Total<\/th>\n\t\t\t<td><span class=\”amount\”>$
;73.00<\/span><\/strong> <\/td>\n\t\t<\/tr>\n\n\t\t\n\t<\/tfoot>\n<\/table>\n”,”.woocommerce-checkout-payment”
:”<div id=\”payment\” class=\”woocommerce-checkout-payment\”>\r\n\t\t<ul class=\”wc_payment_methods payment_methods
methods\”>\r\n\t\t<li class=\”wc_payment_method payment_method_paypal\”>\n\t<input id=\”payment_method_paypal
\” type=\”radio\” class=\”input-radio\” name=\”payment_method\” value=\”paypal\” data-order_button_text
=\”Proceed to PayPal\” \/>\n\n\t<label for=\”payment_method_paypal\”>\n\t\tPayPal <img src=\”https:\
/\/www.paypalobjects.com\/webstatic\/en_AU\/mktg\/logo\/Solutions-graphics-1-184×80.jpg\” alt=\”PayPal
Acceptance Mark\” \/><a href=\”https:\/\/www.paypal.com\/au\/webapps\/mpp\/paypal-popup\” class=\”about_paypal
\” onclick=\”javascript:window.open(‘https:\/\/www.paypal.com\/au\/webapps\/mpp\/paypal-popup’,’WIPaypal’
,’toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width
=1060, height=700′); return false;\” title=\”What is PayPal?\”>What is PayPal?<\/a>\t<\/label>\n\t\t
\t<div class=\”payment_box payment_method_paypal\” style=\”display:none;\”>\n\t\t\t<p>Pay via PayPal
; you can pay with your credit card if you don’t have a PayPal account.<\/p>\n\t\t<\/div>\n\t<
\/li>\n<li class=\”wc_payment_method payment_method_paypal_pro\”>\n\t<input id=\”payment_method_paypal_pro
\” type=\”radio\” class=\”input-radio\” name=\”payment_method\” value=\”paypal_pro\” checked=’checked’
data-order_button_text=\”\” \/>\n\n\t<label for=\”payment_method_paypal_pro\”>\n\t\tCredit card <img
src=\”https:\/\/mcgilldesigngroup.com\/dev\/wp-content\/plugins\/paypal-for-woocommerce\/assets\/images
\/cards.png\” alt=\”Credit card\” \/>\t<\/label>\n\t\t\t<div class=\”payment_box payment_method_paypal_pro
\” >\n\t\t\t<p>Pay with your credit card<p>NOTICE: SANDBOX (TEST) MODE ENABLED.<br \/>For testing purposes
you can use the card number 4916311462114485 with any CVC and a valid expiration date.<\/p>\t\t<fieldset
id=\”paypal_pro-cc-form\”>\n\t\t\t\t\t\t<p class=\”form-row form-row-wide\”>\r\n\t\t\t\t<label for=
\”paypal_pro-card-number\”>Credit Card Number <span class=\”required\”>*<\/span><\/label>\r\n\t\t\t\t
<input id=\”paypal_pro-card-number\” class=\”input-text wc-credit-card-form-card-number\” type=\”text
\” maxlength=\”20\” autocomplete=\”off\” placeholder=\”\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022
\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022\” name=\”paypal_pro-card-number\” \/>\r\n\t\t\t<\
/p><p class=\”form-row form-row-first\”><label for=\”cc-expire-month\”>Expiration Date<span class=\”required
\”>*<\/span><\/label><select name=\”paypal_pro_card_expiration_month\” id=\”cc-expire-month\” class=
\”woocommerce-select woocommerce-cc-month mr5\”><option value=\”\”>Month<\/option><option value=1>January
<\/option><option value=2>February<\/option><option value=3>March<\/option><option value=4>April<\/option
><option value=5>May<\/option><option value=6>June<\/option><option value=7>July<\/option><option value
=8>August<\/option><option value=9>September<\/option><option value=10>October<\/option><option value
=11>November<\/option><option value=12>December<\/option><\/select><select name=\”paypal_pro_card_expiration_year
\” id=\”cc-expire-year\” class=\”woocommerce-select woocommerce-cc-year ml5\”><option value=\”\”>Year
<\/option><option value=16>2016<\/option><option value=17>2017<\/option><option value=18>2018<\/option
><option value=19>2019<\/option><option value=20>2020<\/option><option value=21>2021<\/option><option
value=22>2022<\/option><option value=23>2023<\/option><option value=24>2024<\/option><option value=25
>2025<\/option><option value=26>2026<\/option><option value=27>2027<\/option><option value=28>2028<\
/option><option value=29>2029<\/option><option value=30>2030<\/option><option value=31>2031<\/option
><\/select><\/p><p class=\”form-row form-row-last\”>\r\n\t\t\t\t<label for=\”paypal_pro-card-cvc\”>Card
Security Code <span class=\”required\”>*<\/span><\/label>\r\n\t\t\t\t<input id=\”paypal_pro-card-cvc
\” class=\”input-text wc-credit-card-form-card-cvc\” type=\”text\” autocomplete=\”off\” placeholder=
\”CVC\” name=\”paypal_pro-card-cvc\” \/>\r\n\t\t\t<\/p>\t\t\t\t\t\t<div class=\”clear\”><\/div>\n\t\t
<\/fieldset>\n\t\t\t\t<\/div>\n\t<\/li>\n\t<\/ul>\r\n\t\r\n\t<div class=\”form-row place-order\”>\r\n
\r\n\t\t<noscript>Since your browser does not support JavaScript, or it is disabled, please ensure you
click the Update Totals<\/em> button before placing your order. You may be charged more than the
amount stated above if you fail to do so.<br\/><input type=\”submit\” class=\”button alt\” name=\”woocommerce_checkout_update_totals
\” value=\”Update totals\” \/><\/noscript>\r\n\r\n\t\t <p class=\”form-row terms wc-terms-and-conditions
\”>\n\t\t<input type=\”checkbox\” class=\”input-checkbox\” name=\”terms\” id=\”terms\” \/>\n
<label for=\”terms\” class=\”checkbox\”>I’ve read and accept the <a href=\”https:\/\/mcgilldesigngroup
.qnetau.com\/dev\/terms-conditions\/\” target=\”_blank\”>terms & conditions<\/a> <span class=\”required
\”>*<\/span><\/label>\n <input type=\”hidden\” name=\”terms-field\” value=\”1\” \/>\n <\/p
>\n\r\n\t\t\r\n\t\t<input type=\”submit\” class=\”button alt\” name=\”woocommerce_checkout_place_order
\” id=\”place_order\” value=\”Place order\” data-value=\”Place order\” \/>\r\n\t\t\r\n\t\t<input type
=\”hidden\” id=\”_wpnonce\” name=\”_wpnonce\” value=\”62d21cdc0e\” \/><input type=\”hidden\” name=\”_wp_http_referer
\” value=\”\/dev\/checkout\/?wc-ajax=update_order_review\” \/>\t<\/div>\r\n\r\n\t<div class=\”clear\”
><\/div>\r\n<\/div>\r\n”}}
- The topic ‘JSON Error Unexpected Token Paypal Payments Pro’ is closed to new replies.