Browse Source

支付通知

master
weigang 5 years ago
parent
commit
690619bdf4
  1. 2
      app/Service/v3/Implementations/OrderOfflineService.php
  2. 2
      app/Service/v3/Implementations/OrderOnlineService.php
  3. 12
      config/routes.php

2
app/Service/v3/Implementations/OrderOfflineService.php

@ -75,7 +75,7 @@ class OrderOfflineService implements OrderOfflineServiceInterface
Db::commit(); Db::commit();
// 支付 // 支付
return $this->paymentService->do($globalOrderId, $money, $userId, config('site_host') . '/wechat/notify/wxminioffline');
return $this->paymentService->do($globalOrderId, $money, $userId, config('site_host') . '/v3/wechat/notify/offline');
} catch (\Exception $e) { } catch (\Exception $e) {
Db::rollBack(); Db::rollBack();
$this->log->event(LogLabel::ORDER_ONLINE_LOG, ['exception_msg' => $e->getMessage()]); $this->log->event(LogLabel::ORDER_ONLINE_LOG, ['exception_msg' => $e->getMessage()]);

2
app/Service/v3/Implementations/OrderOnlineService.php

@ -363,7 +363,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface
Db::commit(); Db::commit();
// 支付 // 支付
return $this->paymentService->do($globalOrderId, $totalAmount, $userId, config('site_host') . '/wechat/notify/wxminionline');
return $this->paymentService->do($globalOrderId, $totalAmount, $userId, config('site_host') . '/v3/wechat/notify/online');
} catch (\Exception $e) { } catch (\Exception $e) {
Db::rollBack(); Db::rollBack();
$this->log->event(LogLabel::ORDER_ONLINE_LOG, ['exception_msg' => $e->getMessage()]); $this->log->event(LogLabel::ORDER_ONLINE_LOG, ['exception_msg' => $e->getMessage()]);

12
config/routes.php

@ -70,8 +70,8 @@ Router::addGroup('/v1/',function (){
},['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]);
Router::addGroup('/wechat/',function () { Router::addGroup('/wechat/',function () {
Router::post('notify/wxminionline', 'App\Controller\v3\NotifyController@wxminiOnline');
Router::post('notify/wxminioffline', 'App\Controller\v3\NotifyController@wxminiOffline');
Router::post('notify/wxminionline', 'App\Controller\NotifyController@wxminiOnline');
Router::post('notify/wxminioffline', 'App\Controller\NotifyController@wxminiOffline');
Router::post('notify/wxpayrefund', 'App\Controller\NotifyPayRefundController@wxPayRefund'); Router::post('notify/wxpayrefund', 'App\Controller\NotifyPayRefundController@wxPayRefund');
}); });
@ -130,4 +130,10 @@ Router::addGroup('/v3/', function () {
Router::post('userAddress/delete', 'App\Controller\v3\UserAddressController@delete'); Router::post('userAddress/delete', 'App\Controller\v3\UserAddressController@delete');
Router::post('coupon/getListByUser', 'App\Controller\v3\CouponController@getListByUser'); Router::post('coupon/getListByUser', 'App\Controller\v3\CouponController@getListByUser');
Router::post('shopCart/info', 'App\Controller\v3\ShopCartController@info'); Router::post('shopCart/info', 'App\Controller\v3\ShopCartController@info');
},['middleware' => [\App\Middleware\Auth\ApiMiddleware::class, \App\Middleware\Auth\UserMiddleware::class]]);
},['middleware' => [\App\Middleware\Auth\ApiMiddleware::class, \App\Middleware\Auth\UserMiddleware::class]]);
// 微信支付回调
Router::addGroup('/v3/wechat/',function () {
Router::post('notify/online', 'App\Controller\v3\NotifyController@wxminiOnline');
Router::post('notify/offline', 'App\Controller\v3\NotifyController@wxminiOffline');
});
Loading…
Cancel
Save