简体   繁体   中英

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. 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

<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

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

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