Announcing Laravel Cashier Mollie v2

Sander van Hooft's profile picture

Sander van Hooft

Founder

Today we're excited to announce Cashier Mollie v2! 🚀

Next level features. A new home. And the same smooth developer experience.

Check out what's in store for Cashier Mollie.

New features

One-off charges

This release brings you one-off charges.

With one-off charges, you can conveniently charge the customer for a single, non-recurring payment.

If Cashier has no payment mandate on record the customer will automatically be sent through Mollie's hosted checkout to process the payment and obtain a mandate.

However, if there is a mandate on record, the charge will smoothly be performed in the background.

Here's a detailed example of how the new charge builder gives you full control:

use App\Models\User;

$user = App\User::find(1);

$item = new \Laravel\Cashier\Charge\ChargeItemBuilder($user);
$item->unitPrice(money(100,'EUR')); //1 EUR
$item->description('Test Item 1');
$chargeItem = $item->make();

$item2 = new \Laravel\Cashier\Charge\ChargeItemBuilder($user);
$item2->unitPrice(money(200,'EUR'));
$item2->description('Test Item 2');
$chargeItem2 = $item2->make();

$result = $user->newCharge()
    ->addItem($chargeItem)
    ->addItem($chargeItem2)
    ->create();

if(is_a($result, \Laravel\Cashier\Http\RedirectToCheckoutResponse::class)) {
    return $result;
}

return back()->with('status', 'Thank you.');

Once paid, a charge results in an order along with the full feature set such as invoice downloads, refunds and chargebacks. Pretty neat!

Retrying failed payments

Cashier's subscription and one-off charge features heavily rely on triggering mandated payments in the background. In a perfect world these never fail.

Yet... In the real world creditcards do expire and customers do close their bank accounts.

So in case a mandated payment fails, Cashier now allows you to retry the payment.

$event = $customerHasUpdatedThePaymentMethodAfterAFailedPayment;
$order = $event->payment->order;
$order->retryNow();

Refunds

Did you know that for online retail shopping, over 30% of the transactions result in a refund?

More than 3 out of 10 transactions! Way too much to handle manually in the Mollie dashboard!

That's why we've packed a full set of refund features in this release.

You can now easily perform full refunds. Or generate complicated partial refund orders - all with only a few lines of code.

use App\Models\User;

$user = App\User::find(1);

$order = $user->orders->first();
$order->refundCompletely();

Chargebacks

A chargeback occurs when a customer disputes the charge you made to their creditcard. You should prevent these from happening at all times, but when they do happen, Cashier will fire a ChargebackReceived event.

Dealing with chargebacks is super business specific. This event allows you to react to these events with your own custom logic. That part is up to you.

Localisation

Thanks to community member Lex de Willigen, it is now possible to bill users in their preferred language using Laravel's translation file system. Capeesh?

A new home and a fresh documentation website

In 2019, Cashier Mollie had a fantastic launch in the Laravel namespace with great exposure, for which we are forever grateful.

Together with Taylor Otwell we decided it was better for our friends at Mollie to have full control over this package.

So as of today, Cashier Mollie has a new home:

mollie/laravel-cashier-mollie

The old repository over at Laravel will be closed down within a few months.

So make sure to switch over and star ⭐️ the new GitHub repo!

The full documentation for Cashier Mollie is now available to you at a brand new website, cashiermollie.com.

Special thanks

Special thanks go to our friends at Mollie, the Sandorian team, the community contributors and all alpha testers.

This package exists because of you. ❤️

Sandorian Consultancy B.V.

  • Groenestraat 294
    6531JC Nijmegen
    The Netherlands
  • KVK 84842822

Subscribe to our newsletter

The latest news, articles and resources sent to your inbox.

Sandorian is a trademark of Sandorian Holding B.V.
© 2024 Sandorian.com • All rights reserved