2017-25 © Pedro Peláez
 

library epay

Epay.bg API wrapper for Laravel 5.*

image

angelbachev/epay

Epay.bg API wrapper for Laravel 5.*

  • Saturday, September 30, 2017
  • by angelbachev
  • Repository
  • 1 Watchers
  • 5 Stars
  • 713 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 14 % Grown

The README.md

Laravel-epay API

Laravel wrapper for the Epay.bg API. Working with laravel 5.1, (*1)

Install

Via Composer, (*2)

``` bash $ composer require angelbachev/epay, (*3)


* Add the service provider to your $providers array in config/app.php file like:

AngelBachev\Epay\EpayServiceProvider::class, (*4)


* Add the alias to your $aliases array in config/app.php file like:

'Epay' => AngelBachev\Epay\Facades\Epay::class, (*5)


* Run one of the following commands to publish package configuration depending on your needs: * To publish only **angelbachev/epay** package configuration: ``` php artisan vendor:publish --provider="AngelBachev\Epay\EpayServiceProvider" ``` * To publish configuration of all packages you use: ``` php artisan vendor:publish --tag="config" ``` * To publish all assets of all packages: ``` php artisan vendor:publish ``` * Add the following lines to your .env file

Epay configuration values

EPAY.mode=stage # if you want to make real payments set this to prod, (*6)

Settings for testing purposes

EPAY.stage.client_id= #Add your Customer number EPAY.stage.secret= #Add your Secret key EPAY.stage.success_url= #URL where you want the customer to be redirected after confirming payment EPAY.stage.cancel_url= #URL where you want the customer to be redirected if he rejects the payment, (*7)

Production settings

EPAY.prod.client_id= #Add your Customer number EPAY.prod.secret= #Add your Secret key EPAY.prod.success_url= #URL where you want the customer to be redirected after confirming payment EPAY.stage.cancel_url= #URL where you want the customer to be redirected if he rejects the payment, (*8)

## Usage

``` php

    $invoice     = mt_rand(1, 1000000);
    $amount      = 150.63;
    $expiration  = '01.03.2016 08:30:00';
    $description = 'Invoice Description';

    Epay::setData(
        $invoice,     // accepts only positive integer values
        $amount,      // accepts only positive integers and float numbers with 1 or 2 digits after decimal point
        $expiration,  // accepts time in format DD.MM.YYYY[ hh:mm[:ss]]
        $description, // max length 100 symbols
        [$currency],  // optional, accepts only "BGN", "USD", "EUR" ("BGN" by default)
        [$encoding]   // optional, accepts only "utf-8"
    );

Notification receive route (POST)

``` PHP Route::post('receive', function() { # replace 'receive' with your real route for handling Epay notifications, (*9)

    $receiver = Epay::receiveNotification(Input::all());

    /**
    * Update order or status of payment
    *
    *    array (
    *      'invoice' => '1500',
    *      'status' => 'PAID',
    *      'pay_date' => '20160221143730',
    *      'stan' => '036257',
    *      'bcode' => '036257',
    *    ),
    *
    **/
    // Do something with the response
    foreach($receiver['items'] as $item) {
        Log::info($item);
        Log::info($item['status']);
        Log::info($item['invoice']);
    }

    return $receiver['response'];
});


### Form in view
<form action="{{ Epay::getSubmitUrl() }}" method="post">
    {!! Epay::generateHiddenInputs() !!}

    // your code here

    <button type=submit>Send</button>
</form>

```, (*10)

Support

This package only supports Laravel 5 & Laravel 5.1 & 5.2 at the moment., (*11)

  • In case of any issues, kindly create one on the Issues section.
  • If you would like to contribute:
    • Fork this repository.
    • Implement your features.
    • Generate pull request.

Change log

Please see CHANGELOG for more information what has changed recently., (*12)

Security

If you discover any security related issues, please email angelbachev@gmail.com instead of using the issue tracker., (*13)

Credits

  • [epay.bg demo packages][https://demo.epay.bg/]

License

The MIT License (MIT). Please see License File for more information., (*14)

https://packagist.org/packages/angelbachev/epay, (*15)

The Versions

30/09 2017

dev-master

9999999-dev https://github.com/angelbachev/laravel-epay

Epay.bg API wrapper for Laravel 5.*

  Sources   Download

MIT

The Requires

 

The Development Requires

  • php >=4.8

by :Angel Bachev

epay angel bachev

30/09 2017

1.0.2

1.0.2.0 https://github.com/angelbachev/laravel-epay

Epay.bg API wrapper for Laravel 5.*

  Sources   Download

MIT

The Requires

 

The Development Requires

  • php >=4.8

by :Angel Bachev

epay angel bachev

22/02 2016

1.0.1

1.0.1.0 https://github.com/angelbachev/laravel-epay

Epay.bg API wrapper for Laravel 5.*

  Sources   Download

MIT

The Requires

 

The Development Requires

  • php >=4.8

by :Angel Bachev

epay angel bachev

22/02 2016

1.0.0

1.0.0.0 https://github.com/angelbachev/laravel-epay

Epay.bg API wrapper for Laravel 5.*

  Sources   Download

MIT

The Requires

 

by :Angel Bachev

epay angel bachev