简体   繁体   中英

Ruby on rails - STRIPE API KEY

I keep getting this error with strip :

在此处输入图片说明

I have visited https://stripe.com/docs/stripe.js but I am not sure where to put this script tags does it go in the

 {new.html.erb | create.html.erb | charges.html.erb}

JavaScript :

<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script type="text/javascript">
  Stripe.setPublishableKey('pk_test_xxxxxxxxxx');
</script>

You should remove your test key from this post.

You need to set the publishable key inside a <script></script> tag.

It could be several issues:

  1. Check, please, your API key in Stripe account settings (probably it was changed).
  2. Be sure that command "Stripe.setPublishableKey('...')" is running (cache? forgot reloading page? etc...).

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