PHPackages                             alxlab-zone66x/beanstream - 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. [API Development](/categories/api)
4. /
5. alxlab-zone66x/beanstream

ActiveLibrary[API Development](/categories/api)

alxlab-zone66x/beanstream
=========================

Beanstream PHP API

021PHP

Since Sep 9Pushed 1y agoCompare

[ Source](https://github.com/alxlab-zone66x/beanstream-php)[ Packagist](https://packagist.org/packages/alxlab-zone66x/beanstream)[ RSS](/packages/alxlab-zone66x-beanstream/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Bambora PHP API
===============

[](#bambora-php-api)

Composer ready PHP wrapper for [Bambora NA Payment API](https://dev.na.bambora.com/docs/references/).

This fork contains fixes for PHP 8 and up.

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

[](#installation)

The recommended way to install the library is using [Composer](https://getcomposer.org).

1. Add this json to your composer.json file:

```
{
    "require": {
        "beanstream/beanstream": "dev-master"
    }
}
```

2. Next, run this from the command line:

```
composer install

```

3. Finally, add this line to your php file that will be using the SDK:

```
require 'vendor/autoload.php';

```

Handling Exceptions
-------------------

[](#handling-exceptions)

If the server returns an unexpected response or error, PHP API throws *\\Beanstream\\Exception*.

Positive error codes correspond to Beanstream API errors, see [Bambora NA Payment API](https://dev.na.bambora.com/docs/references/)

Negative codes correspond to [cURL errors](http://curl.haxx.se/libcurl/c/libcurl-errors.html)(original cURL error codes are positive, in *\\Beanstream\\Exception* those are just reversed). Exception with zero error code are PHP API specific, e.g. *The curl extension is required* or *Unexpected response format*.

Generally, any unsuccessful request, e.g. insufficient data or declined transaction, results in *\\Beanstream\\Exception*, thus *try..catch* is recommended for intercepting and handling them, see example below.

Your First Integration
----------------------

[](#your-first-integration)

```
