Stripe is an Application Programming Interface (API) that allows websites to process payments directly, without establishing a merchant account first. It does have a transaction fee, but no monthly fees, setup fees, validation fees and so forth. And until now, it didn’t support batch payments at all!
Our client started vteam #365 to provide a one-click solution that allows for processing batch payments in Stripe. They wanted to be able to charge more than a thousand customers at once, through their application admin panel. Research yielded no answers as to how to do this and a quick call to Stripe Support told us they don’t support batch payments at all.
The custom solution created by our developer had a few requirements:
- It needed to be efficient, reliaible and error-free.
- It couldn’t hold up the application with a high-volume transaction.
- A proper and accurate log of all transactions is required.
Our developer chose to use Cron, a time-based job scheduler, to execute a script for processing payment batches. Cron runs the script in the background, so it won’t tie up the application’s other activities. When the client clicks the “Process Payments” button in the admin panel, a Cron job is setup automatically using the web host manager cPanel library. Specific checks were added to the script to ensure each transaction is executed only once. The script executes each transaction one by one, updating records in the database and logs successful and failed transactions. After completing the batch payments, an email is generated detailing all of the transactions for the client, so they have a record of the process.
Our solution proved to work very much to the clients satisfaction.