stripe

Experimental Stripe API Client!

The Crystal module for the Stripe API

The Stripe REST API. Please see https://stripe.com/docs/api for more details.

This SDK is automatically generated by the OpenAPI Generator project with CUSTOM templates:

For more information, please visit https://stripe.com

Installation

Install from Git

Add the following to shard.yaml

dependencies:
  stripe:
    github: cyangle/stripe
    version: ~> 0.0.2

Usage

Warning: Experimental Stripe SDK, use at your own risk!

Check here for more information about how to use stripe APIs.

Below lists only a few examples of the most interesting APIs, the client should support APIs provided by the stripe OpenAPI specification file as it's generated from the OpenAPI v3 specification ./stripe_api_v104.json.

JSON serialization

This shard uses nason for JSON (de)serialization.

Require this shard in your project

First you need to require it.

require "stripe"

Configure client with stripe credentials

Stripe.configure do |config|
  config.access_token = "STRIPE_API_KEY"
end

You can try stripe APIs with their test API key: sk_test_4eC39HqLyjWDarjtT1zdp7dc

Create an instance of Stripe::DefaultApi

api = Stripe::DefaultApi.new

Get balance

balance = api.get_balance
pp balance

Development

Install dependencies

shards

Run the tests:

crystal spec

Run lints

./bin/ameba
crystal tool format --check