Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
326dfcc6
Commit
326dfcc6
authored
Jan 04, 2019
by
chenchuanwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orderClose
parent
103d36bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
TencentPay.php
application/library/Payment/TencentPay.php
+10
-7
RefundReturn.php
application/models/DAO/Order/RefundReturn.php
+7
-5
No files found.
application/library/Payment/TencentPay.php
View file @
326dfcc6
...
@@ -26,8 +26,8 @@ class TencentPay {
...
@@ -26,8 +26,8 @@ class TencentPay {
protected
$prepay_id
=
''
;
protected
$prepay_id
=
''
;
protected
$tradeType
=
''
;
protected
$tradeType
=
''
;
public
$data
;
//接收到的数据,类型为关联数组
public
$data
;
//接收到的数据,类型为关联数组
var
$returnParameters
;
//返回参数,类型为关联数组
public
$returnParameters
;
//返回参数,类型为关联数组
var
$parameters
;
//请求参数,类型为关联数组
public
$parameters
;
//请求参数,类型为关联数组
public
function
setRequestParams
(
$orderInfo
){
public
function
setRequestParams
(
$orderInfo
){
$pay_sn
=
$orderInfo
[
'paySn'
];
$pay_sn
=
$orderInfo
[
'paySn'
];
...
@@ -158,8 +158,11 @@ class TencentPay {
...
@@ -158,8 +158,11 @@ class TencentPay {
{
{
if
(
$signType
==
'MD5'
){
if
(
$signType
==
'MD5'
){
//echo '加签参数:'.json_encode($this->parameters)."\n";
//echo '加签参数:'.json_encode($this->parameters)."\n";
if
(
empty
(
$this
->
parameters
)){
$this
->
parameters
[
"sign"
]
=
$this
->
getSign
(
$this
->
parameters
);
//签名
echo
234234
;
exit
;
}
$tempParam
=
$this
->
parameters
;
$this
->
parameters
[
"sign"
]
=
$this
->
getSign
(
$tempParam
);
//签名
}
else
{
}
else
{
$this
->
parameters
[
"sign"
]
=
$this
->
getHMACSHA1Sign
(
$this
->
parameters
,
'sha256'
);
$this
->
parameters
[
"sign"
]
=
$this
->
getHMACSHA1Sign
(
$this
->
parameters
,
'sha256'
);
}
}
...
@@ -281,9 +284,9 @@ class TencentPay {
...
@@ -281,9 +284,9 @@ class TencentPay {
*/
*/
public
function
getSign
(
$Obj
)
public
function
getSign
(
$Obj
)
{
{
if
(
empty
(
$Obj
)){
/*
if(empty($Obj)){
var_dump
(
$this
->
parameters
);
exit
;
$Obj = $this->parameters
;
}
}
*/
foreach
(
$Obj
as
$k
=>
$v
)
foreach
(
$Obj
as
$k
=>
$v
)
{
{
$Parameters
[
$k
]
=
$v
;
$Parameters
[
$k
]
=
$v
;
...
...
application/models/DAO/Order/RefundReturn.php
View file @
326dfcc6
...
@@ -484,9 +484,10 @@ class RefundReturnModel extends \DAO\AbstractModel
...
@@ -484,9 +484,10 @@ class RefundReturnModel extends \DAO\AbstractModel
$param
[
'subMchId'
]
=
$mchIdArray
[
'mchId'
];
$param
[
'subMchId'
]
=
$mchIdArray
[
'mchId'
];
}
}
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
wxAppPayType
)
{
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
wxAppPayType
)
{
$wxpay
=
\Payment\WxPay
::
getInstance
();
$wxpay
=
new
\Payment\WxPay
();
//unset($param['subMchId']);
//unset($param['subMchId']);
$refund_return
=
$wxpay
->
refund
(
$param
);
$refund_return
=
$wxpay
->
refund
(
$param
);
unset
(
$wxpay
);
$this
->
errorMessage
=
"微信返回:"
.
json_encode
(
$refund_return
);
$this
->
errorMessage
=
"微信返回:"
.
json_encode
(
$refund_return
);
if
(
!
(
$refund_return
[
'return_code'
]
==
'SUCCESS'
&&
$refund_return
[
'result_code'
]
==
'SUCCESS'
))
{
if
(
!
(
$refund_return
[
'return_code'
]
==
'SUCCESS'
&&
$refund_return
[
'result_code'
]
==
'SUCCESS'
))
{
if
(
$refund_return
[
'err_code_des'
]
==
'订单已全额退款'
||
$refund_return
[
'err_code_des'
]
==
'订单已Q68额退款'
){
if
(
$refund_return
[
'err_code_des'
]
==
'订单已全额退款'
||
$refund_return
[
'err_code_des'
]
==
'订单已Q68额退款'
){
...
@@ -497,8 +498,9 @@ class RefundReturnModel extends \DAO\AbstractModel
...
@@ -497,8 +498,9 @@ class RefundReturnModel extends \DAO\AbstractModel
return
false
;
return
false
;
}
}
}
else
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
alipay
)
{
}
else
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
alipay
)
{
$aliPay
=
\Payment\Alipay
::
getInstance
();
$aliPay
=
new
\Payment\Alipay
();
$return
=
$aliPay
->
refund
(
$param
);
$return
=
$aliPay
->
refund
(
$param
);
unset
(
$aliPay
);
$this
->
errorMessage
=
"支付宝返回:"
.
json_encode
(
$return
);
$this
->
errorMessage
=
"支付宝返回:"
.
json_encode
(
$return
);
$resultCode
=
$return
->
code
;
$resultCode
=
$return
->
code
;
if
(
!
empty
(
$resultCode
)
&&
$resultCode
==
ApiConst
::
alipayRefundSuccess
)
{
if
(
!
empty
(
$resultCode
)
&&
$resultCode
==
ApiConst
::
alipayRefundSuccess
)
{
...
@@ -508,11 +510,10 @@ class RefundReturnModel extends \DAO\AbstractModel
...
@@ -508,11 +510,10 @@ class RefundReturnModel extends \DAO\AbstractModel
return
false
;
return
false
;
}
}
}
else
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
wxProgram
)
{
}
else
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
wxProgram
)
{
$wxpay
=
\Payment\WxLitePay
::
getInstance
();
$wxpay
=
new
\Payment\WxLitePay
();
$refund_return
=
$wxpay
->
refund
(
$param
);
$refund_return
=
$wxpay
->
refund
(
$param
);
unset
(
$wxpay
);
$this
->
errorMessage
=
"微信返回:"
.
json_encode
(
$refund_return
)
.
"
\r\n
"
;
$this
->
errorMessage
=
"微信返回:"
.
json_encode
(
$refund_return
)
.
"
\r\n
"
;
echo
json_encode
(
$param
)
.
"
\r\n
"
;
return
false
;
if
(
!
(
$refund_return
[
'return_code'
]
==
'SUCCESS'
&&
$refund_return
[
'result_code'
]
==
'SUCCESS'
))
{
if
(
!
(
$refund_return
[
'return_code'
]
==
'SUCCESS'
&&
$refund_return
[
'result_code'
]
==
'SUCCESS'
))
{
if
(
$refund_return
[
'err_code_des'
]
==
'订单已全额退款'
||
$refund_return
[
'err_code_des'
]
==
'订单已Q68额退款'
){
if
(
$refund_return
[
'err_code_des'
]
==
'订单已全额退款'
||
$refund_return
[
'err_code_des'
]
==
'订单已Q68额退款'
){
$this
->
errorMessage
=
date
(
'Y-m-d'
)
.
$refund_return
[
'err_code_des'
]
.
$orderInfo
[
'orderId'
]
.
"
\r\n
"
;
$this
->
errorMessage
=
date
(
'Y-m-d'
)
.
$refund_return
[
'err_code_des'
]
.
$orderInfo
[
'orderId'
]
.
"
\r\n
"
;
...
@@ -522,6 +523,7 @@ class RefundReturnModel extends \DAO\AbstractModel
...
@@ -522,6 +523,7 @@ class RefundReturnModel extends \DAO\AbstractModel
return
false
;
return
false
;
}
}
}
}
return
true
;
return
true
;
}
}
...
...
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