0

I have an issue in checkout. It will make me crazy... The last days i try to understand why is happened. When a customer is registered and go to checkout the issue is

POST https://mysite/rest/default/V1/carts/mine/set-payment-information-and-get-totals 400 main.js?attr=9IDcL1d…Qz3N6ZuKrKVk6g:2666
xhrSendProcessor    @   main.js?attr=9IDcL1d…Qz3N6ZuKrKVk6g:2666
window.XMLHttpRequest.send  @   main.js?attr=9IDcL1d…Qz3N6ZuKrKVk6g:2557
send    @   jquery.js:10260
ajax    @   jquery.js:9744
post    @   storage.js:46
(anonymous) @   set-payment-and-update-totals.js:32
(anonymous) @   cash-on-delivery-fee.js:26
notifySubscribers   @   knockout.js:1320
valueHasMutated @   knockout.js:1538
observable  @   knockout.js:1504
(anonymous) @   select-payment-method.js:20
_super  @   wrapper.js:73
(anonymous) @   select-payment-method-mixin.js:20
(anonymous) @   wrapper.js:78
selectPaymentMethod @   default.js:176
(anonymous) @   knockout.js:4245
dispatch    @   jquery.js:5232
elemData.handle @   jquery.js:4884


POST https://mysite/rest/default/V1/carts/mine/set-payment-information 400 main.js?attr=9IDcL1d…Qz3N6ZuKrKVk6g:2666 
xhrSendProcessor    @   main.js?attr=9IDcL1d…Qz3N6ZuKrKVk6g:2666
window.XMLHttpRequest.send  @   main.js?attr=9IDcL1d…Qz3N6ZuKrKVk6g:2557
send    @   jquery.js:10260
ajax    @   jquery.js:9744
post    @   storage.js:46
(anonymous) @   set-payment-information-extended.js:73
(anonymous) @   select-payment-method-mixin.js:27
(anonymous) @   wrapper.js:78
selectPaymentMethod @   default.js:176
(anonymous) @   knockout.js:4245
dispatch    @   jquery.js:5232
elemData.handle @   jquery.js:4884

I try to disable all extensions in checkout but with no luck My first thought is that could be an issue from cookies...

Guest user place order without problem, Registred user have this issue and when they click Place Order they redirect to cart

How can i find or solve this? Had anyone face it?

I Request Payload (set-payment-information-and-get-totals) for guest user

{cartId: "dxJXdNDj7P2PLpF7puxeFGwRcrKOlAjX",…}
billingAddress: {countryId: "GR", regionId: "489", regionCode: "AT", region: "Αττικής", street: ["test"], company: "",…}
city: "test"
company: ""
countryId: "GR"
firstname: "test"
lastname: "test"
postcode: "12345"
region: "Αττικής"
regionCode: "AT"
regionId: "489"
saveInAddressBook: null
street: ["test"]
telephone: "3213213213"
cartId: "dxJXdNDj7P2PLpF7puxeFGwRcrKOlAjX"
email: "mail@gmail.com"

for registered user

{cartId: "4913",…}
billingAddress: {customerAddressId: "114", countryId: "GR", regionId: "489", regionCode: "AT", region: "Αττικής",…}
city: "city"
company: null
countryId: "GR"
customAttributes: []
customerAddressId: "114"
customerId: "735"
fax: null
firstname: "name"
lastname: "lastname"
middlename: null
postcode: "172 37"
prefix: null
region: "region"
regionCode: "AT"
regionId: "489"
saveInAddressBook: null
street: ["street"]
suffix: null
telephone: "telephone"
vatId: null
cartId: "4913"

I See some questions for this but it isn't solved

I use Magento 2.4.2

2 Answers 2

1

Having a similar issue after upgrading from 2.2.3 to 2.4.3. I have an ancient no longer supported plugin for COD (msp cashondelivery) which causes a 500 error in checkout when selecting it as payment method. The fullscreen loader stucks in an infinite loop. I removed the loader element from object inspector in my browser so I can access the form again and the error disapperared when I checked the terms and conditions required field. So yes I can confirm that both a third parth plugin and the terms and conditions checkbox are BOTH related to similar errors (more specifically I have issue on /V1/carts/mine/selected-payment-method) as the author of this question stated at some point.

1
  • i remove the validator for cachondelivery and it work, i don't remember how i did it. As you say, if you don't ask for terms and conditions in checkout the issue disappear but i think it is not suit with GDPR
    – Pantelis
    Mar 11 at 14:20
0

4xx has something to do with Authorization.

Did you try open the var/log and var/report to check the error message?

9
  • i don't see any issue there for this issue, i only get an error for stats [2021-03-10 17:05:33] main.CRITICAL: Cannot gather stats! Warning!stat(): stat failed for /pub/static/frontend/Pearl/weltpixel_custom/el_GR/mage/requirejs/mixins.js {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Cannot gather stats! Warning!stat(): stat failed for /pub/static/frontend/Pearl/weltpixel_custom/el_GR/mage/requirejs/mixins.js at /vendor/magento/framework/Filesystem/Driver/File.php:95)"} []
    – Pantelis
    Mar 11, 2021 at 9:09
  • How about you try it again? I often empty the whole folders. And then create the error, this way I always get the newest error. If you still don't see any error in the var folder, you can open network tab, which is in your browser (chrome/firefox) devtool, this may help monitor the request and response. Maybe Magento will show log there.
    – Jimmy
    Mar 11, 2021 at 9:30
  • i can't see anything for this in log folder again... from the network tab is the Request Payload i paste in the question. When i simply click on the error i see <response> <message>Request does not match any route.</message> <trace/> </response> In fresh magento installation i see that it call the /rest/default/V1/carts/mine/set-payment-information and not the /rest/default/V1/carts/mine/set-payment-information-and-get-totals
    – Pantelis
    Mar 11, 2021 at 9:59
  • That's weird, it should show the error. Anyway, you can start debugging by opening the class handles the request, in this case, it is \Magento\Checkout\Model\PaymentInformationManagement::savePaymentInformation
    – Jimmy
    Mar 11, 2021 at 10:13
  • is it a way to send you the link? maybe you can see something i don't
    – Pantelis
    Mar 11, 2021 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.