本接口服务已于 [代码]2021.11.10[代码] (北京时间)停止开放,已有权限的暂且可继续用,不支持新接入。
微信支付实名校验-实名认证【公众号】接口权限申请这个文档中的接口 https://pay.weixin.qq.com/doc/v2/merchant/4011987273 mch_id:1289581601 appid: wx991e24812664e161
05-23小程序签约,后端给前端的数据中,需要把notify_url做encode后去签名
调用小程序纯签约返回暂无法开通此服务,商家系统错误,请联系商家处理?let postExtraData = { appid: data.h5_url.extraData.appid, contract_code: data.h5_url.extraData.contract_code, contract_display_account: data.h5_url.extraData.contract_display_account, mch_id: data.h5_url.extraData.mch_id, notify_url: encodeURIComponent(data.h5_url.extraData.notify_url),//encodeURIComponent(data.h5_url.extraData.notify_url), plan_id: data.h5_url.extraData.plan_id,//'195543' request_serial: data.h5_url.extraData.request_serial, timestamp: data.h5_url.extraData.timestamp, outerid: data.h5_url.extraData.outerid, sign: data.h5_url.extraData.sign } [图片] 小程序纯签约展示该报错,使用公众号签约正常签约成功。 1、使用签名工具(https://pay.weixin.qq.com/doc/v2/tool/sign_verify)排查了签名没有问题 2、参数以及参数类型也没有问题 3、notify_url小程序端做了encode, 签名的时候没有encode 4、检查request_serial(请求序列号)或timestamp(时间戳)是int类型,并且时间戳是10位序列号大于10位:9223372036854776000 希望各位大佬帮忙看下,或者有没有哪一位原来遇到过,希望告知排查路径。 wx.navigateToMiniProgram({ appId: 'wxbd687630cd02ce1d', path: 'pages/index/index', extraData: postExtraData, success(res) { // 成功跳转到签约小程序 console.log("打印跳转成功res " + JSON.stringify(res)) }, fail(res) { uni.showToast({ title: '取消签约', }) setTimeout(() => { uni.navigateBack() }, 600) console.log('fail:', res) // 未成功跳转到签约小程序 }, complete(res){ console.log('complete:', res) } })
05-23把 stringSign 打印出来看看末尾是不是多一个 & 符号?
wx.openBusinessView 商户签名校验失败?这里是官方文档:https://pay.weixin.qq.com/doc/v3/merchant/4012587984 前端调用使用的也是businessType,调试了很多次,拉起支付分订单详情一直提示"商户签名校验失败",请求各位大佬帮分析下 代码片段,service_id 和 v2 密钥保密 /** * 获取 openBusinessView 所需参数 */ @GetMapping("/business-view") public ApiResult getBusinessViewParams(@RequestParam String outOrderNo) { try { Map params = new HashMap<>(); params.put("mch_id", "1611641336"); params.put("service_id", "我的service_id"); params.put("out_order_no", outOrderNo); params.put("timestamp", String.valueOf(System.currentTimeMillis() / 1000)); params.put("nonce_str", generateNonceStr()); params.put("sign_type", "HMAC-SHA256"); // 生成签名 String sign = generateSignature(params); params.put("sign", sign); return ApiResult.success("success", params); } catch (Exception e) { return ApiResult.fail("生成参数失败: " + e.getMessage()); } } /** * 生成 HMAC-SHA256 签名 */ private String generateSignature(Map params) throws Exception { // 1. 过滤空值并排序 List keys = params.keySet().stream() .filter(k -> !k.equals("sign") && StringUtils.hasText(params.get(k))) .sorted() .collect(Collectors.toList()); // 2. 拼接签名字符串 StringJoiner query = new StringJoiner("&"); for (String key : keys) { query.add(key + "=" + params.get(key)); } String stringSign = query.toString(); // 3. 使用密钥加密 Mac sha256 = Mac.getInstance("HmacSHA256"); SecretKeySpec secretKey = new SecretKeySpec("我的 v2 密钥".getBytes(), "HmacSHA256"); sha256.init(secretKey); byte[] bytes = sha256.doFinal(stringSign.getBytes(StandardCharsets.UTF_8)); // 4. 转成十六进制 return bytesToHex(bytes).toUpperCase(); } /** * 生成随机字符串 */ private String generateNonceStr() { return UUID.randomUUID().toString().replace("-", "").substring(0, 32); } public static String bytesToHex(byte[] bytes) { StringBuilder sb = new StringBuilder(); for (byte b : bytes) { sb.append(String.format("%02x", b)); } return sb.toString(); } 渠道的结果片段: mch_id: "1611641336" nonce_str: "45566a3137424247956962a29b44ef8b" out_order_no: "AIV20250523104335682fe0d74759e" service_id: "00004000000000168722808608323064" sign: "CDDD0719DB3ABDA897D447B9675A9BA63120273A07985535DD837F0A8E8DD480" sign_type: "HMAC-SHA256" timestamp: "1747971706"
05-23初始化请按照你的商户号所能接入的方式选择对应实例化客户端 require_once('vendor/autoload.php'); use WeChatPay\Builder; use WeChatPay\Crypto\Rsa; // 商户号 $merchantId = '190000****'; // 从本地文件中加载「商户API私钥」,用于生成请求的签名 $merchantPrivateKeyFilePath = 'file:///path/to/merchant/apiclient_key.pem'; $merchantPrivateKeyInstance = Rsa::from($merchantPrivateKeyFilePath, Rsa::KEY_TYPE_PRIVATE); // 「商户API证书」的「证书序列号」 $merchantCertificateSerial = '3775B6A45ACD588826D15E583A95F5DD********'; // 从本地文件中加载「微信支付公钥」,用来验证微信支付应答的签名 $platformPublicKeyFilePath = 'file:///path/to/wechatpay/publickey.pem'; $platformPublicKeyInstance = Rsa::from($platformPublicKeyFilePath, Rsa::KEY_TYPE_PUBLIC); // 「微信支付公钥」的「微信支付公钥ID」 // 需要在 商户平台 -> 账户中心 -> API安全 查询 $platformPublicKeyId = 'PUB_KEY_ID_01142321349124100000000000********'; // 构造一个 APIv3 客户端实例(微信支付公钥模式) $instance = Builder::factory([ 'mchid' => $merchantId, 'serial' => $merchantCertificateSerial, 'privateKey' => $merchantPrivateKeyInstance, 'certs' => [ $platformPublicKeyId => $platformPublicKeyInstance, ] ]); Native下单$instance->v3->pay->transactions->native->postAsync([ 'json' => [ 'appid' => 'wxd678efh567hg6787', 'mchid' => '1230000109', 'description' => 'Image形象店-深圳腾大-QQ公仔', 'attach' => '自定义数据', 'out_trade_no' => '1217752501201407033233368018', 'amount' => [ 'total' => 100, 'currency' => 'CNY', ], 'time_expire' => '2018-06-08T10:34:56+08:00', 'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php', 'goods_tag' => 'WXG', 'limit_pay' => ['no_balance'], 'support_fapiao' => true, 'detail' => [ 'cost_price' => 608800, 'invoice_id' => '微信123', 'goods_detail' => [[ 'merchant_goods_id' => '商品编码', 'wechatpay_goods_id' => '1001', 'goods_name' => 'iPhoneX 256G', 'quantity' => 1, 'unit_price' => 828800, ],], ], 'scene_info' => [ 'payer_client_ip' => '14.23.150.211', 'device_id' => '013467007045764', 'store_info' => [ 'id' => '0001', 'name' => '腾讯大厦分店', 'area_code' => '440305', 'address' => '广东省深圳市南山区科技中一道10000号', ], ], 'payer' => [ 'identity' => [ 'type' => 'IDCARD', 'number' => '6B46824C852FA29AAC3DCE6BFD852E27', 'name' => '6B46824C852FA29AAC3DCE6BFD852E27', ], ], 'settle_info' => [ 'profit_sharing' => true, ], ], 'headers' => [ 'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000', ], ]) ->then(static function(\Psr\Http\Message\ResponseInterface $response) { print_r(json_decode((string) $response->getBody(), true)); }) ->wait(); 摘自 https://wechatpay.im/guide/getting-startedhttps://wechatpay.im/guide/getting-started
支付时如何使用微信支付公钥呢?有参考代码吗?微信支付 新申请的商户号只能用 微信支付公钥了,平台证书不能用了。支付时如何使用微信支付公钥呢?有参考代码吗?php的参考代码
05-23GET的时候,拼接文本末尾的 {"xxx":"yyy"} JSON是不参与的,本地的「证书签名/验签」工具不完全遵守了这样的规则约定,给你的错觉就是,工具验签正确然而微信支付服务端验不过,然而实际上,验签结果需要以微信支付服务端返回的结果为准。 建议用 wechatpay-php SDK,代码CV可直接拿走 https://wechatpay.im/openapi/v3/fund-app/mch-transfer/transfer-bills/transfer-bill-no/%7Btransfer_bill_no%7D
新版商家转账的“微信单号查询转账单”接口返回验签错误,验签工具验签通过[图片] 新版商家转账的“微信单号查询转账单”接口返回验签错误,验签工具验签通过。请懂的大神指导下
05-21平台给啥就用啥,不纠结「为什么」,用微信支付公钥还不用担心过期,不也挺好
新申请的商户号怎么没有平台证书的接口了?[图片]
05-20商家助手小程序 -> 首页 -> 授权管理 -> 产品权限管理 -> 待处理 TAB里面试试看
小微商户要如何授权服务商JSAPI支付?服务商平台已经发起邀请了,小微商户小程序端不能确认,点击确认提示“该功能暂不支持移动端授权”,小微商户有登录不了PC商户平台,要怎么确认授权呢[图片][图片]
05-19see https://wechatpay.im/openapi/v3/fund-app/mch-transfer/transfer-bills 转账场景ID([代码]transfer_scene_id[代码]) 及 转账场景报备信息([代码]transfer_scene_report_infos[代码]) 有如下固定搭配组合要求 部分
未传入完整且对应的转账场景报备信息,请根据接口文档检查[图片] 相应账号权限都开通了,请求报文与接口文档一致,但是依然报错
05-19你的小程序是不是也用的是自定义tabbar?猜测是小程序基础库的问题... 详细可见这里的调试信息, https://developers.weixin.qq.com/community/develop/doc/00024022b84770059d339ad4d66c01?source=indexnew&pass_ticket=mWLmoyr+YZUeLM/r40IBgOYEBagLCioUlbmusTW6NNjI5V2owDnfVWx9DxFHqX7GvqoISX2rODvIsJDVNphl0Q==&jumpto=comment&commentid=0006065dc1c2f027a3331c7ac614
【紧急】小程序支付,进入点金计划广告页,按返回键后,小程序里的路由方法都失效了?这几天很多用户反馈最新版IOS 微信8.0.59遇到这个问题 从点金计划广告页返回到自身小程序后,小程序页面本身按钮点击可以跳转,现在都跳转不了,任意路由方法navigateTo、redirectTo等都无效,都报fail rejected due to no permission currently,怎么解决? 视频地址:https://file.install.rs/s/10m3cg
05-19第2.5步,给小程序wx.requestPayment的数据签名,里面的appId需要用甲方公司的,即预下单时的subAppId,估计你这个参数用的是你们自己的吧
合作伙伴服务商jsapi支付返回appid和mch_id不匹配,请检查后再试服务商是我们公司,我们的甲方公司跟我们公司绑定了一个合作伙伴 支付时使用的支付相关的密钥什么的用的时我们公司的支付时传入的subAppid和subMchid是甲方的小程序和商户号(甲方公司已经跟这个小程序绑定过了)支付时参数都是正确的 就是一直返回 appid和mch_id不匹配,请检查后再试请知道的大哥们传授一下经验
05-19