支付接口增加分账参数

This commit is contained in:
HH 2022-04-24 18:19:14 +08:00
parent 4cb7e800ec
commit eaa59ba9a1
2 changed files with 16 additions and 14 deletions

View File

@ -31,7 +31,7 @@ public class WxPayController extends BaseController {
* &redirect_uri=http%3A%2F%2Fwww.opsoul.com%2Fpay%2Fwx%2Fpub
* &response_type=code
* &scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect
* */
*/
@GetMapping("/pub")
@ResponseBody
public AjaxResult pubPay(HttpServletRequest request) {
@ -48,7 +48,7 @@ public class WxPayController extends BaseController {
WxLiteExpend expend = new WxLiteExpend();
expend.setOpen_id(openId);
Map<String, Object> map = adapayService.wxPubPay(new WxPubPayCallBack(), expend, "wxPay123456" + Math.ceil(Math.random() * 100), "1.00",
"测试商品", "测试商品detail", "description");
"测试商品", "测试商品detail", null, "description");
//拼接消息给前端.前端通过JSAPI调用微信支付
map.forEach((key, value) -> {
logger.info("key is " + key + ", value is " + value);

View File

@ -68,24 +68,24 @@ public class AdapayService {
* 支付宝正扫支付
*/
public Map<String, Object> alipayQrPay(PayCallback callback, WxLiteExpend expend, String orderNo, String payAmt,
String goodsTittle, String goodsDesc, String description) throws BaseAdaPayException {
return pay(callback, PayChannelEnum.ALIPAY_QR.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, description);
String goodsTittle, String goodsDesc, String divMembers, String description) throws BaseAdaPayException {
return pay(callback, PayChannelEnum.ALIPAY_QR.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, divMembers, description);
}
/**
* 微信小程序支付
*/
public Map<String, Object> wxPubPay(PayCallback callback, WxLiteExpend expend, String orderNo, String payAmt,
String goodsTittle, String goodsDesc, String description) throws BaseAdaPayException {
return pay(callback, PayChannelEnum.WX_PUB.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, description);
String goodsTittle, String goodsDesc, String divMembers, String description) throws BaseAdaPayException {
return pay(callback, PayChannelEnum.WX_PUB.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, divMembers, description);
}
/**
* 微信小程序支付
*/
public Map<String, Object> wxLitePay(PayCallback callback, WxLiteExpend expend, String orderNo, String payAmt,
String goodsTittle, String goodsDesc, String description) throws BaseAdaPayException {
return pay(callback, PayChannelEnum.WX_LITE.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, description);
String goodsTittle, String goodsDesc, String divMembers, String description) throws BaseAdaPayException {
return pay(callback, PayChannelEnum.WX_LITE.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, divMembers, description);
}
/**
@ -96,11 +96,12 @@ public class AdapayService {
* @param goodsDesc [必填项]商品描述信息微信小程序和微信公众号该字段最大长度42个字符
* @param payChannel [必填项]支付渠道详见 https://docs.adapay.tech/api/appendix.html#id2
* @param expend 支付渠道额外参数条件可输入详见 https://docs.adapay.tech/api/appendix.html#expend
* @param divMembers 分账对象信息列表最多仅支持7个分账方json 数组形式详见 https://docs.adapay.tech/api/appendix.html#divmembers
* @param description 订单附加说明
* @return 同步返回一个 支付对象详见 https://docs.adapay.tech/api/trade.html#id2
*/
public Map<String, Object> pay(PayCallback callback, String payChannel, Expend expend, String orderNo, String payAmt,
String goodsTittle, String goodsDesc, String description) throws BaseAdaPayException {
String goodsTittle, String goodsDesc, String divMembers, String description) throws BaseAdaPayException {
Map<String, Object> paymentParams = new HashMap<>(16);
paymentParams.put("app_id", adapayProperties.getAppId());
paymentParams.put("notify_url", adapayProperties.getNotifyUrl());
@ -109,6 +110,7 @@ public class AdapayService {
paymentParams.put("pay_amt", payAmt);
paymentParams.put("goods_title", goodsTittle);
paymentParams.put("goods_desc", goodsDesc);
paymentParams.put("div_members", divMembers);
paymentParams.put("description", description);
paymentParams.put("expend", expend);
PayReplyMapping.putCallback(orderNo, callback);