@appstitch/google-calendar

1.0.5 • 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

Usage

Initialize Appstitch in your root file

import appStitch from "@appstitch/core";

appStitch.initialize({ appStitchKey:your_stitch_key"});

Create a Stripe Charge

import { createCharge } from "@appstitch/stripe";

const createACharge = (chargeOptions) => {

    const {currency,amount } =  chargeOptions; 
    createCharge({currency,amount }).then(result => {

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

List Stripe Charges

import {  listCharges } from "@appstitch/stripe";

const listCharges = ({
    starting_after, 
    ending_before, 
    limit, 
    autoPaginate
    }) => {

    listCharges({starting_after, ending_before, limit, autoPaginate})
    .then(result => {

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

NOTE Using autoPaginate will fetch all results. It will be slow so only use if it is absolutely necessary!

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

Package Sidebar

Install

npm i @appstitch/google-calendar

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

3.79 kB

Total Files

4

Last publish

Collaborators

  • yashmaistry