I’m using Stripe’s “Embedded form” example verbatim. I am trying to add email consent collection.
In the example’s chekout.php, I add the line 'consent_collection' => ['promotions' => 'auto']
This makes the script at js.stripe.com/v3 return a parse error.
Uncaught (in promise) IntegrationError: fetchClientSecret failed with error "JSON.parse: unexpected end of data at line 1 column 1 of the JSON data"
r https://js.stripe.com/v3/:1
n https://js.stripe.com/v3/:1
r https://js.stripe.com/v3/:1
t https://js.stripe.com/v3/:1
e https://js.stripe.com/v3/fingerprinted/js/embedded-checkout-outer-60acd9aac45305c6390331b023b051cf.js:4
promise callback*e https://js.stripe.com/v3/fingerprinted/js/embedded-checkout-outer-60acd9aac45305c6390331b023b051cf.js:4
Q https://js.stripe.com/v3/fingerprinted/js/embedded-checkout-outer-60acd9aac45305c6390331b023b051cf.js:4
Ki https://js.stripe.com/v3/:1
promise callback*Ki https://js.stripe.com/v3/:1
initEmbeddedCheckout https://js.stripe.com/v3/:1
initialize https://testing.ivyaudio.com/checkout.js:16
https://testing.ivyaudio.com/checkout.js:4
v3:1:712678
e https://js.stripe.com/v3/fingerprinted/js/embedded-checkout-outer-60acd9aac45305c6390331b023b051cf.js:4
(Async: promise callback)
e https://js.stripe.com/v3/fingerprinted/js/embedded-checkout-outer-60acd9aac45305c6390331b023b051cf.js:4
Q https://js.stripe.com/v3/fingerprinted/js/embedded-checkout-outer-60acd9aac45305c6390331b023b051cf.js:4
Ki https://js.stripe.com/v3/:1
(Async: promise callback)
Ki https://js.stripe.com/v3/:1
initEmbeddedCheckout https://js.stripe.com/v3/:1
initialize https://testing.ivyaudio.com/checkout.js:16
https://testing.ivyaudio.com/checkout.js:4
The same error appears when I attempt other changes, like changing payment
to subscription
, as suggested in the example doc.
Stripe has a troubleshooting doc, but it assumes it’s your own js returning the error, not theirs.
Clearly I am missing something. How can I get a look at the object causing the parse error, and why does Stripe throw an error if I change anything in the checkout_session?