Get started
Customization
Troubleshooting the checkout flow
The checkout flow used for this plugin can result in Pending orders existing in WooCommerce, where the payment has not been finalized in Walley. This is part of the general WooCommerce checkout flow, and it does not implicate that something is wrong.
The WooCommerce order is created first (in Pending status), then the Walley order is placed, and finally the WooCommerce order is updated to Processing status. This update is more compatible with other WooCommerce plugins.
I see pending orders in WooCommerce, is something wrong?
As mentioned above – you can have pending orders in WooCommerce with Walley Checkout as the payment method without any errors in your store. These might just be orders not finalized by the customer.
However, if you want to troubleshoot this a bit closer, here’s how you do it.
- Make sure that you have turned on Logging in the plugin settings.
- The logs can be found by navigating to WooCommerce → Status → Logs.
Order creation step by step
Order creation step by step and how to debug and follow it in the log
Some of these events happen one time in the order creation, while others can happen multiple times. We have added a note to each event on whether you should expect to find it in the log once or several times.
1. Access token (POST)
"id":null,"type":"POST","title":"Access token"
This event should happen once.
2. Initialize checkout (POST)
"id":"","type":"POST","title":"Initialize checkout"
When customers visit the checkout page, a new checkout session is initiated. This action generates a fresh Walley order ID that will be linked to the ongoing session.
This event should happen once.
3. Get checkout (GET)
"id":"your-walley-order-id","type":"GET","title":"Get checkout"
This request is made whenever Walley notifies us about a change that occurred in the embedded payment form. We need to retrieve the updated form data from them in such cases. It’s important to note that this type of request can occur multiple times.
For instance, that a customer enters the billing address in the embedded payment form and clicks on the “Continue to delivery” button can be a trigger for this event. Also appears in the log when/if the customer is adding/changing billing details, or changing shipping details.
This event can happen more than once.
4. Update checkout (PUT)
"id":"your-walley-order-id","type":"PUT","title":"Update checkout"
Whenever a change occurs in WooCcommerce, we need to notify Walley about it. We achieve this by issuing a PUT request. It’s important to note that this type of request can occur multiple times, and the changes made may not always be immediately reflected in the embedded Walley payment form.
For instance, if a new item is added to the cart or if the quantity of an item is modified, a PUT request is sent to inform Walley about these changes.
This event can happen more than once.
5. onBeforePayment from Walley triggered
"Frontend JS "your-walley-order-id": onBeforePayment from Walley triggered"
When the customer clicks the Finalize checkout button in the Walley iframe, this will be logged in the log file.
This event usually happens once, but can happen more than once if there are any changes to the order.
6. Set order reference (PUT)
"id":"your-walley-order-id","type":"PUT","title":"Set order reference"
In this sequence the Walley Checkout plugin populates the address fields in the regular WooCommerce checkout form and submits the form. Now the WooCommerce order reference has been set and if the WooCommerce validation is successful (e.g., no coupon errors, the products are in stock), a new Pending Payment order is created in WooCommerce.
This event usually happens once, but can happen more than once if the WC cart hash has been changed, then you will also see that another WC order is created. More common is that it updates the existing WC order.
7. Successfully placed order
"Frontend JS "your-walley-id": Successfully placed order."
If the order creation went well you should now see this in the logs and the plugin now hands over the checkout process to Walley.
This event usually happens once, but can happen more than once if the customer for example cancels the purchase through the Walley iframe, returns to the store to add another product and then proceeds to the checkout again etc.
8. Notification Listener hit
"Notification Listener hit. Private id: “your-walley-order-id”. Public token: “public-XX-token”. Customer type: b2c/b2b"
If the payment went well, you can now see the order in the Walley/Walley portal and you should now see that the Walley order ID has been added to the WooCommerce order.
WC order info: Payment via Walley Checkout → Payment via Walley Checkout (“your-walley-order-id“)
This event should happen once.
9. Get checkout (GET)
"id":"your-walley-order-id","type":"GET","title":"Get checkout"
This request is made whenever Walley notifies us about a change that occurred in the embedded payment form. We need to retrieve the updated form data from them in such cases. It’s important to note that this type of request can occur multiple times.
This event usually happens once, but can happen more than once if there are any changes to the order.
10. Order ID … confirmed on the confirmation page
"Order ID X confirmed on the confirmation page. Walley payment ID: "your-walley-payment-id"."
This indicates that the purchase process was completed, and the customer was successfully redirected to the confirmation (thank you) page.
This event should happen once.
11. Thankyou page rendered
"Thankyou page rendered for order ID - "your-walley-order-id""
This indicates that the thank you page was rendered correctly for the order.
This event should happen once.
Errors that might happen
Checkout error
If the order creation didn’t go as expected you might see a Checkout error
. This is caused by WooCommerce validation NOT being successful (e.g., coupon errors, subscription that require login, no stock). This should happen between steps 6 and 7 in the order creation.
AJAX error
If the order creation didn’t go as expected you might see a AJAX error
. If you see the AJAX error you need to talk to your developer or the support. This is most likely caused by a third party plugin, or other code. This should happen between steps 6 and 7 in the order creation.
Possible scenarios with errors
Timeout
"Frontend JS your-walley-order-id: Checkout error | Error message: Timeout"
This is a Checkout error that is generated by WooCommerce, this appears when the Finalize checkout process takes too long and can not be completed correctly for some reason.
One example of when this occurs is when you try to finalize the order when the order total in WooCommerce and order total in the Walley iframe differs.
This leads to an Order total mismatch error which is visible in the log above the Timeout Checkout error explained above: "Order total mismatch in process_payment. Woo order total: …. Walley order total: … (cart:..., shipping: …, delivery module: )."
. The reason for why the order sum differs might be that the merchant have enabled the Walley nShift delivery setting in the plugin settings in WooCommerce but are not using the Walley Shipping Module as shipping method in the WooCommerce setting shipping Zones → Shipping methods.
Temporary error
This error message comes from Walley and is visible in the Walley iframe, this is usually visible when you are trying to finalize the purchase but something goes wrong in Walley. One scenario is that the payment option that the customer chooses is not working at the moment or that Walley is having temporary server issues.
It could also be due to timeout, the order taking too long to process in the Finalize Checkout process. Walley has a timeout set to 10 seconds (will be changing it to 15 seconds) and when the order takes more than 10/15 seconds this error will appear. This issue can be hard to find since the plugin is not logging any specific log regarding this more than the Temporary error being visible in the checkout. But one way to check if the issue is regarding timeout is to count how many seconds is between the first “Get checkout” and “Set order reference” after the onBeforePayment from Walley triggered in the log.
When this error appears most often the log ends with a validation from the plugin that the order is Successfully placed order but no Notification Listener hit /confirmation from Walley is logged since the order was not completed in the checkout.