Closed martijnvdbrug closed 2 years ago
I would also vote to just do the break. I'll announce it in the blog post etc, but I think the impact will be small because the package is not yet widely adopted.
@michaelbromley We have 2 ways of implementing this:
A GraphQL query createMolliePaymentIntent
which returns the redirectUrl. The client would need to redirect to Mollie for the payment.
:heavy_check_mark: This option is in line with the Stripe plugin. :heavy_check_mark: An error can be shown in the storefront when createPaymentIntent failed, because the redirect was retrieved via an AJAX call :x: Extra network call, so a bit slower and a slightly higher chance of failure
A rest endpoint payWithMollie
which does something like this:
const redirectUrl = await mollie.createPayment()
res.redirect(302, redirectUrl)
:heavy_check_mark: Saves 1 network call from the storefront. Less complexity on the storefront side :x: Cannot be done via AJAX call, so the user will leave the storefront, even when redirect creation fails.
I slightly favor option 1. What do you think?
I'd go with option 1 too. Giving more control to the client at the slight expense of extra steps to implement I think is the better choice in the long-run.
Closed by #1437
Is your feature request related to a problem? Please describe. When using Mollie as paymentmethod, an order can get stuck in the
PaymentAuthorized
state as described here: https://github.com/vendure-ecommerce/vendure/issues/1330Describe the solution you'd like Use a
createMolliePaymentIntent
orgetMolliePaymentUrl
endpoint to get the Mollie redirectUrl for an order payment, and add Mollie as paymentMethod to the order on callback from Mollie. Similar to the solution for Stripe described here: https://github.com/vendure-ecommerce/vendure/pull/1417Describe alternatives you've considered Allow orders to stay in PaymentCreated state after addOrderToPayment has been called. Also described in #1330
Additional context How do we deal with this breaking change? Do we keep a hybrid solution where both
addPaymentToOrder
and the new endpoint exist?Since there is no way to deprecate the
addPaymentToOrder
mutation for Mollie only, I suggest we don't go through the trouble of maintaining both solutions and just do the breaking change.You can assign this issue to me.