dev-master
9999999-dev https://github.com/simplephp/paymentthis payment bundle for symfony2
MIT
The Requires
- php >=5.3.2
by kevin
pay symfony2 bundle alipay weixin payease
Wallogit.com
2017 © Pedro Peláez
this payment bundle for symfony2
payment 集成了原始支付宝支付SDK、微信支付SDK,封装了统一的支付接口,方便开发者快速集成支付功能,专注业务开发。, (*1)
1、通过命令行下安装:, (*2)
composer require "simplephp/payment:1.0.*"
2、通过项目下composer.json文件配置方式安装:, (*3)
"require": {
"simplephp/payment": "1.0.*"
}
1、配置详解, (*4)
$config = [
'alipay' => [
'default' => [
// 支付宝-应用ID-必填
'app_id' => '2021***408',
// 支付宝-应用私钥-必填
'merchant_private_key' => 'MIIE***m3I=',
// 支付宝-支付宝公钥-选填(alipay_public_key【密钥模式】 和 (alipay_public_cert_path、alipay_root_cert_path、merchant_cert_path【证书模式】)二选一
'alipay_public_key' => 'MIIB***AQAB',
// 支付宝-支付宝公钥证书路径-选填
'alipay_public_cert_path' => '',
// 支付宝-支付宝根证书路径-选填
'alipay_root_cert_path' => '',
// 支付宝-应用公钥证书文件路径-选填
'merchant_cert_path' => '',
// 支付宝-同步通知地址-选填
'return_url' => 'https://www.***.cn/alipay/return',
// 支付宝-异步通知地址-选填
'notify_url' => 'https://www.***.cn/alipay/notify',
// 支付宝-周期扣款/商家扣款-选填 product_code:产品码 周期扣款:CYCLE_PAY_AUTH:商家扣款:GENERAL_WITHHOLDING
'product_code' => Alipay::GENERAL_WITHHOLDING,
// 支付宝-周期扣款/商家扣款-选填 sign_scene:签约场景码,具体参数请商家完成产品签约后,根据业务场景或用户购买商品的差异性对应新增模版及场景码。 说明:登录 商家平台 > 产品大全 > 商家扣款 > 功能管理 > 修改 > 设置模版 可新增模版及场景码。商家在确认新增模版及场景码完成后,签约接入时需要传入模版中实际填写的场景码。场景码格式详情可查看
'sign_scene' => 'INDUSTRY|DEFAULT_SCENE',
// 支付宝-周期扣款/商家扣款-选填 签约个人产品码
'personal_product_code' => 'CYCLE_PAY_AUTH_P',
//'mode' => Pay::MODE_NORMAL,
],
// 其他商户配置 ....
],
'wechat' => [
'default' => [
// 微信-商户号-必填
'mch_id' => '151***131',
// 微信-应用ID-必填
'app_id' => 'wxd***2336',
// 微信-v3商户秘钥-必填
'api_v3_key' => 'RIGK***ZjZ3',
// 微信-商户私钥文件地址-必填
'merchant_private_key_path' => __DIR__ . '/cert/apiclient_key.pem',
// 微信-商户API证书序列号-必填
'merchant_certificate_serial' => '6645***D0744',
// 微信-支付平台证书地址-必填,使用 composer 生成
// composer exec CertificateDownloader.php -- -k ${apiV3key} -m ${mchId} -f ${mchPrivateKeyFilePath} -s ${mchSerialNo} -o ${outputFilePath}
'platform_certificate_file_path' => __DIR__ . '/cert/wechatpay_61A5***F60C.pem',
// 支付宝-同步通知地址-选填
'return_url' => 'https://www.***.cn/alipay/return',
// 支付宝-异步通知地址-选填
'notify_url' => 'https://www.***.cn/alipay/notify',
// 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE
//'mode' => Pay::MODE_NORMAL,
]
],
];
2、集成示例 (示例详情请查看examples目录), (*5)
├── examples │ ├── .... │ ├── notify.php // 异步通知示例 │ └── pay.php // 支付示例 ├── ...
本项目基于: - wechatpay/wechatpay - alipay-easysdk, (*6)
this payment bundle for symfony2
MIT
pay symfony2 bundle alipay weixin payease