Skip to content

A Rust implementation of Stripe's Checkout Single Subscription sample

Notifications You must be signed in to change notification settings

rrebelo62/stripe-checkout-sample-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stripe-checkout-sample-rust

An implementation, in Rust, of the Stripe Checkout Simple Subscription sample

How to install

  1. Login to stripe (with your key and password) and get a pairing code: stripe login
  2. Create a basic and a premium product, either using the CLI or the dashboard. If using the CLI:
stripe products create --name="Basic" --description="Basic plan"
stripe products create --name="Premium" --description="Premium plan"
  1. Create a basic and premium price, either using the CLI or the dashboard. If using the CLI:
stripe prices create --product=prod_XYZ --unit-amount=1200 --currency=usd -d"recurring[interval]=month"

For each product call the command line above but replace prod_XYZ with the product ids you got on 2 and change the price and currency accordingly.

  1. Edit change the file .env.example name into .env and change the test keys, prices' ids and webhook id.

  2. Call cargo run and access http://localhost:4242 with a web browser. Because the sample doesn't run on SSL, I recomend using MS Edge. For security reasons, the settings on other browsers will block some components.

  3. For the customer to be able to access the customer portal and manage billing you'll need to enable it in the Stripe dashboard.

About

A Rust implementation of Stripe's Checkout Single Subscription sample

Resources

Stars

Watchers

Forks

Packages

No packages published