2017 © Pedro Peláez
 

library laravel-braintree

image

bradleyboy/laravel-braintree

  • Friday, August 12, 2016
  • by bradleyboy
  • Repository
  • 1 Watchers
  • 24 Stars
  • 25,778 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 22 Forks
  • 2 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

Note: This package is no longer maintained, use oureastudios/laravel5-braintree instead., (*1)

Braintree for Laravel 4

Installation

In your Laravel project's composer.json file, add laravel-braintree as a dependency in the require object:, (*2)

"bradleyboy/laravel-braintree": "dev-master"

You do not need to add any other dependencies, as laravel-braintree loads in the other dependencies automatically., (*3)

Finally, do a composer update., (*4)

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

'providers' => array(

    'Bradleyboy\Laravel\BraintreeServiceProvider'

)

Configuration

To publish a boilerplate configuration file, run:, (*6)

php artisan config:publish bradleyboy/laravel-braintree

Then open app/config/packages/bradleyboy/laravel-braintree/braintree.php to setup your environment and keys:, (*7)

<?php

return array(
    'environment'             => 'sandbox',
    'merchantId'              => 'my-merchant-id',
    'publicKey'               => 'my-public-key',
    'privateKey'              => 'my-private-key',
    'clientSideEncryptionKey' => 'my-client-side-encryption-key',
);

You can setup different environmental configurations by creating matching folders inside the app/config/packages/bradleyboy/laravel-braintree directory. For instance, if you have a local environment, add a config file at app/config/packages/bradleyboy/laravel-braintree/local/braintree.php for that environment., (*8)

Usage

Once setup, you can use the Braintree PHP classes as spelled out in the documentation., (*9)

braintree.js

If you are using braintree.js, you can easily output your client side encryption key in your Blade views:, (*10)







Credits

Thanks to the Abodeo/laravel-stripe package, as I used it as a starting point., (*11)

The Versions

12/08 2016

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Brad Daily