All Projects → WilliamDASILVA → Nuxt Stripe Module

WilliamDASILVA / Nuxt Stripe Module

Licence: mit
A NuxtJS module to import Stripe client script.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Nuxt Stripe Module

nuxt-stripejs
💳 NuxtJS module for Stripe.js which loads only when required and w/ retry mechanism
Stars: ✭ 17 (-76.39%)
Mutual labels:  stripe, nuxtjs
Nuxt Tailwind
A Nuxt.js starter project template using Tailwind CSS without the distraction of a complicated development environment.
Stars: ✭ 71 (-1.39%)
Mutual labels:  nuxtjs
Donate
A simple Stripe donation form.
Stars: ✭ 48 (-33.33%)
Mutual labels:  stripe
Tipsi Stripe
React Native Stripe binding for iOS/Android platforms
Stars: ✭ 1,106 (+1436.11%)
Mutual labels:  stripe
Stripy
Micro wrapper for Stripe's REST API.
Stars: ✭ 49 (-31.94%)
Mutual labels:  stripe
Stripe Elixir
Stripe API client for Elixir
Stars: ✭ 66 (-8.33%)
Mutual labels:  stripe
Vuedarkmode
👩‍🎨👨‍🎨 A minimalist dark design system for Vue.js. Based components designed for the insomniacs who enjoy dark interfaces as much as we do.
Stars: ✭ 1,034 (+1336.11%)
Mutual labels:  nuxtjs
Firebase Stripe
Headless Stripe Payments Using Firebase Functions
Stars: ✭ 72 (+0%)
Mutual labels:  stripe
Sample Vue Shop
See readme for newer repo details! A sample shop that shows how to manage payments with Vue, Stripe, and Serverless Functions
Stars: ✭ 1,166 (+1519.44%)
Mutual labels:  stripe
Nuxt Netlify Functions Example
Nuxt.js example for running Netlify functions locally in a dev environment and as a generated static site deployed to Netlify
Stars: ✭ 59 (-18.06%)
Mutual labels:  nuxtjs
Checkout Netlify Serverless
Sell products on the Jamstack with Netlify Functions and Stripe Checkout!
Stars: ✭ 58 (-19.44%)
Mutual labels:  stripe
Stripe Kit
Stars: ✭ 50 (-30.56%)
Mutual labels:  stripe
Parabol
Free online agile retrospective meeting tool
Stars: ✭ 1,145 (+1490.28%)
Mutual labels:  stripe
Eslint Module
ESLint module for Nuxt.js
Stars: ✭ 49 (-31.94%)
Mutual labels:  nuxtjs
Nova Stripe Theme
A Laravel Nova theme closely resembling Stripe.
Stars: ✭ 71 (-1.39%)
Mutual labels:  stripe
Pwa Module
Zero config PWA solution for Nuxt.js
Stars: ✭ 1,033 (+1334.72%)
Mutual labels:  nuxtjs
Laravel Vuejs.com
Laravel and VueJs Blog, using Laravel nova, GraphQL, NuxtJs, Apollo and ...more
Stars: ✭ 54 (-25%)
Mutual labels:  nuxtjs
Nuxt Compress
A simple static asset compression module for Nuxt that runs Gzip and Brotli compression during the build process
Stars: ✭ 61 (-15.28%)
Mutual labels:  nuxtjs
Docker Nuxt
Docker image to run NUXT.js application in production mode
Stars: ✭ 71 (-1.39%)
Mutual labels:  nuxtjs
Gp Vue Boilerplate
Grabarz & Partner Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites with vuejs.
Stars: ✭ 71 (-1.39%)
Mutual labels:  nuxtjs

Nuxt Stripe Module

npm (scoped with tag) npm js-standard-style

A NuxtJS module to import the StripeJS client script.

Table of Contents

Requirements

  • npm
  • NuxtJS
  • NodeJS

Install

# npm
$ npm install --save nuxt-stripe-module

# yarn
$ yarn add nuxt-stripe-module

Getting Started

Add 'nuxt-stripe-module' to the modules section of your nuxt.config.js file.

Inline configuration entry

{
  modules: [
    ['nuxt-stripe-module', {
      publishableKey: 'YOUR_STRIPE_PUBLISHABLE_KEY',
    }],
  ]
}

External configuration entry

{
  modules: [
    'nuxt-stripe-module',
  ],
  stripe: {
    publishableKey: 'YOUR_STRIPE_PUBLISHABLE_KEY',
  },
}

Options

The following options can be configured in the module's configuration entry in your nuxt.config.js file.

Publishable key - publishableKey

  • Required
  • Default: null

Your publishable key.

https://stripe.com/docs/js/initializing#init_stripe_js-publishableKey

API version - apiVersion

  • Optional
  • Default: null

Override your account's API version.

https://stripe.com/docs/js/initializing#init_stripe_js-options-apiVersion

Locale - locale

  • Optional
  • Default: 'en'

A locale used to globally configure localization in Stripe. Setting the locale here will localize error strings for all Stripe.js methods. It will also configure the locale for Elements and Checkout. Default is auto (Stripe detects the locale of the browser).

Stripe Account - stripeAccount

  • Optional
  • Default: ''

Usage

  1. Inject the module in your nuxt.config.js file. See Getting Started.
  2. this.$stripe is now available in your components. Note that $stripe can be null if the script fails to load.
{
  ...
  mounted() {
    if (this.$stripe) {
      const elements = this.$stripe.elements();
      const card = elements.create('card', {});
      // Add an instance of the card Element into the `card-element` <div>
      card.mount('#card-element');
    }
  },
  ...
}

For more details, please refer to the official Stripe documentation.

TypeScript

Add the types to your "types" array in tsconfig.json after the @nuxt/types (Nuxt 2.9.0+) or @nuxt/vue-app entry

{
  "compilerOptions": {
    "types": [
      "@nuxt/types",
      "nuxt-stripe-module"
    ]
  }
}

Why?

Because of the way Nuxt works the $stripe property on the context has to be merged into the Nuxt Context interface via declaration merging. Adding nuxt-stripe-module to your types will import the types from the package and make typescript aware of the additions to the Context interface.

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].