This tutorial implements these different scenarios:
Create an account
Debit an account
Enable an account
Each of these scenarios is triggered by a different external event from an HTTP channel.
The create an account scenario is shown in Figure 1.1, “Create Account Scenario”. This scenario creates an account from information in the create account event if the account does not already exist.
The debit account scenario is shown in Figure 1.2, “Debit Account Scenario”. This scenario performs the following steps when a debit account event is received:
If the account is disabled, no action is taken.
Debit the account with the amount in the event. The maximum amount that will be debited is the current account balance.
If the balance is now zero, disable the account.
If fraud is detected, disable the account.
To establish whether fraud is suspected, the frequency, and amount of debits in a rolling time window is used. Fraud is suspected when either of the following criteria is met:
An account incurs more than three debit transactions in a two minute period.
The sum of the debits in the two minute period totals more than 80% of the average monthly balance of the account.
Accounts with suspected fraud are disabled.
The enable account scenario is shown in Figure 1.3, “Enable Account Scenario”. This scenario simply enables an account if it exists and is disabled when an enable account event is received.