支付回调,更新获取ip方式
parent
876616d5d0
commit
e9b02febaa
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\API\H5;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class PayController extends Controller
|
||||||
|
{
|
||||||
|
//支付回调
|
||||||
|
public function Notify()
|
||||||
|
{
|
||||||
|
$order_num =request('order_num');
|
||||||
|
$status =request('status');
|
||||||
|
$pay_info =request('pay_info');
|
||||||
|
if(!isset($order_num)) return \Yz::echoError1("订单号不能为空");
|
||||||
|
$order=DB::table('orders')->where(['order_number'=>$order_num])->first();
|
||||||
|
if(!$order) return \Yz::echoError1("订单不存在");
|
||||||
|
if($status=='SUCCESS'){
|
||||||
|
$u=DB::table('orders')->where(['order_number'=>$order_num])->update([
|
||||||
|
'status'=>2
|
||||||
|
]);
|
||||||
|
if($u){
|
||||||
|
return \Yz::Return(true,"更新成功",['order_num'=>$order_num]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue