Device storage issue

I have integrated the RazorPay payment gateway in my shopping wocommerce application. My issue is that when the user doing the payment using RazorPay and storage of that device is near to full then Application is being closed and order not getting placed and the Amount has been cut from the user’s account.

If anyone has faced the issue similar to this then please suggest the solution for this.