Giter Club home page Giter Club logo

jekyll-stripe's Introduction

jekyll-stripe

A Jekyll plugin for easily letting site visitors buy products you've set up in your Stripe dashboard.

Installation

Add the following to your site's Gemfile:

gem 'jekyll-stripe'

Add the following to your site's _config.yml:

plugins:
  - jekyll-stripe

If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.

Usage

Add the following right before </head> in your site's layout:

{% stripe pk_live_1234567890 %}

Where pk_live_1234567890 is your Stripe Publishable API Key. Never put your secret key here!

And then wherever you want to show a buy button, add:

{% stripe_button price_1234567890 %}

Where price_1234567890 is the API ID for the Price you want this button to be used to purchase. You can create Prices within Products in your Stripe dashboard.

If the customer cancels during checkout they'll be redirected to the page where they clicked the button.

If checkout succeeds, the customer will be redirected to the same page with -thanks appended, e.g. https://example.com/my-course-thanks/ if the button was on https://example.com/my-course/.

Use Stripe webhooks (or Zapier, etc) if you need something to happen behind the scenes after a confirmed purchase.

Known limitations

  • Ability to customize:
    • Button text
    • Button styling (though you can do this easily with CSS)
    • Success/cancel URLs
    • Other settings
  • Protection against incorrect setup
  • Protection against accidentally using secret key

Stripe docs

https://stripe.com/docs/payments/checkout/client

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/shai126/jekyll-stripe.

License

The gem is available as open source under the terms of the MIT License.

jekyll-stripe's People

Contributors

shai126 avatar

Stargazers

 avatar  avatar Syed Peer avatar Jamil Ramsey avatar Michael Ball avatar Amos Groth avatar Andy Brown avatar

Watchers

James Cloos avatar  avatar  avatar

jekyll-stripe's Issues

Button not working

I got to where I have the button on my Jekyll website but it doesn't click and go anywhere?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.