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

JulesBlm/stripe-payments-demo-netlify

Repository files navigation

Netlify-Stripe-Payments-Demo

Deploy to Netlify.

The Stripe Payments Demo converted to work on Netlify with Netlify Lambda. Read their page for information.

Enter your Stripe API keys, webhook secret and country into the 'Build environment variables' under 'Deploy Settings' in Netlify. Like below:

buildenvvars

And add your webhook endpoint in your Stripe Developer dashboard.

webhookendpoint

Payments Integration

The frontend code for the demo is in the 'src/' directory.

The core logic of the Stripe integration is mostly contained within two files:

'src/payments.js' creates the payment experience on the frontend using Stripe Elements. The 'src/functions' folders defines the serverless functions on the backend that create Stripe charges and receive webhook events.

Beyond Cards: Payments Sources for Europe and Asia

This demo also shows how to reach customers in Europe and Asia by supporting their preferred way to pay online. It supports payment methods such as ACH credit transfers, Alipay, Bancontact, iDEAL, Giropay, SEPA Direct Debit, SOFORT, and WeChat Pay. Be sure to turn these on in your Stripe dashboard if you plan to use these live.

The app also supports both Multibanco and EPS which are currently in Public Beta on Stripe.

Getting Started

  1. Install with npm run install, this also installs the Stripe CLI assuming you have Brew
  2. Run npm run build
  3. Then to set up the products in Stripe run npm run setup-products
  4. Run npm run dev to run a local server with Netlify Dev and the Stripe CLI.