百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

wilde-things

> 编程语言
开源

一个在 PHP 中集成 Stripe 的教程

176 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个在 PHP 中集成 Stripe 的教程

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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