Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Latest commit

 

History

History
58 lines (38 loc) · 3.95 KB

README.md

File metadata and controls

58 lines (38 loc) · 3.95 KB

This repo has been archived and is no longer maintained. It may be inaccurate and remains archived for historical reasons

Stripe Checkout Foundations

Stripe Checkout creates a secure, Stripe-hosted payment page that lets you collect payments quickly. It works across devices and can help increase your conversion. Checkout makes it easy to build a first-class payments experience.

About this Repo

This repo corresponds to the Checkout integration built in the Checkout 101 video series. The initial code is the code provided by the Checkout Quickstart Integration Builder.

This repo differs slightly from the Integration Builder code:

  • The hard coded API key has been replaced with an environment variable.
  • Calls to Stripe.set_app_info and Stripe.api_version have been added to server.rb.

Running the code

  1. Rename or copy .env.example to .env and set STRIPE_SECRET_KEY to your test secret API key.
  2. Update the price id used in the Stripe::Checkout::Session.create in server.rb
  3. Build the server
bundle install
  1. Run the server
ruby server.rb
  1. Visit http://localhost:4242/checkout.html to start the Checkout flow.

Pull requests corresponding to Checkout 101 episodes

You can see the code shown in each 101 episode by video by viewing the corresponding pull request:

  1. Getting started wtih a Payment Link: A no code way to get up and running quickly with a Checkout (no code)
  2. Accept a payment with Checkout and the integration builder: Use the Checkout Quickstart Integration Builder to get up and running quickly with Checkout (initial commit of repo)
  3. Build notifications into Checkout: Add a webhook handler to your Checkout integration so you know when you've gotten paid and can fulfill the order. PR
  4. Build a customer order confirmation page with Checkout: Use the Checkout Session ID to look up order information after the customer has completed their purchase to display on the success page. Allow your customers to return to their Checkout session from the cancel page. PR
  5. Add support for adjustable quantities: Let your customer adjust their order during Checkout. Display the total price and quantities for each line item purchased on the success page. PR
  6. Recover abandoned carts: Configure Checkout to generate a new session when the original session is abandoned by the customer and expires. Collect consent to send promotional emails and listen for session expired events to know when to reach out to encourage a customer to complete their purchase. PR

Get support

If you found a bug or want to suggest a new [feature/use case/sample], please file an issue.

If you have questions, comments, or need help with code, we're here to help:

Sign up to stay updated with developer news.

Credits

Photography credit for box of chocolates: Louis Mornaud