Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1214851

    fatheaddrummer
    Participant

    Hi There, When I try to purchase a product via Test mode and stripe it tells me the following:
    SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

    could you help me out with this?
    related page: https://www.diamond-precision-studio.com/product/top-sound-mit-kleinem-budget/

    Thanks a lot!

    Best, Christian

    #1215302

    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    This is the first error,

    XMLHttpRequest cannot load https://api.stripe.com/v1/tokens. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://checkout.stripe.com' is therefore not allowed access.

    You should allow api.stripe.com, please add this to your site’s .htaccess file

        <IfModule mod_headers.c>
            SetEnvIf Origin "http(s)?://(www\.)?(stripe.com|api.stripe.com)$" AccessControlAllowOrigin=$0
            Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
        </IfModule>

    Maybe it’s affecting how the data is being processed, let’s fix that first 🙂

    Cheers!

    #1215827

    fatheaddrummer
    Participant

    Hello Rad,

    Thank you so much for helping me out!!
    I added it to my .htaccess file like this: https://www.dropbox.com/s/3995xz97n55e46j/Bildschirmfoto%202016-10-14%20um%2009.19.16.png?dl=0

    Was that correct?
    Unfortunately this didn’t solve the issue…
    Do you have any more ideas?

    I am so thankful for your help!!

    Best, Christian

    #1215849

    Rad
    Moderator

    Hi there,

    I checked it and it fixes the origin issue, but there is another error.

    mPDF error: IMAGE Error (https://staging1.diamond-precision-studio.com/wp-content/uploads/2016/08/dps_logo2014_gold-1-300x212.png): Could not find image file

    The image is still pointing to your staging site, and if you visit the URL, it doesn’t exist anymore. It triggers after hitting the payment button and request is sent as https://www.diamond-precision-studio.com/en/checkout/?wc-ajax=checkout

    Where did you set that up? JSON result is responded with that string and it’s invalid.

    Thanks!

    #1215864

    fatheaddrummer
    Participant

    Hello Rad,

    Your support is so amazingly great! I found the image source and solved the issue! It works perfectly now!

    Thank you soooo much!

    Best, Christian 🙂

    #1215887

    Rad
    Moderator

    You’re so much welcome 🙂