2017 © Pedro Peláez
 

library laravel-stripe

image

mmollick/laravel-stripe

  • Friday, October 9, 2015
  • by mmollick
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3,453 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 1 Versions
  • 12 % Grown

The README.md

Stripe 2.0 for Laravel 4

Integrates the Stripe PHP library with Laravel 4 via a ServiceProvider, config, and Blade extensions., (*1)

This is originally a fork from the abodeo/laravel-stripe package, (*2)

Installation

Include laravel-stripe as a dependency in composer.json:, (*3)

"mmollick/laravel-stripe": "dev-master"

Run composer install to download the dependency., (*4)

Add the ServiceProvider to your provider array within app/config/app.php:, (*5)

'providers' => array(

    'MMollick\LaravelStripe\LaravelStripeServiceProvider'

)

Finally, publish the configuration files via php artisan config:publish abodeo/laravel-stripe., (*6)

Configuration

It is advisable to keep all of your sensitive configuration out of your configuration files. Instead, utilize Laravel's "dot files" to keep them out of source control and making them easily overridable on dev environments., (*7)

If you have not setup a "dot file", read Laravel's "Protecting Sensitive Configuration for detailed setup instructions. To quickly get up an running, simply create a .env.php file in the same directory as you apps composer.json file. Then add your Stripe API credentials to it., (*8)

<?php
return array(
  'stripe' => array(
    'api_key' => 'my-api-key',
    'publishable_key' => 'my-pub-key',
    'api_version' => null,
  )
);

If you insist on keeping your API credentials in your config, you can set your API Key and Publishable Key in app/config/packages/abodeo/laravel-stripe/stripe.php:, (*9)

<?php
return array(
  'api_key' => 'my-api-key',
  'publishable_key' => 'my-pub-key',
  'api_version' => null,
);

Usage

You may use the Stripe PHP Library as normal within your application. The Stripe API will automatically be configured with your API Key, so you do not need to set it yourself., (*10)

In your Blade views, you may output your Stripe Publishable Key using the @stripeKey Blade extension:, (*11)

<script src="https://checkout.stripe.com/v2/checkout.js" class="stripe-button"
          data-key="@stripeKey"
          data-amount="5000" data-description="One year's subscription"></script>

The Versions

09/10 2015

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Michael Mollick