Still have issues with the script you did.
1. its not always storing data into the database, but always takes payment.
2. Update the success part when it does work to say "Please close this page a shipping label is being generated and will be emailed to you soon.
Please get back intouch with me ASAP