alkurn/yii2-braintree

yii 2 braintree integration

Installs: 100

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

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

This package is not auto-updated.

Last update: 2024-04-18 23:20:46 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']);