|
|
|
@@ -74,11 +74,9 @@ public class WxRefundV3AdapterService implements RefundPayAdapterService{ |
|
|
|
|
|
|
|
private V3PayRefundReq getReq(WxPayAccount payAccount,WxAppinfo appInfo,WxRefundOrder record,WxPayOrder payOrder,Long orderId,EnumPayType payType) { |
|
|
|
V3PayRefundReq req = new V3PayRefundReq(); |
|
|
|
log.error("ceshi+"+JSON.toJSONString(payAccount)); |
|
|
|
//直连 |
|
|
|
if (payAccount.getMchType() == EnumPayMchType.DIRECT.getCode()) { |
|
|
|
WxComposeChildOrderShare share = payOrder.getChildOrderShare(orderId); |
|
|
|
log.error("ceshi+"+JSON.toJSONString(share)); |
|
|
|
req.setSub_mchid(share.getMerchantUid()); |
|
|
|
//总分 |
|
|
|
}else if (payAccount.getMchType() == EnumPayMchType.TOTAL.getCode()) { |
|
|
|
@@ -86,15 +84,18 @@ public class WxRefundV3AdapterService implements RefundPayAdapterService{ |
|
|
|
}else { |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前支付模式非法"); |
|
|
|
} |
|
|
|
log.error("ceshi+"+JSON.toJSONString(payOrder)); |
|
|
|
req.setOut_trade_no(payOrder.getPayOrderNo()); |
|
|
|
log.error("ceshi+"+JSON.toJSONString(record)); |
|
|
|
req.setOut_refund_no(String.valueOf(record.getId())); |
|
|
|
log.error("ceshi+"+JSON.toJSONString(payType)); |
|
|
|
try { |
|
|
|
req.setReason(WxPayV3.handleChinese(payType.getMessage())); |
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
req.setReason(payType.getCode().toString()); |
|
|
|
if(null != payType) { |
|
|
|
if (payType == EnumPayType.PAY_B_REFUND) { |
|
|
|
req.setReason("B端商户退款"); |
|
|
|
} else if (payType == EnumPayType.PAY_ADMIN_REFUND) { |
|
|
|
req.setReason("管理端商户退款"); |
|
|
|
} else if (payType == EnumPayType.PAY_AUTO_REFUND) { |
|
|
|
req.setReason("超期自动退款"); |
|
|
|
} else if (payType == EnumPayType.PAY_C_REFUND){ |
|
|
|
req.setReason("用户自己退款"); |
|
|
|
} |
|
|
|
} |
|
|
|
req.setNotify_url(payAccount.getRefundNotifyV3Url()); |
|
|
|
V3PayRefundAmountReq amount = new V3PayRefundAmountReq(); |
|
|
|
@@ -103,7 +104,6 @@ public class WxRefundV3AdapterService implements RefundPayAdapterService{ |
|
|
|
req.setAmount(amount); |
|
|
|
List<V3PayRefundGoodsReq> goods = new ArrayList<V3PayRefundGoodsReq>(); |
|
|
|
WxOrder order = wxOrderService.getById(orderId, payAccount.getTenantId()); |
|
|
|
log.error("ceshi+"+JSON.toJSONString(order)); |
|
|
|
V3PayRefundGoodsReq gr = new V3PayRefundGoodsReq(); |
|
|
|
try { |
|
|
|
gr.setGoods_name(WxPayV3.handleChinese("商品"+order.getProductId())); |
|
|
|
|