mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-21 11:07:37 +08:00
new:jsapi合单支付
This commit is contained in:
@@ -7,6 +7,10 @@ import lombok.NoArgsConstructor;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 二级商户进件 查询申请状态结果响应
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class ApplymentsStatusResult implements Serializable {
|
||||
|
@@ -6,10 +6,24 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 合单支付 JSAPI支付结果响应
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CombineTransactionsJsResult implements Serializable {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:预支付交易会话标识
|
||||
* 变量名:prepay_id
|
||||
* 是否必填:是
|
||||
* 类型:string(64)
|
||||
* 描述:
|
||||
* 数字和字母。微信生成的预支付会话标识,用于后续接口调用使用。
|
||||
* 示例值:wx201410272009395522657a690389285100
|
||||
* </pre>
|
||||
*/
|
||||
@SerializedName("prepay_id")
|
||||
private String prepayId;
|
||||
|
||||
|
@@ -1,8 +1,6 @@
|
||||
package com.github.binarywang.wxpay.service;
|
||||
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsRequest;
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult;
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult;
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.*;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
|
||||
/**
|
||||
@@ -55,4 +53,15 @@ public interface EcommerceService {
|
||||
*/
|
||||
ApplymentsStatusResult queryApplyStatusByOutRequestNo(String outRequestNo) throws WxPayException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 合单下单-JS支付API.
|
||||
* 请求URL:https://api.mch.weixin.qq.com/v3/combine-transactions/jsapi
|
||||
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter3_2.shtml
|
||||
* </pre>
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @return 预支付交易会话标识, 数字和字母。微信生成的预支付会话标识,用于后续接口调用使用。
|
||||
*/
|
||||
CombineTransactionsJsResult combineTransactions(CombineTransactionsJsRequest request) throws WxPayException;
|
||||
}
|
||||
|
@@ -1,8 +1,6 @@
|
||||
package com.github.binarywang.wxpay.service.impl;
|
||||
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsRequest;
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult;
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult;
|
||||
import com.github.binarywang.wxpay.bean.ecommerce.*;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.github.binarywang.wxpay.service.EcommerceService;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
@@ -41,5 +39,12 @@ public class EcommerceServiceImpl implements EcommerceService {
|
||||
return GSON.fromJson(result, ApplymentsStatusResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CombineTransactionsJsResult combineTransactions(CombineTransactionsJsRequest request) throws WxPayException {
|
||||
String url = String.format("%s/v3/combine-transactions/jsapi", this.payService.getPayBaseUrl());
|
||||
String response = this.payService.postV3(url, GSON.toJson(request));
|
||||
return GSON.fromJson(response, CombineTransactionsJsResult.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user