PHPackages                             yarcode/yii2-payeer - 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. yarcode/yii2-payeer

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

yarcode/yii2-payeer
===================

Yii2 Payeer Component

2.0.2(9y ago)38.8k2MITPHPPHP &gt;=5.4.0

Since Jul 17Pushed 9y ago3 watchersCompare

[ Source](https://github.com/yarcode/yii2-payeer)[ Packagist](https://packagist.org/packages/yarcode/yii2-payeer)[ Docs](https://github.com/yarcode/yii2-payeer)[ RSS](/packages/yarcode-yii2-payeer/feed)WikiDiscussions master Synced 2mo ago

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

Payeer component for Yii2
=========================

[](#payeer-component-for-yii2)

Payment gateway and api client for [Payeer](https://payeer.com) service.

Package consists of 2 main components:

- `Api` to perform various API calls. For instance: get balance, send money, get account history, etc.
- `Merchant` to connect Merchant API and receipt payments

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist yarcode/yii2-payeer "~1.0"
```

or add

```
"yarcode/yii2-payeer": "~1.0"

```

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

API
---

[](#api)

### Configuration

[](#configuration)

Configure `payeerApi` component in the `components` section of your application.

```
'payeerApi' => [
    'class' => \yarcode\payeer\Api::class,
    'accountNumber' => '',
    'apiId' => '',
    'apiSecret' => ''
],
```

### Usage

[](#usage)

You shall wrap API calls using `try {} catch() {}` to handle any errors.

```
/** @var \yarcode\payeer\Api $api */
$api = Yii::$app->get('payeerApi');

try {
    $result = $api->balance();
} catch(ApiException $e) {
    // handle API errors here, for instance:
     $error = $e->getMessage();
     $result = null;
}
```

### Available Methods

[](#available-methods)

```
$api->isAuth();
$api->balance();
$api->transfer($to, $sum, $curIn, $curOut = null, array $restParams = [])
$api->checkUser('P1234567')
$api->getExchangeRate();
$api->initOutput($psId, $sumIn, $accountNumber, $curIn = self::CURRENCY_USD, $curOut = null);
$api->output($psId, $sumIn, $accountNumber, $curIn = self::CURRENCY_USD, $curOut = null);
$api->getPaySystems();
$api->historyInfo($historyId);
$api->shopOrderInfo($shopId, $orderId);
$api->history(array $params = []);
$api->merchant($shop, $ps, $form, array $restParams = []);
```

Merchant
--------

[](#merchant)

### Configuration

[](#configuration-1)

Configure `payeer` component in the `components` section of your application.

```
'payeer' => [
    'class' => \yarcode\payeer\Merchant::class,
    'shopId' => '',
    'secret' => '',
    'currency' => '' // by default Merchant::CURRENCY_USD
],
```

### Redirecting to the payment system

[](#redirecting-to-the-payment-system)

To redirect user to Payeer site you need to create the page with RedirectForm widget. User will redirected right after page load.

```
