简体   繁体   中英

NetworkError: 403 Forbidden - https://js.recurly.com/v4/recurly.js loading recurly.js

I have implemented the recurly.js form but facing problem in loading recurly.js. Following is my code:

<form>
    <input type="text" data-recurly="first_name">
    <input type="text" data-recurly="last_name">
    <div data-recurly="number"></div>
    <div data-recurly="month"></div>
    <div data-recurly="year"></div>
    <div data-recurly="cvv"></div>
    <input type="hidden" name="recurlytoken" data-recurly="token">
    <button>
        submit
    </button>
</form>
<script src="https://js.recurly.com/v4/recurly.js"></script>
<script type="text/javascript">
    $('document').ready(function() {
        $('#signupForm').on('submit', function(event) {
            var form = this;
            event.preventDefault();
            recurly.token(form, function(err, token) {
                if (err) {
                    alert(JSON.stringify(err));
                    return false;
                } else {
                    $('input[name="recurly-token"]').val(token.id);
                    form.submit();
                }
            });
        });
    });
</script>

I am facing the problem of "NetworkError: 403 Forbidden - https://js.recurly.com/v4/recurly.js "

There's some kind of networking issue between the browser and the recurly.js file. You'll need to look at your firewall settings. The recurly.js file appears to be hosted on cloudflare which might be blocked?

The browser should be sending a request like

  • :authority:js.recurly.com
  • :method:GET
  • :path:/v4/recurly.js
  • :scheme:https
  • accept: /
  • accept-encoding:gzip, deflate, sdch, br
  • cookie:
  • user-agent:

And the server should be responding back with

  • access-control-allow-credentials:false
  • access-control-allow-methods:GET
  • cache-control:public, max-age=14400
  • cf-cache-status:HIT
  • content-encoding:gzip
  • content-type:application/x-javascript
  • server:cloudflare-nginx
  • status:200
  • strict-transport-security:max-age=15768000;
  • includeSubDomains vary:Accept-Encoding

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM