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?
I found that I was not entering valid credit card info (I passed jQuery object into expiration date parameter and not its value ... ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With