正在显示
1 个修改的文件
包含
16 行增加
和
6 行删除
@@ -164,12 +164,12 @@ class IndexController extends HomeBaseController | @@ -164,12 +164,12 @@ 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 | - ]; | 167 | +// $builder = [ |
168 | +// 'WIDsubject' => '购买', | ||
169 | +// 'WIDout_trade_no' => '20181017256210', | ||
170 | +// 'WIDtotal_amount' => 0.01, | ||
171 | +// 'WIDbody' => '商品' | ||
172 | +// ]; | ||
173 | 173 | ||
174 | $alipay_config = [ | 174 | $alipay_config = [ |
175 | 'gatewayUrl' => 'https://openapi.alipay.com/gateway.do', | 175 | 'gatewayUrl' => 'https://openapi.alipay.com/gateway.do', |
@@ -179,6 +179,16 @@ class IndexController extends HomeBaseController | @@ -179,6 +179,16 @@ class IndexController extends HomeBaseController | ||
179 | 'charset' => 'UTF-8', | 179 | 'charset' => 'UTF-8', |
180 | 'sign_type' => 'RSA' | 180 | 'sign_type' => 'RSA' |
181 | ]; | 181 | ]; |
182 | + | ||
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 | + | ||
182 | $alipay = new \AlipayTradeService($alipay_config); | 192 | $alipay = new \AlipayTradeService($alipay_config); |
183 | $return = $alipay->wapPay($builder, '', ''); | 193 | $return = $alipay->wapPay($builder, '', ''); |
184 | print_r($return); | 194 | print_r($return); |
-
请 注册 或 登录 后发表评论