This is a small Sinatra app that demonstrates how to use Chargify Direct for Signups. It leverages the new Chargify2 gem to create the Direct secure form inputs and signature, verify the redirect response, and fetch the call response.
- Clone this repo to your local machine
- Install the
sinatra
andchargify2
gems - Copy
config/config.example.yml
toconfig/config.yml
- Edit
config/config.yml
to add your own API User credentials (Note: this is a "V2" API User that is not generally available yet. You may request one to be created by contacting Michael Klett) - Create products on your API User's Site with handles 'basic' and 'pro' (or edit the example to match product handles you have)
- Invoke the app with
ruby -rubygems chargify_direct_example_app.rb
and play at http://localhost:4567