问个好先
最近接收一个微信项目,以前也没碰过,突然间支付那块儿出问题了,微信的JSAPI支付接口也就是WeixinJSBridge.invoke("getBrandWCPayRequest".....这个东西一直返回:get_brand_wcpay_request:fail,然后就没有然后了。
我去公众平台官网技术文档的JSAPI技术文档看了下,看的云里雾里,跟我项目里代码完全不一样,后来才知道我那个项目里的是微信支付V2版本,官网里的是V3,然后我又在“https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6”找到一个H5网页调用JS支付的一个文档,不幸的是,看起来跟我调用的很像,但参数还是不一样,貌似也是V3的。百度了一下这个关键词“get_brand_wcpay_request:fail”,还有说新版微信不支持这种调用了,但不确定,因为官网没说不能用。
所以现在我的处境根本就是绝境,既不知道到底我那部分代码能不能用,也找不到任何有帮助的信息,也不干升级支付,我看了升级支付还设计好多东西。现在无可奈何,寻求帮助,希望有这方面经验的前辈不吝赐教!
我真是很奇怪,从来没有见过这么混乱的技术文档,这是什么玩意儿。太恼火。
回复内容:
问个好先
最近接收一个微信项目,以前也没碰过,突然间支付那块儿出问题了,微信的JSAPI支付接口也就是WeixinJSBridge.invoke("getBrandWCPayRequest".....这个东西一直返回:get_brand_wcpay_request:fail,然后就没有然后了。
我去公众平台官网技术文档的JSAPI技术文档看了下,看的云里雾里,跟我项目里代码完全不一样,后来才知道我那个项目里的是微信支付V2版本,官网里的是V3,然后我又在“https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6”找到一个H5网页调用JS支付的一个文档,不幸的是,看起来跟我调用的很像,但参数还是不一样,貌似也是V3的。百度了一下这个关键词“get_brand_wcpay_request:fail”,还有说新版微信不支持这种调用了,但不确定,因为官网没说不能用。
所以现在我的处境根本就是绝境,既不知道到底我那部分代码能不能用,也找不到任何有帮助的信息,也不干升级支付,我看了升级支付还设计好多东西。现在无可奈何,寻求帮助,希望有这方面经验的前辈不吝赐教!
我真是很奇怪,从来没有见过这么混乱的技术文档,这是什么玩意儿。太恼火。
微信支付现在分为v2版和v3版,2014年9月10号之前申请的为v2版,之后申请的为v3版。V3版的微信支付没有paySignKey参数。
两个版本取决于申请时间,是不能转换的,代码和流程也有很大的不同。
现在调用微信的jsapi需要先通过权限验证,你这个问题的解决办法就是使用微信的jssdk进行jsapi支付,但服务端的微信支付代码还是用原来的。
微信V2升级V3不难,V3在支付参数少了财付通那边的key,然后官方有对应语言的源码提供,都是可行的。直接修改里面的参数就能运行,如果你是C#,你可以到我们群里来交流。217073730
php 和 c# 微信支付官网都有现成的DEMO,改几个参数就能用。你可以先试试官方的demo,看能不能正常运行。
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=11_1

DependencyInjection(DI)inPHPenhancescodeflexibilityandtestabilitybydecouplingdependencycreationfromusage.ToimplementDIeffectively:1)UseDIcontainersjudiciouslytoavoidover-engineering.2)Avoidconstructoroverloadbylimitingdependenciestothreeorfour.3)Adhe

ToimproveyourPHPwebsite'sperformance,usethesestrategies:1)ImplementopcodecachingwithOPcachetospeedupscriptinterpretation.2)Optimizedatabasequeriesbyselectingonlynecessaryfields.3)UsecachingsystemslikeRedisorMemcachedtoreducedatabaseload.4)Applyasynch

Yes,itispossibletosendmassemailswithPHP.1)UselibrarieslikePHPMailerorSwiftMailerforefficientemailsending.2)Implementdelaysbetweenemailstoavoidspamflags.3)Personalizeemailsusingdynamiccontenttoimproveengagement.4)UsequeuesystemslikeRabbitMQorRedisforb

DependencyInjection(DI)inPHPisadesignpatternthatachievesInversionofControl(IoC)byallowingdependenciestobeinjectedintoclasses,enhancingmodularity,testability,andflexibility.DIdecouplesclassesfromspecificimplementations,makingcodemoremanageableandadapt

The best ways to send emails using PHP include: 1. Use PHP's mail() function to basic sending; 2. Use PHPMailer library to send more complex HTML mail; 3. Use transactional mail services such as SendGrid to improve reliability and analysis capabilities. With these methods, you can ensure that emails not only reach the inbox, but also attract recipients.

Calculating the total number of elements in a PHP multidimensional array can be done using recursive or iterative methods. 1. The recursive method counts by traversing the array and recursively processing nested arrays. 2. The iterative method uses the stack to simulate recursion to avoid depth problems. 3. The array_walk_recursive function can also be implemented, but it requires manual counting.

In PHP, the characteristic of a do-while loop is to ensure that the loop body is executed at least once, and then decide whether to continue the loop based on the conditions. 1) It executes the loop body before conditional checking, suitable for scenarios where operations need to be performed at least once, such as user input verification and menu systems. 2) However, the syntax of the do-while loop can cause confusion among newbies and may add unnecessary performance overhead.

Efficient hashing strings in PHP can use the following methods: 1. Use the md5 function for fast hashing, but is not suitable for password storage. 2. Use the sha256 function to improve security. 3. Use the password_hash function to process passwords to provide the highest security and convenience.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Chinese version
Chinese version, very easy to use

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
