mirror of
https://github.com/v2board/v2board.git
synced 2025-01-26 16:09:09 +08:00
update
This commit is contained in:
parent
b4a7b20159
commit
bf28f4bc4b
@ -26,15 +26,15 @@ class OrderController extends Controller
|
|||||||
if($response->isPaid()){
|
if($response->isPaid()){
|
||||||
$order = Order::where('trade_no', $_POST['out_trade_no'])->first();
|
$order = Order::where('trade_no', $_POST['out_trade_no'])->first();
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
abort(500, 'ERROR');
|
abort(500, 'fail');
|
||||||
}
|
}
|
||||||
if ($order->status !== 0) {
|
if ($order->status !== 0) {
|
||||||
die('SUCCESS');
|
die('success');
|
||||||
}
|
}
|
||||||
$order->status = 1;
|
$order->status = 1;
|
||||||
$order->callback_no = $_POST['trade_no'];
|
$order->callback_no = $_POST['trade_no'];
|
||||||
if (!$order->save()) {
|
if (!$order->save()) {
|
||||||
abort(500, 'ERROR');
|
abort(500, 'fail');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Payment is successful
|
* Payment is successful
|
||||||
@ -72,16 +72,16 @@ class OrderController extends Controller
|
|||||||
if ($obj['status'] == 'succeeded') {
|
if ($obj['status'] == 'succeeded') {
|
||||||
$order = Order::where('callback_no', $obj['source']['id'])->first();
|
$order = Order::where('callback_no', $obj['source']['id'])->first();
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
abort(500, 'ERROR');
|
abort(500, 'fail');
|
||||||
}
|
}
|
||||||
if ($order->status !== 0) {
|
if ($order->status !== 0) {
|
||||||
die('SUCCESS');
|
die('success');
|
||||||
}
|
}
|
||||||
$order->status = 1;
|
$order->status = 1;
|
||||||
if (!$order->save()) {
|
if (!$order->save()) {
|
||||||
abort(500, 'ERROR');
|
abort(500, 'fail');
|
||||||
}
|
}
|
||||||
die('SUCCESS');
|
die('success');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user