Build and start your own marketplace by using the Stripe Connect API with PHP to process the payments between your platform, connected accounts and customers!
This script has been written to be easily modified to fit your very own needs so you can integrate Stripe Connect to your website. The code is written in the simplest possible way for you to understand how it works quickly, it’s also fully commented with every Stripe API function use having a link to its API documentation and other useful links when needed. Even if the design of the script doesn’t really matter here, you’ll be happy to know that it’s also responsive. The Stripe Connect API version is the latest to date (version 2019-12-03) and the script uses PHP 7, jQuery, Bootstrap 4 and MySQL 5. Please note that a MySQL database will be needed to run the script, using just one single table (simple, told you!).
All the instructions to install the script are in the “readme” file, it’ll take just a few minutes for you to set it ready to test.
Once installed, you will get a welcome page with the links to the five steps that you need for your integration. The code for these steps is separated into 5 respective folders to keep things as clear as possible! Here are the 5 steps:
- Create an account: Full creation of an account (the sellers/shops on your platform) with all of their details required by Stripe and the regulations of their own countries as well as their bank accounts so they can receive the payouts from their sales on your platform.
- Create a customer: Creation of a customer (the buyers of products/services on your platform) with the needed details.
- Payment process: Create a payment intent using the best practices Stripe Connect requires, working both with “one-to-one” (one payment to one account) and “one-to-many” (one payment to many accounts) methods. Then you can pay using a payment card and get the results of the payment via the included webhook script so you can record the payment, send an email to the account(s), customer and the platform when a payment has been passed, etc… The payment process supports all types of cards that Stripe supports, covers the 3D Secure payments (required by law in the European Union) and detects the fake cards, insuffisant provision, expired cards, ...
- Refund process: Select a payment and do partial or full refunds from your accounts to the customers.
- Listing: A dashboard/backoffice simulation listing most of the informations you might want to display on your platform from Stripe, including : • List of all your accounts • Account page with their details (informations, missing informations, balance, bank accounts, payments, transfers, payouts) • List of all your customers • Customer page with their details (informations, cards, bank accounts, payment intents, charges) • Platform activity (list all the events involving the Stripe API on your platform) • Platform balance (available/reserved/pending balance in all currencies, list of all the transactions on your platform) • Platform earnings (explaining how to record and display those, as the Stripe API doesn’t allow to get them)
Just so you can quickly try the script, most of the inputs are pre-filled so you don’t have to fill them all when creating a test account, for instance.
Please note that I am not a Stripe developper and am not affiliated to Stripe so I won’t answer any question on how Stripe and its API work! I do mention the best ways to get their help if you need, it’s all in the “readme” file. I will try to maintain this script up to date when the Stripe API is updated and changes are needed in the code though, or if someone reports a bug or security issue in the script; everything works perfectly in this version as far as I know, and as the Stripe API version used is set in the script, even if Stripe updates their API, there shouldn’t be any problem using this script… I’ve seen a comment from someone using a version of the script from 2014 and their script was still working perfectly in 2020.
Enjoy this script and the free time you just saved by purchasing it!
Stripe Connect PHP API - Create accounts, customers, payments & refunds (build your marketplace)
- • api
- • banking
- • marketplace
- • money
- • online
- • payment
- • paypal
- • php
- • platform
- • service
- • shop
- • stripe
- • stripe api
- • stripe connect
- • stripe connect api