gerro/dotpay
Composer 安装命令:
composer require gerro/dotpay
包简介
dotpay for laravel
README 文档
README
Dotpay for laravel (5.2, 5.3, 5.4)
#Installation
composer require gerro/dotpay
Add provider to /config/app.php
Gerro\Dotpay\GerroDotpayServiceProvider::class,
Add aliases to /config/app.php
'Dotpay'=> Gerro\Dotpay\Facades\Dotpay::class,
Copy to command
php artisan vendor:publish --provider="Gerro\Dotpay\GerroDotpayServiceProvider"
#Config/dotpay.php
return [ #id,pin 'Account'=>[ 'dotpayId'=>'123456', 'dotpayPin'=>'IvvvSbaR8J9YD3MF5nnr67CvTa1KVVVV' ], #url 'Services'=>[ 'production'=>'https://ssl.dotpay.pl/t2/', 'test'=>'https://ssl.dotpay.pl/test_payment/' ] ];
#Routes.php If you want to test it to add to the line
Route::get('/','DotpayController@start');
Route::post('/dotpay','DotpayController@dotpay');
Route::post('/end','DotpayController@end');
#Middleware/VerifyCsrfToken.php
protected $except = [
'/dotpay',
'/end'
];
#DotpayController.php
namespace App\Http\Controllers;use Illuminate\Http\Request;
use App\Http\Requests; use Dotpay; class DotpayController extends Controller { public function start(){
##### STEP 1 ##### //parameters $ParametersArray = array( "api_version" => "dev", "amount" => "11.07", "currency" => "PLN", "description" => "Platnosc za zamowienie 567915976", "control" => "12345", "url" => "http://example.com/end", "type" => "3", "buttontext" => "Wroc do poprzedniej strony !", "urlc" => "http://example.com/dotpay", "firstname" => "Jan", "lastname" => "Nowak", "email" => "jan.nowak@example.com", "street" => "Warszawska", "street_n1" => "1", "city" => "Krakow", "postcode" => "12-345", "phone" => "123456789", "country" => "POL" ); ##### STEP 2 ##### //parameters setting $ParametersSetArray = Dotpay::parametersSetArray($ParametersArray); ##### STEP 3 ##### //generator chk $chkValue = Dotpay::chkValue($ParametersSetArray); ##### STEP 3 ##### //production or test $environment = Dotpay::environment('test'); ##### STEP 4 ##### //method POST or GET $redirectionMethod = Dotpay::redirectionMethod('POST'); ##### STEP 5 ##### //Button automaticy $button = Dotpay::buttonDotpay($environment,$redirectionMethod,$chkValue,$ParametersSetArray); return view('welcome') ->with('button',$button); } public function dotpay(Request $request){ Dotpay::dotpayCheckServer(); $id = $request->id; $status = $request->operation_status; $amount = $request->operation_amount; $control = $request->control; //check is completed if(Dotpay::checkCompleted($status,$id,$amount,$control)) { //$t = new Transakcje(); //$t->id_transakcji = $id; //$t->amount = $amount; //$t->control = $control; //$t->save(); //must be at the end of echo 'OK'; } } public function end(Request $request){ if($request->status == 'OK') { return 'SUCCESS'; } else{ return 'FAIL'; } }}
Warning ! This is not a 100 % guarantee of security is still in the testing phase .
#License Gerro/Dotpay is open-sourced software licensed under the MIT license
gerro/dotpay 适用场景与选型建议
gerro/dotpay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 158 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 08 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 gerro/dotpay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gerro/dotpay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 158
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-01