—————–订单的支付宝支付
<?php
namespace App\Support\Pay;
use App\Contracts\Pay\PayContracts;
class AliPaySupport implements PayContracts
{
public function pay($order, $request)
{
if ($order->paid_at || $order->closed){
return [
'code' => 400,
'error' => '订单状态不正确'
];
}
return app('alipay')->web([
'out_trade_no' => $order->no,
'total_amount' => $order->total_amount,
'subject' => '支付 '.env('APP_NAME').' 的订单:'.$order->no,
]);
}
public function payReturn()
{
$data = app('alipay')->verify();
dd($data);
}
public function payNotify()
{
$data = app('alipay')->verify();
\Log::debug('Alipay notify'.$data->all());
}
}