微信充值退款逻辑和订单数据处理
This commit is contained in:
parent
97641a18ce
commit
ba9bc4a8aa
@ -114,7 +114,7 @@ class UserRechargeController extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//支付宝
|
//支付宝
|
||||||
|
return $this->success();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@ class PayController extends BaseApiController
|
|||||||
{
|
{
|
||||||
$app = new PayService(1);
|
$app = new PayService(1);
|
||||||
$result = $app->wechat->callback(Request()->post());
|
$result = $app->wechat->callback(Request()->post());
|
||||||
Cache::set('6log'.time(),$result);
|
|
||||||
Cache::set('6logJ'.time(),json_encode($result));
|
|
||||||
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
|
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
|
||||||
$ciphertext = $result->resource['ciphertext'];
|
$ciphertext = $result->resource['ciphertext'];
|
||||||
if ($ciphertext['trade_state'] === 'SUCCESS') {
|
if ($ciphertext['trade_state'] === 'SUCCESS') {
|
||||||
|
@ -259,6 +259,17 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
//更新状态
|
//更新状态
|
||||||
$order = StoreOrder::where('order_id', $orderSn)->findOrEmpty();
|
$order = StoreOrder::where('order_id', $orderSn)->findOrEmpty();
|
||||||
if ($order->isEmpty() || $order->status == OrderEnum::REFUND_PAY) {
|
if ($order->isEmpty() || $order->status == OrderEnum::REFUND_PAY) {
|
||||||
|
//充值
|
||||||
|
$orderRe = UserRecharge::where('order_id',$orderSn)->findOrEmpty();
|
||||||
|
if($orderRe->isEmpty() || $orderRe->status == -1){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
$orderRe->status = -1;
|
||||||
|
$orderRe->refund_price = $orderRe->price;
|
||||||
|
$orderRe->refund_time = time();
|
||||||
|
$orderRe->remarks = '';
|
||||||
|
$orderRe->save();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$order->status = OrderEnum::REFUND_PAY;
|
$order->status = OrderEnum::REFUND_PAY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user