In the previous post you learned that Cashier is not always the best fit for payment processing in Laravel. And if that’s the case you will need to integrate payment processing manually into your application.
Personally I have been integrating the Mollie gateway into Laravel projects targeting a Dutch customer base. This way it is possible to accept iDeal payments – which is the preferred method of my customers.
The major take-away?
Fully integrating a payment gateway manually becomes tedious very fast.
You could use the official Mollie PHP client, the Omnipay Mollie client or the Mollie Laravel client, but these only help you redirect the customer to the Mollie payment page and redirect them back to you afterwards.
You will still have to do other things. The webhook route and controller still need to be written. Also you probably want to keep matching payment records in your own database and fire Laravel Events when the payment status changes. And as a best practice cover all this functionality using unit tests…
Yes that’s a lot of work, yet is the same for most e-commerce projects.
That’s why I’ve created the laravel-payable-redirect-mollie package (yes that’s a mouthful) to integrate this all at once.
For your benefit I have open sourced it.
Take a look at the package’s github page for more details and installation instructions.
PS. As a last step in the payment process you probably want to generate an invoice (html/pdf) and provide it to the customer. There’s a package coming up for that as well. Stay tuned.