|
@@ -14,6 +14,7 @@ import com.chelvc.framework.wechat.WechatPaymentCallback;
|
|
|
import com.chelvc.framework.wechat.WechatPaymentHandler;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -40,7 +41,7 @@ public class OmsOrderController {
|
|
|
private final OmsOrderClient omsOrderClient;
|
|
|
private final OmsOrderReturnApplyClient omsOrderReturnApplyClient;
|
|
|
|
|
|
- private final WechatPaymentHandler wechatPaymentHandler;
|
|
|
+ private final ApplicationContext applicationContext;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -116,8 +117,10 @@ public class OmsOrderController {
|
|
|
@PostMapping("/order/{name}/callback")
|
|
|
public void paySuccess(@PathVariable("name") String name,
|
|
|
@RequestBody String body, HttpServletResponse response) throws IOException {
|
|
|
+
|
|
|
+ WechatPaymentHandler wechatPaymentHandler = applicationContext.getBean(WechatPaymentHandler.class);
|
|
|
//获取支付回调信息
|
|
|
- WechatPaymentCallback callback = this.wechatPaymentHandler.callback(name, body);
|
|
|
+ WechatPaymentCallback callback = wechatPaymentHandler.callback(name, body);
|
|
|
if(callback == null){
|
|
|
return;
|
|
|
}
|