|
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.payment.platform.module.payment.har.client.dto.HarPayRequest;
|
|
import com.payment.platform.module.payment.har.client.dto.HarPayRequest;
|
|
|
import com.payment.platform.module.payment.har.client.dto.HarPrecreateRequest;
|
|
import com.payment.platform.module.payment.har.client.dto.HarPrecreateRequest;
|
|
|
import com.payment.platform.module.payment.har.client.dto.HarQueryRequest;
|
|
import com.payment.platform.module.payment.har.client.dto.HarQueryRequest;
|
|
|
|
|
+import com.payment.platform.module.payment.har.client.dto.HarRefundRequest;
|
|
|
import com.payment.platform.module.payment.har.client.dto.HarShopCreateRequest;
|
|
import com.payment.platform.module.payment.har.client.dto.HarShopCreateRequest;
|
|
|
import com.payment.platform.module.payment.har.config.HarProperties;
|
|
import com.payment.platform.module.payment.har.config.HarProperties;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -47,6 +48,17 @@ public class HarClient {
|
|
|
private static final String METHOD_PRECREATE = "kf.alipay.trade.precreate";
|
|
private static final String METHOD_PRECREATE = "kf.alipay.trade.precreate";
|
|
|
private static final String METHOD_PAY = "kf.alipay.trade.pay";
|
|
private static final String METHOD_PAY = "kf.alipay.trade.pay";
|
|
|
private static final String METHOD_QUERY = "kf.alipay.trade.query";
|
|
private static final String METHOD_QUERY = "kf.alipay.trade.query";
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 退款 method。取值见规范 5.4 章标题、接口声明表第 4 行、表 8 表头行 —— 三处一致。
|
|
|
|
|
+ *
|
|
|
|
|
+ * <p>表 8 里 {@code method} 的**备注格**写的是 {@code kf.jh.stage.trade.refund},
|
|
|
|
|
+ * 与 precreate 同款的复制粘贴缺陷(那次备注格写 {@code kf.jh.stage.trade.precreate},
|
|
|
|
|
+ * 联调实证可用的是 {@code kf.alipay.trade.precreate})。备注格那一列在本规范里不可信,
|
|
|
|
|
+ * 以章标题/声明表/表头为准。
|
|
|
|
|
+ */
|
|
|
|
|
+ private static final String METHOD_REFUND = "kf.alipay.trade.refund";
|
|
|
|
|
+
|
|
|
private static final String METHOD_SHOP_CREATE = "kf.har.shop.create";
|
|
private static final String METHOD_SHOP_CREATE = "kf.har.shop.create";
|
|
|
|
|
|
|
|
/** 上游 context-path,见 demo Main.java:13 的 http://localhost:9090/kf-alipay-api/... */
|
|
/** 上游 context-path,见 demo Main.java:13 的 http://localhost:9090/kf-alipay-api/... */
|
|
@@ -68,6 +80,18 @@ public class HarClient {
|
|
|
return invoke(METHOD_QUERY, "/api/alipay/trade/query", req);
|
|
return invoke(METHOD_QUERY, "/api/alipay/trade/query", req);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 订单退款(全额)。
|
|
|
|
|
+ *
|
|
|
|
|
+ * <p>规范 5.4 的 biz 只有 order_no / third_order_no,没有金额字段 —— 上游没给部分退款的入口。
|
|
|
|
|
+ * 响应的 {@code detail} 结构上游未公开(设计文档记「HAR 侧接口仍在开发中」),
|
|
|
|
|
+ * 因此本方法只回传原始 {@link HarResponse},**不解析 detail**:字段名猜不得,
|
|
|
|
|
+ * 退款结果的收敛走通知与主动查询。
|
|
|
|
|
+ */
|
|
|
|
|
+ public HarResponse refund(HarRefundRequest req) {
|
|
|
|
|
+ return invoke(METHOD_REFUND, "/api/alipay/trade/refund", req);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 门店创建。
|
|
* 门店创建。
|
|
|
*
|
|
*
|