作者 lihan
1 个管道 的构建 通过 耗费 0 秒

支付宝

@@ -417,7 +417,7 @@ class OrderController extends HomeBaseController @@ -417,7 +417,7 @@ class OrderController extends HomeBaseController
417 $payRequestBuilder->setBody($body); 417 $payRequestBuilder->setBody($body);
418 $payRequestBuilder->setSubject($subject); 418 $payRequestBuilder->setSubject($subject);
419 $payRequestBuilder->setOutTradeNo($out_trade_no); 419 $payRequestBuilder->setOutTradeNo($out_trade_no);
420 - $payRequestBuilder->setTotalAmount($total_amount); 420 + $payRequestBuilder->setTotalAmount(0.01);
421 $payRequestBuilder->setTimeExpress($timeout_express); 421 $payRequestBuilder->setTimeExpress($timeout_express);
422 422
423 $payResponse = new \AlipayTradeService($config); 423 $payResponse = new \AlipayTradeService($config);
@@ -427,10 +427,14 @@ class OrderController extends HomeBaseController @@ -427,10 +427,14 @@ class OrderController extends HomeBaseController
427 } 427 }
428 } 428 }
429 429
430 - //支付宝回调 430 + //支付宝异步回调
431 public function alipayNotify() 431 public function alipayNotify()
432 { 432 {
433 - 433 + require EXTEND_PATH . '/alipay/config.php';
  434 + require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
  435 + $alipay = new \AlipayTradeService($config);
  436 + Db::name('user')->where(['id'=>10])->setInc('balance', 1);
  437 + $alipay->check();
434 } 438 }
435 439
436 } 440 }