PHPackages                             benoth/boa-compra - 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. benoth/boa-compra

ActiveLibrary[Payment Processing](/categories/payments)

benoth/boa-compra
=================

Unofficial BoaCompra billing PHP library

1.0.3(10y ago)2121MITPHPPHP &gt;=5.4

Since Aug 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Benoth/boa-compra)[ Packagist](https://packagist.org/packages/benoth/boa-compra)[ RSS](/packages/benoth-boa-compra/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Unofficial BoaCompra billing PHP library
========================================

[](#unofficial-boacompra-billing-php-library)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/d72ca739ff4315416a27e01e6d944f93b960f0dc2329da27d39a7f69d88cb884/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f42656e6f74682f626f612d636f6d7072612e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Benoth/boa-compra)[![Coverage Status](https://camo.githubusercontent.com/0876600a08748c0fe8234eb2c4a35f04509e087f43f9101503670e195c7b4fb1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f42656e6f74682f626f612d636f6d7072612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Benoth/boa-compra/code-structure)[![Quality Score](https://camo.githubusercontent.com/b44af3a1b9106f5bb575fe5a67e61bac49bfdcae0ec561a0be709e1d3411a282/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f42656e6f74682f626f612d636f6d7072612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Benoth/boa-compra)[![SensioLabsInsight](https://camo.githubusercontent.com/b454e4ea736aa324fd7f05ce47ddb5d4a4745fb0b9f4b1ea5b8d657a38129f35/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64363037306530622d323030382d343262372d613265642d6537313839383135666439312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/d6070e0b-2008-42b7-a2ed-e7189815fd91)

This package is compliant with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

Requirements
------------

[](#requirements)

The following versions of PHP are supported:

- PHP 5.4
- PHP 5.5
- PHP 5.6
- PHP 7
- HHVM

The following extensions are also required:

- curl
- mbstring

Usage
-----

[](#usage)

### Create a payment

[](#create-a-payment)

```
$vsi = new VirtualStoreIdentification($yourStoreId, $yourSecretKey);

try {
    $endUser = new EndUser('me@example.com');
    $endUser->setName('John Doe')
            // ...
            ->setLanguage('en_US');

    $payment = new Payment(
        $vsi,
        $endUser,
        $yourReturnUrl,
        $yourNotifyUrl,
        $yourCurrencyIso,
        $yourOrderId,
        $orderDescription,
        $amount // without dot or comma (ie: 500 for $5.00)
    );
    $payment->setTestMode(1)
            ->setProjectId(1)
            ->setPaymentId(1);
} catch (\Exception $e) {
	// Log or anything ...
}

$form = new PaymentFormGenerator($payment);

// Then in your HTML code, just call :
$form->render();
```

### Validate BoaCompra notification

[](#validate-boacompra-notification)

```
try {
    // $payment is your previously set Payment object
	$notif = new PaymentNotification(
	    $payment,
	    $_POST['store_id'],
	    $_POST['transaction_id'],
	    $_POST['order_id'],
	    $_POST['amount'],
	    $_POST['currency_code'],
	    $_POST['payment_id'],
	    $_SERVER['REMOTE_ADDR']
	);
	$postback = new PaymentPostBack($notif);
	$postback->validatePayment();
	return 'Ok !';
} catch (\Exception $e) {
	return 'Error validating the payment : '.$e->getMessage();
}
```

### Check the status of a payment

[](#check-the-status-of-a-payment)

```
try {
	$notif = new PaymentNotification(
	    $payment,
	    $storeId,
	    $transactionId,
	    $orderId,
	    $amount,
	    $currencyCode,
	    $paymentId
	);
	$status = new PaymentCheckStatus($notif);
	$status->validatePayment();
	return 'Ok !';
} catch (\Exception $e) {
	return 'Error validating the payment : '.$e->getMessage();
}
```

API
---

[](#api)

The API documentation is available on [Github Pages](http://benoth.github.io/boa-compra/api/Benoth/BoaCompra.html)

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/Benoth/boa-compra/blob/master/LICENSE) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

Every ~9 days

Total

4

Last Release

3924d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f504a912e2ce0089dda1b1fd22e1da40fe19a4457c9491ee556989e25d263626?d=identicon)[Benoth](/maintainers/Benoth)

---

Top Contributors

[![lvancrayelynghe](https://avatars.githubusercontent.com/u/1170965?v=4)](https://github.com/lvancrayelynghe "lvancrayelynghe (66 commits)")

---

Tags

payment

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/benoth-boa-compra/health.svg)

```
[![Health](https://phpackages.com/badges/benoth-boa-compra/health.svg)](https://phpackages.com/packages/benoth-boa-compra)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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