Code Monkey home page Code Monkey logo

oauth-stripe-connect-php's Introduction

A simple Stripe Connect PHP demo app

This is a simple Stripe Connect application written in PHP. At this point it doesn't do a whole lot, and the intention is primarily to provide a general example to help you get up and running with Stripe Connect. You can find a running demo of this application running at https://connect.fff.red/. This example uses test credentials, so this platform will only be able to access test data when you connect your account.

Some important things you should know right off the bat

  • This isn't, by any means, ready for production.
  • You should read over Stripe's Connect documentation as a first step.
  • In the interest of creating an example that is useful and readable for the greatest number of people, no framework was used. If you're planning to create a srs bizness app of any complexity, you'll likely want to use some framework like Laravel.
  • This application uses an OAuth 2.0 client library provided by the PHP League. Though it's possible to build the OAuth flow out yourself, it's recommended that you use an OAuth library like this one.
  • Since the goal here is just to show the connection process, this application doesn't make use of any database. IRL, you'll want to save at least the account ID to your database when your user connects so you can do things on their behalf later.
  • This integration uses standalone accounts, so you can either create a new test account using some test data, or connect an existing account.

Getting started

Clone this repository:

git clone https://github.com/adamjstevenson/oauth-stripe-connect-php.git

Log in to your Stripe account (or create one) and register your application as a platform. Set a redirect URI in Stripe that points to https://yoursite.com/connected.php.

Note: This project includes a Vagrantfile and a bootstrap.sh file to provision a server that's ready to go for this application and will run locally by default on 12.12.12.12 (covered in more detail below). If you choose this option, you'll want to set the redirect URI to http://12.12.12.12/connected.php.

Add your test secret key, development client ID, and redirect URL to the config/config.php file.

Run composer install from the project's root directory to install dependencies.

Testing locally with Vagrant

This repo contains a Vagrantfile and bootstrap.sh file to provision a local development environment and get this app up and running easily. To use this, you'll want to:

  1. Ensure you've installed Vagrant.
  2. From the project's root directory, run vagrant up. The bootstrap file should provision the machine and install everything that's needed to run this application. This might take a while the first time.
  3. Load http://12.12.12.12 (or whatever IP you defined as the local network in your Vagrantfile) in your browser. You should see the index page for this app with a button to "connect to Stripe".
  4. Fill out the account application with some test data, connect an existing Stripe account if you have one, or just click the "skip this account form" link at the top to connect with a test-only account.
  5. You'll be redirected back to the redirect URL you defined in your Stripe account (your local Vagrant instance) and some information about your account will be displayed. Hooray!

oauth-stripe-connect-php's People

Contributors

adam-stripe avatar adamjstevenson avatar

Watchers

Ameeno avatar James Cloos avatar  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.