Search code examples
javascriptrecurly

Recurly JS v4 - Access-Control-Allow-Origin


https://paulz.dev.biznessapps.com/global/signup_subscribe?plan=mobileapp59&offer=special

I'm using Recurly JS v4 for this subscription form. And when there is coupon code entered, it should update the order summary details (subtotal, discount, due today).

recurly.configure() works fine, but when I try to attach pricing API using recurly.pricing(), it does not work resulting following JS error in console.

XMLHttpRequest cannot load https://api.recurly.com/js/v1/plans/?version=4.3.0&key=ewr1-Sx4mdGQIjeWwp1wKKPKXJe. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://paulz.dev.biznessapps.com' is therefore not allowed access. The response had HTTP status code 404.

enter image description here

I'm not sure how to allow this domain to access this API.


Solution

  • Pay attention to the whole error message:

    The response had HTTP status code 404.

    The lack of permission to read the data is a side effect of you having the wrong URL.