PHP code example of angelbachev / epay

1. Go to this page and download the library: Download angelbachev/epay library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

angelbachev / epay example snippets


    php artisan vendor:publish --provider="AngelBachev\Epay\EpayServiceProvider"
    

    php artisan vendor:publish --tag="config"
    

    php artisan vendor:publish
    
 PHP
    Route::post('receive', function() { # replace 'receive' with your real route for handling Epay notifications

        $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 action="{{ Epay::getSubmitUrl() }}" method="post">
        {!! Epay::generateHiddenInputs() !!}

        // your code here

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