GithubHelp home page GithubHelp logo

isabella232 / wilde-things Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stripe-archive/wilde-things

0.0 0.0 0.0 231 KB

A tutorial integrating Stripe in PHP

License: MIT License

PHP 98.09% CSS 1.91%

wilde-things's Introduction

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 <YOUR PUBLISHABLE STRIPE API KEY> and <YOUR SECRET STRIPE API KEY> 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.

wilde-things's People

Contributors

antifuchs avatar kyleconroy avatar larry-stripe avatar larryullman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.