微信退款自定义回调通知

This commit is contained in:
egzosn
2021-02-24 22:02:31 +08:00
parent e87e62c241
commit ec11b7af56

View File

@@ -40,6 +40,7 @@ import com.alibaba.fastjson.JSONObject;
import com.egzosn.pay.common.api.BasePayService;
import com.egzosn.pay.common.bean.BillType;
import com.egzosn.pay.common.bean.MethodType;
import com.egzosn.pay.common.bean.Order;
import com.egzosn.pay.common.bean.PayMessage;
import com.egzosn.pay.common.bean.PayOrder;
import com.egzosn.pay.common.bean.PayOutMessage;
@@ -214,8 +215,7 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> implements
// 总金额单位为分
parameters.put("total_fee", Util.conversionCentAmount(order.getPrice()));
setParameters(parameters, "attach", order.getAddition());
parameters.put("notify_url", payConfigStorage.getNotifyUrl());
setParameters(parameters, "notify_url", order);
initNotifyUrl(parameters, order);
parameters.put("trade_type", order.getTransactionType().getType());
if (null != order.getExpirationTime()) {
parameters.put("time_start", DateUtils.formatDate(new Date(), DateUtils.YYYYMMDDHHMMSS));
@@ -512,6 +512,12 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> implements
}
private Map<String, Object> initNotifyUrl(Map<String, Object> parameters, Order order) {
setParameters(parameters, "notify_url", payConfigStorage.getNotifyUrl());
setParameters(parameters, "notify_url", order);
return parameters;
}
/**
* 申请退款接口
*
@@ -528,7 +534,7 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> implements
setParameters(parameters, "out_refund_no", refundOrder.getRefundNo());
parameters.put("total_fee", Util.conversionCentAmount(refundOrder.getTotalAmount()));
parameters.put("refund_fee", Util.conversionCentAmount(refundOrder.getRefundAmount()));
setParameters(parameters, "notify_url", payConfigStorage.getNotifyUrl());
initNotifyUrl(parameters, refundOrder);
if (null != refundOrder.getCurType()) {
parameters.put("refund_fee_type", refundOrder.getCurType().getType());
}
@@ -778,12 +784,12 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> implements
* @param order 转账订单
* <pre>
*
* 注意事项:
* ◆ 当返回错误码为“SYSTEMERROR”时请不要更换商户订单号一定要使用原商户订单号重试否则可能造成重复支付等资金风险。
* ◆ XML具有可扩展性因此返回参数可能会有新增而且顺序可能不完全遵循此文档规范如果在解析回包的时候发生错误请商户务必不要换单重试请商户联系客服确认付款情况。如果有新回包字段会更新到此API文档中。
* ◆ 因为错误代码字段err_code的值后续可能会增加所以商户如果遇到回包返回新的错误码请商户务必不要换单重试请商户联系客服确认付款情况。如果有新的错误码会更新到此API文档中。
* ◆ 错误代码描述字段err_code_des只供人工定位问题时做参考系统实现时请不要依赖这个字段来做自动化处理。
* </pre>
* 注意事项:
* ◆ 当返回错误码为“SYSTEMERROR”时请不要更换商户订单号一定要使用原商户订单号重试否则可能造成重复支付等资金风险。
* ◆ XML具有可扩展性因此返回参数可能会有新增而且顺序可能不完全遵循此文档规范如果在解析回包的时候发生错误请商户务必不要换单重试请商户联系客服确认付款情况。如果有新回包字段会更新到此API文档中。
* ◆ 因为错误代码字段err_code的值后续可能会增加所以商户如果遇到回包返回新的错误码请商户务必不要换单重试请商户联系客服确认付款情况。如果有新的错误码会更新到此API文档中。
* ◆ 错误代码描述字段err_code_des只供人工定位问题时做参考系统实现时请不要依赖这个字段来做自动化处理。
* </pre>
* @return 对应的转账结果
*/
@Override