更新支付回调
This commit is contained in:
parent
d0b44d71d3
commit
6058a4e21a
@ -64,46 +64,21 @@ class Auth extends BaseController
|
|||||||
{
|
{
|
||||||
public function dotest()
|
public function dotest()
|
||||||
{
|
{
|
||||||
$notify = [
|
$repository = app()->make(StoreOrderRepository::class);
|
||||||
'mchid' => '1635725673',
|
$param = [
|
||||||
'appid' => 'wx9d68c92b550ddd1e',
|
"status" => 0,
|
||||||
'out_trade_no' => 'bzj20230923161859650e9f73c308f',
|
"is_del" => 0,
|
||||||
'transaction_id' => '4200001919202309239135900670',
|
"mer_id" => 1,
|
||||||
'trade_type' => 'APP',
|
"pay_type" => 1,
|
||||||
'trade_state' => 'SUCCESS',
|
"attach" => "margin",
|
||||||
'trade_state_desc' => '支付成功',
|
"order_info" => '{"is_margin":1,"margin":"0.01"}',
|
||||||
'bank_type' => 'OTHERS',
|
"pay_price" => 0.01,
|
||||||
'attach' => 'margin',
|
"order_sn" => "bzj" . date('YmdHis') . uniqid(),
|
||||||
'success_time' => '2023-09-23T16:19:07+08:00',
|
"body" =>'哈哈哈',
|
||||||
'payer' => [
|
|
||||||
'openid' => 'okLE26lLqzkfg9cdxoSuPd6ApHyo',
|
|
||||||
],
|
|
||||||
'amount' => [
|
|
||||||
'total' => 1,
|
|
||||||
'payer_total' => 1,
|
|
||||||
'currency' => 'CNY',
|
|
||||||
'payer_currency' => 'CNY',
|
|
||||||
],
|
|
||||||
'scene_info' => [
|
|
||||||
'device_id' => 'shop system',
|
|
||||||
]
|
|
||||||
];
|
];
|
||||||
event('pay_success_margin', ['order_sn' => $notify['out_trade_no'], 'data' => $notify, 'is_combine' => 0]);
|
$payType = 'weixinApp';
|
||||||
// $repository = app()->make(StoreOrderRepository::class);
|
$service = new PayService($payType, $param);
|
||||||
// $param = [
|
$payInfo = $service->pay(User::where(['uid'=>1])->find());
|
||||||
// "status" => 0,
|
|
||||||
// "is_del" => 0,
|
|
||||||
// "mer_id" => 1,
|
|
||||||
// "pay_type" => 1,
|
|
||||||
// "attach" => "margin",
|
|
||||||
// "order_info" => '{"is_margin":1,"margin":"0.01"}',
|
|
||||||
// "pay_price" => 0.01,
|
|
||||||
// "order_sn" => "bzj" . date('YmdHis') . uniqid(),
|
|
||||||
// "body" =>'哈哈哈',
|
|
||||||
// ];
|
|
||||||
// $payType = 'weixinApp';
|
|
||||||
// $service = new PayService($payType, $param);
|
|
||||||
// $payInfo = $service->pay(User::where(['uid'=>1])->find());
|
|
||||||
return app('json')->success([]);
|
return app('json')->success([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,9 +590,8 @@ class WechatService
|
|||||||
$this->application->payment = new PaymentService($this->application->merchant);
|
$this->application->payment = new PaymentService($this->application->merchant);
|
||||||
//TODO 微信支付
|
//TODO 微信支付
|
||||||
return $this->application->payment->handleNotify(function ($notify, $successful) {
|
return $this->application->payment->handleNotify(function ($notify, $successful) {
|
||||||
Log::info('微信支付成功回调000' . var_export($notify, 1));
|
Log::info('微信支付成功回调' . var_export($notify, 1));
|
||||||
if (!$successful) return false;
|
if (!$successful) return false;
|
||||||
Log::info('微信支付成功回调111' . var_export($notify, 1));
|
|
||||||
try {
|
try {
|
||||||
event('pay_success_' . $notify['attach'], ['order_sn' => $notify['out_trade_no'], 'data' => $notify, 'is_combine' => 0]);
|
event('pay_success_' . $notify['attach'], ['order_sn' => $notify['out_trade_no'], 'data' => $notify, 'is_combine' => 0]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -606,9 +605,8 @@ class WechatService
|
|||||||
public function handleNotifyV3()
|
public function handleNotifyV3()
|
||||||
{
|
{
|
||||||
return $this->application->v3Pay->handleNotify(function ($notify, $successful) {
|
return $this->application->v3Pay->handleNotify(function ($notify, $successful) {
|
||||||
Log::info('微信支付成功回调0' . var_export($notify, 1));
|
Log::info('微信支付成功回调' . var_export($notify, 1));
|
||||||
if (!$successful) return false;
|
if (!$successful) return false;
|
||||||
Log::info('微信支付成功回调222' . var_export($notify, 1));
|
|
||||||
try {
|
try {
|
||||||
event('pay_success_' . $notify['attach'], ['order_sn' => $notify['out_trade_no'], 'data' => $notify, 'is_combine' => 0]);
|
event('pay_success_' . $notify['attach'], ['order_sn' => $notify['out_trade_no'], 'data' => $notify, 'is_combine' => 0]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user