diff --git a/src/main/java/com/sczx/order/controller/VerifyController.java b/src/main/java/com/sczx/order/controller/VerifyController.java index 6d01af7..90a6d20 100644 --- a/src/main/java/com/sczx/order/controller/VerifyController.java +++ b/src/main/java/com/sczx/order/controller/VerifyController.java @@ -20,6 +20,9 @@ public class VerifyController { @Autowired private MeiTuanService meituanService; + @Autowired + private DouyinService douyinService; + @ApiOperation(value = "接收美团Token数据接口") @GetMapping("/authorization") public Result authorization(@RequestParam("code") String code, @RequestParam("sign") String sign, @RequestParam("developerId") Long developerId, @RequestParam("businessId") int businessId, @@ -31,5 +34,11 @@ public class VerifyController { return Result.ok(meituanService.getAccessToken(code,state)); } + @ApiOperation(value = "美团验券接口") + @GetMapping("/meituan") + public Result meituan(@RequestParam("pid") String pid, @RequestParam("tid") String tid){ + return Result.ok(douyinService.cancel(pid,tid)); + } + } diff --git a/src/main/java/com/sczx/order/service/DouyinService.java b/src/main/java/com/sczx/order/service/DouyinService.java index f1aeed1..84309c8 100644 --- a/src/main/java/com/sczx/order/service/DouyinService.java +++ b/src/main/java/com/sczx/order/service/DouyinService.java @@ -9,7 +9,7 @@ public interface DouyinService { CertificateVerifyResponse verify(CertificateVerifyRequest req); - CertificateCancelResponse cancel(String certificateId, String verifyId) ; + CertificateCancelResponse cancel(String paymentId,String transactionId) ; diff --git a/src/main/java/com/sczx/order/service/impl/DouyinServiceImpl.java b/src/main/java/com/sczx/order/service/impl/DouyinServiceImpl.java index f8091ab..3c9399c 100644 --- a/src/main/java/com/sczx/order/service/impl/DouyinServiceImpl.java +++ b/src/main/java/com/sczx/order/service/impl/DouyinServiceImpl.java @@ -121,10 +121,10 @@ public class DouyinServiceImpl implements DouyinService { return sdkResponse; } catch (TeaException e) { - throw new RuntimeException("券验证失败"); + throw new RuntimeException("券验证失败:"+e.message); } catch (Exception e) { - throw new RuntimeException("券验证失败"); + throw new RuntimeException("券验证失败: "+e.getMessage()); } }