2017 © Pedro Peláez
 

library braintree

A Braintree Service provider, wrapper with examples for Laravel

image

mschinis/braintree

A Braintree Service provider, wrapper with examples for Laravel

  • Tuesday, February 24, 2015
  • by mschinis
  • Repository
  • 3 Watchers
  • 5 Stars
  • 669 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Braintree Package for Laravel 4.2

Installation

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

"mschinis/braintree": "dev-master"

Use composer update for composer to update the dependencies and download the package., (*2)

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

'providers' => array(

    'Mschinis\Braintree\BraintreeServiceProvider'

)

Configuration

To publish the configuration file, run:, (*4)

php artisan config:publish mschinis/braintree

Then open app/config/packages/mschinis/braintree/config.php to setup your environment and keys: Acceptable environment values are sandbox or production. All required keys can be found by logging in to your sandbox or production account, (*5)

<?php

return array(
    'environment'   => 'sandbox',
    'merchantId'    => 'use_your_merchant_id',
    'publicKey'     => 'use_your_public_key',
    'privateKey'    => 'use_your_private_key',
    'CSEKey'        => 'use_your_client_side_encryption_key'
);

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

Example

You can use the artisan command php artisan braintree:example to generate a boilerplate controller that will handle an example payment and an example view with a payment form., (*7)

After you generate the files, make sure you add the controller to your routes: Route::controller('braintree', "BraintreeController");., (*8)

Once the steps above are completed, you can access the test page at /braintree/test-page, (*9)

Usage

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

Links to essential information: * Generating Client Tokens * Drop-in UI * Transactions * Result & Error Handling, (*11)

The Versions

24/02 2015

dev-master

9999999-dev

A Braintree Service provider, wrapper with examples for Laravel

  Sources   Download

MIT

The Requires

 

by Michael Schinis