[测试]微信JSAPI支付

This commit is contained in:
Anyon 2018-05-03 15:11:22 +08:00
parent e045a302a4
commit c2c4cb3388

View File

@ -33,11 +33,12 @@ class Index extends Controller
public function pay() public function pay()
{ {
$wechat = new Pay(config('wechat.')); $wechat = new Pay(config('wechat.'));
$openid = WechatService::webOauth(0)['openid'];
$options = [ $options = [
'body' => '测试商品', 'body' => '测试商品',
'out_trade_no' => time(), 'out_trade_no' => time(),
'total_fee' => '1', 'total_fee' => '1',
'openid' => 'o38gps3vNdCqaggFfrBRCRikwlWY', 'openid' => $openid,
'trade_type' => 'JSAPI', 'trade_type' => 'JSAPI',
'notify_url' => 'http://a.com/text.html', 'notify_url' => 'http://a.com/text.html',
'spbill_create_ip' => '127.0.0.1', 'spbill_create_ip' => '127.0.0.1',