ctf0/laravel-paymob
最新稳定版本:v2.0.0
Composer 安装命令:
composer require ctf0/laravel-paymob
包简介
paymob integration for laravel
README 文档
README
Laravel PayMob
Paymob integration for laravel.
Currently Supported
Installation
-
install the package
composer require ctf0/laravel-paymob
-
publish the package assets with
php artisan vendor:publish --provider="ctf0\PayMob\PayMobServiceProvider"
Config
Setup
-
add the package routes to your
routes/web.phpex.Route::group([ 'prefix' => 'orders', 'as' => 'order.', 'middleware' => 'auth', ], function () { ctf0\PayMob\PayMobRoutes::routes(); });
-
add
Billableto the model you will be billing. -
next add
getBillingData()which should return all the required fields for the order creation, check paymob requirements for more info.- all the optional fields has already been taken care of.
use Illuminate\Database\Eloquent\Model; use ctf0\PayMob\Integrations\Contracts\Billable; class Client extends Model implements Billable { // ... public function getBillingData(): array { return [ 'email' => $this->email, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'street' => $this->address, 'phone_number' => $this->phone_number, ]; } }
Usage
# Normal
-
update
paymob.controllerwith your own controller, which should have 3 methodsyou can check
DummyControllerfor a more detailed overview.type @method return GET checkOutreturns the view where the user will press the checkout btn POST processget the selected payment type & make a request to paymob server GET completecheck for the transaction hmac & save it to your server, for more info check.
# Refund
-
all you need to is to call
PayMob::refundand pass to it thetransaction_id&amount_in_poundsthat will be refunded, ex.for more info check
PayMob::refund(655, 10);
Security
If you discover any security-related issues, please email ctf0-dev@protonmail.com.
统计信息
- 总下载量: 534
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-23