mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-13 21:33:41 +08:00
@@ -18,8 +18,46 @@
|
||||
package cn.felord.payment.wechat.enumeration;
|
||||
|
||||
/**
|
||||
* 退款成功事件.
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.6.RELEASE
|
||||
*/
|
||||
public enum RefundStatus {
|
||||
/**
|
||||
* 退款异常事件.
|
||||
*
|
||||
* @since 1.0.6.RELEASE
|
||||
*/
|
||||
ABNORMAL("REFUND.ABNORMAL"),
|
||||
|
||||
/**
|
||||
* 退款关闭事件.
|
||||
*
|
||||
* @since 1.0.6.RELEASE
|
||||
*/
|
||||
CLOSED("REFUND.CLOSED"),
|
||||
/**
|
||||
* 支付成功事件.
|
||||
*
|
||||
* @since 1.0.0.RELEASE
|
||||
*/
|
||||
TRANSACTION("TRANSACTION.SUCCESS");
|
||||
/**
|
||||
* The Event.
|
||||
*/
|
||||
private final String refundStatus;
|
||||
|
||||
/**
|
||||
* Instantiates a new Event type.
|
||||
*
|
||||
* @param refundStatus the event
|
||||
*/
|
||||
RefundStatus(String refundStatus) {
|
||||
this.refundStatus = refundStatus;
|
||||
}
|
||||
|
||||
public String getRefundStatus() {
|
||||
return refundStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,6 +280,8 @@ public class WechatDirectPayApi extends AbstractApi {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.build()
|
||||
.toUri();
|
||||
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||
params.setNotifyUrl(v3.getDomain().concat(params.getNotifyUrl()));
|
||||
return Post(uri, params);
|
||||
}))
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
|
||||
@@ -283,9 +283,9 @@ public class WechatPayCallback {
|
||||
CallbackParams callbackParams = resolve(params);
|
||||
String eventType = callbackParams.getEventType();
|
||||
|
||||
if (!Objects.equals(eventType, EventType.REFUND_CLOSED.event)||
|
||||
!Objects.equals(eventType,EventType.REFUND_ABNORMAL.event)||
|
||||
!Objects.equals(eventType,EventType.REFUND_SUCCESS.event)) {
|
||||
if (!(Objects.equals(eventType, EventType.REFUND_CLOSED.event) ||
|
||||
Objects.equals(eventType, EventType.REFUND_ABNORMAL.event) ||
|
||||
Objects.equals(eventType, EventType.REFUND_SUCCESS.event))) {
|
||||
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
||||
throw new PayException(" wechat pay event type is not matched");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user