alkurn/yii2-braintree

yii 2 braintree integration

Installs: 53

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2018-06-13 12:28 UTC

README

braintree for yii 2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist alkurn/yii2-braintree "dev-master"

or add

"alkurn/yii2-braintree": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, you should configure it in the application configuration like the following,

'components' => [
    'braintree' => [
        'class' => 'alkurn\braintree\Braintree',
        'environment' => 'sandbox',
        'merchantId' => 'your_merchant_id',
        'publicKey' => 'your_public_key',
        'privateKey' => 'your_private_key',
    ]
]

** Creating a customer

Yii::$app->braintree->gateway->customer()->create(['firstName' => 'first_name',
             'lastName' => 'last_name',
             'paymentMethodNonce' => 'Nonce']);