Skip to content

khamdullaevuz/laravel-payme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Installation

composer require khamdullaevuz/laravel-payme

Configuration

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

Add your configs to config/payme.php

return [
    'min_amount' => env('PAYME_MIN_AMOUNT', 1_000_00),
    'max_amount' => env('PAYME_MAX_AMOUNT', 100_000_000_00),
    'identity' => env('PAYME_IDENTITY', 'id'),
    'login' => env('PAYME_LOGIN', 'TestUser'),
    'key' => env('PAYME_KEY', 'TestKey'),
    'merchant_id' => env('PAYME_MERCHANT_ID', '123456789'),
    'allowed_ips' => [
        '185.178.51.131', '185.178.51.132', '195.158.31.134', '195.158.31.10', '195.158.28.124', '195.158.5.82', '127.0.0.1'
    ]
];

Add service provider to config/app.php

'providers' => [
    // Other Service Providers
    Khamdullaevuz\Payme\PaymeServiceProvider::class,
],

Add facade to globally aliases in config/app.php

'aliases' => [
    // Other Aliases
    'Payme' => Khamdullaevuz\Payme\Facades\Payme::class,
],

Migrate database

php artisan migrate

Usage in route

use Khamdullaevuz\Payme\Facades\Payme;
use Khamdullaevuz\Payme\Http\Middleware\PaymeCheck;
use Illuminate\Http\Request;

// Other Routes

Route::any('/payme', function (Request $request) {
    return Payme::handle($request);
})->middleware(PaymeCheck::class);