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
f5b70629
Commit
f5b70629
authored
Sep 07, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
d65aaa3d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
8 deletions
+42
-8
WxPay.php
application/library/Payment/WxPay.php
+26
-0
OrderService.php
application/models/Business/Order/OrderService.php
+0
-1
Order.php
application/models/DAO/Order/Order.php
+1
-1
RefundReturn.php
application/models/DAO/Order/RefundReturn.php
+14
-5
close.php
scripts/crontab/order/close.php
+1
-1
No files found.
application/library/Payment/WxPay.php
100755 → 100644
View file @
f5b70629
...
...
@@ -90,6 +90,32 @@ class WxPay extends \Payment\TencentPay
$this
->
checkSign
(
$values
);
return
$values
;
}
public
function
refundWxProgram
(
$param
)
{
$total_fee
=
intval
(
$param
[
'totalFee'
]);
$refund_fee
=
intval
(
$param
[
'refundFee'
]);
if
(
APP_ENV
==
'develop'
||
APP_ENV
==
'test'
||
APP_ENV
==
'pre'
||
APP_ENV
==
'ccwdevelop'
){
$this
->
parameters
[
'total_fee'
]
=
1
;
$this
->
parameters
[
'refund_fee'
]
=
1
;
}
else
{
$this
->
parameters
[
'total_fee'
]
=
$total_fee
;
$this
->
parameters
[
'refund_fee'
]
=
$refund_fee
;
}
$this
->
parameters
[
'out_refund_no'
]
=
$param
[
'refundOrderNo'
];
$this
->
parameters
[
'out_trade_no'
]
=
$param
[
'outTradeNo'
];
$this
->
parameters
[
'op_user_id'
]
=
$this
->
mch_id
;
$this
->
parameters
[
'nonce_str'
]
=
$this
->
createNoncestr
(
32
);
$this
->
parameters
[
'appid'
]
=
\Our\PayConst
::
wxLiteAppId
;
$this
->
parameters
[
'mch_id'
]
=
\Our\PayConst
::
wxPayMchId
;
$xml
=
$this
->
createXml
();
$response
=
$this
->
postXmlSSLCurl
(
$xml
,
$this
->
refundUrl
,
6
);
$values
=
$this
->
xmlToArray
(
$response
);
if
(
$values
[
'return_code'
]
!=
'SUCCESS'
)
{
return
$values
;
}
$this
->
checkSign
(
$values
);
return
$values
;
}
/**
* 类实例
...
...
application/models/Business/Order/OrderService.php
View file @
f5b70629
...
...
@@ -503,7 +503,6 @@ class OrderServiceModel extends \Business\AbstractModel
public
$baseDir
;
//订单任务脚本关闭订单
//订单任务脚本关闭订单
public
function
cancelOrderTask
()
{
...
...
application/models/DAO/Order/Order.php
View file @
f5b70629
...
...
@@ -771,7 +771,7 @@ class OrderModel extends \DAO\AbstractModel
//删除订单详情缓存
public
function
deleteFindByOrderIdCache
(
$orderId
)
{
return
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$this
,
'findByOrderId'
),
array
(
$orderId
),
array
(
$orderId
));
return
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$this
,
'findByOrderId'
),
array
(),
array
(
$orderId
));
}
//删除订单列表缓存
...
...
application/models/DAO/Order/RefundReturn.php
View file @
f5b70629
...
...
@@ -273,21 +273,30 @@ class RefundReturnModel extends \DAO\AbstractModel {
$refund_return
=
$wxpay
->
refund
(
$param
);
$this
->
errorMessage
=
"微信返回:"
.
json_encode
(
$refund_return
);
if
(
!
(
$refund_return
[
'return_code'
]
==
'SUCCESS'
&&
$refund_return
[
'result_code'
]
==
'SUCCESS'
))
{
$this
->
errorMessage
=
'微信退款操作执行失败!'
.
$orderInfo
[
'orderId'
]
.
"
\r\n
"
;
$this
->
errorMessage
=
date
(
'Y-m-d'
)
.
'微信退款操作执行失败!'
.
$orderInfo
[
'orderId'
]
.
"
\r\n
"
;
return
false
;
}
}
else
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
alipay
)
{
$aliPay
=
\Payment\Alipay
::
getInstance
();
$aliPay
=
\Payment\Alipay
::
getInstance
();
$return
=
$aliPay
->
refund
(
$param
);
$this
->
errorMessage
=
"支付宝返回:"
.
json_encode
(
$return
);
$this
->
errorMessage
=
"支付宝返回:"
.
json_encode
(
$return
);
$resultCode
=
$return
->
code
;
if
(
!
empty
(
$resultCode
)
&&
$resultCode
==
ApiConst
::
alipayRefundSuccess
)
{
if
(
!
empty
(
$resultCode
)
&&
$resultCode
==
ApiConst
::
alipayRefundSuccess
)
{
return
true
;
}
else
{
$this
->
errorMessage
=
'支付宝退款操作执行失败:'
.
$orderInfo
[
'orderId'
]
.
"
\r\n
"
;
$this
->
errorMessage
=
date
(
'Y-m-d'
)
.
'支付宝退款操作执行失败:'
.
$orderInfo
[
'orderId'
]
.
"
\r\n
"
;
return
false
;
}
}
else
if
(
intval
(
$orderInfo
[
'paymentType'
])
==
ApiConst
::
wxProgram
){
$wxpay
=
\Payment\WxPay
::
getInstance
();
$refund_return
=
$wxpay
->
refund
(
$param
);
$this
->
errorMessage
=
"微信小程序返回:"
.
json_encode
(
$refund_return
);
if
(
!
(
$refund_return
[
'return_code'
]
==
'SUCCESS'
&&
$refund_return
[
'result_code'
]
==
'SUCCESS'
))
{
$this
->
errorMessage
=
date
(
'Y-m-d'
)
.
'微信退款操作执行失败!'
.
$orderInfo
[
'orderId'
]
.
"
\r\n
"
;
return
false
;
}
}
return
true
;
}
/**
* 增加退款退货
...
...
scripts/crontab/order/close.php
100755 → 100644
View file @
f5b70629
...
...
@@ -81,7 +81,7 @@ class cliOrderClose extends basecli
}
$this
->
autoCloseOrder
();
echo
'定单关闭消息发送
成功'
.
"
\r\n
"
;
echo
date
(
'Y-m-d H:i:s'
,
TIMESTAMP
)
.
'定单关闭消息
成功'
.
"
\r\n
"
;
}
}
...
...
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