Bank Cancelled Cards Daemon

Sometimes a customer will cancel either the authorisation for Virgin Wines to take money from their account or their account altogether at the bank without telling us.  Under these circumstances, Worldpay will send us back an error of type R1 (Revocation of Authorization Order) or R3 (Revocation of All Authorizations Order).  If we've been sent this code, on all subsequent attempts to take payment from this card we will incur a charge.  In order to avoid this, there is a daemon that runs as a part of the WineBank and Subscription runs (it's included in their shell scripts) which runs immediately after the batch daemon is run and puts an urgent note in the diary for the relevant customer to cancel their subscription who this note goes to is configurable in Mantiki.  At the moment it goes to Simon Walker.


Error messages returned from Worldpay on Subscriptions and WineBank are stored in customer_subscription_event or customer_account_event respectively.


The Bank Cancelled Cards Daemon searches these tables after a subscription/winebank run for any messages since the last time the daemon ran.  If it finds a specific message (detailed in {{BankCancelledCardsDao}}) then it adds a diary note to that customer.