2017 © Pedro Peláez
 

library laravel-uniteller

Laravel integration internet-acquiring of the Uniteller (unofficial)

image

gitkv/laravel-uniteller

Laravel integration internet-acquiring of the Uniteller (unofficial)

  • Friday, July 20, 2018
  • by gitkv
  • Repository
  • 1 Watchers
  • 5 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel Uniteller

Build Status, (*1)

Laravel / Lumen package for integration with Uniteller payment processing. The package is based on tmconsulting/uniteller-php-sdk/., (*2)

Requires: * Laravel / Lumen >=5.5 * PHP >= 7.1 * tmconsulting/uniteller-php-sdk, (*3)

Installation

  • Run:
composer require "gitkv/laravel-uniteller"

Configuration

Laravel:

Add service provider to /config/app.php:, (*4)

'providers' => [
    gitkv\Uniteller\LaravelServiceProvider::class
],
'aliases' => [
    'Uniteller' => gitkv\Uniteller\Facade\Uniteller::class,
],

Publish config/uniteller.php, (*5)

php artisan vendor:publish --provider="gitkv\Uniteller\LaravelServiceProvider" --tag=config

Lumen:

Register service provider to /bootstrap/app.php:, (*6)

$app->register(gitkv\Uniteller\LumenServiceProvider::class);

Copy config file /vendor/gitkv/laravel-uniteller/config/uniteller.php to /config/app.php, (*7)

cp vendor/gitkv/laravel-uniteller/config/uniteller.php config/app.php

Usage

Method "Pay":

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

$builder = (new PaymentBuilder())
    ->setOrderIdp('invoice_number')
    ->setSubtotalP(10)
    ->setCustomerIdp('customer_id');

$redirectUrl = Uniteller::pay($builder);

or, if need redirect, (*8)

Uniteller::pay($builder, false);

Method "Recurrent Pay":

<?php
use gitkv\Uniteller\Facade\Uniteller;
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

$result = Uniteller::recurrentPay($builder);

Method "Receive results":

<?php
use gitkv\Uniteller\Facade\Uniteller;

$result = Uniteller::receiveResult($orderIdp);

Method "Cancel":

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

$builder = (new CancelBuilder())->setBillNumber('RRN Number, (12 digits)');
$result = Uniteller::cancel($builder);

Method "Verify Signature":

<?php
use gitkv\Uniteller\Facade\Uniteller;

if (! Uniteller::verifyCallbackRequest(['all_parameters_from_post_with_signature'])) {
    return 'invalid_signature';
}

Callback event:

The package determines the default routing for processing the order status change. Default: [APP_URL]/uniteller/callback You need to specify this router in the settings of the billing uniteller., (*9)

If the order is successfully paid, the uniteller will make a POST request to your application. The query data will be validated (Uniteller::verifySignature), and upon success the event gitkv\Uniteller\Events\UnitellerCallbackEvent You only need to create an event listener and change the order status in your application., (*10)

UnitellerCallbackListener.php:, (*11)

<?php
namespace App\Listeners;


use gitkv\Uniteller\Events\UnitellerCallbackEvent;

class UnitellerCallbackListener {

    public function __construct() {
        //
    }

    public function handle(UnitellerCallbackEvent $event) {
        $payload = $event->getPayload();

        //your code here...
    }
}

The Versions

20/07 2018

dev-master

9999999-dev

Laravel integration internet-acquiring of the Uniteller (unofficial)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php lumen payment uniteller internet-acquiring

20/07 2018

v0.1.3

0.1.3.0

Laravel integration internet-acquiring of the Uniteller (unofficial)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php lumen payment uniteller internet-acquiring

19/07 2018

v0.1.2

0.1.2.0

Laravel integration internet-acquiring of the Uniteller (unofficial)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php lumen payment uniteller internet-acquiring

19/07 2018

v0.1.1

0.1.1.0

Laravel integration internet-acquiring of the Uniteller (unofficial)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php lumen payment uniteller internet-acquiring