Checkout flow logic

  1. Home
  2. /
  3. Nexi Checkout
  4. /
  5. Get started
  6. /
  7. 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 Nexi. This is part of the general WooCommerce checkout flow, and it does not implicate that something is wrong.

Three different flows


Nexi Checkout has three different checkout flows. The Embedded checkout flow, the Redirect checkout flow and the Overlay checkout flow. These three flows can be changed in the plugin settings.

  • Embedded flow is a solution where Nexi Checkout 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 Nexi to finalize the purchase.
  • Overlay flow has similar logic as redirect flow, but the hosted payment window is displayed in an overlay on desktop.

Embedded checkout flow


  1. Customer navigates to the checkout page in WooCommerce. If Nexi Checkout is the selected (or default) payment method, an initialize session request is sent to Nexi.
  2. Nexi 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 Nexi Checkout, a JS event is triggered. The Nexi Checkout 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 Nexi.
  4. When the customer clicks the Pay button in Nexi Checkout, a pay-initialized JavaScript event is triggered by Nexi.
  5. The standard WooCommerce checkout form is submitted by the Nexi Checkout plugin, with customer data that we receive from Nexi, 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 Nexi Checkout 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 Nexi will not finalize the purchase. Instead an error notice will be displayed for the customer). 
  7. Provided that the Nexi Checkout plugin respond with a true message, Nexi then finalizes the purchase in their system.
  8. When the purchase is completed by the customer, a payment-completed JavaScript event is triggered by Nexi.
  9. The Nexi Checkout plugin redirects the customer to the confirmation URL.
  10. The Nexi Checkout 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 Nexi Checkout as payment method and clicks the Place order button.
  3. pending order is created in WooCommerce.
  4. Customer is redirected to Nexi Checkout payment window.
  5. Customer completes the purchase and get redirected back to the store.
  6. The Nexi Checkout 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 Nexi to verify that everything went well.

Overlay checkout flow


The overlay flow has the same logic as the redirect flow.