vendure-ecommerce/vendure

Feat: Use Mollie's 'Order API'

Closed this issue · 0 comments

Is your feature request related to a problem? Please describe.
Mollie recommends using the Orders API for most cases (more details below). The new Orders API also comes with some extra features: https://docs.mollie.com/orders/why-use-orders

The most important improvement for Vendure is that we can use Pay later payment methods.

Mollie gives these reasons for NOT using the orders API:

  • When you do not collect customer details like the address, it is not possible to use the Orders API. Then you can choose for the Payments API to create a simple payment instead.
  • When you only want to receive donations and you do not sell any digital or physical products.
  • You are already using the Payments API and do not want to use all the nice extra features of the Orders API.

I don't think any of these reasons apply to Vendure, so, we migrate to the Orders API 🚀

Describe the solution you'd like

  • Pay after delivery payment methods such as Klarna Pay later, Klarna Slice it or in3, Klarna Pay now, as well as eco vouchers, gift vouchers, and meal vouchers require the Orders API
  • Some payment methods communicate the order lines to the customer in their hosted payment pages or in an invoice. For example, the customer will see the order lines on the checkout page of PayPal.
    You can manage the created orders in the Mollie Dashboard.

Describe alternatives you've considered
Keep using the payments API, but this means we can't use any of the pay later methods ever.

Additional context
With the new Order API we can have 2 payment flows, 1 for traditional payment methods and 1 for pay-later methods:

  • In both cases a payment intent is created, and the order stays in the AddingItems state
  • With the traditional flow, the payment is immediately settled via webhook (this is currently the only flow)
  • The pay-later flow is a little different: The first webhook will have status Authorized, and later, when the order in Mollie is transitioned to Shipped, another webhook will follow with status Paid.

So the Mollie plugin should be able to handle these flows:

  1. Create payment intent > payment settled
  2. Create payment intent > payment authorized > payment settled

Quote from the Mollie docs:

Pay later payment methods will have an authorized status. Shipping is required, and it ensures you will be settled. Mollie expects Vendure to update the status of an order in Mollie to 'Shipped'. When all items are shipped, the order is completed.

image