Walk through the basics of Subscription pausing using Ruby and Sinatra.
Follow these instructions to spin-up a copy of this demo project up on your local machine for development and testing purposes. This is meant to be a guide to show you how to go about pausing Subscriptions.
- Configure your keys
Copy the example .env
file and update those values with your Stripe keys.
cp .env.example server/.env
Then, be sure to update the publishable key (pk_xxx) in client/manual.html.
- Start the server
ruby server.rb
- Run the demo
Create a customer with Stripe CLI:
stripe customers create \
--description="Pausing Test Customer" \
-d payment_method=pm_card_visa \
-d invoice_settings[default_payment_method]=pm_card_visa
Create a subscription with Stripe CLI with the billing_cycle_anchor set to a few min from now:
stripe subscriptions create \
--customer={ID_FROM_PREV} \
-d "items[0][plan]"=plan_xxx \
-d billing_cycle_anchor={UNIX_TIMESTAMP_60_SECONDS_FROM_NOW}
Pause a Subscription and review in your Stripe dashboard.