Knowledge BasePayment Methods and PSP Gateway

Payment Methods and PSP Gateway

Sana Commerce 8.3
Your provider

External Payment Flow

The diagrams below provides a clear and simple overview of the external payment flows in the real-time and scheduled scenarios for end customers:
 

Payment Flow in the Real-time Scenario
 

Payment Flow in the Scheduled Scenario
 
Below is an extended diagram which shows the external payment flow for developers:
 

Payment Flow for an External Payment Module
 
However, there are few possible flows that payment can take in case of an external payment module. These flows and the status that can result from them are described below.
 
Successful payment - Confirm before ok page
  • User is redirected to the PSP
  • User pays for his order at the PSP
  • Confirm page is called by the PSP
    • Basked is deleted
    • Order mail will be send
    • Stock will be deducted
    • User will be redirected to the ok page (ordersubmit.aspx); this page will have no actions
Payment status will be 'Paid / In progress'
 
Successful payment - ok page before confirm
  • User is redirected to the PSP
  • User pays for his order at the PSP
  • Basket is deleted
  • Order mail will be send
    • User will be redirected to the ok page;
    • Confirm page is called by the PSP
  • Stock will be deducted
Payment status will be 'Paid / In progress'
 
Failed payment - Without Confirm
  • User is redirected to the PSP
  • An error occurred
  • User is redirected to the failure page
  • Note:  this is an exceptional case were the PSP is not working or wrongly configured. In normal cases confirm page is called

Payment status will be 'New'

 
Failed payment - With Confirm before failed page
  • User is redirected to the PSP
  • User cancels order or an error occurred
  • Confirm page is called with failure status; this status is mapped to the 'cancelled' status in Sana Commerce
  • User is redirected to the failure page

Payment status will be 'Cancelled', basket remains intact and no mail is send.

  
Failed payment - With Confirm after failed page
  •  User is redirected to the PSP
  • User cancels order or an error occurred
  • User is redirected to the failure page
  • Confirm page is called with 'failure' status; this status is mapped to the cancelled status in Sana Commerce

Payment status will be 'Cancelled', basket remains intact and no mail is send.

 
  
Started payment - User cancels payment
  • User is redirected to the PSP
  • User cancels order
  • Confirm page is called with 'failure' status; this status is mapped to the 'cancelled' status in Sana Commerce. (not shown in image)
  • User is redirected to the failure page
Payment status will be 'Cancelled', basket remains intact and no mail is send.
 
Started payment - User closes browser at PSP
  •  User is redirected to the PSP
  • User closes browser and leaves PSP
Payment status will be 'New', basket remains intact and no mail is send.
  
Successful payment - Confirm page not called!
 
This is a rare case if the PSP provider stopped working or the confirm page does not work in this case the status of the order will remain 'New' till the confirm page will be back online. If it is back online the call to the confirm page will be repeated.
  
Successful payment - But Ok Page not called (browser hangs)
  • User is redirected to the PSP
  • User closes browser and leaves PSP
  • Request will be made to confirm
  • Status will be set to 'Paid'
 
 
 
 
These flows are generally the same for each PSP. When creating a custom implementation of a payment service provider you need to be sure to keep all these possible flows in account.
 
Note that in some of these cases the order is not paid by the user. This happens when an error occurs on the PSP side and the Order Confirmation page. In this case the payment status of the order remains 'New'.
 
Such order can be seen in the Sana Commerce backoffice on the Sales -> Sales Orders page and directly in Microsoft Dynamics NAV or AX in the sales orders management. In this case the shop administrators should take care of such an order by themselves.
Knowledge BasePayment Methods and PSP Gateway