as
@bitkidd/adonis-stripe
npm i @bitkidd/adonis-stripe
as

@bitkidd/adonis-stripe

A stripe service provider for Adonis Framework

by Chirill Ceban

8.168.0 (see all)License:MITTypeScript:Built-In
npm i @bitkidd/adonis-stripe
Readme

Adonis Stripe

adonis, stripe

npm-image license-image typescript-image

This service provider makes it easier to integrate and to work with Stripe official library. It is compatible with Adonis Framework v5.x. and Adonis Framework v4.x. via legacy tag.

It is built on top of stripe-node and proxies all the methods keeping them 100% original. So you can follow official Stripe documentation.

Package will follow stripe-node versioning to keep you in sync

Installation

To install package for Adonis v5.x run:

npm install @bitkidd/adonis-stripe
# or
yarn add @bitkidd/adonis-stripe

As the package has been installed, you have to configure it by running a command:

node ace configure @bitkidd/adonis-stripe

Then open the env.ts file and paste the following code inside the Env.rules object.

STRIPE_SECRET_KEY: Env.schema.string(),
STRIPE_API_VERSION: Env.schema.string()

And don't forget to add these variables to your .env and .env.sample files.

To install package for Adonis v4.x run:

npm install @bitkidd/adonis-stripe@legacy
# or
yarn add @bitkidd/adonis-stripe@legacy

And then follow the instructions.

Usage

import Stripe from '@ioc:Adonis/Addons/Stripe'

public async signup ({ response, request }) {
  
  ...

  const customer = await Stripe.customers.create({
    email: user.email
  });

  ...
}
VersionTagPublished
8.168.0
latest
1yr ago
8.168.0-legacy
legacy
1yr ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate