Payment method: Cash on Delivery issue
-
I am encountering an issue with the WooCommerce plugin on my website. The problem seems to be related to the nonce header and payment method during the checkout process. Here are the details:
- When attempting to place an order, the browser console shows the following error:jsonCopy code
{"code":"woocommerce_rest_missing_nonce","message":"Missing the Nonce header. This endpoint requires a valid nonce.","data":{"status":401}}
- To troubleshoot, I temporarily disabled the nonce check using the following filter:phpCopy code
add_filter( 'woocommerce_store_api_disable_nonce_check', '__return_true' );
- After disabling the nonce check, the following message appears:jsonCopy code
{"order_id":11909,"status":"checkout-draft","order_key":"wc_order_Duvi9v02ink9E","order_number":"11909","customer_note":"","customer_id":0,"billing_address":{"first_name":"Chris","last_name":"Jack","company":"","address_1":"Greater noida","address_2":"","city":"Test","state":"UP","postcode":"201306","country":"IN","email":"[email protected]","phone":""},"shipping_address":{"first_name":"Chris","last_name":"Jack","company":"","address_1":"Greater noida","address_2":"","city":"Test","state":"UP","postcode":"201306","country":"IN","phone":""},"payment_method":"","payment_result":{"payment_status":"","payment_details":[],"redirect_url":""},"additional_fields":[],"extensions":{}}
- This response indicates that the
payment_method
field is missing, even though the Cash on Delivery option is selected.
After clicking Place Order, the order in the admin panel is visible but the loading icon spins endlessly.
As a developer specializing in our theme, I am not in a position to make changes to the WooCommerce plugin. Therefore, I kindly request your assistance in resolving this issue.
Could you please provide guidance on how to address the missing nonce header and ensure the payment method is correctly captured during the checkout process?
Please note that this issue occurs only with the payment method: Cash on Delivery. I have also tested it by activating the default WordPress theme and deactivating all plugins. The problem still persists.
Thank you for your support.
The page I need help with: [log in to see the link]
- When attempting to place an order, the browser console shows the following error:jsonCopy code
- You must be logged in to reply to this topic.