Skip to content

babaly/laravel-paytech

Repository files navigation

Laravel Paytech Payment

Latest Version on Packagist

Total Downloads

Description

This package help laravel developers to use the paytech payment methods created by Intech-group.

[]

Installation

You can install the package via composer:

composer require babaly/laravel-paytech

Add the service provider to config/app.php into providers section

return [
    'providers' => [
        ...
        App\Providers\PaytechServiceProvider::class
    ]
];

You can publish all tags by running the command

php artisan vendor:publish --provider="Babaly\LaravelPaytech\LaravelPaytechServiceProvider"

--OR--

You can publish and run the migrations with:

php artisan vendor:publish --tag="laravel-paytech-migrations"
php artisan migrate

You can publish the config file with:

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

This is the contents of the published config file:

return [
    'PAYTECH_API_KEY' => '',
    'PAYTECH_SECRET_KEY' => '',
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="laravel-paytech-views"

You can publish the services file with:

php artisan vendor:publish --tag="laravel-paytech-services"

You can publish the model file with:

php artisan vendor:publish --tag="laravel-paytech-models"

You can publish the controller file with:

php artisan vendor:publish --tag="laravel-paytech-controllers"

Usage

Copy the API_SECRET_KEY and API_KEY from your paytech account and paste it to the config file with somethings likde this

return [
    'PAYTECH_API_KEY' => '',
    'PAYTECH_SECRET_KEY' => '',
];

Run Your application with the artisan command

php artisan serve

After that, visit the payment route to test payment platform

http://127.0.0.1:8000/payment

NB: Make sure that the routes is copied to default route web, else, copied the next line to your route file

use App\Http\Controllers\PaymentController;

Route::get('payment', [PaymentController::class, 'index'])->name('payment.index');
Route::post('/checkout', [PaymentController::class, 'payment'])->name('payment.submit');
Route::get('ipn', [PaymentController::class, 'ipn'])->name('paytech-ipn');
Route::get('payment-success/{code}', [PaymentController::class, 'success'])->name('payment.success');
Route::get('payment/{code}/success', [PaymentController::class, 'paymentSuccessView'])->name('payment.success.view');
Route::get('payment-cancel', [PaymentController::class, 'cancel'])->name('paytech.cancel');

A windows like this image will appear if everythings is ok

Alt text

Click the button to validate the command and you'll be redirected to paytech platform payment

Alt text

Alt text

Alt text

Alt text

Mode Production

Don't forget to set test mode to false if you're in production. You can disabled to the controller by calling methods setTestMode(false) or enable the live mode with setLiveMode(true).

If you're in test mode, Paytech retrieve just 100xof for any of your transactions amount. See more about transactions to their documentation

See their documentation for more information

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

About

A package for using paytech wallet payment platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published