2017 © Pedro Peláez
 

library osmp

Georgian OSMP System Payment

image

zgabievi/osmp

Georgian OSMP System Payment

  • Friday, June 2, 2017
  • by zgabievi
  • Repository
  • 1 Watchers
  • 3 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

laravel-osmp

Some great updates are comming soon..., (*1)

Latest Stable Version Total Downloads License, (*2)

OSMP
OSMP OSMP payment system integration for Laravel 5.*. Trying to make it perfect, easy to use and awesome package :tada: Pull requests are welcome.

Table of Contents

Installation

Composer

Run composer command in your terminal., (*3)

composer require zgabievi/osmp

Laravel

Open config/app.php and find the providers key. Add OSMPServiceProvider to the array., (*4)

Gabievi\OSMP\OSMPServiceProvider::class

Find the aliases key and add Facade to the array., (*5)

'OSMP' => Gabievi\OSMP\OSMPFacade::class

Usage

Attention! You need to disable short_open_tag in your php.ini file, to use xml response;, (*6)

Follow this url for more information: ini.short-open-tag, (*7)

Create route in your routes.php, (*8)

Route::get('billing', function () {
    // LISTENERS

    return OSMP::init();
})->middleware('osmp.auth');

Middleware is required if you want to make Basic Authentication, (*9)

In place of // LISTENERS you can write osmp listeners:, (*10)

Event::listen('osmp.*', function (...$args) {
    if ($args[0] == 'check') {
        // flash session data for check operation
        session()->flash('osmp', [
            'result' => 0,
            'data' => [
                'fullname' => 'Zura Gabievi',
                'account' => '000000'
            ]
        ]);
    } else {
        // flash session data for pay operation
        session()->flash('osmp', [
            'result' => 0,
            'data' => [
                'fullname' => 'John Doe',
                'account' => '000001'
            ]
        ]);
    }
});

Flashed session data will be used in XML response as additional information, (*11)

You can call Response early to show some kind of error. For example:, (*12)

return OSMP::Response(5);

This will output:, (*13)

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <result>5</result>
    <comment>User does not exist</comment>
</response>

Protocol

This is the protocol for provider:, (*14)

  • http(s)://yoursite.com/billing/?command=check&account=000000
  • http(s)://yoursite.com/billing/?command=pay&txn_id=1234567&account=000000&sum=10.45

Command: check/pay are required, (*15)

Codes

Key Description
0 Operation was successful
1 Server Timeout
4 Wrong format of the user's account
5 User does not exist
7 Payments are prohibited
215 Transaction duplication
275 Wrong amount
300 Fatal Error

Config

Publish OSMP config file using command:, (*16)

php artisan vendor:publish

Created file config\osmp.php. Inside you can change configuration as you wish., (*17)

License

laravel-osmp is licensed under a MIT License., (*18)

TODO

  • [ ] Create tests for checking funtionality
  • [ ] Create separated file for response codes
  • [ ] Make artisan command that will create reponse codes php file
  • [ ] Make artisan command that will register routes for user
  • [ ] Make OSMP object more Model like

The Versions

02/06 2017

dev-dependenci69160

dev-dependenci69160 https://github.com/zgabievi/OSMP

Georgian OSMP System Payment

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar zgabievi

payment zgabievi osmp

19/09 2016

dev-master

9999999-dev https://github.com/zgabievi/OSMP

Georgian OSMP System Payment

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar zgabievi

payment zgabievi osmp

14/01 2016

0.1.0

0.1.0.0 https://github.com/zgabievi/OSMP

OSMP Payment

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar zgabievi

payment zgabievi osmp