From cd034c4a6a33d42d41b90dadefcd38dc32b36d6d Mon Sep 17 00:00:00 2001 From: hiddentrack Date: Thu, 26 May 2022 17:03:08 +0800 Subject: [PATCH] =?UTF-8?q?:new:=20#2664=20=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E7=94=B5=E5=95=86=E6=94=B6=E4=BB=98?= =?UTF-8?q?=E9=80=9A(=E5=88=86=E8=B4=A6)=E5=A2=9E=E5=8A=A0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=AE=A2=E5=8D=95=E5=89=A9=E4=BD=99=E5=BE=85=E5=88=86?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ofitSharingOrdersUnSplitAmountRequest.java | 36 ++++++++++++++ ...rofitSharingOrdersUnSplitAmountResult.java | 47 +++++++++++++++++++ .../wxpay/service/EcommerceService.java | 12 +++++ .../service/impl/EcommerceServiceImpl.java | 8 ++++ 4 files changed, 103 insertions(+) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountResult.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountRequest.java new file mode 100644 index 000000000..b2d8bc4c1 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountRequest.java @@ -0,0 +1,36 @@ +package com.github.binarywang.wxpay.bean.ecommerce; + + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * 查询订单剩余待分金额API 请求对象 + * + * @author mshyh + * @date 2022/05/26 + */ + + +@Data +@NoArgsConstructor +public class ProfitSharingOrdersUnSplitAmountRequest { + + /** + *
+   * 字段名:微信订单号
+   * 变量名:transaction_id
+   * 是否必填:是
+   * 类型:string[1, 32]
+   * 描述:微信支付订单号
+   * 示例值:4208450740201411110007820472
+   * 
+ */ + @SerializedName(value = "transaction_id") + private String transactionId; + + + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountResult.java new file mode 100644 index 000000000..0469965a4 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ProfitSharingOrdersUnSplitAmountResult.java @@ -0,0 +1,47 @@ +package com.github.binarywang.wxpay.bean.ecommerce; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + + + +/** + * 查询订单剩余待分金额API 结果响应 + * + * @author mshyh + * @date 2022/05/26 + */ + +@Data +@NoArgsConstructor +public class ProfitSharingOrdersUnSplitAmountResult { + + /** + *
+   * 字段名:微信支付订单号
+   * 变量名:transaction_id
+   * 是否必填:是
+   * 类型:string[1,32]
+   * 描述:微信支付订单号。
+   * 示例值:4208450740201411110007820472
+   * 
+ */ + @SerializedName(value = "transaction_id") + private String transactionId; + + /** + *
+   * 字段名:订单剩余待分金额
+   * 变量名:unsplit_amount
+   * 是否必填:是
+   * 类型:int
+   * 描述:订单剩余待分金额,整数,单位为分。
+   * 示例值:1000
+   * 
+ */ + @SerializedName(value = "unsplit_amount") + private Integer unsplitAmount; + + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java index 3f97b150a..b3dbdee01 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java @@ -252,6 +252,18 @@ public interface EcommerceService { */ ProfitSharingResult queryProfitSharing(ProfitSharingQueryRequest request) throws WxPayException; + /** + *
+   * 查询订单剩余待分金额API
+   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_4_9.shtml
+   * 
+ * + * @param request 查询订单剩余待分金额请求 + * @return 返回数据 profit sharing UnSplitAmount result + * @throws WxPayException the wx pay exception + */ + ProfitSharingOrdersUnSplitAmountResult queryProfitSharingOrdersUnsplitAmount(ProfitSharingOrdersUnSplitAmountRequest request) throws WxPayException; + /** *
    * 添加分账接收方API
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
index 1927920d2..91ab36830 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
@@ -200,6 +200,14 @@ public class EcommerceServiceImpl implements EcommerceService {
     return GSON.fromJson(response, ProfitSharingResult.class);
   }
 
+  @Override
+  public ProfitSharingOrdersUnSplitAmountResult queryProfitSharingOrdersUnsplitAmount(ProfitSharingOrdersUnSplitAmountRequest request) throws WxPayException {
+    String url = String.format("%s/v3/ecommerce/profitsharing/orders/%s/amounts",
+      this.payService.getPayBaseUrl(), request.getTransactionId());
+    String response = this.payService.getV3(url);
+    return GSON.fromJson(response, ProfitSharingOrdersUnSplitAmountResult.class);
+  }
+
   @Override
   public ProfitSharingReceiverResult addReceivers(ProfitSharingReceiverRequest request) throws WxPayException {
     String url = String.format("%s/v3/ecommerce/profitsharing/receivers/add", this.payService.getPayBaseUrl());