1.0.5 • Published 4 years ago

@appstitch/google-calendar v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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