PHPackages                             bryglen/yii2-braintree - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. bryglen/yii2-braintree

ActiveYii2-extension[Payment Processing](/categories/payments)

bryglen/yii2-braintree
======================

yii 2 braintree integration

1.0.0(10y ago)01.2k5[2 issues](https://github.com/bryglen/yii2-braintree/issues)MITPHP

Since Sep 25Pushed 10y ago2 watchersCompare

[ Source](https://github.com/bryglen/yii2-braintree)[ Packagist](https://packagist.org/packages/bryglen/yii2-braintree)[ RSS](/packages/bryglen-yii2-braintree/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

Yii 2 Braintree Integration
===========================

[](#yii-2-braintree-integration)

braintree for yii 2

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist bryglen/yii2-braintree "*"

```

or add

```
"bryglen/yii2-braintree": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

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

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

\*\* Creating a customer

```
$braintree = Yii::$app->braintree;
$response = $braintree->call('Customer', 'create', [
    'firstName' => 'bryan',
    ....
]);

$braintree = Yii::$app->braintree;
$response = $braintree->call('Transaction', 'sale', [
    'amount' => 25.00,
    'customerId' => 1,
    'paymentMethodToken' => 'some_token'
    ....
]);
```

braintree is using static methods for their API and to use the static methods for braintree. it should be like this `Braintree_Transaction::sale($args)` into `$braintree->call('Transaction', 'sale', $args)`

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3883d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/875604?v=4)[bryglen](/maintainers/bryglen)[@bryglen](https://github.com/bryglen)

---

Top Contributors

[![bryglen](https://avatars.githubusercontent.com/u/875604?v=4)](https://github.com/bryglen "bryglen (2 commits)")

---

Tags

phpyii2extensionbraintree

### Embed Badge

![Health badge](/badges/bryglen-yii2-braintree/health.svg)

```
[![Health](https://phpackages.com/badges/bryglen-yii2-braintree/health.svg)](https://phpackages.com/packages/bryglen-yii2-braintree)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
