How to Integrate Stripe Payment Gateway in php

| Last Updated: | In: Payment Gateway, PHP Tutorial


I got some request from my blog readers about “How to Integrate Stripe Payment Gateway in php”, so that I have created stripe payment gateway script with live checkout demo and also put this code to download for my website subscribers.

I have created this demo stripe payment gateway script using bootstrap for payment process.

Stripe payment gateway
Download Live Demo

Stripe Payment

You need to create an account on https://dashboard.stripe.com/register to generate the Test Secret Key and test Publishable Key.

Stripe Register

After register with stripe, you will get an email from the stripe to verify your email address. Click on the email link to verify your email and then login in stripe dashboard.

Stripe Login

How to generate stripe API key

After login in stripe navigate to the dashboard => API and click on the API option to get your Test Secret Key and test Publishable Key.

API Key Settings

Stripe checkout form

Before creating the checkout form you need to include the below JS files.

Below is the Stripe checkout form to enter the customer credit card details to capture the payment. You can modify the below form as per your requirement.

Add below JS code before body tag closed in your file.

Stripe test credit card

Use below credit card detail to test the stripe payment gateway code on the demo.

Card Number: 4111111111111111
Expiration Month: 12
Expiration Year: 2020
Card CVV: 123

Download Live Demo


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:


, , , , , , ,