Stripe Payment Gateway Integration on Google Cloud

The Stripe payment gateway provides an easy and powerful way to accept credit cards directly on the web application. Stripe make it easy to integrate checkout system and collect payment on the website. The Stripe API is a powerful solution to integrate checkout system in the web application to provide a smooth payment experience.Stripe is responsible for processing and keeping clients’ credit/debit card data so no information of essence would be stored on your server and you would not have to comply with all the rules that come with storing credit/debit cards.

Let’s start integration:

Step 1: Create account on

Step 2: After the setup ,Login into Account and navigate to account settings > API Keys.

Before getting started Collect the Publishable key and Secret key to later use in the script .Referring stripe docs , stripe produces code which can be used on the website directly ,the code which looks like this

The simple integration uses a script tag inside your payment form to render the blue Checkout button. Upon completion of the Checkout process, Checkout submits your form to your server, passing along a stripeToken and any elements your form contains. When adding the following code to your page, make sure that the form submits to your own server-side code within the action attribute:

Step 3: Now Replace the data-key in script code with your publishable key and in the PHP form replace the set API key with Secret key

require_once can be used in two ways,here i used example for composer so in php form you can find autoload.php. Alternatively you can download or know more about composer

Step:4 : Testing the Payment Process

To test the payment process, you need test card details. Use any of the following test card numbers, a valid future expiration date, and any random CVC number, to test Stripe payment gateway integration in PHP.

4242424242424242 Visa
4000056655665556 Visa (debit)
5555555555554444 Mastercard
5200828282828210 Mastercard (debit)
378282246310005 American Express
6011111111111117 Discover

Change the Test API keys (Publishable key and Secret key) with the Live API keys (Publishable key and Secret key) in the script once the testing is done with test data

Blog Categories

Looking for a Top Rated* Marketing Company?

Contact us at +1 630 999 (7768) or submit a business inquiry online.

NectarSpot team executed the Quick and solid build of AMP website. Not afraid of small tweaks here and there. The team has, from the beginning of project, focus on conversion and provided a seamless workflow for my prospects to visit, educate and finally purchase on my e-commerce portal. They provided design, development on AMP framework and helped to host e-commerce portal on scalable and secure google cloud. We are looking forward to working with them in future for other projects as well.

Read More....

Ryan Frederickson

Art Wine Preserver

Read more to gain insights from our blogs.
Receive latest marketing insights, data and inspiration by subscribing .

Start Your Project Today (100% Satisfaction Guaranteed)

  • NectarSpot Inc. is an integrated digital marketing agency specializing in Design & Development of Web, Mobile & Voice Applications.
    We excel in providing Optimization, Automation, PPC & Analytics services to high performing brands across industries.

    Contact us today at +1 630 999 (7768) or email at to know more.

Need help?

We are right here!