How to use the vue-stripe-elements-plus.createToken function in vue-stripe-elements-plus

To help you get started, we’ve selected a few vue-stripe-elements-plus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Hujjat / vue-shop / src / views / Checkout.vue View on Github external
pay () {
      // createToken returns a Promise which resolves in a result object with
      // either a token or an error key.
      // See https://stripe.com/docs/api#tokens for the token object.
      // See https://stripe.com/docs/api#errors for the error object.
      // More general https://stripe.com/docs/stripe.js#stripe-create-token.
      createToken().then(data => console.log(data.token))
    }
  }
github sdras / sample-vue-shop / components / AppCheckout.vue View on Github external
pay() {
      createToken().then(data => {
        this.submitted = true;
        console.log(data.token); //this is a token we would use for the stripeToken below
        axios
          .post(
            'https://sdras-stripe.azurewebsites.net/api/charge?code=zWwbn6LLqMxuyvwbWpTFXdRxFd7a27KCRCEseL7zEqbM9ijAgj1c1w==',
            {
              stripeEmail: this.stripeEmail,
              stripeToken: 'tok_visa', //testing token
              stripeAmt: this.total
            },
            {
              headers: {
                'Content-Type': 'application/json'
              }
            }
          )

vue-stripe-elements-plus

Stripe Elements components for Vue

MIT
Latest version published 10 months ago

Package Health Score

51 / 100
Full package analysis

Popular vue-stripe-elements-plus functions