kitlabs/kit-pay-bundle
Composer 安装命令:
composer require kitlabs/kit-pay-bundle
包简介
Easily use alipay & weixinpay in Symfony
README 文档
README
Symfony wrapper for payment.
The KitPayBundle provides a simple integration for your Symfony project.
Installation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require kitlabs/kit-pay-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Kit\Bundle\PayBundle\KitPayBundle(),
);
// ...
}
// ...
}
Step 3: Configuration
# config.yml
kit_pay:
config:
alipay:
use_sandbox: true
partner: 20888xxxxxx #收款支付宝用户ID
app_id: 2014072xxxxxxx # 支付宝分配给开发者的应用ID
sign_type: RSA2 # RSA or RSA2
ali_public_key: '%kernel.root_dir%/alipay/alipay_public_key_sha256.txt' # path or content(app/alipay/alipay_public_key_sha256.txt)
rsa_private_key: '%kernel.root_dir%/alipay/rsa_private_key_2048.txt' # path or content(app/alipay/rsa_private_key_2048.txt)
limit_pay: ['creditCard']
notify_url: http://kitlabs.cn/notify
return_url: http://kitlabs.cn/return
return_raw: true # 异步回调是否显示原始数据
weipay:
use_sandbox: true
app_id: wx47xxxxxxx # appid是微信公众账号或开放平台APP的唯一标识
mch_id: 148xxxxxx # 商户收款账号
md5_key: de95341c9xxxxxx # API密钥
app_cert_pem: '%kernel.root_dir%/cert/apiclient_cert.pem' # app/cert/apiclient_cert.pem
app_key_pem: '%kernel.root_dir%/cert/apiclient_key.pem' # app/cert/apiclient_key.pem
sign_type: MD5 # MD5 or HMAC-SHA256
limit_pay: ['no_credit']
fee_type: CNY
notify_url: http://kitlabs.cn/notify
redirect_url: http://kitlabs.cn/return
return_raw: true # 异步回调是否显示原始数据
Read the payment configure documentation
Usage
//paytype and channel
$types = [
'alipay' => [
'ali_app', // 支付宝app支付
'ali_wap', // 支付宝H5支付
'ali_web', // 支付宝电脑网站支付
'ali_qr', // 支付宝当面付:扫码支付
'ali_bar' // 支付宝当面付:条码支付
],
'weipay' => [
'wx_app', // 微信app支付
'wx_pub', // 微信公众号支付
'wx_qr', // 微信扫码支付
'wx_bar', // 微信刷卡支付
'wx_lite', // 微信小程序支付
'wx_wap' // 微信H5支付
],
'cmbpay' => [
'cmb_app', // 招商一网通app支付
'cmb_wap' // 招商H5支付
]
];
/**
* @var \Kit\Bundle\PayBundle\Service\PaymentService $paymentService
*/
$paymentService = $this->get('kit_pay.payment_service');
$paymentService->run($channel, $paytype, $metadata); // $channel one of "alipay","weipay"
// 不使用默认配置的商户号支付,添加额外商户号支付
$paymentService->run($channel, $paytype, $metadata,$config); // $config为配置的数组
kitlabs/kit-pay-bundle 适用场景与选型建议
kitlabs/kit-pay-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 122 次下载、GitHub Stars 达 6, 最近一次更新时间为 2017 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「alipay」 「pay bundle」 「weixin pay」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kitlabs/kit-pay-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kitlabs/kit-pay-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kitlabs/kit-pay-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Payyo Gateway for the Omnipay payment processing library
Библиотека для приема платежей через Альфабанк.
克隆自 yansongda/pay
fork from yansongda/pay and support alipay cert with @cuikangyi 's pr https://github.com/yansongda/pay/pull/288
Some pre-defined rules for validation in Omnipay payment processing library.
BluePay gateway for the Omnipay payment processing library
统计信息
- 总下载量: 122
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-21