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

支付宝

@@ -164,12 +164,6 @@ class IndexController extends HomeBaseController @@ -164,12 +164,6 @@ class IndexController extends HomeBaseController
164 public function alipay() 164 public function alipay()
165 { 165 {
166 require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php'; 166 require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
167 -// $builder = [  
168 -// 'WIDsubject' => '购买',  
169 -// 'WIDout_trade_no' => '20181017256210',  
170 -// 'WIDtotal_amount' => 0.01,  
171 -// 'WIDbody' => '商品'  
172 -// ];  
173 167
174 $alipay_config = [ 168 $alipay_config = [
175 'gatewayUrl' => 'https://openapi.alipay.com/gateway.do', 169 'gatewayUrl' => 'https://openapi.alipay.com/gateway.do',
@@ -180,15 +174,12 @@ class IndexController extends HomeBaseController @@ -180,15 +174,12 @@ class IndexController extends HomeBaseController
180 'sign_type' => 'RSA' 174 'sign_type' => 'RSA'
181 ]; 175 ];
182 176
183 - $builder ="{" .  
184 - " \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," .  
185 - " \"subject\":\"大乐透\"," .  
186 - " \"out_trade_no\":\"70501111111S001111119\"," .  
187 - " \"timeout_express\":\"90m\"," .  
188 - " \"total_amount\":9.00," .  
189 - " \"product_code\":\"QUICK_WAP_WAY\"" .  
190 - " }";  
191 - 177 + $builder = [
  178 + 'WIDsubject' => '购买',
  179 + 'WIDout_trade_no' => '20181017256210',
  180 + 'WIDtotal_amount' => 0.01,
  181 + 'WIDbody' => '商品'
  182 + ];
192 $alipay = new \AlipayTradeService($alipay_config); 183 $alipay = new \AlipayTradeService($alipay_config);
193 $return = $alipay->wapPay($builder, '', ''); 184 $return = $alipay->wapPay($builder, '', '');
194 print_r($return); 185 print_r($return);