vue-stripe / vue-stripe

Stripe Checkout & Elements for Vue.js
https://vuestripe.com
MIT License
1.08k stars 151 forks source link

SKUs for Checkout require a `name` attribute. #81

Closed ivxa closed 4 years ago

ivxa commented 4 years ago

Hey,

I get the following error when clicking the checkout button: Uncaught (in promise) IntegrationError: SKUs for Checkout require a name attribute. (Find the code below; I'm using "^3.0.0-beta.2")

Most likely I'm doing something definitely wrong and there is no issue with the module. Any help would be appreciated.

Thanks!

<template>
  <vue-stripe-checkout
    ref="checkoutRef"
    :items="items"
    :successUrl="successUrl"
    :cancelUrl="cancelUrl"
  >
    <template slot="checkout-button">
      <button @click="checkout">Shutup and take my money!</button>
    </template>
  </vue-stripe-checkout>
</template>

<script>
export default {
  data: () => ({
    loading: false,
    items: [
      {
        sku: "sku_GDQLhuzRJFpKUl",
        quantity: 1
      }
    ],
    successUrl: "http://localhost:8080/",
    cancelUrl: "http://localhost:8080/"
  }),
  methods: {
    checkout() {
      this.$refs.checkoutRef.redirectToCheckout();
    }
  }
};
</script>
ivxa commented 4 years ago

Solved. It wasn't related with the module. I just needed to add the "name" attribute to the SKU in Stripe's dashboard