stripe

Version, currently main branch1 version
  • main branchlatestJun 7, 2025

github.com/jgaskins/stripe

Stripe API client for Crystal

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  stripe:
    github: jgaskins/stripe
    branch: main

main is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
>= 1.13.2
License
MIT
Author
Jamie Gaskins
Targets
  • all_webhooks from examples/oops_all_webhooks.cr
  • select_webhooks from examples/webhook.cr

Dependencies

Runtime Dependencies

Development Dependencies

  • stripe*path: .dev

README

stripe

Crystal implementation of the Stripe API

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      stripe:
        github: jgaskins/stripe
  2. Run shards install

Usage

The Stripe::Client takes an API key argument or you can set the STRIPE_API_KEY environment variable.

require "stripe"

# Pass the API key explicitly
stripe = Stripe::Client.new(api_key)

# ... or pull it from the `STRIPE_API_KEY` env var
stripe = Stripe::Client.new

To create a PaymentIntent:

payment_intent = stripe.payment_intents.create(
  amount: 13_37, # $13.37
  currency: :usd,
  customer: user.stripe_customer_id,
  confirm: true,
)

See the Stripe docs for details on what these options do.

Contributing

  1. Fork it (https://github.com/jgaskins/stripe/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors