PHP code example of merdan / gateway-tm

1. Go to this page and download the library: Download merdan/gateway-tm 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/ */

    

merdan / gateway-tm example snippets


'providers' => [
    //...
    Merdanio\GatewayTM\Payment\Providers\GatewayServiceProvider::class,
]

    'aliases' => Facade::defaultAliases()->merge([
        // 'Example' => App\Facades\Example::class,
        'Gateway' => Merdanio\GatewayTM\Payment\Facades\GatewayFacade::class
    ])->toArray(),

use Gateway;

class MyController extends Controller {

    public function index() {
        return Gateway::availableGates();
    }
}

Gateway::availableGates();

Gateway::registerOrder('rysgal', // providers code
    'success_route_name',        // route to return when payment is successful
    'fail_route_name',           // route to return when payment failed
    14500,                       // payment amount 145 man.
    'Example Ecommerse payment', // payment description
    'ord-123'                    // payment order number
);

Gateway::getOrderStatus(
    'rysgal', //providers code
    'ord-123' //order number
);
bash
php artisan vendor:publish --tag="gateway"