1

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"

Pritika
  • 296
  • 1
  • 17
  • 2
    Have you tried another IP address? Yours may be banned on the server. –  Jul 05 '16 at 07:10

1 Answers1

0

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
PHPDave
  • 904
  • 1
  • 7
  • 15