Checkout flow logic

Checkout flow logic

The checkout flow used for this plugin can result in  Pending orders existing in WooCommerce, where the payment has not been finalized in Nets. This is part of the general WooCommerce checkout flow, and it does not implicate that something is wrong.

Two different flows


Nets Easy for WooCommerce has two different checkout flows. The Embedded checkout flow and the Redirect checkout flow. These two flows can be changed in the plugin settings.

  • Embedded flow is a solution where Nets Easy is embedded in the WooCommerce checkout page and partially replaces the standard checkout page.
  • Redirect flow is a traditional payment flow where the regular WooCommerce checkout page is used and the customer is redirected to a payment window hosted by Nets to finalize the purchase.

Embedded checkout flow


  1. Customer navigates to the checkout page in WooCommerce. If Nets Easy is the selected (or default) payment method, an initialize session request is sent to Nets.
  2. Nets responds with a paymentId that is used do display the embedded checkout (via JavaScript) on the WooCommerce checkout page.
  3. When the customer identify herself in the Nets Easy checkout, a JS event is triggered. The Nets Easy for WooCommerce plugin is listening for this event, updates the customer in WooCommerce and recalculates the cart. If anything changes (like the selected shipping method), an update checkout request is sent to Nets.
  4. When the customer clicks the Pay button in Nets Easy, a pay-initialized JavaScript event is triggered by Nets.
  5. The standard WooCommerce checkout form is submitted by the Nets Easy plugin, with customer data that we receive from Nets, and a pending order is created in WooCommerce. This order has not yet been paid for and you should not change the status to Processing/Completed manually.
  6. If the order creation went well, the Nets Easy plugin responds with a true message in the JavaScript event (if something went wrong during the order creation process the plugin will respond with a false message and Nets will not finalize the purchase. Instead an error notice will be displayed for the customer). 
  7. Provided that the Nets Easy plugin respond with a true message, Nets then finalizes the purchase in their system.
  8. When the purchase is completed by the customer, a payment-completed JavaScript event is triggered by Nets.
  9. The Nets Easy plugin redirects the customer to the confirmation URL.
  10. The Nets Easy plugin confirms the WC order and trigger the WooCommerce function $order->payment_complete(). WooCommerce then decides if the order status should be set to Processing or Completed (depending on the types of items in the order).
  11. The WooCommerce order received page is rendered and displayed for the customer.

Redirect checkout flow


  1. Customer navigates to the checkout page in WooCommerce and enter address information in the checkout form fields.
  2. Customer selects Nets Easy as payment method and clicks the Place order button.
  3. pending order is created in WooCommerce.
  4. Customer is redirected to Nets Easy payment window.
  5. Customer completes the purchase and get redirected back to the store.
  6. The Nets Easy plugin confirms the WC order and trigger the WooCommerce function $order->payment_complete(). WooCommerce then decides if the order status should be set to Processing or Completed (depending on the types of items in the order).
  7. The WooCommerce order received page is rendered and displayed for the customer.
  8. 2 minutes after the steps above are all completed, a callback is sent from Nets to verify that everything went well.