Skip to content
An example Stripe integration with Rails
Ruby HTML JavaScript CSS
Branch: master
Clone or download
Latest commit 583def8 Sep 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app adds tests Aug 1, 2019
bin initial commit Jul 31, 2019
config working example Aug 1, 2019
db adds tests Aug 1, 2019
lib adds tests Aug 1, 2019
log initial commit Jul 31, 2019
public initial commit Jul 31, 2019
storage initial commit Jul 31, 2019
test adds tests Aug 1, 2019
tmp initial commit Jul 31, 2019
vendor initial commit Jul 31, 2019
.browserslistrc initial commit Jul 31, 2019
.env.example working example Aug 1, 2019
.gitignore working example Aug 1, 2019
.ruby-version initial commit Jul 31, 2019
Gemfile adds tests Aug 1, 2019
Gemfile.lock gem updates Sep 3, 2019
README.md adds link in readme Sep 3, 2019
Rakefile initial commit Jul 31, 2019
babel.config.js initial commit Jul 31, 2019
config.ru initial commit Jul 31, 2019
nutmeg.png adds example image Aug 1, 2019
package.json working example Aug 1, 2019
postcss.config.js initial commit Jul 31, 2019
yarn.lock working example Aug 1, 2019

README.md

An example Stripe implementation which I wrote more about here: Stripe: Beyond the "Getting Started" Docs.

Nutmeg

Setup

  1. $ bundle exec install
  2. gem install mailcatcher
  3. $ cp .env.example .env
  4. Edit that file with your own stripe config and ngrok subdomain
  5. $ bundle exec rails db:create db:migrate
  6. $ ngrok http -subdomain=whatever_you_put_in_env_file 3000
  7. $ mailcatcher -f
  8. $ bundle exec rails server

Run the tests

  1. $ bundle exec install
  2. $ bundle exec rails db:create db:migrate
  3. $ bundle exec rails test ; bundle exec rails test:system

FAQ

1. What about more than one Stripe plan?

You'd have to augment this example. It's only setup to work with having a single plan at the moment, because that's all I needed.

2. Why dot-env over rails credentials?

Idk, I just felt iffy about committing credentials publicly -- even encrypted, test-only ones 🤷‍♂️

3. Why did you call it Nutmeg?

This example is pulled from a project I'm working on called Skilltree, so I just picked a random type of tree 🌳

You can’t perform that action at this time.