strapi-plugin-stripe-payment-gateway-basic v1.0.3
Strapi plugin stripe-payment-gateway-basic
This is a sample template on how to integrate Stripe with Strapi
Prerequisite:
https://stripe.com/docs/stripe-cli example: stripe listen --forward-to http://localhost:1337/webhook
Create Stripe dev account
Get Stripe API Credentials
- Publishable Key
- Signing Secret
- Secret Key
Frontend code
Follow the codes from Homepage
Backend code
Follow the routes, controllers, and services codes Set environment variables SIGNING_SECRET and SECRET_KEY in .env in the root Strapi folder. Also the STRIPE_SUCCESS_REDIRECT_URL and STRIPE_CANCEL_REDIRECT_URL.
Note
koa-body/unparsed.js must be enabled under Strapi's config/middleware file
settings: {
parser: {
enabled: true,
multipart: true,
includeUnparsed: true,
},
},
koa-body/unparsed.js must also be installed to parse the Stripes raw payload.
Then run yarn strapi build then yarn develop. Make this plugin's createsession and webhook API to be public in Strapi Settings -> Users and Permissions -> Roles -> Public
That's it. Just click the
Pay
button to try! Happy coding :)