dgeorgiev / laravel-epay by dgeorgiev

Laravel epay.bg api integration
146
7
3
Package Data
Maintainer Username: dgeorgiev
Maintainer Contact: me@dgeorgiev.biz (Daniel Georgiev)
Package Create Date: 2015-12-04
Package Last Update: 2016-06-04
Language: PHP
License: MIT
Last Refreshed: 2024-05-02 15:00:25
Package Statistics
Total Downloads: 146
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 7
Total Watchers: 3
Total Forks: 0
Total Open Issues: 5

Laravel-epay API

Laravel wrapper for the Epay.bg API. Working with laravel 5.1

Install

Via Composer

$ composer require dgeorgiev/epay

  • Add the service provider to your $providers array in config/app.php file like:
Dgeorgiev\Epay\EpayServiceProvider::class
  • Add the alias to your $aliases array in config/app.php file like:
Epay' => Dgeorgiev\Epay\Facades\Epay::class
  • Run the following command to publish configuration:
php artisan vendor:publish

Usage


    $invoice     = sprintf("%.0f", rand(1, 50) * 105);
    $amount      = '22,80';
    $expiration  = '01.08.2020';
    $description = 'Test';

    Epay::setData(
        $invoice,
        $amount,
        $expiration,
        $description
    );

Notification receive route (POST)

    Route::post('receive', function(){

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

        /**
        * Update order or status of payment
        *
        *    array (
        *      'invoice' => '1890',
        *      'status' => 'PAID',
        *      'pay_date' => '20151204143730',
        *      'stan' => '036257',
        *      'bcode' => '036257',
        *    ),
        *
        **/
        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>Изпрати</button>
    </form>

Support

This package only supports Laravel 5 & Laravel 5.1 at the moment.

  • 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.

Security

If you discover any security related issues, please email me@dgeorgiev.biz instead of using the issue tracker.

Credits

epay.bg demo packages

License

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

https://packagist.org/packages/dgeorgiev/epay