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 Dintero. This is part of the general WooCommerce checkout flow, and it does not implicate that something is wrong.
The Embedded Checkout Flow
- Customer navigates to the checkout page in WooCommerce. If Dintero Checkout is the selected (or default) payment method, an initialize session request is sent to Dintero.
- Dintero responds with a session id that is used for further communication with Dintero and a html snippet that is rendered on the checkout page. The html snippet includes the embedded Dintero checkout.
- When the customer identify herself in the Dintero checkout, a JS event is triggered. The Dintero Checkout 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 Dintero.
- The standard WooCommerce checkout form is submitted by the Dintero Checkout plugin with customer data that we have in this step 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.
- Provided that the Dintero Checkout plugin respond with a true message, Dintero then finalizes the purchase in their system.
- Dintero Checkout redirects the customer to the confirmation URL.
- The Dintero Checkout plugin runs the WooCommerce function payment_complete() that changes the WooCommerce order status to either Processing or Completed.
- The order received page is rendered and displayed for the customer.
The Redirect Checkout Flow
- Customer navigates to the checkout page in WooCommerce. If Dintero Checkout is the selected (or default) payment method, a WooCommerce order with the status Pending payment is created when the customer clicks the Pay button. This order has not yet been paid for and you should not change the status to Processing/Completed manually.
- The customer is redirected to Dintero’s payment page.
- When the customer completes the payment, the customer is redirected to the WooCommerce confirmation page. The Dintero order ID is then saved in the WooCommerce order, and its status is updated to Processing or Completed, depending on the product types.
- If the customer cancel the payment, they are redirected back to the checkout page. If they click on the Pay button again, the same WooCommerce order is reused.