An open API service indexing awesome lists of open source software.

https://github.com/cyangle/stripe

Stripe crystal lang client SDK generated by OpenAPI Generator.
https://github.com/cyangle/stripe

Last synced: about 1 year ago
JSON representation

Stripe crystal lang client SDK generated by OpenAPI Generator.

Awesome Lists containing this project

README

          

# 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](https://openapi-generator.tech) project with CUSTOM templates:

- API version: 2024-06-20
- Stripe OpenAPI version v1250
- Package version: 0.0.4
- Build package: org.openapitools.codegen.languages.CrystalClientCodegen
- Custom templates: [crystal_client_generator](https://github.com/cyangle/crystal_client_generator)

For more information, please visit [https://stripe.com](https://stripe.com)

## Installation

### Install from Git

Add the following to shard.yaml

```yaml
dependencies:
stripe:
github: cyangle/stripe
version: ~> 0.0.4
```

## Usage

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

Check [here](https://stripe.com/docs/api) 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_spec_fixed.json`.

### Require this shard in your project

First you need to require it.

```crystal
require "stripe"

# Or Require a specific api
require "stripe/api/balance_api"
```

### Configure client with stripe credentials

```crystal
Stripe.configure do |config|
config.access_token = "STRIPE_API_KEY"
end
Stripe::ApiClient.default.default_headers["Stripe-Version"] = "2024-06-20"
```

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

### Create an instance of Stripe::BalanceApi

```crystal
api = Stripe::BalanceApi.new
```

#### Get balance

```crystal
balance = api.get_balance
pp balance
```

## Development

Install dependencies

```shell
shards
```

Run the tests:

```shell
crystal spec
```

Run lints

```shell
./bin/ameba
crystal tool format --check
```