-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(plugin-ecommerce): support Mollie as payment adapter #15039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the only way I could think of for now. Maybe there is a better solution, because this required the field mollieCustomerID to be present on the customers collection?
|
|
||
| const shippingAddressAsString = JSON.stringify(shippingAddressFromData) | ||
|
|
||
| const parameters = await createPayment?.({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a custom function/hook here. This way users can override the payment object. Its also required for passing webhookUrl. We may use this pattern on other adapters as well.
| // This will appear on the customer's bank statement | ||
| // Use the cart ID as a description for now | ||
| description: parameters?.description || `${cart.id}`, | ||
| // TODO: billingAddress: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that billingAddress and shippingAddress are still missing. I wasn't sure how they are implemented correctly, because they are not typed. A user may override them with the createPayment hook,
What?
This PR adds basic support for Mollie as payment adapter to the ecommerce plugin.
Why?
Currently, only Stripe is supported for taking payments. However, Mollie is one of the largest PSPs in the European Economic Area.
We can utilise the existing adapter pattern and create a new adapter that supports one-time payments in a similiar way.
How?
The current adapter configuration is cloned and tailored to the Mollie ecosystem.
There are some important changes/limitations to note:
createPaymentwas introduced to bypass above limitations.This pull request is just for basic support and may need some additional changes. There are more options that can be passed to the Mollie client, but only
apiKeyis implemented for now.