Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ldy
/
payment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9fc1c285
authored
Oct 10, 2019
by
wangyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整README.md及移除测试内容
1 parent
24a88c67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
50 deletions
README.md
examples/TLConfig.php
examples/notify.php
README.md
View file @
9fc1c28
...
...
@@ -2,16 +2,25 @@
支付工具包 from riverslei/payment
> v2.0
> v1.0.x
*
初次发布
> v2.0.x
*
新增通联支付
> v3.0
*
新增
Mi付通道
> v3.0
.x
*
新增
米付支付
> v3.1
*
新增扫呗支付
通道
> v3.1
.x
*
新增扫呗支付
(利楚商务)
*
优化业务逻辑、修复已知bug
> v3.2
*
新增富友支付通道
*
已发现问题调整
\ No newline at end of file
> v3.2.x
-
v3.2.0.x
*
新增富友支付通道
*
已发现问题调整
-
v3.2.1
*
新增微信企业付款到银行卡及付款订单查询
examples/TLConfig.php
View file @
9fc1c28
<?php
/**
*
* @createTime: 2016-08-01 11:37
* @description: 微信配置文件
*/
return
[
'app_id'
=>
''
,
// 公众账号ID
'cus_id'
=>
''
,
// 商户id
'md5_key'
=>
''
,
// md5 秘钥
'sign_type'
=>
'MD5'
,
// MD5 HMAC-SHA256
'app_id'
=>
'00032161'
,
// 公众账号ID
'cus_id'
=>
'55079104816PJXP'
,
// 商户id
'md5_key'
=>
'55079104816PJXP04'
,
// md5 秘钥
'sign_type'
=>
'MD5'
,
// MD5 HMAC-SHA256
'limit_pay'
=>
[
'no_credit'
],
'
limit_pay'
=>
[
'no_credit'
]
,
'
notify_url'
=>
'http://172.16.2.46:8080/vo-apidemo/OrderServlet'
,
'
notify_url'
=>
'http://172.16.2.46:8080/vo-apidemo/OrderServlet'
,
'
redirect_url'
=>
''
,
// 如果是h5支付,可以设置该值,返回到指定页面
'redirect_url'
=>
'https://helei112g.github.io/'
,
// 如果是h5支付,可以设置该值,返回到指定页面
'return_raw'
=>
false
,
// 在处理回调时,是否直接返回原始数据,默认为true
'return_raw'
=>
false
,
// 在处理回调时,是否直接返回原始数据,默认为true
];
//测试账号
//商户号:55079104816PJXP
//交易密码:Zyzswz1234
// 登录密码:Zyzs123456
//
appid
:
000202
81
交易密钥:
55079104816
PJXP04
\ No newline at end of file
examples/notify.php
View file @
9fc1c28
<?php
/**
* 第三方支付回调处理
*
...
...
@@ -10,8 +11,6 @@ require_once __DIR__ . '/../autoload.php';
require_once
__DIR__
.
'/testNotify.php'
;
use
Payment\Common\PayException
;
use
Payment\Client\Notify
;
use
Payment\Utils\ArrayUtil
;
date_default_timezone_set
(
'Asia/Shanghai'
);
...
...
@@ -22,7 +21,7 @@ $tlConfig = require_once __DIR__ . '/TLConfig.php';
$miConfig
=
require_once
__DIR__
.
'/mipay/MiConfig.php'
;
$callback
=
new
TestNotify
();
$type
=
'
mi_charge'
;
// xx_charge
$type
=
'
wx'
;
if
(
stripos
(
$type
,
'ali'
)
!==
false
)
{
$config
=
$aliConfig
;
...
...
@@ -30,29 +29,16 @@ if (stripos($type, 'ali') !== false) {
$config
=
$wxConfig
;
}
elseif
(
stripos
(
$type
,
'cmb'
)
!==
false
)
{
$config
=
$cmbConfig
;
}
elseif
(
stripos
(
$type
,
'tl'
)
!==
false
)
{
}
elseif
(
stripos
(
$type
,
'tl'
)
!==
false
)
{
$config
=
$tlConfig
;
}
elseif
(
stripos
(
$type
,
'mi'
)
!==
false
)
{
}
elseif
(
stripos
(
$type
,
'mi'
)
!==
false
)
{
$config
=
$miConfig
;
}
try
{
if
(
!
empty
(
$config
)){
// $retData = Notify::getNotifyData($type, $config);// 获取第三方的原始数据,未进行签名检查
// $retData = "{\"acct\":\"odNM242ffm2FaJlLIpkcwM1O3YsE\",\"appid\":\"00020281\",\"chnltrxid\":\"4200000135201805042268978922\",\"cusid\":\"55079104816PJXP\",\"cusorderid\":\"20180504091414288930545254561086\",\"outtrxid\":\"20180504091414288930545254561086\",\"paytime\":\"20180504091423\",\"sign\":\"AD9FB6CD0E1455574C690F8AFE26F2A1\",\"termauthno\":\"CFT\",\"termrefnum\":\"4200000135201805042268978922\",\"termtraceno\":\"0\",\"trxamt\":\"1\",\"trxcode\":\"VSP501\",\"trxdate\":\"20180504\",\"trxid\":\"111817080000227489\",\"trxreserved\":\"通联支付测试备注信息\",\"trxstatus\":\"0000\"}";
//
// $ret = ArrayUtil::ValidSign(json_decode($retData,true), $tlConfig['md5_key']);
// $basePath = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'CacertFile' . DIRECTORY_SEPARATOR;
// $publicKeyPath = "{$basePath}mipay".DIRECTORY_SEPARATOR."meepay_public_key.pem";
$publicKeyPath
=
"/project/ldy/payment/src/CacertFile/mipay/meepay_public_key.pem"
;
$retData
=
"
{
\"result_code\":\"SUCCESS\",\"out_trade_sn\":\"SN20181031020706\",\"meepay_trade_no\":\"MF0118103102070684504\",\"transaction_id\":\"4200000203201810316768166604\",\"sub_merchant_id\":\"10002\",\"sub_appid\":\"wx03b4aeb839cc8d85\",\"sub_openid\":\"oUlAM0fD5RsWs9CvOCCMU_nYEDSY\",\"total_amount\":\"1\",\"trade_type\":\"NATIVE\",\"nonce_str\":\"af7rhpf50cjqjadyzthu82hyl7rzdkgk\",\"fee_type\":\"CNY\",\"cash_fee\":\"1\",\"attach\":\"1233\",\"sign_type\":\"RSA2\",\"sign\":\"d0AsaPytw9by+gfD9DLBHp9s1U+aQt9qVd1DYjPP4xvp+7umDU/bLsuxER+0XPF5M0vwdcks/Tge+KCWX3wWdMIOnltVKfDRFfsf7HOznwr4sE5zUxb0nkfCayLMZ/m/kcgqy9QryAl+SY/+MmLlmnxEI6eyjtnX0rf8qZyZDGI=\"
}
"
;
if
(
!
empty
(
$config
))
{
$ret
=
ArrayUtil
::
SignVerify
(
json_decode
(
$retData
,
true
),
$publicKeyPath
);
echo
$ret
;
}
}
catch
(
PayException
$e
)
{
echo
$e
->
errorMessage
();
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment