关于请求分账的功能,网上也没有一个是介绍这方面的。
目前已经完成如下图 1,2
现在做到第三个功能的时候,按这文档写一直执行不了,不知道官方有没有一些介绍后台如何实现或必须要怎么做才可以分账户。
以下是我的代码:
我现在可能怀疑是我这里出了问题,不知道是否与(是否需要证书请求需要双向证书。 详见证书使用)这个思路有什么关联。上面的签名和其他的我都已经完成。就是关请求过程。
有哪位做过这分账的,求介绍。。。。谢谢
关于请求分账的功能,网上也没有一个是介绍这方面的。
目前已经完成如下图 1,2
现在做到第三个功能的时候,按这文档写一直执行不了,不知道官方有没有一些介绍后台如何实现或必须要怎么做才可以分账户。
以下是我的代码:
我现在可能怀疑是我这里出了问题,不知道是否与(是否需要证书请求需要双向证书。 详见证书使用)这个思路有什么关联。上面的签名和其他的我都已经完成。就是关请求过程。
有哪位做过这分账的,求介绍。。。。谢谢
As for the function of requesting account splitting, there is no one on the Internet that introduces this aspect. At present, it has been completed, as shown in Figure 1 and 2 below. When the third function is implemented, it can't be executed according to this document. I wonder if the official has introduced how to implement the background or what must be done before the account can be divided. Here's my code: I may now suspect that something is wrong with me, and I don't know if it's necessary to ask for a certificate and a two-way certificate. What is the relationship between the idea of "certificate use". I've finished the signature and the rest. It's about closing the request process. Who has done this account sharing, please introduce.... thank you
回答:
对,请求没有使用证书导致,可以网上找下资料,或者下载下百度网盘的内容,https://developers.weixin.qq.com/community/develop/article/doc/000e828610c15075ed0a319a95bc13, 引用Mirsh . 使用只用的HttpClient来处理
var httpClient = new HttpClient();
httpClient.X509Certs.Add(new System.Security.Cryptography.X509Certificates.X509Certificate2(this.CertPath, this.CertPassword));
var result = httpClient.Post(url, reqBody);
return result;
分账流程如下:
1,需要在统一下单的时候给需要分账的订单,加入标识profit_sharing=Y。(默认冻结30天)。
2,添加分账接收方。https://pay.weixin.qq.com/wiki/doc/api/allocation_sl.php?chapter=25_3&index=4
3,调用请求分账接口。https://pay.weixin.qq.com/wiki/doc/api/allocation_sl.php?chapter=25_1&index=1(具体请求单次分账还是多次分账。商户需求而定)
4,单次分账成功以后就会解冻金额,多次分账需要调用完结分账接口。https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=27_5&index=6
5,需要使用双向证书。证书使用说明:https://pay.weixin.qq.com/wiki/doc/api/allocation_sl.php?chapter=4_3