wechatpay-php icon indicating copy to clipboard operation
wechatpay-php copied to clipboard

【官方调查问卷】微信支付 API v3 PHP SDK 开发者体验调查

Open xy-peng opened this issue 2 years ago • 11 comments

为了向广大开发者提供更好的使用体验,微信支付诚挚邀请您将使用微信支付 API v3 SDK中的感受反馈给我们。本问卷可能会占用您不超过2分钟的时间,感谢您的支持。

问卷系统使用的腾讯问卷,您可以点击这里,或者扫描以下二维码参与调查。

image

xy-peng avatar Jul 21 '21 05:07 xy-peng

demo 都不搞全

as882301 avatar Feb 01 '23 03:02 as882301

@as882301

当你阅读了,为 wechatpay-php 增加IDE提示的接口描述包 iwechatpay/openapi 介绍,以及正确的使用了composer及成熟IDE,你会发现demo纯粹是多余的。

PHPStormVisual Studio Code 可正常链上几乎所有接口,请求参数描述也可以无脑式,从对应的方法中直接拷贝出去(没有任何方言的完整数据结构),当自有项目的数据接口参照。

TheNorthMemory avatar Feb 01 '23 03:02 TheNorthMemory


Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.mch.weixin.qq.com/v3/certificates in D:\codes\eju_online\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211 Stack trace: #0 D:\codes\eju_online\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(542): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 D:\codes\eju_online\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::retryFailedRewind(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Array) #2 D:\codes\eju_online\vendor\guzzlehttp\guzzle\s in D:\codes\eju_online\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 211

搞不定阿,不知道什么情况~

jk1860 avatar Apr 07 '23 07:04 jk1860

Builder::normalize 方法的替换兼容性不够好

cmslz avatar Jul 29 '23 02:07 cmslz

Builder::normalize 方法的替换兼容性不够好

有没例子说明下不好在哪里?

TheNorthMemory avatar Jul 29 '23 03:07 TheNorthMemory

image image Builder::normalize 方法把我的订单号替换了 我把截图圈起来的地方注释掉就可以正常查到订单结果了

cmslz avatar Jul 29 '23 03:07 cmslz

image image Builder::normalize 方法把我的订单号替换了 我把截图圈起来的地方注释掉就可以正常查到订单结果了

参考:

https://github.com/wechatpay-apiv3/wechatpay-php/issues/74#issuecomment-999283485

及README底部FAQ

为什么 URL 上的变量 OpenID,请求时被替换成小写了?

本 SDK 把 URL 中的大写视为包含连字号的 segment。请求时, camelCase 会替换为 camel-case。相关 issue 可参考 https://github.com/wechatpay-apiv3/wechatpay-php/issues/56 、 https://github.com/wechatpay-apiv3/wechatpay-php/issues/69 。

为了避免大小写错乱,URL 中存在变量时的正确做法是:使用 链式 URI Template 的 Path 变量。比如:

推荐写法

->v3->marketing->favor->users->_openid_->coupons->post(['openid' => 'AbcdEF12345'])
->v3->marketing->favor->users->{'{openid}'}->coupons->post(['openid' => 'AbcdEF12345'])
->chain('{+myurl}')->post(['myurl' => 'v3/marketing/favor/users/AbcdEF12345/coupons'])
->{'{+myurl}'}->post(['myurl' => 'v3/marketing/favor/users/AbcdEF12345/coupons'])

TheNorthMemory avatar Jul 29 '23 03:07 TheNorthMemory

image image Builder::normalize 方法把我的订单号替换了 我把截图圈起来的地方注释掉就可以正常查到订单结果了

参考:

#74 (comment)

及README底部FAQ

为什么 URL 上的变量 OpenID,请求时被替换成小写了?

本 SDK 把 URL 中的大写视为包含连字号的 segment。请求时, camelCase 会替换为 camel-case。相关 issue 可参考 #56 、 #69 。

为了避免大小写错乱,URL 中存在变量时的正确做法是:使用 链式 URI Template 的 Path 变量。比如:

推荐写法

->v3->marketing->favor->users->_openid_->coupons->post(['openid' => 'AbcdEF12345'])
->v3->marketing->favor->users->{'{openid}'}->coupons->post(['openid' => 'AbcdEF12345'])
->chain('{+myurl}')->post(['myurl' => 'v3/marketing/favor/users/AbcdEF12345/coupons'])
->{'{+myurl}'}->post(['myurl' => 'v3/marketing/favor/users/AbcdEF12345/coupons'])

这个写法确实解决了我的问题,不过这种我之前那个用法很容易产生误导 还是感谢您的答复哈

cmslz avatar Jul 29 '23 03:07 cmslz

image image Builder::normalize 方法把我的订单号替换了 我把截图圈起来的地方注释掉就可以正常查到订单结果了

参考: #74 (comment) 及README底部FAQ

为什么 URL 上的变量 OpenID,请求时被替换成小写了?

本 SDK 把 URL 中的大写视为包含连字号的 segment。请求时, camelCase 会替换为 camel-case。相关 issue 可参考 #56 、 #69 。 为了避免大小写错乱,URL 中存在变量时的正确做法是:使用 链式 URI Template 的 Path 变量。比如: 推荐写法

->v3->marketing->favor->users->_openid_->coupons->post(['openid' => 'AbcdEF12345'])
->v3->marketing->favor->users->{'{openid}'}->coupons->post(['openid' => 'AbcdEF12345'])
->chain('{+myurl}')->post(['myurl' => 'v3/marketing/favor/users/AbcdEF12345/coupons'])
->{'{+myurl}'}->post(['myurl' => 'v3/marketing/favor/users/AbcdEF12345/coupons'])

这个写法确实解决了我的问题,不过这种我之前那个用法很容易产生误导 还是感谢您的答复哈

语义化及参数化URL后,就可以大规模、批量、模式化去“描述”所谓的“资源”,建议再看看 https://github.com/TheNorthMemory/wechatpay-openapi 项目,800+业务请求描述,批量按此规则“约束描述”都生成出来了。

TheNorthMemory avatar Jul 29 '23 04:07 TheNorthMemory

微信支付平台证书下载报错 [Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "git branch -a --no-color --no-abbrev -v" exceeded the timeout of 300 seconds.

shuizhangzhe avatar Apr 03 '24 04:04 shuizhangzhe