2017 © Pedro Peláez
 

library laravel-braintree

image

evasquez/laravel-braintree

  • Wednesday, July 15, 2015
  • by evervasquez
  • Repository
  • 2 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Braintree for Laravel 4.2 with Braintree 3.x

Installation

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

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

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

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

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

'providers' => array(

    'Evasquez\LaravelBraintree\LaravelBraintreeServiceProvider'

)

Configuration

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

php artisan config:publish evasquez/laravel-braintree

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

<?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/evasquez/laravel-braintree directory. For instance, if you have a local environment, add a config file at app/config/packages/evasquez/laravel-braintree/local/braintree.php for that environment., (*7)

Usage

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

braintree.js

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







Credits

Thanks to the bradleyboy/laravel-braintree package, as I used it as a starting point., (*10)

The Versions

15/07 2015

dev-master

9999999-dev

  Sources   Download

The Requires

 

by eveR Vásquez