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?