Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe blocked frame origin

I have custom stripe form so I am using standard javascript file:

<script type="text/javascript" src="https://js.stripe.com/v2/"></script>

I try to get the token with:

<script>
  Stripe.setPublishableKey('xxx'); 
  Stripe.card.createToken({
      number: '4242 4242 4242 4242',
      cvc: '100',
      exp: '10/2018'
    },
    function (response) {
      console.log(response);
    }
  );
</script>

Code is pretty straight forward but I receive exception in my browser:

(index):3 Uncaught SecurityError: 
Blocked a frame with origin "https://localhost:3000" 
from accessing a frame with origin "https://js.stripe.com". 
Protocols, domains, and ports must match.

Any idea what am I doing wrong?

like image 229
knagode Avatar asked Sep 06 '25 20:09

knagode


1 Answers

I found that I was not entering valid credit card info (I passed jQuery object into expiration date parameter and not its value ... ).

like image 180
knagode Avatar answered Sep 12 '25 05:09

knagode