@mezielabs/adonis-stripe
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

Table of contents

Adonis Stripe

Stripe provider for AdonisJS 5

typescript-image npm-image license-image

This packages makes it seamless to work with Stripe in AdonisJS 5 applications.

Installation

Install the package using either npm or yarn:

npm i @mezielabs/adonis-stripe
# or
yarn add @mezielabs/adonis-stripe

Then, configure the package using the configure command:

node ace configure @mezielabs/adonis-stripe

This package needs to be configured with your Stripe account's API keys, which you can get from your Stripe Dashboard. Also, you can specify the API version as well as your webhook secret.

// .env

STRIPE_SECRET_KEY=YOUR_STRIPE_SECRET_KEY
STRIPE_PUBLIC_KEY=YOUR_STRIPE_PUBLISHABLE_KEY
STRIPE_API_VERSION=STRIPE_API_VERSION // defaults to Stripe account's API version
STRIPE_WEBHOOK_SECRET=YOUR_STRIPE_WEBHOOK_SECRET

Usage

import Stripe from '@ioc:Mezielabs/Stripe'

async checkout ({ view }) {
  paymentIntent = await Stripe.paymentIntents.create({
    amount: 1900,
    currency: 'usd'
  })
}

This package is built top of stripe-node. For usage, see the stripe-node API docs for Node.js.

Learn AdonisJS

Want to learn how to build projects like this with AdonisJS? Check out Adonis Mastery, where you get to learn AdonisJS through practical screencasts.

Readme

Keywords

Package Sidebar

Install

npm i @mezielabs/adonis-stripe

Weekly Downloads

187

Version

1.0.7

License

MIT

Unpacked Size

9.3 kB

Total Files

10

Last publish

Collaborators

  • ammezie