小程序
小游戏
企业微信
微信支付
扫描小程序码分享
PHP执行以下语句时,返回[],请各位大神帮忙解决!
$instance = Builder::factory([
'mchid' => $merchantId,
'serial' => $merchantCertificateSerial,
'privateKey' => $merchantPrivateKeyInstance,
'certs' => [
$platformCertificateSerial => $platformPublicKeyInstance,
],
]);
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
<?php print_r($instance);exit;
即打印出类似如下的信息,以此就可以按照README上的例子,发起HTTP请求了:
<?php ArrayIterator@anonymous Object ( [driver:protected] => WeChatPay\ClientDecorator Object ( [v2:protected] => GuzzleHttp\Client Object ( [config:GuzzleHttp\Client:private] => Array ( [base_uri] => GuzzleHttp\Psr7\Uri Object ( [scheme:GuzzleHttp\Psr7\Uri:private] => https [userInfo:GuzzleHttp\Psr7\Uri:private] => [host:GuzzleHttp\Psr7\Uri:private] => api.mch.weixin.qq.com [port:GuzzleHttp\Psr7\Uri:private] => [path:GuzzleHttp\Psr7\Uri:private] => / [query:GuzzleHttp\Psr7\Uri:private] => [fragment:GuzzleHttp\Psr7\Uri:private] => [composedComponents:GuzzleHttp\Psr7\Uri:private] => ) [headers] => Array ( [Accept] => text/xml, text/plain, application/x-gzip [Content-Type] => text/xml; charset=utf-8 [User-Agent] => wechatpay-php/1.4.3 GuzzleHttp/7 curl/7.82.0 (Darwin/17.7.0) PHP/8.1.3 ) [allow_redirects] => Array ( [max] => 5 [protocols] => Array ( [0] => http [1] => https ) [strict] => [referer] => [track_redirects] => ) [http_errors] => 1 [decode_content] => 1 [verify] => 1 [cookies] => [idn_conversion] => ) ) [v3:protected] => GuzzleHttp\Client Object ( [config:GuzzleHttp\Client:private] => Array ( [base_uri] => GuzzleHttp\Psr7\Uri Object ( [scheme:GuzzleHttp\Psr7\Uri:private] => https [userInfo:GuzzleHttp\Psr7\Uri:private] => [host:GuzzleHttp\Psr7\Uri:private] => api.mch.weixin.qq.com [port:GuzzleHttp\Psr7\Uri:private] => [path:GuzzleHttp\Psr7\Uri:private] => / [query:GuzzleHttp\Psr7\Uri:private] => [fragment:GuzzleHttp\Psr7\Uri:private] => [composedComponents:GuzzleHttp\Psr7\Uri:private] => ) [headers] => Array ( [Accept] => application/json, text/plain, application/x-gzip, application/pdf, image/png, image/*;q=0.5 [Content-Type] => application/json; charset=utf-8 [User-Agent] => wechatpay-php/1.4.3 GuzzleHttp/7 curl/7.82.0 (Darwin/17.7.0) PHP/8.1.3 ) [allow_redirects] => Array ( [max] => 5 [protocols] => Array ( [0] => http [1] => https ) [strict] => [referer] => [track_redirects] => ) [http_errors] => 1 [decode_content] => 1 [verify] => 1 [cookies] => [idn_conversion] => ) ) ) [storage:ArrayIterator:private] => Array ( ) )
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
<?php print_r($instance);exit;
即打印出类似如下的信息,以此就可以按照README上的例子,发起HTTP请求了:
<?php ArrayIterator@anonymous Object ( [driver:protected] => WeChatPay\ClientDecorator Object ( [v2:protected] => GuzzleHttp\Client Object ( [config:GuzzleHttp\Client:private] => Array ( [base_uri] => GuzzleHttp\Psr7\Uri Object ( [scheme:GuzzleHttp\Psr7\Uri:private] => https [userInfo:GuzzleHttp\Psr7\Uri:private] => [host:GuzzleHttp\Psr7\Uri:private] => api.mch.weixin.qq.com [port:GuzzleHttp\Psr7\Uri:private] => [path:GuzzleHttp\Psr7\Uri:private] => / [query:GuzzleHttp\Psr7\Uri:private] => [fragment:GuzzleHttp\Psr7\Uri:private] => [composedComponents:GuzzleHttp\Psr7\Uri:private] => ) [headers] => Array ( [Accept] => text/xml, text/plain, application/x-gzip [Content-Type] => text/xml; charset=utf-8 [User-Agent] => wechatpay-php/1.4.3 GuzzleHttp/7 curl/7.82.0 (Darwin/17.7.0) PHP/8.1.3 ) [allow_redirects] => Array ( [max] => 5 [protocols] => Array ( [0] => http [1] => https ) [strict] => [referer] => [track_redirects] => ) [http_errors] => 1 [decode_content] => 1 [verify] => 1 [cookies] => [idn_conversion] => ) ) [v3:protected] => GuzzleHttp\Client Object ( [config:GuzzleHttp\Client:private] => Array ( [base_uri] => GuzzleHttp\Psr7\Uri Object ( [scheme:GuzzleHttp\Psr7\Uri:private] => https [userInfo:GuzzleHttp\Psr7\Uri:private] => [host:GuzzleHttp\Psr7\Uri:private] => api.mch.weixin.qq.com [port:GuzzleHttp\Psr7\Uri:private] => [path:GuzzleHttp\Psr7\Uri:private] => / [query:GuzzleHttp\Psr7\Uri:private] => [fragment:GuzzleHttp\Psr7\Uri:private] => [composedComponents:GuzzleHttp\Psr7\Uri:private] => ) [headers] => Array ( [Accept] => application/json, text/plain, application/x-gzip, application/pdf, image/png, image/*;q=0.5 [Content-Type] => application/json; charset=utf-8 [User-Agent] => wechatpay-php/1.4.3 GuzzleHttp/7 curl/7.82.0 (Darwin/17.7.0) PHP/8.1.3 ) [allow_redirects] => Array ( [max] => 5 [protocols] => Array ( [0] => http [1] => https ) [strict] => [referer] => [track_redirects] => ) [http_errors] => 1 [decode_content] => 1 [verify] => 1 [cookies] => [idn_conversion] => ) ) ) [storage:ArrayIterator:private] => Array ( ) )