定制 babaly/laravel-paytech 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

babaly/laravel-paytech

Composer 安装命令:

composer require babaly/laravel-paytech

包简介

This package helps laravel developers to use paytech payment platform into their website (ecommerce etc.)

README 文档

README

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.

统计信息

  • 总下载量: 38
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固