mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-17 23:43:41 +08:00
@@ -18,8 +18,46 @@
|
|||||||
package cn.felord.payment.wechat.enumeration;
|
package cn.felord.payment.wechat.enumeration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 退款成功事件.
|
||||||
|
*
|
||||||
* @author felord.cn
|
* @author felord.cn
|
||||||
* @since 1.0.6.RELEASE
|
* @since 1.0.6.RELEASE
|
||||||
*/
|
*/
|
||||||
public enum RefundStatus {
|
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))
|
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||||
.build()
|
.build()
|
||||||
.toUri();
|
.toUri();
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
params.setNotifyUrl(v3.getDomain().concat(params.getNotifyUrl()));
|
||||||
return Post(uri, params);
|
return Post(uri, params);
|
||||||
}))
|
}))
|
||||||
.consumer(wechatResponseEntity::convert)
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
|||||||
@@ -283,9 +283,9 @@ public class WechatPayCallback {
|
|||||||
CallbackParams callbackParams = resolve(params);
|
CallbackParams callbackParams = resolve(params);
|
||||||
String eventType = callbackParams.getEventType();
|
String eventType = callbackParams.getEventType();
|
||||||
|
|
||||||
if (!Objects.equals(eventType, EventType.REFUND_CLOSED.event)||
|
if (!(Objects.equals(eventType, EventType.REFUND_CLOSED.event) ||
|
||||||
!Objects.equals(eventType,EventType.REFUND_ABNORMAL.event)||
|
Objects.equals(eventType, EventType.REFUND_ABNORMAL.event) ||
|
||||||
!Objects.equals(eventType,EventType.REFUND_SUCCESS.event)) {
|
Objects.equals(eventType, EventType.REFUND_SUCCESS.event))) {
|
||||||
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
||||||
throw new PayException(" wechat pay event type is not matched");
|
throw new PayException(" wechat pay event type is not matched");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user