khamdullaevuz/laravel-payme

There is no license information available for the latest version (1.0.0) of this package.

Laravel Payme

1.0.0 2023-07-21 06:10 UTC

This package is auto-updated.

Last update: 2024-11-21 09:17:29 UTC


README

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);