Technical Implementation
Learn about the sequence flow of banking ordering process in Financial Services Accelerator
Sequence Flow
*The steps in grey are disabled by default.
The banking order process is triggered when the user selects the desired identification method and clicks the Continue button on the banking storefront (Step 6 in the checkout - User Identification).
- <WAIT_USER_IDENTIFICATION>
- <USER_VERIFIED>
- <USER_REJECTED>
- <APPLICATION_REJECTED>
As has been said, a user is verified automatically with video identification option on UI, or manually through Backoffice (in other words, the process temporarily stops for <waitUserIdentification> action ). If either the user or application gets rejected, a rejection mail is sent.
Changing the process to the <USER_VERIFIED> status in Backoffice, triggers the event ${process.order.code}_USER_VERIFIED, which allows the process to move to next actions (<underwritingCheckOrder> and <paymentCheck>). In Financial Services Accelerator, the latter step checks whether the payment is enabled. If it is, the transition is labeled "OK" and the process is moved to the <checkAuthorizeOrderPayment> step. Otherwise, the transition leads to the <fraudCheck> step.
In the current implementation, the<paymentCheck> is not enabled, so the process automatically goes to the <fraudCheck> step. This is because the payment information (<paymentInfo>) isn't collected. The paymentEnabled is set to "false" for the banking storefront in the financialacceleratorstorefront/project.properties.template file:
financialacceleratorstorefront.banking.paymentEnabled=false
If we enable the payment in the current implementation, by setting the paymentEnabled attribute to "true", the process will end up in the FAILED state, as the <checkAuthorizeOrderPayment> step cannot be passed without the <paymentInfo>.
If the <fraudCheck> is not passed, the customer is notified by email. In case of potentially fraudulent order, a customer support agent performs a manual check and either cancels or places the order. Once the order is placed and confirmed, an email is sent to the customer, notifying them about successful confirmation of their application process.
- ERROR - the order hasn't been validated and the error message is displayed to the user
- FAILED - the order is canceled, as the internal checks haven't been passed
- SUCCEDED - the order is placed; the order passes both the validation and internal checks
If the users get to the ERROR state, a message box pops up to notify them of the error. In case of FAILED checks, the users get notification by email. When the process is SUCCEDED, after sucessfully placing an order, the users receive a confirmation email that the order has been submitted and confirmed, and yet another email, when the order is completed.
New or Modified Actions
The banking order process is set out in the banking-order-process.xml file. Almost all actions are reused from the yacceleratorfulfilmentprocess extension of the Core Accelerator.
- <identifyUser> - IdentifyUserAction where
- OrderStatus is being set to one of four possible statuses (see the previous section)
- IdentificationType is being verified - if it is equal to <VIDEO_IDENTIFICATION>, then OrderStatus is changed to <USER_VERIFIED> (the current, mocked implementation)
- If the IdentificationType is other than <VIDEO_IDENTIFICATION>, a pending order email is being sent to the customer, and the OrderStatus needs to be manually changed to <USER_VERIFIED> in Backoffice
- <checkOrder> - FinancialServicesCheckOrderAction
- Sets order status to <CHECKED_VALID> (OK) or <CHECKED_INVALID> (NOK)
- For checking the order, FinancialServicesCheckOrderService is used, which inspects whether the payment is enabled - if it is, then it also checks whether the order has payment; if it is not enabled, this check is skipped
- <paymentCheck> - PaymentCheckAction for getting the info if the payment is enabled for that site
- If payment is enabled, the next step in the order process is <checkAuthorizeOrderPayment>
- If payment is not enabled, the next step in the order process is <fraudCheck>
SummaryCheckoutStepController
As the payment authorization check is not needed for both stores, a separate behavior per store is set, as is shown in this code example from SummaryCheckoutStepController.
if (isPaymentEnabledForCurrentSite(getCheckoutFacade().getCheckoutCart()) && !isPaymentAuthorized(placeOrderForm))
{
GlobalMessages.addErrorMessage(model, "checkout.error.authorization.failed");
return enterStep(model, redirectModel);
}