2017 © Pedro Peláez
 

library uniteller-php-sdk

PHP Library for integration with Uniteller payment processing.

image

tmconsulting/uniteller-php-sdk

PHP Library for integration with Uniteller payment processing.

  • Friday, July 20, 2018
  • by smgladkovskiy
  • Repository
  • 6 Watchers
  • 17 Stars
  • 784 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 9 Versions
  • 16 % Grown

The README.md

Uniteller PHP SDK


, (*1)

, (*2)



, (*3)

, (*4)


, (*5)

PHP (7.2+) SDK for integration internet-acquiring of the Uniteller (unofficial). This documentation is available in Russian language. Also, this SDK integrated with Payum library and you can use gateway., (*6)

Features: * payment (method pay) * recurrent (method recurrent) * cancel (method unblock) * receive results * callback (method for verify incoming signature) * general error handler for any request * general statuses (In the requests/responses may to meet canceled or cancelled variants. They will be converted to general status like as cancelled.), (*7)

TODO: * translate to English comments and system (error) messages * validation * implement method card * implement method confirm, (*8)

Install

For install package follow this command:, (*9)

composer require tmconsulting/uniteller-php-sdk, (*10)

Usage

A few usage example the current SDK your can found on the examples folder. Just follow instruction on README.md file., (*11)

Configure credentials

<?php
$uniteller = new \Tmconsulting\Uniteller\Client();
$uniteller->setShopId('you_shop_id');
$uniteller->setLogin('you_login_number');
$uniteller->setPassword('you_password');
$uniteller->setBaseUri('https://wpay.uniteller.ru');

Redirect to page payment

So, for redirect to page your enough to run payment method with parameters like as:, (*12)

<?php
use Tmconsulting\Uniteller\Payment\PaymentBuilder;

$builder = new PaymentBuilder();
$builder
    ->setOrderIdp(mt_rand(10000, 99999))
    ->setSubtotalP(10)
    ->setCustomerIdp(mt_rand(10000, 99999))
    ->setUrlReturnOk('http://google.ru/?q=success')
    ->setUrlReturnNo('http://google.ru/?q=failure');

$uniteller->payment($builder)->go();
// if you don't need redirect
// $uniteller->payment($builder)->getUri();

or use plain array, (*13)

<?php
$uniteller->payment([
    'Order_IDP' => mt_rand(10000, 99999),
    // ... other parameters
])->go();

Recurrent payment

<?php
use Tmconsulting\Uniteller\Recurrent\RecurrentBuilder;

$builder = (new RecurrentBuilder())
    ->setOrderIdp(mt_rand(10000, 99999))
    ->setSubtotalP(15)
    ->setParentOrderIdp(00000) // order id of any past payment
    ->setParentShopIdp($uniteller->getShopId()); // optional

$results = $uniteller->recurrent($builder);

or use plain array, (*14)

<?php
$results = $uniteller->recurrent([
    'Order_IDP' => mt_rand(10000, 99999),
    // ... other parameters
]);

Cancel payment

<?php
use Tmconsulting\Uniteller\Cancel\CancelBuilder;

$builder = (new CancelBuilder())->setBillNumber('RRN Number, (12 digits)');
$results = $uniteller->cancel($builder);

or, (*15)

<?php
use Tmconsulting\Uniteller\Order\Status;

$results = $uniteller->cancel([
    'Billnumber' => 'RRN Number, (12 digits)',
    // ...
]);

foreach ($results as $payment) {
    // see Tmconsulting\Uniteller\Order\Order for other methods.
    if ($payment->getStatus() === Status::CANCELLED) {
        // payment was cancelled
    }    
} 

Receive results

<?php

$results = $uniteller->results([
    'ShopOrderNumber' => 'Order_IDP number'
]);

var_dump($results);

// $results[0]->getCardNumber();

Callback (gateway notification)

Receive incoming parameters from gateway and verifying signature., (*16)

<?php
if (! $uniteller->verifyCallbackRequest(['all_parameters_from_post_with_signature'])) {
    return 'invalid_signature';
}

Tests

vendor/bin/phpunit, (*17)

License

MIT., (*18)

The Versions

20/07 2018

dev-master

9999999-dev

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

20/07 2018

0.2.1

0.2.1.0

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

17/07 2018

0.2.0

0.2.0.0

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

25/06 2017

dev-add-code-of-conduct-1

dev-add-code-of-conduct-1

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

17/05 2017

0.1.5

0.1.5.0

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

14/03 2017

0.1.2

0.1.2.0

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

14/03 2017

dev-travis

dev-travis

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

13/03 2017

0.1.0

0.1.0.0

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie

13/03 2017

0.1.1

0.1.1.0

PHP Library for integration with Uniteller payment processing.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Roquie