wechatpay-apiv3 / wechatpay-php

微信支付 APIv3 的官方 PHP Library,同时也支持 APIv2
Apache License 2.0
474 stars 98 forks source link

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

Open xy-peng opened 2 years ago

xy-peng commented 2 years ago

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

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

image

as882301 commented 1 year ago

demo 都不搞全

TheNorthMemory commented 1 year ago

@as882301

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

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

jk1860 commented 1 year ago


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

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

cmslz commented 11 months ago

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

TheNorthMemory commented 11 months ago

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

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

cmslz commented 11 months ago

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

TheNorthMemory commented 11 months ago

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/56https://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'])
cmslz commented 11 months ago

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'])

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

TheNorthMemory commented 11 months ago

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+业务请求描述,批量按此规则“约束描述”都生成出来了。

shuizhangzhe commented 3 months ago

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

zhouyl commented 1 week ago
  1. 不提供沙箱账号申请,对开发不友好
  2. 证书下载管理流程复杂、混乱,又要下载工具,又要登录这个登录那个,无法在一个页面完成全部操作
  3. SDK DEMO和文档不完善,调试困难 总结:接过十多个支付方式,微信支付是最垃圾的