支付接口增加分账参数
This commit is contained in:
parent
4cb7e800ec
commit
eaa59ba9a1
|
|
@ -31,7 +31,7 @@ public class WxPayController extends BaseController {
|
||||||
* &redirect_uri=http%3A%2F%2Fwww.opsoul.com%2Fpay%2Fwx%2Fpub
|
* &redirect_uri=http%3A%2F%2Fwww.opsoul.com%2Fpay%2Fwx%2Fpub
|
||||||
* &response_type=code
|
* &response_type=code
|
||||||
* &scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect
|
* &scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect
|
||||||
* */
|
*/
|
||||||
@GetMapping("/pub")
|
@GetMapping("/pub")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult pubPay(HttpServletRequest request) {
|
public AjaxResult pubPay(HttpServletRequest request) {
|
||||||
|
|
@ -48,7 +48,7 @@ public class WxPayController extends BaseController {
|
||||||
WxLiteExpend expend = new WxLiteExpend();
|
WxLiteExpend expend = new WxLiteExpend();
|
||||||
expend.setOpen_id(openId);
|
expend.setOpen_id(openId);
|
||||||
Map<String, Object> map = adapayService.wxPubPay(new WxPubPayCallBack(), expend, "wxPay123456" + Math.ceil(Math.random() * 100), "1.00",
|
Map<String, Object> map = adapayService.wxPubPay(new WxPubPayCallBack(), expend, "wxPay123456" + Math.ceil(Math.random() * 100), "1.00",
|
||||||
"测试商品", "测试商品detail", "description");
|
"测试商品", "测试商品detail", null, "description");
|
||||||
//拼接消息给前端.前端通过JSAPI调用微信支付
|
//拼接消息给前端.前端通过JSAPI调用微信支付
|
||||||
map.forEach((key, value) -> {
|
map.forEach((key, value) -> {
|
||||||
logger.info("key is " + key + ", value is " + value);
|
logger.info("key is " + key + ", value is " + value);
|
||||||
|
|
|
||||||
|
|
@ -68,24 +68,24 @@ public class AdapayService {
|
||||||
* 支付宝正扫支付
|
* 支付宝正扫支付
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> alipayQrPay(PayCallback callback, WxLiteExpend expend, String orderNo, String payAmt,
|
public Map<String, Object> alipayQrPay(PayCallback callback, WxLiteExpend expend, String orderNo, String payAmt,
|
||||||
String goodsTittle, String goodsDesc, String description) throws BaseAdaPayException {
|
String goodsTittle, String goodsDesc, String divMembers, String description) throws BaseAdaPayException {
|
||||||
return pay(callback, PayChannelEnum.ALIPAY_QR.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, description);
|
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,
|
public Map<String, Object> wxPubPay(PayCallback callback, WxLiteExpend expend, String orderNo, String payAmt,
|
||||||
String goodsTittle, String goodsDesc, String description) throws BaseAdaPayException {
|
String goodsTittle, String goodsDesc, String divMembers, String description) throws BaseAdaPayException {
|
||||||
return pay(callback, PayChannelEnum.WX_PUB.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, description);
|
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,
|
public Map<String, Object> wxLitePay(PayCallback callback, WxLiteExpend expend, String orderNo, String payAmt,
|
||||||
String goodsTittle, String goodsDesc, String description) throws BaseAdaPayException {
|
String goodsTittle, String goodsDesc, String divMembers, String description) throws BaseAdaPayException {
|
||||||
return pay(callback, PayChannelEnum.WX_LITE.getCode(), expend, orderNo, payAmt, goodsTittle, goodsDesc, description);
|
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 goodsDesc [必填项]商品描述信息,微信小程序和微信公众号该字段最大长度42个字符
|
||||||
* @param payChannel [必填项]支付渠道,详见 https://docs.adapay.tech/api/appendix.html#id2
|
* @param payChannel [必填项]支付渠道,详见 https://docs.adapay.tech/api/appendix.html#id2
|
||||||
* @param expend 支付渠道额外参数,条件可输入,详见 https://docs.adapay.tech/api/appendix.html#expend
|
* @param expend 支付渠道额外参数,条件可输入,详见 https://docs.adapay.tech/api/appendix.html#expend
|
||||||
|
* @param divMembers 分账对象信息列表,最多仅支持7个分账方,json 数组形式,详见 https://docs.adapay.tech/api/appendix.html#divmembers
|
||||||
* @param description 订单附加说明
|
* @param description 订单附加说明
|
||||||
* @return 同步返回一个 支付对象,详见 https://docs.adapay.tech/api/trade.html#id2
|
* @return 同步返回一个 支付对象,详见 https://docs.adapay.tech/api/trade.html#id2
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> pay(PayCallback callback, String payChannel, Expend expend, String orderNo, String payAmt,
|
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);
|
Map<String, Object> paymentParams = new HashMap<>(16);
|
||||||
paymentParams.put("app_id", adapayProperties.getAppId());
|
paymentParams.put("app_id", adapayProperties.getAppId());
|
||||||
paymentParams.put("notify_url", adapayProperties.getNotifyUrl());
|
paymentParams.put("notify_url", adapayProperties.getNotifyUrl());
|
||||||
|
|
@ -109,6 +110,7 @@ public class AdapayService {
|
||||||
paymentParams.put("pay_amt", payAmt);
|
paymentParams.put("pay_amt", payAmt);
|
||||||
paymentParams.put("goods_title", goodsTittle);
|
paymentParams.put("goods_title", goodsTittle);
|
||||||
paymentParams.put("goods_desc", goodsDesc);
|
paymentParams.put("goods_desc", goodsDesc);
|
||||||
|
paymentParams.put("div_members", divMembers);
|
||||||
paymentParams.put("description", description);
|
paymentParams.put("description", description);
|
||||||
paymentParams.put("expend", expend);
|
paymentParams.put("expend", expend);
|
||||||
PayReplyMapping.putCallback(orderNo, callback);
|
PayReplyMapping.putCallback(orderNo, callback);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue