Completing your order…
182 |We’re just waiting for the confirmation from your bank… This might take a moment but feel free to close this page.
183 |We’ll send your receipt via email shortly.
184 |Thanks for your order!
187 |Woot! You successfully made a payment with Stripe.
188 |We just sent your receipt to your email address, and your items will be on their way shortly.
189 |Thanks! One last step!
192 |Please make a payment using the details below to complete your order.
193 | 194 |Oops, payment failed.
197 |It looks like your order could not be paid at this time. Please try again or select a different payment option.
198 | 199 |
2 | >
3 | > This project is deprecated and is no longer being actively maintained.
4 |
5 | # Stripe on StdLib Demo
6 |
7 | 
18 |
19 | You can read more about the features from this app on the [main payments repository](https://github.com/stripe/stripe-payments-demo#overview).
20 |
21 | ## Stripe and StdLib Integration
22 |
23 | This section gives you some details about how this Stripe and StdLib integration works.
24 |
25 | ### API Endpoints
26 |
27 | The `functions` directory contains the code for all the API endpoints consumed by the single-page demo. [FaaSlang](https://github.com/faaslang/faaslang#what-is-faaslang) defines semantics and rules for the deployment and execution of these serverless functions.
28 |
29 | The ability to create orders via a POST request on `/orders` is defined in [`functions/orders/__main__.js`](functions/orders/__main__.js), and the ability to list products via a GET request on `/products` is defined in [`functions/products/__main__.js`](functions/products/__main__.js). These functions rely on the [`stripe/inventory.js`](stripe/inventory.js) library which helps with product and order management on Stripe.
30 |
31 | The interesting thing to note is that for API endpoints which contain IDs in their path, such as `POST /orders/{id}/pay` to pay a specific order, the serverless function is defined in [`functions/orders/__notfound__.js`](functions/orders/__notfound__.js), which is called automatically since the endpoint has a variable. The same applies for fetch a specific product.
32 |
33 | The Stripe webhook handler is defined in [`functions/webhook.js`](functions/webhook.js).
34 |
35 | ### Single-Page App and Static Assets
36 |
37 | The frontend code for the demo lives in the `public` directory. In particular, [`public/javascripts/payments.js`](public/javascripts/payments.js) creates the payment experience using Stripe Elements, and [`public/javascripts/store.js`](public/javascripts/store.js) handles the inventory and order management on Stripe.
38 |
39 | The main app template is served by a function, specifically the main function defined in [`functions/__main__.js`](functions/__main__.js). All the static assets (scripts, stylesheets, and images) are also rendered by a function, specifically via the [`functions/public/__notfound__.js`](functions/public/__notfound__.js) function which relies on the [`fileio.js`](helpers/fileio.js) helper to read and map files from the `public` directory.
40 |
41 | ## Getting Started
42 |
43 | You’ll need the following:
44 |
45 | * [Node.js](http://nodejs.org) >= 8.x.
46 | * Modern browser that supports ES6 (Chrome to see the Payment Request, and Safari to see Apple Pay).
47 | * Stripe account to accept payments ([sign up](https://dashboard.stripe.com/register) for free).
48 | * StdLib account to deploy the project ([sign up](https://stdlib.com/) for free).
49 |
50 | In your Stripe Dashboard, you can [enable the payment methods](https://dashboard.stripe.com/payments/settings) you’d like to test with one click. Some payment methods require receiving a real-time webhook notification to complete a charge. This StdLib demo exposes an endpoint for webhooks which you can enter in your webhooks settings on Stripe (it should look like `https://
166 |