我正在 Hybris 中进行第三方支付集成 Adyen,在成功进行 3D 安全验证后,发卡机构会将购物者重定向到我们的网站。在这种情况下,我将收到对我在 returnURl 中指定的 URL 的 HTTP POST 调用,在我的情况下是https://localhost:9002/test/en/EUR/payment/submitResponse
.
从发卡机构到我们的 URL 的 HTTP POST 调用包括以下参数:
- MD——发卡机构返回的支付会话标识符。
- PaRes – 发卡机构返回的支付授权响应。
请求标头:
Content-Type: application/x-www-form-urlencoded
Origin: https://test.test.com
Referer: https://test.test.com/hpp/3d/authenticate.shtml
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/83.0.4103.116 Safari/537.36
Form Data->
MD: SomeString
PaRes: SomeString
控制器注释:
@Controller
@RequestMapping(value = "/payment")
方法:
@ResponseBody
@RequestMapping(value = "/submitResponse", method = RequestMethod.POST)
public Map<String, Object> submitResponse(final HttpServletRequest request) {
Map<String, Object> responseMap = new HashMap<>();
responseMap.put("Key", "hello im submitted");
return responseMap;
}
我检查了来自 Adyen 的 POST 请求的标头,发现了表单数据:
md="SomeString"
Pares="someString"
但是,我收到以下异常:
WARN [hybrisHTTP34] [DefaultHandlerExceptionResolver] Resolved exception caused by handler execution: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
在浏览器控制台中:
Failed to load resource: the server responded with a status of 405 ()