update 创建撤销请求,放入扩展字段

This commit is contained in:
2023-08-17 12:05:21 +08:00
parent ae5f0d8faf
commit 8caab85abe
4 changed files with 18 additions and 7 deletions

View File

@@ -663,7 +663,7 @@ public class AdapayMemberService {
* 延迟分账未确认, 调交易撤销接口退款
* @param wechatAppId 微信小程序appId
*/
public PaymentReverseResponse createPaymentReverseRequest(String paymentId, BigDecimal reverseAmt, String wechatAppId) {
public PaymentReverseResponse createPaymentReverseRequest(String paymentId, BigDecimal reverseAmt, String wechatAppId, String memberId, String scenarioType, String orderCode) {
PaymentReverseResponse response;
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(wechatAppId);
if (config == null) {
@@ -676,7 +676,15 @@ public class AdapayMemberService {
reverseParams.put("reverse_amt", AdapayUtil.formatAmount(reverseAmt));
reverseParams.put("order_no", IdUtils.fastSimpleUUID());
reverseParams.put("notify_url", ADAPAY_CALLBACK_URL);
reverseParams.put("", "");
// expand 为扩展域
Map<String, String> expendMap = Maps.newHashMap();
expendMap.put("memberId", memberId);
expendMap.put("scenarioType", scenarioType);
if (StringUtils.isNotBlank(orderCode)) {
expendMap.put("orderCode", orderCode);
}
reverseParams.put("expand", expendMap);
// reverseParams.put("reason", "reason");
Map<String, Object> paymentReverse = null;
try {
paymentReverse = PaymentReverse.create(reverseParams, config.getWechatAppId());