GithubHelp home page GithubHelp logo

stripe-samples / github-pages-stripe-checkout Goto Github PK

View Code? Open in Web Editor NEW
163.0 8.0 102.0 786 KB

Example of a client-only (no server) donation payment page that can be hosted on GitHub using Stripe Checkout.

Home Page: https://stripe-samples.github.io/github-pages-stripe-checkout

License: MIT License

HTML 38.48% CSS 61.52%
stripe-checkout

github-pages-stripe-checkout's People

Contributors

anish749 avatar ch-stripe avatar cjavilla-stripe avatar dawn-stripe avatar mfix-stripe avatar thorsten-stripe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-pages-stripe-checkout's Issues

Doesnt work if button inside a form element.

Bug report

Doesnt work if button inside a form element.

Describe the bug

If you are designing your own shopping cart page you are probably using an existing layout. This is an excellent example however if you have your button and quantity within a form element then when you click the button it just blips.

This may seem obvious not sure it's a bug but it needs to be stated in the documentation to save people wasting time.

To Reproduce

Place the payment button inside form element

Expected behavior

I get the payment page

Thanks.

Unable to run this sample with prices API

Bug report

Describe the bug

Hello,
I am trying to integrate this sample in a github pages blog, however I am unable to use the prices_id to list the products in test mode. (haven't tried in live mode yet)

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create products, and add prices in Stripe Dashboard (I have a few price_xyz id now)
  2. Enable client only checkout, add publishable key as described.
  3. Run this example, on click I get the following error
    IntegrationError: No such plan: 'price_xyz'

I understand the error, however I am unable to make redirectToCheckout use the price api instead of plan, and I am not sure how to get a plan id.

The following is my diff in this repo:

diff --git a/index.html b/index.html
index 632bb71..9676c70 100644
--- a/index.html
+++ b/index.html
@@ -44,7 +44,7 @@
             <h1>Recurring Donation</h1>
             <button
               data-checkout-mode="subscription"
-              data-price-id="plan_GU4MXg0k0Uv1S6"
+              data-price-id="price_xyz"
             >
               Donate $20.00 per month
             </button>
@@ -68,7 +68,7 @@

     <script>
       // Replace with your own publishable key: https://dashboard.stripe.com/test/apikeys
-      var PUBLISHABLE_KEY = 'pk_test_Tr8olTkdFnnJVywwhNPHwnHK00HkHV4tnP';
+      var PUBLISHABLE_KEY = 'pk_test_my_key';
       // Replace with the domain you want your users to be redirected back to after payment
       var DOMAIN = location.href.replace(/[^/]*$/, '');

Expected behavior

I expect it to redirect to the client only check out page.

Screenshots

Screenshot 2020-08-06 at 22 14 08

System information

  • OS: macOS
  • Browser: chrome, safari
  • Server environment: NA

Additional context

NA

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.