Laravel Cashier Mollie is here

Last week I announced the public beta of Laravel Cashier Mollie, live from Laracon Madrid.

This official new member of the Laravel family makes it a cinch to implement recurring billing in your Laravel application, backed by Mollie’s payment services.

This is how easy to use Cashier Mollie is:

Wait a minute…

You may be thinking: nice, but how is this new? We already have good old Cashier Stripe for this, right?

I agree, but Cashier Stripe just didn’t meet my demands.

For sure, I love how fluent it is. And that’s why I kept Cashier Mollie’s API as similar as possible. There’s no need to reinvent the wheel here.

But the Stripe integration is not really suitable for serving European customers.

As Europeans we are just not into credit cards that much.

And that’s why I developed Cashier Mollie.

Backed by Mollie’s payment services, Cashier Molie allows your customers to check out using their favorite payment method.

This includes credit card, all kinds of SEPA debit cards (iDEAL, Bancontact, etc.) and Apple Pay. Within a few weeks from writing this, PayPal will be supported as well.

And as a bonus, it’s also supporting some more advanced use cases.

In this post I’ll show you the basic usage of Cashier Mollie. In a later post, I’ll cover how you can use this package for advanced use cases, such as metered billing and custom coupons.

I’m going to skip over installation (you can find instructions in the package readme) and dive straight into setting it up.

Configuration

After installing you have three config files to tinker with:

  • config/cashier.php for managing general Cashier settings. You’ll not necessarily need to change anything here.
  • config/cashier_plans.php for managing subscription plans
  • config/cashier_coupons.php for managing coupons. Be sure to comment out the example coupon before moving anything to production. I am not going to cover coupons here. Cashier Mollie allows for advanced coupon handling, which I will explain in another post.

I recommend to first configure some subscription plans in config/cashier_plans.php. Let’s configure a basic €10 a month plan and a premium €25 a month plan:

Example CreateSubscriptionController

Now your subscription plans are all set you can create a CreateSubscriptionController. And add an accompanying route to routes/web.php.

The CreateSubscriptionController first checks whether the user is already on this plan.

If not, it either starts a subscription and returns the new Subscription model (if the user went succesfully through Mollie’s checkout before), or redirects to Mollie’s checkout for making a first payment.

After this first payment is processed, your application is notified by Mollie using a webhook, the subscription is started and the customer redirected back to your website.

About the first payment

Protecting your customers and you and complying to European banking regulations, Mollie always requires a first payment before enabling recurring payments.

So even if you’re starting a subscription with a trial period, Cashier will automatically set up a minimum first payment amount which you can define in config/cashier_plans.php.

Need to provide a trial subscription without any form of payment upfront? Use a generic subscription trial.

That’s it, you now know the basics of Cashier Mollie. Keep an eye out for more news.

Thanks!

Big thanks to:

  • the alpha testing group, with special thanks to Robin Dirksen, Joeri Aben, Michael Snoeren, Peter Steenbergen, Jason Judge and Dan Brady.
  • everyone at Mollie.com for their ongoing trust and support.
  • Cosmin Popovici (@cossssmin) for creating the MaizzleJS toolset, and helping me to use this for the Cashier Mollie invoice template.
  • Shawn McCool for helping me get the word out and making me somewhat comfortable on the Laracon Madrid stage. I hope to meet again soon.
  • Taylor Otwell (founder of Laravel) for making me consider communicating with less words (failed here) and for adopting Cashier Mollie into the Laravel product family. Without Laravel, this package would obviously not make any sense :).

Leave a Reply

Your email address will not be published. Required fields are marked *