lokielse / omnipay-wechatpay

(微信支付)WeChatPay driver for the Omnipay PHP payment processing library
MIT License
316 stars 103 forks source link

WechatPay_Native 微信支付问题 #59

Closed pangxioujiang closed 6 years ago

pangxioujiang commented 6 years ago

$gateway = Omnipay::create('WechatPay_Native'); $gateway->setAppId('wx0b2cb4687763f2c5'); $gateway->setMchId('1303570701'); $gateway->setApiKey('qK2Szcejbv19r9hI6VbaqodqpH3x5mXd'); $order = [ 'body' => 'The test order', 'out_trade_no' => date('YmdHis').mt_rand(1000, 9999), 'total_fee' => 0.01, //=0.01 'spbill_create_ip' => 'ip_address', 'fee_type' => 'CNY' ];

    $request  = $gateway->purchase($order);
    $response = $request->send();

    $response->isSuccessful();
    $response->getData(); //For debug
    $response->getAppOrderData(); //For WechatPay_App
    $response->getJsOrderData(); //For WechatPay_Js
    $response->getCodeUrl(); //For Native Trade Type

Omnipay \ Common \ Exception \ InvalidRequestException The notify_url parameter is required

successgo commented 6 years ago

@pangxioujiang

The notify_url parameter is required

请你设置一下 notify_url 字段呗

pangxioujiang commented 6 years ago

// $gateway->setNotifyUrl(config("laravel-omnipay.gateways.alipay.options.returnUrl")); //回调地址

        $gateway->setNotifyUrl("https://paysdk.weixin.qq.com/example/notify.php");   微信官网调试数据

设置后,页面上是一片空白,什么都没有呢,没有提示错误!

solody commented 6 years ago

qq.com是你家的域名?