mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-05 17:38:05 +08:00
🆕【微信支付】新增查询特约商户设置的允许服务商分账的最大比例的V3接口
This commit is contained in:
parent
a3a8295262
commit
b35645ee67
@ -0,0 +1,27 @@
|
||||
package com.github.binarywang.wxpay.bean.profitsharingV3;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 微信V3接口-查询特约商户设置的允许服务商分账的最大比例结果类
|
||||
*
|
||||
* @author 狂龙骄子
|
||||
* @since 4.4.0
|
||||
* @date 2022-12-09
|
||||
*/
|
||||
@Data
|
||||
public class ProfitSharingMerchantMaxRatioQueryResult implements Serializable {
|
||||
private static final long serialVersionUID = -6259241881199571683L;
|
||||
|
||||
/** 子商户号 */
|
||||
@SerializedName("sub_mchid")
|
||||
private String subMchId;
|
||||
|
||||
/** 子商户允许服务商分账的最大比例,单位万分比,比如 2000表示20% */
|
||||
@SerializedName("max_ratio")
|
||||
private Integer maxRatio;
|
||||
|
||||
}
|
@ -8,9 +8,27 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
* 微信支付V3-资金应用-分账
|
||||
*
|
||||
* @author pg 2021-6-23
|
||||
* created on 2021-6-23
|
||||
* @date 2021-6-23
|
||||
*/
|
||||
public interface ProfitSharingV3Service {
|
||||
/**
|
||||
* <pre>
|
||||
* 查询最大分账比例
|
||||
*
|
||||
* 可调用此接口查询特约商户设置的允许服务商分账的最大比例
|
||||
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_1_7.shtml
|
||||
* 接口链接: https://api.mch.weixin.qq.com/v3/profitsharing/merchant-configs/{sub_mchid}
|
||||
* </pre>
|
||||
*
|
||||
* @param subMchId 子商户号(微信支付分配的子商户号,即分账的出资商户号)
|
||||
* @return {@link ProfitSharingMerchantMaxRatioQueryResult} 特约商户设置的允许服务商分账的最大比例结果
|
||||
* @throws WxPayException the wx pay exception
|
||||
* @see <a href="https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_1_7.shtml">服务商平台>>API字典>>资金应用>>分账>>查询最大分账比例</a>
|
||||
* @since 4.4.0
|
||||
* @date 2022-12-09
|
||||
*/
|
||||
ProfitSharingMerchantMaxRatioQueryResult getProfitSharingMerchantMaxRatio(String subMchId) throws WxPayException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 请求分账API
|
||||
|
@ -2,7 +2,6 @@ package com.github.binarywang.wxpay.service.impl;
|
||||
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader;
|
||||
import com.github.binarywang.wxpay.bean.profitsharingV3.*;
|
||||
import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.github.binarywang.wxpay.service.ProfitSharingV3Service;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
@ -31,6 +30,13 @@ public class ProfitSharingV3ServiceImpl implements ProfitSharingV3Service {
|
||||
private static final Gson GSON = new GsonBuilder().create();
|
||||
private final WxPayService payService;
|
||||
|
||||
@Override
|
||||
public ProfitSharingMerchantMaxRatioQueryResult getProfitSharingMerchantMaxRatio(String subMchId) throws WxPayException {
|
||||
String url = String.format("%s/v3/profitsharing/merchant-configs/%s", this.payService.getPayBaseUrl(), subMchId);
|
||||
String result = this.payService.getV3(url);
|
||||
return GSON.fromJson(result, ProfitSharingMerchantMaxRatioQueryResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfitSharingResult profitSharing(ProfitSharingRequest request) throws WxPayException {
|
||||
String url = String.format("%s/v3/profitsharing/orders", this.payService.getPayBaseUrl());
|
||||
|
Loading…
Reference in New Issue
Block a user