I am using the "Vue Stripe Checkout 3" component, and when I try to implement it, I get the following error "
Invalid value for Stripe (): apiKey should be a string. You specified: undefined.
In my data I have:
publishableKey: process.env.PUBLISHABLE_KEY,
Also I tried putting adding my key directly (publishableKey: 'my key') and it still didn't work. I also tried putting it in the prop directly and nothing.
<template>
<div>
<stripe-checkout
ref="checkoutRef"
:pk="publishableKey"
:items="items"
:successUrl="successUrl"
:cancelUrl="cancelUrl">
<template slot="checkout-button">
<button @click="checkout" class="btn-yellow wow fadeInUp btn" style="visibility: visible; animation-name: fadeInUp;">Pagar</button>
</template>
</stripe-checkout>
</div>
</template>
<script>
import { StripeCheckout } from 'vue-stripe-checkout';
export default {
components: {
StripeCheckout
},
data: () => ({
loading: false,
publishableKey: 'sk_test_51H85e2F5x69G5dDPxFEtO0RyIBWBEWkqwV9fpN5ovLysfCxJ15kfyeALoUFdZNi57yt0zj40h4LV3l5Zkra6WPCw00by0N0W3a',
items: [
{
sku: item.sku,
quantity: 1
}
],
successUrl: 'https://tarfut.es',
cancelUrl: 'https://tarfut.es',
}),
methods: {
checkout () {
this.$refs.checkoutRef.redirectToCheckout();
},
},
}
</script>
Thanks in advance.