Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #48 from stripe/payment-intents-all-sources
Browse files Browse the repository at this point in the history
Change to PaymentIntents for all payment methods and upgrade to API version 2019-02-11
  • Loading branch information
adreyfus-stripe authored Mar 8, 2019
2 parents 18dbe8f + a0e288c commit 01d53e2
Show file tree
Hide file tree
Showing 19 changed files with 672 additions and 926 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ STRIPE_WEBHOOK_SECRET=
# Stripe account country (required for Payment Request).
STRIPE_ACCOUNT_COUNTRY=US

# Supported payment methods for the store.
# Some payment methods support only a subset of currencies.
# Make sure to check the docs: https://stripe.com/docs/sources
# Only used for the python server. For Node.js see the server/node/config.js file!
PAYMENT_METHODS="alipay, bancontact, card, eps, ideal, giropay, multibanco, sofort, wechat"

# Optional ngrok configuration for development (if you have a paid ngrok account).
NGROK_SUBDOMAIN=
NGROK_AUTHTOKEN=
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This demo provides an all-in-one example for integrating with Stripe on the web:
🚀 | **Built-in proxy for local HTTPS and webhooks.** Card payments require HTTPS and asynchronous payment methods with redirects rely on webhooks to complete transactions—[ngrok](https://ngrok.com/) is integrated so the app is served locally over HTTPS and an endpoint is publicly exposed for webhooks.
🔧 | **Webhook signing and idempotency keys**. We verify webhook signatures and pass idempotency keys to charge creations, two recommended practices for asynchronous payment flows.
📱 | **Responsive design**. The checkout experience works on all screen sizes. Apple Pay works on Safari for iPhone and iPad if the Wallet is enabled, and Payment Request works on Chrome for Android.
📦 | **No datastore required.** Products, SKUs, and Orders are stored using the [Stripe Orders API](https://stripe.com/docs/orders), which you can replace with your own database to keep track of orders and inventory.
📦 | **No datastore required.** Products, and SKUs are stored using the [Stripe API](https://stripe.com/docs/api/products), which you can replace with your own database to keep track of products and inventory.

## Payments Integration

Expand Down Expand Up @@ -67,9 +67,9 @@ There are a couple server implementations in the [`server`](/server) directory.

You’ll need the following:

* [Node.js](http://nodejs.org) >= 8.x.
* Modern browser that supports ES6 (Chrome to see the Payment Request, and Safari to see Apple Pay).
* Stripe account to accept payments ([sign up](https://dashboard.stripe.com/register) for free).
- [Node.js](http://nodejs.org) >= 8.x.
- Modern browser that supports ES6 (Chrome to see the Payment Request, and Safari to see Apple Pay).
- Stripe account to accept payments ([sign up](https://dashboard.stripe.com/register) for free).

In your Stripe Dashboard, you can [enable the payment methods](https://dashboard.stripe.com/payments/settings) you’d like to test with one click.

Expand All @@ -87,7 +87,7 @@ Install dependencies using npm:

npm install

This demo uses the Stripe API as a datastore for products and orders, but you can always choose to use your own datastore instead. When starting the app for the first time, the initial loading can take a couple of seconds as it will automatically set up the products within Stripe.
This demo uses the Stripe API as a datastore for products and SKUs, but you can always choose to use your own datastore instead. When starting the app for the first time, the initial loading can take a couple of seconds as it will automatically set up the products and SKUs within Stripe.

Run the app:

Expand All @@ -111,5 +111,5 @@ Use this second URL in your browser to start the demo.

## Credits

* Code: [Romain Huet](https://twitter.com/romainhuet) and [Thorsten Schaeff](https://twitter.com/thorwebdev)
* Design: [Tatiana Van Campenhout](https://twitter.com/tatsvc)
- Code: [Romain Huet](https://twitter.com/romainhuet) and [Thorsten Schaeff](https://twitter.com/thorwebdev)
- Design: [Tatiana Van Campenhout](https://twitter.com/tatsvc)
21 changes: 14 additions & 7 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,20 @@ <h1>Order Summary</h1>
<div class="line-item demo">
<div id="demo">
<p class="label">Demo in test mode</p>
<p class="note">This app is running in test mode. You will
<em>not</em> be charged.</p>
<p class="note"> Feel free to test payments using a real card or any
<a href="https://stripe.com/docs/testing#cards" target="_blank">Stripe test card</a>. Non-card payments will redirect to test pages.
</p>
<p class="note">Run this app locally in live mode with your Stripe account to create real payments and see redirects to banking
sites.
<p class="note">You can copy and paste the following test cards to trigger different scenarios:</p>
<table class="note">
<tr>
<td>Default US card:</td>
<td class="card-number">4242<span></span>4242<span></span>4242<span></span>4242</td>
</tr>
<tr>
<td><a href="https://stripe.com/guides/strong-customer-authentication" target="_blank">3D Secure auth</a> required:</td>
<td class="card-number">4000<span></span>0000<span></span>0000<span></span>3063</td>
</tr>
</table>
<p class="note">
See the <a href="https://stripe.com/docs/testing#cards" target="_blank">docs</a> for a full list of test cards.
Non-card payments will redirect to test pages.
</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 01d53e2

Please sign in to comment.