Troubleshooting the Pay for order/Hosted Payment Page Redirect flow

  1. Home
  2. /
  3. Avarda Checkout for WooCommerce
  4. /
  5. Troubleshooting
  6. /
  7. Troubleshooting the Pay for order/Hosted Payment Page Redirect flow

Troubleshooting the Pay for order/Hosted Payment Page Redirect flow

The Checkout flow in Avarda Checkout is constructed in a way that a WooCommerce order will be created first (in Pending status), then the Avarda order is placed, and finally the WooCommerce order is updated to Processing status. This flow is more compatible with other WooCommerce plugins.

This checkout flow also means that Pending orders can be visible in WooCommerce, where the payment has not been finalized in Avarda (for example card payment where there was not enough funds on the card). This is part of the general WooCommerce checkout flow, and it does not implicate that something is wrong.


I see pending orders in WooCommerce, is something wrong?


As mentioned above – you can have pending orders in WooCommerce with Avarda 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. Get Avarda purchase ID from session

"Get Avarda purchase ID from session. Order ID674. Avarda purchase ID: "

The expected behavior is that the session ID as received during the session initialization should remain consistent throughout the checkout process. This piece of information is useful to identify whether an existing session has been reset. A session reset is unusual, but this log entry is useful for indicating that there is an underlying problem.

This event can happen more than once.

2. Redirecting to order pay page

"Processing order wc-order-id|wc_order_xxx (Avarda ID: ) OK. Redirecting to order pay page."

The order was successfully processed, and the customer will be redirected to the order pay page.

This event can happen more than once.

3. Loading order receipt template

"Loading order receipt template for Avarda checkout: receipt-url"

This event can happen more than once.

4. No purchase id found

"No purchase id found in order or session when getting Avarda Payment."

The existing session doesn’t contain a purchase ID. How we handle this differs depending on the context, but most likely we’ll create a new session. If this keeps happening persistently, there might be an issue with the WooCommerce session management (most likely caused by a third-party plugin or the hosting provider).

5. ACO create auth token (Redirect Checkout Flow)

"id":"","type":"POST","title":"ACO create auth token"

The auth token has expired, and we’ve requested renewal. Make sure the response body token has a value, should not be null.

This log only appears for when placing an order via the Redirect checkout flow. This will not be logged with Pay for order flow.

6. ACO initialize payment (POST)

"id":"","type":"POST","title":"ACO initialize payment"

When customers visit the checkout page, a new checkout session is initiated. This action generates a fresh Avarda order ID that will be linked to the ongoing session.

This event should happen once.

7. ACO get payment (GET)

"id":"avarda-order-id","type":"GET","title":"ACO get payment"

This request is made whenever Avarda 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, when a customer enters the billing address in the embedded payment form and clicks on the “Continue” button can be a trigger for this event.

State: Initialized

This event can happen more than once.

8. Trying to initialize new or updating existing checkout session

"Checking session for wc-order-id|wc_order_3IvgOm1TmO443 (Avarda ID: avarda-order-id). Session state: Initialized. Trying to initialize new or updating existing checkout session."

Trying to create or update a checkout session from an existing WooCommerce order on the pay for order page.

This event can happen more than once. Every time the order page is refreshed.

9. ACO update payment (PUT)

"id":"avarda-order-id","type":"PUT","title":"ACO update payment"

Whenever a change occurs in WooCommerce, we need to notify Avarda 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 Avarda’s embedded 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 Avarda about these changes.

This event can happen more than once.

10. Confirm the Avarda order from the confirmation page

"avarda-order-id: Confirm the Avarda order from the confirmation page. Order ID: wc-order-id"

This event happens when we handle the redirect to the confirmation. It indicates that the WooCommerce order was successfully acknowledged, and that the customer will now be redirected to the confirmation page.

This event should happen only once.

11. ACO get payment (GET)

"id":"avarda-order-id","type":"GET","title":"ACO get payment"

Same as step 7 but with another state.

State: Completed

This event can happen more than once.

12. ACO update order reference (PUT)

"id":"avarda-order-id","type":"PUT","title":"ACO update order reference"

Throughout the order process, the Avarda has been having a temporary order number. At this step, now that we have a successful order, we’ll send its order number to Avarda so that they can update the corresponding order in their system.

This event should happen only once.

13. Notification callback hit (Callback)

"Notification callback hit for Avarda purchase ID: avarda-order-id. WC order ID: wc-order-id"

A server-to-server call always happens after the order in the Avarda is completed. This is to ensure that an order is still created in case an unrecoverable error occurred during checkout or if the customer closed the store page abruptly after confirming their purchase. You’ll always see this callback hit regardless of the outcome: whether the order was successful or not.

This event should happen only once.

14. Aborting notification callback

"Aborting notification callback. Order wc-order-id (order ID wc-order-id) already processed."

The order has already been processed, no further actions will be taken.

This event should happen only once.