Download the PHP package rapidwebltd/simplestripe without Composer
On this page you can find all versions of the php package rapidwebltd/simplestripe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rapidwebltd/simplestripe
More information about rapidwebltd/simplestripe
Files in rapidwebltd/simplestripe
Package simplestripe
Short Description SimpleStripe makes it easier than ever to integrate basic Stripe-powered payments into a site. With only a small amount of code you can have a payment form ready to start charging customers.
License LGPL-3.0-only
Informations about the package simplestripe
SimpleStripe
This super simple Stripe integration package allow you to integrate a Stripe powered payment form and charge your customers with only a tiny amount of code.
Installation & Dependencies
This package and its dependencies can be installed using composer.
Just add the package to your composer.json file as follows and run
composer update
.
If your framework does not do so for you, remember to include the autoload files generated by composer, as follows.
Setup
To use SimpleStripe, you must first instantiate the
SimpleStripe
object. To do this, all you need is the Stripe API
keys and the currency you wish to take payments in.
You can find your Stripe API keys within your https://dashboard.stripe.com/account/apikeys. You will need both the secret key and the publishable key.
The currency must be presented in ISO 4217 format, such as GBP, USD, EUR.
Displaying payment form
The following code will display a simple payment form, suitable for taking payment with all common debit and credit cards.
This code will also include all the necessary JavaScript code to handle client-side communication with Stripe and display of validation errors. The form will post back to the same URL it is displayed upon.
Charging the customer
Charging customers is simple. The following code is an example of how you can:
- Handle the payment form post back
- Attempt to charge the customer
- Handle success or failure
You should include code similar to this towards the top of the page containing your payment form.
Example
For a complete implementation of SimpleStripe, see src/Example.php
.
License
This library is licensed under the Lesser General Public License version 3.