Почему я получаю ответ 301 на сообщение HTTP на Laravel без токена CSRF? - PullRequest
0 голосов
/ 11 марта 2020

Я пытаюсь настроить уведомления Adyen в моем интернет-магазине. https://docs.adyen.com/development-resources/notifications/understand-notifications

Когда я проверяю сообщение HTTP с помощью тестовой страницы Adyen, я получаю ответ 301, но когда я проверяю сообщение HTTP с пользовательской формой, маршрут работает.

Маршрут в сети. php: Route::name('shop.checkout.adyen-notification')->post('/adyen-notification', 'Shop\CheckoutController@adyenNotification');

Настройки в VerifyCsrfToken. php: protected $except = ['*/adyen-notification?*'];

Пользовательская форма:

<form method="post" action="https://example.com/adyen-notification?originalReference=&reason=&merchantAccountCode=Test&eventCode=NOTIFICATIONTEST&operations=&success=true&paymentMethod=bankTransfer_BE&currency=EUR&pspReference=test_NOTIFICATIONTEST_1&merchantReference=testMerchantRef1&value=11099">
    <input type="submit" value="SUBMIT">
</form>

Я не могу понять, почему он дает мне ответ 301.

1 Ответ

0 голосов
/ 11 марта 2020

У вас есть опечатка в действии формы, отсутствует заключительная кавычка:

<form method="post" action="https://example.com/adyen-notification?originalReference=&reason=&merchantAccountCode=Test&eventCode=NOTIFICATIONTEST&operations=&success=true&paymentMethod=bankTransfer_BE&currency=EUR&pspReference=test_NOTIFICATIONTEST_1&merchantReference=testMerchantRef1&value=11099>
    <input type="submit" value="SUBMIT">
</form>

Должно быть:

<form method="post" action="https://example.com/adyen-notification?originalReference=&reason=&merchantAccountCode=Test&eventCode=NOTIFICATIONTEST&operations=&success=true&paymentMethod=bankTransfer_BE&currency=EUR&pspReference=test_NOTIFICATIONTEST_1&merchantReference=testMerchantRef1&value=11099">
    <input type="submit" value="SUBMIT">
</form>

...