|
|
@@ -121,13 +121,13 @@ public class AutopayOrderController {
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/cancel/{orderSn}")
|
|
|
- public ResultData cancel(@PathVariable String orderSn){
|
|
|
- AutopayOrder autopayOrder = autopayOrderService.getByOrderSn(orderSn);
|
|
|
+ @GetMapping("/cancel/{subscriptionId}")
|
|
|
+ public ResultData cancel(@PathVariable String subscriptionId){
|
|
|
+ AutopayOrder autopayOrder = autopayOrderService.getBySubscriptionId(subscriptionId);
|
|
|
if(autopayOrder == null){
|
|
|
throw new BusinessException(ResultCode.ORDER_NOT_EXIST);
|
|
|
}
|
|
|
- Order order = orderService.getByOrderSn(orderSn);
|
|
|
+ Order order = orderService.getByOrderSn(autopayOrder.getOrderSn());
|
|
|
if(order == null){
|
|
|
throw new BusinessException(ResultCode.ORDER_NOT_EXIST);
|
|
|
}
|
|
|
@@ -135,7 +135,7 @@ public class AutopayOrderController {
|
|
|
if(paypalConfig == null){
|
|
|
throw new BusinessException(ResultCode.PAYPAL_CONFIG_ERROR);
|
|
|
}
|
|
|
- restApiPaypalService.cancelSubscriptions(paypalConfig,autopayOrder.getSubscriptionId());
|
|
|
+ RestApiPaypalService.cancelSubscriptions(paypalConfig,autopayOrder.getSubscriptionId());
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
}
|