@appstitch/stripe

1.0.36 • Public • Published

AppStitch Stripe

A flexible convenience wrapper for Stripe's API

Install

npm install @appstitch/stripe

Install Peer Dependancies AppStitch Core and AppStitch Types

npm install @appstitch/core
npm install @appstitch/types

Remember

Initialize Appstitch Core

Usage

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

Apart from a few exceptions, this library mirror Stripe's API. You can use Stripe's Docs or our JSDocs for reference.

Create a Subscription

stripeClient.createSubsciption({
    customer : "cus_ABC123456",
    items:[{price : "price_XYZ123456"}],

}).then(result => {

    if(result.object === "subscription")
    {
        // Success
    }
})

Create a Payment

    stripeClient.createPaymentIntent({
        customer: "cus_abc123"
        amount : 2500,
        currency:"usd",
        confirm:true
    })
    .then(result => {
        if(result.object === "payment_intent")
        {
            // Success
        }
    })
}

Exceptions

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

// Update
invoices.update(id, {
    ...options
})

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

// Update
updateInvoice({
    id,
    ...options
})

Reference Stripe's Docs and AppStitch Types to find out the attributes for each object/resource

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.360latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.360
1.0.350
1.0.340
1.0.330
1.0.320
1.0.310
1.0.300
1.0.270
1.0.260
1.0.250
1.0.240
1.0.230
1.0.220
1.0.210
1.0.200
1.0.190
1.0.180
1.0.170
1.0.160
1.0.150
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.21

Package Sidebar

Install

npm i @appstitch/stripe

Weekly Downloads

1

Version

1.0.36

License

ISC

Unpacked Size

46.8 kB

Total Files

6

Last publish

Collaborators

  • yashmaistry