简体   繁体   English

Vue Stripe Checkout,演示代码问题

[英]Vue Stripe Checkout, issue with demo code

I am trying to use and implement Vue-Stripe-Checkout , however I came across an issue in the very beginning with the demo code - at the very beginning when using the Vue Stripe Elements from over here.我正在尝试使用和实现Vue-Stripe-Checkout ,但是我在演示代码的一开始就遇到了一个问题 - 在从这里开始使用Vue Stripe Elements时。 I was wondering if someone knows what the issue is?我想知道是否有人知道问题是什么? It doesn't produce an error, but it simply doesn't work when the details are filled and the button is clicked.它不会产生错误,但是当填写详细信息并单击按钮时它根本不起作用。

The token function works, however the button click does not work, which is shown below令牌 function 有效,但按钮单击无效,如下图所示

<StripeElements
                :pk="publishableKey"
                :amount="amount"
                locale="auto"
                @token="tokenCreated"
                @loading="loading = $event"
                ref="elementsRef"
            >
            </StripeElements>
            <v-btn color="primary" @click="submit">Pay ${{amount / 100}}</v-btn>
this.$refs.elementsRef.submit();

Sandbox Example:https://codesandbox.io/s/purple-firefly-ovj4r?file=/src/App.vue沙盒示例:https://codesandbox.io/s/purple-firefly-ovj4r?file=/src/App.vue

Thank you!谢谢!

It looks like you just need to supply your publishable key in pk : https://codesandbox.io/s/adoring-browser-qs7c4?file=/src/App.vue看起来您只需要在pk中提供您的可发布密钥: https://codesandbox.io/s/adoring-browser-qs7c4?file=/src/App.vue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM