This is one of those issues with remote checkout. you will need to set the trigger for storing the order information in the database to before page load.
using the World Pay Remote gateway, the transaction settlement occurs with 4 business days. Within that time, there is no way to know the true status of the transaction, whether is was accepted or declined.
When the order is stored in the database, you should set a status column to pending. you will get an email notification when the transaction is processed, you can update the database record once you receive that notification.