PHPackages                             alext/silverstripe-btpayment - 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. alext/silverstripe-btpayment

ActiveSilverstripe-vendormodule[Payment Processing](/categories/payments)

alext/silverstripe-btpayment
============================

Integrate Braintree payment form in Dropin UI.

v0.6(8y ago)029proprietaryPHPPHP &gt;=5.6

Since Mar 15Pushed 8y agoCompare

[ Source](https://github.com/conqtc/btpayment)[ Packagist](https://packagist.org/packages/alext/silverstripe-btpayment)[ Docs](http://github.com/conqtc/btpayment)[ RSS](/packages/alext-silverstripe-btpayment/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (1)Versions (7)Used By (0)

silverstripe-btpayment
======================

[](#silverstripe-btpayment)

A SilverStripe module to integrate Braintree payment forms in Dropin UI.

Currently there're following forms:

- Make a payment form:

[![](../../../_screenshots/blob/master/btpayment/make_payment.png)](../../../_screenshots/blob/master/btpayment/make_payment.png)

- Add/remove payment methods in the vault:

[![](../../../_screenshots/blob/master/btpayment/manage_methods.png)](../../../_screenshots/blob/master/btpayment/manage_methods.png)

When there's no payment method in the vault, the form allows user to add a new payment method:

[![](../../../_screenshots/blob/master/btpayment/add_payment.png)](../../../_screenshots/blob/master/btpayment/add_payment.png)

Both forms (v0.6) allow user to authorize paypal:

[![](../../../_screenshots/blob/master/btpayment/authorize_paypal.png)](../../../_screenshots/blob/master/btpayment/authorize_paypal.png)

- Display previous transactions simple list

[![](../../../_screenshots/blob/master/btpayment/transactions.png)](../../../_screenshots/blob/master/btpayment/transactions.png)

Support SilverStripe 4.

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

[](#installation)

Use `composer` to install/update:

```
composer require alext/silverstripe-btpayment

```

Braintree settings
------------------

[](#braintree-settings)

After installing and rebuilding (`\dev\build?flush`) go to site admin - Settings and input Braintree settings, see screenshot below:

[![](../../../_screenshots/blob/master/btpayment/settings.png)](../../../_screenshots/blob/master/btpayment/settings.png)

SilverStripe member and Braintree customer
------------------------------------------

[](#silverstripe-member-and-braintree-customer)

This module extends SilverStripe member's data to create a Braintree customer for each member and store its customer id in database.

Braintree customer will be created on the fly at the first time using the forms if there's no customer id found.

Usage
-----

[](#usage)

- To use the make payment form, use `$BTPaymentForm` in your template of the page.

Example:

```
[SamplePayment.ss]

    $BTPaymentForm

```

The page controller must extend `BraintreePageController`

```
use AlexT\BTPayment\BraintreePageController;

class SamplePaymentPageController extends BraintreePageController {
}

```

- To use the payment methods management form, use `$BTEditPaymentForm($amount)` in your template, if $amount is not specified 0 (zero) will be put in place.

Example (in case we process the payment in the separate page, set the total amount on the fly):

```
[SamplePaymentManagement.ss]

    $BTEditPaymentForm

```

Example if we want to change the total amount on the fly:

```
[PaymentPage.ss]
Select a property to purchase:

    ----- Select property -----

        {$Title}

$BTPaymentForm
-----
[scripts.js]
$('#js-select-property').on('change', function (e) {
    $('.js-bt-amount').val($('#js-select-property').val());
});

```

The page controller must extend `BraintreeEditPageController`

```
use AlexT\BTPayment\BraintreeEditPageController;

class SamplePaymentManagementPageController extends BraintreeEditPageController {
}

```

- To use the previous transactions form, use `BTPreviousTransactionsForm` in your template.

Example:

```
[SamplePaymentManagement.ss]

    $BTPreviousTransactionsForm

```

The page controller must extend `BraintreePageController`.

To manually handle the transaction yourself, override `function processPayment($session, $form, $nonce, $amount)` to do your own transaction, for example:

```
public function processPayment($session, $form, $nonce, $amount) {
    $gateway = BraintreeExtension::BTGateway();
    // make a transaction
    $result = $gateway->transaction()->sale([
        'amount' => $amount,
        'paymentMethodNonce' => $nonce,
        'options' => [
            'submitForSettlement' => true
        ]
    ]);

    if ($result->success || !is_null($result->transaction)) {
        // clear session if everything is fine
        $session->clear("FormData.{$form->getName()}.data");
        $form->sessionMessage('A payment of ' . $amount . '$ has been made!', 'Success');
    } else {
        // ERROR
        $errorString = "";

        foreach ($result->errors->deepAll() as $error) {
            $errorString .= 'Error: ' . $error->code . ": " . $error->message . "\n";
        }

        $form->sessionError('Unable to make a payment! ' . $errorString, 'Failure');
    }

    return $this->redirectBack();
}

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Every ~4 days

Total

6

Last Release

3008d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24534860?v=4)[Alex Truong](/maintainers/conqtc)[@conqtc](https://github.com/conqtc)

---

Top Contributors

[![conqtc](https://avatars.githubusercontent.com/u/24534860?v=4)](https://github.com/conqtc "conqtc (12 commits)")

---

Tags

silverstripepaymentpaypalpaycardbraintreecredit

### Embed Badge

![Health badge](/badges/alext-silverstripe-btpayment/health.svg)

```
[![Health](https://phpackages.com/badges/alext-silverstripe-btpayment/health.svg)](https://phpackages.com/packages/alext-silverstripe-btpayment)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3147.0M55](/packages/omnipay-paypal)[cometcult/braintree-bundle

Symfony 2 Bundle for Braintree's PHP client library

2186.0k](/packages/cometcult-braintree-bundle)[freelancehunt/php-credit-card-validator

Validates popular debit and credit cards' numbers against regular expressions and Luhn algorithm. Also validates the CVC and the expiration date.

18658.7k2](/packages/freelancehunt-php-credit-card-validator)

PHPackages © 2026

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