Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
haishi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
haishi
Commits
e12b29b7
Commit
e12b29b7
authored
Mar 27, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
e8adf203
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
113 deletions
+3
-113
api/Appapi/Api/Charge.php
+3
-2
api/Appapi/Api/Wxpay.php
+0
-111
No files found.
api/Appapi/Api/Charge.php
View file @
e12b29b7
...
@@ -181,8 +181,9 @@ class Api_Charge extends PhalApi_Api {
...
@@ -181,8 +181,9 @@ class Api_Charge extends PhalApi_Api {
require
dirname
(
dirname
(
dirname
(
__DIR__
)))
.
'/vendor/autoload.php'
;
require
dirname
(
dirname
(
dirname
(
__DIR__
)))
.
'/vendor/autoload.php'
;
$wx_config
=
[
$wx_config
=
[
'wechat'
=>
[
'wechat'
=>
[
'appid'
=>
'wxa6bcebff7f4c5a3f'
,
// 'appid' => 'wxa6bcebff7f4c5a3f',
'appSecret'
=>
'4b7d6cd67fc566659fd1d9bd399dbcba'
,
'app_id'
=>
'wx31ac4d2b862fa9c0'
,
// 'appSecret' => '4b7d6cd67fc566659fd1d9bd399dbcba',
'mch_id'
=>
'1582052881'
,
'mch_id'
=>
'1582052881'
,
'key'
=>
'XCthxXszMdXiybUZnJBxyVgyVnV4zPuQ'
,
'key'
=>
'XCthxXszMdXiybUZnJBxyVgyVnV4zPuQ'
,
'notify_url'
=>
'http://www.seals-live.com/index.php?g=Appapi&m=pay&a=notify_wx'
,
'notify_url'
=>
'http://www.seals-live.com/index.php?g=Appapi&m=pay&a=notify_wx'
,
...
...
api/Appapi/Api/Wxpay.php
deleted
100755 → 0
View file @
e8adf203
<?php
class
Wxpay
{
protected
function
config
()
{
return
[
'appid'
=>
''
,
// app 开放平台的APPID
'app_id'
=>
''
,
// 公众号 APPID
'miniapp_id'
=>
''
,
//小程序 APPID
'appSecret'
=>
''
,
// 公众号 秘钥
'mch_id'
=>
''
,
// 商户号 id
'key'
=>
''
,
// 商户 key
'notify_url'
=>
'/pay/wx'
,
'cert_client'
=>
__DIR__
.
'/apiclient_cert.pem'
,
// optional, 退款,红包等情况时需要用到
'cert_key'
=>
__DIR__
.
'/apiclient_key.pem'
,
// optional, 退款,红包等情况时需要用到
];
}
protected
function
getWx
()
{
$config
=
$this
->
config
();
return
Yansongda\Pay\Pay
::
wechat
(
$config
);
}
public
function
scan
(
array
$order
)
{
$wx
=
$this
->
getWx
()
->
scan
(
$order
);
return
[
'id'
=>
$order
[
'out_trade_no'
],
'qr'
=>
$wx
->
code_url
,
];
}
public
function
app
(
array
$order
)
{
$data
=
$this
->
getWx
()
->
app
(
$order
);
return
json_decode
(
$data
,
true
);
}
public
function
pos
(
array
$order
)
{
// $order = [
// 'out_trade_no' => time(),
// 'body' => 'subject-测试',
// 'total_fee' => '1',
// 'auth_code' => '1354804793001231564897',
// ];
return
$this
->
getWx
()
->
pos
(
$order
);
}
public
function
transfer
(
array
$order
)
{
// $order = [
// 'partner_trade_no' => '', //商户订单号
// 'openid' => '', //收款人的openid
// 'check_name' => 'NO_CHECK', //NO_CHECK:不校验真实姓名\FORCE_CHECK:强校验真实姓名
// // 're_user_name'=>'张三', //check_name为 FORCE_CHECK 校验实名的时候必须提交
// 'amount' => '1', //企业付款金额,单位为分
// 'desc' => '帐户提现', //付款说明
// ];
return
$this
->
getWx
()
->
transfer
(
$order
);
}
public
function
mini
(
array
$order
)
{
// $order = [
// 'out_trade_no' => time(),
// 'body' => 'subject-测试',
// 'total_fee' => '1',
// 'openid' => 'onkVf1FjWS5SBxxxxxxxx',
// ];
return
$this
->
getWx
()
->
miniapp
(
$order
)
->
toArray
();
}
public
function
html
(
array
$order
,
$isH5
=
false
,
$isScan
=
false
)
{
// $order = [
// 'out_trade_no' => time(),
// 'body' => 'subject-测试',
// 'total_fee' => '1',
// 'openid' => 'onkVf1FjWS5SBxxxxxxxx',
// ];
if
(
$isH5
)
{
return
$this
->
getWx
()
->
wap
(
$order
)
->
send
();
}
if
(
$isScan
)
{
return
$this
->
scan
(
$order
);
}
return
$this
->
getWx
()
->
mp
(
$order
)
->
toArray
();
}
public
function
notify
(
$callback
)
{
$wx
=
$this
->
getWx
();
try
{
$data
=
$wx
->
verify
();
$r
=
call_user_func_array
(
$callback
,
[
$data
]);
if
(
!
empty
(
$r
))
{
return
$wx
->
success
()
->
send
();
}
}
catch
(
\Exception
$e
)
{
$e
->
getMessage
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment