Stripe

A secure client library for Stripe's API

Install

npm install @appstitch/stripe

Install Peer Dependencies

npm install @appstitch/core
npm install @appstitch/types
circle-info

Remember to initialize Appstitcharrow-up-right

Usage

Apart from a few exceptions, this library mirror Stripe's API. You can use Stripe's Docsarrow-up-right for reference.

import { createSubscription } from "@appstitch/stripe";
// OR
import * as stripeClient from "@appstitch/stripe";

Create a customer

import * as stripe from "@appstitch/stripe";

const createCustomer = () => {

  stripe.createCustomer({
      email: "[email protected]"
  })
  .then((res) => {
    if (res.object === "customer") {
       // success
    }
  })
}

Create a subscription

Create a Payment Intent

Stripe Connect Options

All requests can be made on behalf of another Stripe Account. Here's how you do it

circle-info

Note: Similar to Stripe's API, stripeAccount is in camel case

Exceptions

For Retrieve, Delete and Update requests, Stripe Api look something similar to this

After consideration, we went for chose to go for this approach instead. Notice the invoice id is passed with the update options

Reference Stripe's Docsarrow-up-right

Last updated