OrdersController.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. <?php
  2. namespace App\Http\Controllers\QuickApp\Order;
  3. use App\Modules\Activity\Models\Activity;
  4. use App\Modules\Statistic\Services\AdVisitStatService;
  5. use App\Http\Controllers\QuickApp\BaseController;
  6. use Illuminate\Http\Request;
  7. use App\Modules\Subscribe\Services\BookOrderService;
  8. use App\Modules\Subscribe\Services\ChapterOrderService;
  9. use App\Modules\Subscribe\Services\OrderService;
  10. use App\Http\Controllers\QuickApp\Order\Transformers\BookOrderTransformer;
  11. use App\Http\Controllers\QuickApp\Order\Transformers\ChapterOrderTransformer;
  12. use App\Http\Controllers\QuickApp\Order\Transformers\ChargeListTransformer;
  13. use App\Libs\Pay\PayFactory;
  14. use Hashids;
  15. use App\Modules\Product\Services\ProductService;
  16. use App\Modules\Book\Services\BookConfigService;
  17. use App\Modules\Book\Services\BookService;
  18. use App\Modules\Channel\Services\PayTemplateService;
  19. use App\Modules\Subscribe\Models\Order;
  20. use App\Modules\Trade\Pay\OrderArousePayFactory;
  21. use App\Modules\Trade\Pay\OrderPaySuccess;
  22. use App\Modules\Trade\Services\PayMerchantService;
  23. use EasyWeChat\Support\XML;
  24. class OrdersController extends BaseController
  25. {
  26. /**
  27. * @apiDefine Order 订单
  28. */
  29. /**
  30. *
  31. */
  32. private $chargeList;
  33. public function exchangeList()
  34. {
  35. foreach ($this->chargeList as &$item) {
  36. if (!$item->switch_to) continue;
  37. $order = Order::where('uid', $this->uid)->where('status', 'PAID')->where('product_id', $item->id)->first();
  38. if ($order) {
  39. $change = ProductService::getProductSingle($item->switch_to);
  40. $item->id = $change->id;
  41. $item->price = $change->price;
  42. $item->given = $change->given;
  43. }
  44. }
  45. }
  46. /**
  47. * @apiVersion 1.0.0
  48. * @apiDescription 充值列表
  49. * @api {get} order/chargeList 充值列表
  50. * @apiHeader {String} [Authorization] token
  51. * @apiGroup Order
  52. * @apiName chargeList
  53. * @apiSuccess {int} code 状态码
  54. * @apiSuccess {String} msg 信息
  55. * @apiSuccess {object} data 结果集
  56. * @apiSuccessExample {json} Success-Response:
  57. * HTTP/1.1 200 OK
  58. * {
  59. * code: 0,
  60. * msg: "",
  61. * data: [
  62. * {
  63. * product_id: 1,
  64. * price: "30.00元",
  65. * vip: 0,
  66. * intro: [
  67. * {
  68. * label: 3000,
  69. * important: false
  70. * },
  71. * {
  72. * label: "书币",
  73. * important: true
  74. * }
  75. * ]
  76. * },
  77. * {
  78. * product_id: 2,
  79. * price: "50.00元",
  80. * vip: 1,
  81. * intro: [
  82. * {
  83. * label: 5000,
  84. * important: false
  85. * },
  86. * {
  87. * label: "1000+",
  88. * important: true
  89. * },
  90. * {
  91. * label: "书币",
  92. * important: false
  93. * }
  94. * ]
  95. * },
  96. * {
  97. * product_id: 5,
  98. * price: "365.00元",
  99. * vip: 0,
  100. * intro: [
  101. * {
  102. * label: "年费VIP会员",
  103. * important: true
  104. * }
  105. * ]
  106. * }
  107. * ]
  108. * }
  109. */
  110. public function chargeList(Request $request)
  111. {
  112. $bid = $request->input('bid', '');
  113. $temp = $bid;
  114. $template_id = PayTemplateService::getPayTemplate($this->distribution_channel_id);
  115. $book_config = null;
  116. if ($bid) {
  117. $bid = Hashids::decode($bid)[0];
  118. $book_config = BookConfigService::getBookById($bid);
  119. }
  120. if ($template_id == 2) { //模板2只有在长篇小说过来的用户才显示
  121. //部分渠道需要2元模板不管哪个入口进来都展示
  122. $exclude_channels = explode(',', env('PRICE_TWO_SHOW_ALL_CHANNEL'));
  123. if (!in_array($this->distribution_channel_id, $exclude_channels)) {
  124. if ($book_config) {
  125. if ($book_config->charge_type == 'BOOK') $template_id = 1;
  126. }
  127. }
  128. }
  129. $res = ProductService::getChargeProduct($template_id);
  130. if (!$res) {
  131. return response()->error('WAP_SYS_ERROR');
  132. }
  133. $this->chargeList = $res;
  134. $this->exchangeList();
  135. //TODO 长篇小数才有模板2
  136. $uid = $this->uid;
  137. $is_first_recharge = OrderService::judgeUserFirstRecharge($uid);
  138. $data = [];
  139. $appad = 0;
  140. foreach ($res as $v) {
  141. if ($template_id == 7 && $book_config && $book_config->charge_type == 'BOOK' && $v->price == 2) {
  142. continue;
  143. }
  144. if ($template_id == 2 && $v->type == 'NEW_USER' && !$bid) {
  145. //2元模版,直接进充值,不出现
  146. continue;
  147. }
  148. if ($v->type == 'NEW_USER' && $is_first_recharge) {
  149. if (
  150. env('NO_NEW_USER_CHARGE') &&
  151. in_array(
  152. $this->distribution_channel_id,
  153. explode(',', env('NO_NEW_USER_CHARGE'))
  154. )
  155. ) {
  156. continue;
  157. }
  158. $temp = [
  159. 'price' => (float)$v->price . '元',
  160. 'is_year_order' => 0,
  161. 'is_month_order' => 0,
  162. 'text' => sprintf('%s+%s书币', $v->price * 100, $v->given),
  163. 'today_special' => $v->is_default,
  164. 'first_charge' => true,
  165. 'save_text' => round($v->given / 100, 1) . '元',
  166. 'product_id' => $v->id,
  167. ];
  168. $data[] = $temp;
  169. } elseif ($v->type == 'YEAR_ORDER') {
  170. if ($v->type == 'NEW_USER') {
  171. continue;
  172. }
  173. $save_text = '年费vip会员';
  174. $text = '每天1元,全年免费看';
  175. $temp = [
  176. 'price' => (int)$v->price . '元',
  177. 'is_year_order' => 1,
  178. 'is_month_order' => 0,
  179. 'text' => $text,
  180. 'today_special' => $v->is_default,
  181. 'first_charge' => false,
  182. 'save_text' => $save_text,
  183. 'product_id' => $v->id,
  184. ];
  185. $data[] = $temp;
  186. } else {
  187. if ($v->type == 'NEW_USER') {
  188. continue;
  189. }
  190. $save_text = '';
  191. if ($v->given) {
  192. $save_text = round($v->given / 100, 1) . '元';
  193. $text = sprintf('%s+%s书币', $v->price * 100, $v->given);
  194. } else {
  195. $text = sprintf('%s书币', $v->price * 100);
  196. }
  197. $temp = [
  198. 'price' => (float)$v->price . '元',
  199. 'is_year_order' => 0,
  200. 'is_month_order' => 0,
  201. 'text' => $text,
  202. 'today_special' => $v->is_default,
  203. 'first_charge' => false,
  204. 'save_text' => $save_text,
  205. 'product_id' => $v->id,
  206. ];
  207. $data[] = $temp;
  208. }
  209. }
  210. return response()->success($data);
  211. }
  212. /**
  213. * @apiVersion 1.0.0
  214. * @apiDescription 单本消费记录
  215. * @api {get} order/bookOrderList 单本消费记录
  216. * @apiHeader {String} [Authorization] token
  217. * @apiGroup Order
  218. * @apiName bookOrderList
  219. * @apiParam {String} [page_size] 分页大小
  220. * @apiParam {String} [page] 页码
  221. * @apiSuccess {int} code 状态码
  222. * @apiSuccess {String} msg 信息
  223. * @apiSuccess {object} data 结果集
  224. * @apiSuccess {Int} uid uid
  225. * @apiSuccess {Int} bid bid
  226. * @apiSuccess {Int} book_name 书名
  227. * @apiSuccess {Int} fee 钱
  228. * @apiSuccess {String} created_at 时间
  229. * @apiSuccessExample {json} Success-Response:
  230. * HTTP/1.1 200 OK
  231. * {
  232. * code: 0,
  233. * msg: "",
  234. * data: list:[
  235. * {
  236. * uid: 4,
  237. * bid: 1,
  238. * book_name: "dfsedfertrwet",
  239. * fee: 100,
  240. * created_at: "2017-12-02 16:24:54"
  241. * }
  242. * ]
  243. * meta: {
  244. * total: 1,
  245. * per_page: 15,
  246. * current_page: 1,
  247. * last_page: 1,
  248. * next_page_url: "",
  249. * prev_page_url: ""
  250. * }
  251. * }
  252. * }
  253. */
  254. public function bookOrderList(Request $request)
  255. {
  256. $page_size = $request->input('page_size', 15);
  257. $book_order = BookOrderService::getRecord($this->uid, $page_size);
  258. return response()->pagination(new BookOrderTransformer(), $book_order);
  259. }
  260. /**
  261. * @apiVersion 1.0.0
  262. * @apiDescription 章节消费记录
  263. * @api {get} order/chapterOrderList 章节消费记录
  264. * @apiHeader {String} [Authorization] token
  265. * @apiGroup Order
  266. * @apiName chapterOrderList
  267. * @apiParam {String} [page_size] 分页大小
  268. * @apiParam {String} [page] 页码
  269. * @apiSuccess {int} code 状态码
  270. * @apiSuccess {String} msg 信息
  271. * @apiSuccess {object} data 结果集
  272. * @apiSuccess {Int} uid uid
  273. * @apiSuccess {Int} bid bid
  274. * @apiSuccess {Int} cid cid
  275. * @apiSuccess {Int} chapter_name 章节名
  276. * @apiSuccess {Int} book_name 书名
  277. * @apiSuccess {Int} fee 钱
  278. * @apiSuccess {String} created_at 时间
  279. * @apiSuccessExample {json} Success-Response:
  280. * HTTP/1.1 200 OK
  281. * {
  282. * code: 0,
  283. * msg: "",
  284. * data: list:[
  285. * {
  286. * uid: 4,
  287. * bid: 1,
  288. * cid: 1,
  289. * chapter_name: "sdfsd",
  290. * book_name: "dfsedfertrwet",
  291. * fee: 100,
  292. * created_at: "2017-12-02 16:24:54"
  293. * }
  294. * ]
  295. * meta: {
  296. * total: 1,
  297. * per_page: 15,
  298. * current_page: 1,
  299. * last_page: 1,
  300. * next_page_url: "",
  301. * prev_page_url: ""
  302. * }
  303. * }
  304. */
  305. public function chapterOrderList(Request $request)
  306. {
  307. $chapter_model = new ChapterOrderService();
  308. $page_size = $request->input('page_size', 15);
  309. $chapter_order = $chapter_model->getByUid($this->uid, $page_size);
  310. foreach ($chapter_order as $item) {
  311. if ($item->fee == 0) {
  312. $result = AdVisitStatService::getInfoV2($this->uid, $item->cid, ['UNLOCK', 'UNLOCK_2']);
  313. $item->fee = '解锁';
  314. }
  315. }
  316. return response()->pagination(new ChapterOrderTransformer(), $chapter_order);
  317. }
  318. /**
  319. * @apiVersion 1.0.0
  320. * @apiDescription 充值记录
  321. * @api {get} order/chargeRecordLists 充值记录
  322. * @apiParam {String} [token] token
  323. * @apiHeader {String} [Authorization] token 两个token任选其一
  324. * @apiGroup Order
  325. * @apiName chargeRecordLists
  326. * @apiParam {String} [page_size] 分页大小
  327. * @apiParam {String} [page] 页码
  328. * @apiSuccess {int} code 状态码
  329. * @apiSuccess {String} msg 信息
  330. * @apiSuccess {object} data 结果集
  331. * @apiSuccess {String} data.price 价格
  332. * @apiSuccess {String} data.status 状态
  333. * @apiSuccess {String} data.trade_no 订单号
  334. * @apiSuccess {String} data.created_at 时间
  335. * @apiSuccessExample {json} Success-Response:
  336. * HTTP/1.1 200 OK
  337. * {
  338. * code: 0,
  339. * msg: "",
  340. * data: {
  341. * list: [
  342. * {
  343. * id: 134,
  344. * price: "1.00",
  345. * status: "PAID",
  346. * trade_no: "201712021915481585670623626232",
  347. * created_at: "2017-12-02 19:15:56"
  348. * }
  349. * ],
  350. * meta: {
  351. * total: 1,
  352. * per_page: 15,
  353. * current_page: 1,
  354. * last_page: 1,
  355. * next_page_url: "",
  356. * prev_page_url: ""
  357. * }
  358. * }
  359. * }
  360. */
  361. public function chargeRecordLists(Request $request)
  362. {
  363. $page_size = $request->input('page_size', 15);
  364. $res = OrderService::getOrderList($this->uid, $page_size);
  365. return response()->pagination(new ChargeListTransformer(), $res);
  366. }
  367. private function getPayParams(Request $request)
  368. {
  369. myLog('pay-order')->info('request', ['params' => $request->all()]);
  370. $uid = $this->uid;
  371. $product_id = $request->get('product_id', 0);
  372. $send_order_id = $this->send_order_id;
  373. if (!$product_id) {
  374. return false;
  375. }
  376. $bid = $request->get('bid', 0);
  377. if ($bid) {
  378. $from_bid = BookService::decodeBidStatic($bid);
  379. }
  380. $trade_no = date("YmdHis") . hexdec(uniqid());
  381. $product_info = ProductService::getProductSingle($product_id);
  382. if (!getProp($product_info, 'id')) {
  383. return false;
  384. }
  385. $distribution_channel_id = $this->distribution_channel_id;
  386. $price = $product_info->price * 100;
  387. if (in_array($uid, explode(',', env('TEST_UID')))) {
  388. $price = 1;
  389. }
  390. $from_type = 'QuickApp';
  391. if ($product_info->type == 'YEAR_ORDER') {
  392. $order_type = 'YEAR';
  393. } elseif ($product_info->type == 'QUARTER') {
  394. $order_type = 'QUARTER';
  395. } elseif ($product_info->type == 'BOOK_ORDER') {
  396. $order_type = 'BOOK';
  397. } elseif ($product_info->type == 'TICKET_RECHARGE') {
  398. $order_type = 'RECHARGE';
  399. } else {
  400. $order_type = '';
  401. }
  402. $create_ip = _getIp();
  403. // 活动
  404. $activity_token = $request->get('activity_token', '');
  405. $activity_id = 0;
  406. if ($activity_token) {
  407. $activity = Activity::getActivityBuToken($activity_token);
  408. $activity_id = (int)getProp($activity, 'id');
  409. }
  410. return compact(
  411. 'distribution_channel_id',
  412. 'uid',
  413. 'product_id',
  414. 'price',
  415. 'trade_no',
  416. 'create_ip',
  417. 'send_order_id',
  418. 'from_bid',
  419. 'from_type',
  420. 'order_type',
  421. 'activity_id'
  422. );
  423. }
  424. /**
  425. * @apiVersion 1.0.0
  426. * @apiDescription 支付
  427. * @api {get} goToPay 微信APP支付
  428. * @apiGroup pay
  429. * @apiName wxindex
  430. * @apiParam {Int} product_id product_id
  431. * @apiParam {Int} send_order_id send_order_id
  432. * @apiParam {String} bid bid
  433. * @apiHeader {String} [Authorization] token
  434. * @apiSuccess {int} code 状态码
  435. * @apiSuccess {String} msg 信息
  436. * @apiSuccess {Object} data 信息
  437. * @apiSuccess {Object} data.trade_no 订单号
  438. * @apiSuccess {Object} data.appId 唤起支付的appId
  439. * @apiSuccess {Object} data.mch_id 唤起支付的mch_id
  440. * @apiSuccess {Object} data.nonce_str 唤起支付的nonce_str
  441. * @apiSuccess {Object} data.prepay_id 唤起支付的prepay_id
  442. * @apiSuccess {Object} data.sign 唤起支付的sign
  443. * @apiSuccess {Object} data.trade_type 唤起支付trade_type
  444. * @apiSuccessExample {json} Success-Response:
  445. * HTTP/1.1 200 OK
  446. * {
  447. * code: 0,
  448. * msg: "",
  449. * data: {
  450. *
  451. * }
  452. */
  453. function wxIndex(Request $request)
  454. {
  455. if ($params = $this->getPayParams($request)) {
  456. $params['pay_merchant_id'] = $this->app_pay_merchat_id;
  457. } else {
  458. return response()->error('QAPP_PARAM_ERROR');
  459. }
  460. $app = OrderArousePayFactory::wx($this->uid);
  461. // 微信支付参数
  462. $params['trade_type'] = 'APP'; //交易类型
  463. $result = $app->handle($params);
  464. if ($result) {
  465. $result['trade_no'] = $params['trade_no'];
  466. return response()->success($result);
  467. } else {
  468. return response()->error('APP_CREATE_WECHAT_ORDER_FAIL');
  469. }
  470. }
  471. /**
  472. * @apiVersion 1.0.0
  473. * @apiDescription 微信H5支付
  474. * @api {get} goToH5Pay 微信H5支付
  475. * @apiGroup pay
  476. * @apiName wxH5Index
  477. * @apiParam {Int} product_id product_id
  478. * @apiParam {Int} send_order_id send_order_id
  479. * @apiParam {String} bid bid
  480. * @apiHeader {String} [Authorization] token
  481. * @apiSuccess {int} code 状态码
  482. * @apiSuccess {String} msg 信息
  483. * @apiSuccess {Object} data 信息
  484. * @apiSuccess {Object} data.trade_no 订单号
  485. * @apiSuccess {Object} data.appId 唤起支付的appId
  486. * @apiSuccess {Object} data.mch_id 唤起支付的mch_id
  487. * @apiSuccess {Object} data.nonce_str 唤起支付的nonce_str
  488. * @apiSuccess {Object} data.prepay_id 唤起支付的prepay_id
  489. * @apiSuccess {Object} data.sign 唤起支付的sign
  490. * @apiSuccess {Object} data.trade_type 唤起支付trade_type
  491. * @apiSuccess {Object} data.mweb_url 唤起支付mweb_url
  492. * @apiSuccessExample {json} Success-Response:
  493. * HTTP/1.1 200 OK
  494. * {
  495. * code: 0,
  496. * msg: "",
  497. * data: {
  498. *
  499. * }
  500. */
  501. function wxH5Index(Request $request)
  502. {
  503. if ($params = $this->getPayParams($request)) {
  504. $params['pay_merchant_id'] = $this->h5_pay_merchat_id;
  505. } else {
  506. return response()->error('QAPP_PARAM_ERROR');
  507. }
  508. $app = OrderArousePayFactory::wx($this->uid);
  509. // 微信支付参数
  510. $params['trade_type'] = 'MWEB'; //交易类型
  511. $result = $app->handle($params);
  512. if ($result) {
  513. $result['trade_no'] = $params['trade_no'];
  514. return response()->success($result);
  515. } else {
  516. return response()->error('APP_CREATE_WECHAT_ORDER_FAIL');
  517. }
  518. }
  519. /**
  520. * @apiVersion 1.0.0
  521. * @apiDescription 支付宝APP支付
  522. * @api {get} goToAliPay 支付宝APP支付
  523. * @apiGroup pay
  524. * @apiName aliIndex
  525. * @apiParam {Int} product_id product_id
  526. * @apiParam {Int} send_order_id send_order_id
  527. * @apiParam {String} bid bid
  528. * @apiHeader {String} [Authorization] token
  529. * @apiSuccess {Object} data.order_info 唤起支付信息str
  530. * @apiSuccess {Object} data.trade_no 订单号
  531. * @apiSuccessExample {json} Success-Response:
  532. * HTTP/1.1 200 OK
  533. * {
  534. * code: 0,
  535. * msg: "",
  536. * data:""
  537. *
  538. */
  539. public function aliIndex(Request $request)
  540. {
  541. if ($params = $this->getPayParams($request)) {
  542. $params['pay_merchant_id'] = $this->ali_pay_merchat_id;
  543. $params['type'] = 'App';
  544. } else {
  545. return response()->error('QAPP_PARAM_ERROR');
  546. }
  547. $app = OrderArousePayFactory::ali($this->uid);
  548. $order_info = $app->handle($params);
  549. return response()->success(['trade_no' => $params['trade_no'], 'order_info' => $order_info]);
  550. }
  551. /**
  552. * @apiVersion 1.0.0
  553. * @apiDescription 订单查询
  554. * @api {get} checkOrder 订单查询
  555. * @apiGroup pay
  556. * @apiName checkOrder
  557. * @apiParam {String} [token] token
  558. * @apiHeader {String} [Authorization] token 两个token任选其一
  559. * @apiParam {String} order order
  560. * @apiSuccess {int} code 状态码
  561. * @apiSuccess {String} msg 信息
  562. * @apiSuccess {Object} data 信息
  563. * @apiSuccessExample {json} Success-Response:
  564. * HTTP/1.1 200 OK
  565. * {
  566. * code: 0,
  567. * msg: "",
  568. * data: {
  569. *
  570. * }
  571. */
  572. public function checkOrder(Request $request)
  573. {
  574. $order = $request->input('order');
  575. $order_info = OrderService::getByTradeNo($order);
  576. if ($order_info && $order_info->status == 'PAID') {
  577. return response()->success();
  578. }
  579. return response()->success($order);
  580. }
  581. /**
  582. * 官方微信回调
  583. */
  584. function wxback(Request $request)
  585. {
  586. $xml = XML::parse(strval($request->getContent()));
  587. myLog('wxpay')->info($xml);
  588. if (isset($xml['attach'])) {
  589. $pay_merchant_id = (int)$xml['attach'];
  590. $config = PayMerchantService::findPayConfig($pay_merchant_id);
  591. $app = PayFactory::official($config);
  592. $response = $app->notify()->handleNotify(function ($notify, $successful) {
  593. if (!$successful) {
  594. return 'fail';
  595. }
  596. if (OrderPaySuccess::handle($notify->out_trade_no, $notify->transaction_id)) {
  597. return true;
  598. } else {
  599. return 'fail';
  600. }
  601. });
  602. return $response;
  603. } else {
  604. return 'fail';
  605. }
  606. }
  607. /**
  608. * 支付宝支付回调
  609. */
  610. function aliback(Request $request)
  611. {
  612. $param = $request->except('_url');
  613. myLog('alipay')->info($param);
  614. $trade_no = isset($param['out_trade_no']) ? $param['out_trade_no'] : '';
  615. if ($trade_no) {
  616. $order = Order::where('trade_no', $trade_no)->first();
  617. $pay_merchant_id = $order ? $order->pay_merchant_id : 0;
  618. $pay_merchant_id = $pay_merchant_id ? $pay_merchant_id : 140;
  619. $config = PayMerchantService::findAliPayConfig($pay_merchant_id);
  620. $app = PayFactory::aliPay($config);
  621. if ($app->notify($param)) {
  622. if (OrderPaySuccess::handle($param['out_trade_no'], $param['trade_no'])) {
  623. return response('success');
  624. } else {
  625. return response('fail');
  626. }
  627. }
  628. }
  629. myLog('alipay')->info('sign fail');
  630. return response('fail');
  631. }
  632. function wait(Request $request)
  633. {
  634. $param = $request->except('_url');
  635. return view('pay.middleware')->with($param);
  636. }
  637. }