Visitar URL original
微信服务商配置优化、服务商合单支付 by cloudX2019 · Pull Request #1733 · binarywang/WxJava · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
new:jsapi合单支付
  • Loading branch information
曾浩
曾浩 committed Aug 24, 2020
commit 5db9706ba0d669b89dee6293ff92a696ac317063
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
import java.io.Serializable;
import java.util.List;

/**
* 二级商户进件 查询申请状态结果响应
*
*/
@Data
@NoArgsConstructor
public class ApplymentsStatusResult implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,24 @@

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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/**
Expand Down Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -41,5 +39,12 @@ public ApplymentsStatusResult queryApplyStatusByOutRequestNo(String outRequestNo
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);
}


}