locastic/tcompayway
Composer 安装命令:
composer require locastic/tcompayway
包简介
T-com PayWay Library (HT PayWay API)
README 文档
README
#Installation Add repository to composer.json
"repositories": [
{
"url": "https://github.com/locastic/TcomPayWay.git",
"type": "git"
}
],
And inside "require"
"locastic/tcompayway": "@dev"
and use composer install
#Usage (Form)
use Locastic\TcomPayWay\AuthorizeForm\Model\Payment;
###Create object & populate data
$payment = new Payment(
'1234556', //shop id
'payway_secret',
'order_id', //must be unique for each payment
123, //amount
0,
'http://www.mojducan.com/success/narudžba456',
'http://www.mojducan.com/failure/narudžba456'
);
$payment->setPgwFirstName('name');
$payment->setPgwLastName('surname');
$payment->setPgwStreet('street');
$payment->setPgwPostCode('1234');
$payment->setPgwCity('Maribor');
$payment->setPgwCountry('Slovenia');
$payment->setPgwEmail('my.email@test.com');
$payment->setPgwPhoneNumber('1234567');
$payment->setPgwDisableInstallments(1);
$payment->setPgwAuthorizationType(0);
$payment->setPgwAuthorizationToken('');
$payment->setPgwReturnMethod('GET');
$payment->setPgwmerchantData('');
$payment->setPgwOrderInfo('');
$payment->setPgwOrderItems('');
$payment->setPgwLanguage('en');
###Small test example on how send data (with Laravel 5)
{!! Form::open(['method' => 'POST', 'url' => 'https://pgwtest.ht.hr/services/payment/api/authorize-form']) !!}
{!! Form::hidden('pgw_shop_id', $payment->getPgwShopId()) !!}
{!! Form::hidden('pgw_order_id', $payment->getPgwOrderId()) !!}
{!! Form::hidden('pgw_language', $payment->getPgwLanguage()) !!}
{!! Form::hidden('pgw_amount', $payment->getPgwAmount()) !!}
{!! Form::hidden('pgw_authorization_type', $payment->getPgwAuthorizationType()) !!}
{!! Form::hidden('pgw_success_url', $payment->getPgwSuccessUrl()) !!}
{!! Form::hidden('pgw_failure_url', $payment->getPgwFailureUrl()) !!}
{!! Form::hidden('pgw_signature', Locastic\TcomPayWay\AuthorizeForm\Helpers\SignatureGenerator::generateSignature($payment)) !!}
{!! Form::hidden('pgw_authorization_token', $payment->getPgwAuthorizationToken()) !!}
{!! Form::hidden('pgw_return_method', $payment->getPgwReturnMethod()) !!}
{!! Form::hidden('pgw_first_name', $payment->getPgwFirstName()) !!}
{!! Form::hidden('pgw_last_name', $payment->getPgwLastName()) !!}
{!! Form::hidden('pgw_street', $payment->getPgwStreet()) !!}
{!! Form::hidden('pgw_city', $payment->getPgwCity()) !!}
{!! Form::hidden('pgw_post_code', $payment->getPgwPostCode()) !!}
{!! Form::hidden('pgw_country', $payment->getPgwCountry()) !!}
{!! Form::hidden('pgw_telephone', $payment->getPgwPhoneNumber()) !!}
{!! Form::hidden('pgw_email', $payment->getPgwEmail()) !!}
{!! Form::hidden('pgw_merchant_data', $payment->getPgwmerchantData()) !!}
{!! Form::hidden('pgw_order_info', $payment->getPgwOrderInfo()) !!}
{!! Form::hidden('pgw_order_items', $payment->getPgwOrderItems()) !!}
{!! Form::hidden('pgw_disable_installments', $payment->getPgwDisableInstallments()) !!}
{!! Form::submit("Add", ['class' => 'btn btn-success']) !!}
{!! Form::close() !!}
###Reading response (example for Laravel 5.1)
$payment = new Payment(
'1234556', //shop id
'payway_secret',
'order_id', //must be unique for each payment
123, //amount
0,
'http://www.mojducan.com/success/narudžba456',
'http://www.mojducan.com/failure/narudžba456'
);
$payment->isPgwOrderedResponseValid($request->all()); //true or false
//or
$payment->isPgwResponseValid($request->all()); //true or false
locastic/tcompayway 适用场景与选型建议
locastic/tcompayway 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.64k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2014 年 08 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 locastic/tcompayway 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 locastic/tcompayway 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-08-19