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

支付宝

@@ -165,20 +165,21 @@ class IndexController extends HomeBaseController @@ -165,20 +165,21 @@ class IndexController extends HomeBaseController
165 { 165 {
166 require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php'; 166 require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
167 $params = [ 167 $params = [
168 - 'subject' => '购买',  
169 - 'out_trade_no' => '20181017256210',  
170 - 'total_amount' => 0.01, 168 + 'WIDsubject' => '购买',
  169 + 'WIDout_trade_no' => '20181017256210',
  170 + 'WIDtotal_amount' => 0.01,
  171 + 'WIDbody' => '商品'
171 ]; 172 ];
172 173
173 -// $alipay_config = [  
174 -// 'gatewayUrl' => 'https://openapi.alipay.com/gateway.do',  
175 -// 'app_id' => '2018101661696470',  
176 -// 'merchant_private_key' => config('private_key'),  
177 -// 'alipay_public_key' => config('alipay_public_key'),  
178 -// 'charset' => 'UTF-8',  
179 -// 'sign_type' => 'RSA'  
180 -// ];  
181 - $alipay = new \AlipayTradeService(); 174 + $alipay_config = [
  175 + 'gatewayUrl' => 'https://openapi.alipay.com/gateway.do',
  176 + 'app_id' => '2018101661696470',
  177 + 'merchant_private_key' => config('private_key'),
  178 + 'alipay_public_key' => config('alipay_public_key'),
  179 + 'charset' => 'UTF-8',
  180 + 'sign_type' => 'RSA'
  181 + ];
  182 + $alipay = new \AlipayTradeService($alipay_config);
182 $return = $alipay->wapPay($params, '', ''); 183 $return = $alipay->wapPay($params, '', '');
183 print_r($return); 184 print_r($return);
184 } 185 }