Using the Stripe payment gateway with Laravel
E-commerce sites are a consistent staple in web development. In the past, things such as credit card processing have been difficult and the learning curve very steep. With Laravel and the Stripe service, offering credit card transactions is much easier.
Getting ready
For this recipe, we'll need a working installation of Laravel 4 and the proper credentials for Stripe. A free account with Stripe can be created at https://stripe.com/.
How to do it...
To complete this recipe, follow these steps:
Open the app's
composer.json
file and update therequire
section to resemble the following snippet:"require": { "laravel/framework": "4.0.*", "stripe/stripe-php": "dev-master" },
In the command line window, run the composer update with the following command:
php composer.phar update
In the
app/config
directory, create a new file namedstripe.php
with the following code:<?php return array( 'key' => 'fakeKey-qWerTyuuIo4f5' );
In the
routes.php
file...