Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

wilde-things

> 编程语言
Open source

A tutorial integrating Stripe in PHP

176 stars0 likes2 views
WebsiteGitHub

About

A tutorial integrating Stripe in PHP

Wilde Things - A study in PHP

Wilde Things is a website on which you can buy quotes by Oscar Wilde. This is a PHP demo that demonstrates integrating Stripe, originally done for a General Assembly livestream tutorial on November 14, 2012.

The demo is 7 steps and goes from setting up a simple site for accepting one-time payments to a subscription-based service complete with webhook support.

Getting started

To begin, you'll need to take three steps (aside from cloning this repo):

  • Setup the web root directory
  • Install the Stripe PHP library
  • Create a Stripe account

Web root directory

For the purposes of this tutorial, the public folder--included in the git repo--is assumed to be the web root directory. You'll need to configure your web server accordingly, or clone the repo in the right directory to arrange that.

For each step in the tutorial, copy the script(s) to be executed to the public directory to test them.

Installing the Stripe library

To run any of the steps, you will first need to install the Stripe PHP library. As of version 2 of the Stripe PHP library, installation is accomplished via Composer.

Assuming you have installed Composer, add Stripe to your composer.json file (in the public folder):

{
  "require": {
    "stripe/stripe-php": "@stable"
  }
}

(The repo already includes this for you.)

Then run Composer's installation tool:

composer install

Creating a Stripe account

Next, sign up for a Stripe account at https://stripe.com and find your publishable and secret API keys in your account settings. As you go through the tutorial, you'll need to replace every instance of and with your actual keys. You'll want to use your test API keys throughout.

Stripe PHP library versions and major changes

Version 2 of the Stripe PHP library, released in February 2015, makes use of namespaces, is installed via Composer, and requires PHP 5.3.3 or greater. All of the code in this tutorial has been updated for the 2.x Stripe PHP library.

If you're using an older version of the Stripe PHP library, see the changelog of this tutorial for the older code you'd use instead (in your PHP scripts). You can manually download older versions of the Stripe PHP library on GitHub.

Issues· 1 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHP

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言