我正在使用spring restcontroller for stripe制作简单的webhook,只是为了记录事件,它看起来像这样:
@RestController
@CrossOrigin(origins = "*")
@RequestMapping("/stripe")
public class StripeChargeSucceededController {
@PostMapping(value = "/chargeSucceeded", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Void> chargeSucceeded(HttpServletRequest request, HttpServletResponse response, @RequestBody String json) {
System.out.println("INCOMING TEST STRIPE REQUEST");
System.out.println(json);
return ResponseEntity.accepted().build();
}
}
我用postman向服务器发出了测试请求,得到了204个可接受的响应,并按预期记录了json,但是当我用stripe进行测试时,我得到:
测试webhook错误:404无效编码:iso-8859-1
我错过了什么?
暂无答案!
目前还没有任何答案,快来回答吧!