Skip to content

Commit 006f117

Browse files
authored
[UPMERGE] 3.0 -> 3.1 (#269)
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/MolliePlugin/blob/1.0/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/3.1 -m "Resolve conflicts between 3.0 and 3.1" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/MolliePlugin` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
2 parents 4b6c549 + 3a63bd3 commit 006f117

16 files changed

Lines changed: 9 additions & 572 deletions

README.md

Lines changed: 9 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</a>
99
</p>
1010

11-
<h1 align="center">Mollie Payments Plugin</h1>
11+
<h1 align="center">Mollie Plugin</h1>
1212

1313
<p align="center"><a href="https://sylius.com/plugins/" target="_blank"><img src="https://sylius.com/assets/badge-official-sylius-plugin.png" width="200"></a></p>
1414

@@ -18,170 +18,10 @@
1818

1919
---
2020

21-
## Table of Contents
21+
## Documentation
2222

23-
* [Overview](#overview)
24-
* [Demo](#mollie-plugin-demo)
25-
* [Installation](#installation)
26-
* [Usage](#usage)
27-
* [Mollie payment methods synchronization](doc/synchronizing_payment_methods.md)
28-
* [Recurring subscription (internal CRON)](doc/recurring.md)
29-
* [Recurring payments](doc/recurring.md)
30-
* [Community](#community)
31-
32-
---
33-
34-
## Overview
35-
36-
![Screenshot showing payment methods show in shop](doc/payment_methods_shop.png)
37-
![Screenshot showing payment methods show in admin](doc/payment_methods_admin.png)
38-
![Screenshot showing payment method config in admin](doc/payment_method_config.png)
39-
40-
[Mollie](https://www.mollie.com/) is one of the most advanced and developer-friendly payment gateways in Europe. This plugin integrates Mollie into Sylius and is officially certified by Mollie.
41-
42-
> Our mission is to create a greater playing field for everyone. By offering convenient, safe world-wide payment solutions we remove barriers so you could focus on growing your business.
43-
44-
Mollie provides a powerful API allowing webshop and app developers to implement over 20 payment methods with ease. Their services are fast, reliable, and constantly innovating the European payments landscape.
45-
46-
---
47-
48-
## Installation
49-
50-
#### Beware!
51-
52-
This installation instruction assumes that you're using Symfony Flex and Rector. If you don't, take a look at the
53-
[legacy installation instruction](doc/legacy_installation.md). However, we strongly encourage you to use them, it's much quicker!
54-
55-
#### 1. Require Mollie plugin with composer:
56-
57-
```bash
58-
composer require sylius/mollie-plugin:^3.0 --no-scripts -W
59-
```
60-
61-
#### 2. Add the Mollie rector set:
62-
63-
```diff
64-
# <project_root>/rector.php
65-
66-
...
67-
+ use Sylius\SyliusRector\Set\SyliusMollie;
68-
69-
return static function (RectorConfig $rectorConfig): void {
70-
...
71-
+ $rectorConfig->sets([SyliusMollie::MOLLIE_PLUGIN_30]);
72-
};
73-
```
74-
and run it:
75-
```bash
76-
vendor/bin/rector
77-
```
78-
79-
#### 3. Update your database
80-
81-
```
82-
bin/console doctrine:migrations:migrate
83-
```
84-
85-
#### 4. Install frontend assets:
86-
87-
```bash
88-
bin/console assets:install
89-
```
90-
91-
Install additional dependencies:
92-
```bash
93-
yarn add bazinga-translator intl-messageformat lodash.get shepherd.js@11.0
94-
```
95-
96-
Build assets:
97-
98-
```bash
99-
yarn encore dev # for development
100-
yarn encore production # for production
101-
```
102-
103-
#### 5. Clear cache:
104-
105-
```bash
106-
php bin/console cache:clear
107-
```
108-
109-
## Optional and troubleshooting
110-
111-
1. [Optional] To allow refunding orders add the RefundPlugin:
112-
113-
```bash
114-
composer require sylius/refund-plugin:^2.0.2 --no-scripts -W
115-
```
116-
117-
And follow its installation [instructions](https://github.com/Sylius/RefundPlugin/tree/v2.0.1?tab=readme-ov-file#installation).
118-
119-
1. [Optional] Load fixtures:
120-
121-
```bash
122-
bin/console sylius:fixtures:load
123-
```
124-
125-
1. [Optional] Add the payment link cronjob:
126-
127-
```shell script
128-
* * * * * /usr/bin/php /path/to/bin/console mollie:send-payment-link
129-
```
130-
131-
1. [Optional] If you want to use ApplePay, you need to add the [domain validation file](https://www.mollie.com/.well-known/apple-developer-merchantid-domain-association) file to your server at:
132-
```
133-
public/.well-known/apple-developer-merchantid-domain-association
134-
```
135-
136-
## ⚠️ SyliusRefundPlugin Troubleshooting
137-
138-
If you encounter an error related to duplicate transitions in the `sylius_refund_refund_payment` state machine (e.g. multiple `"complete"` transitions from `"new"` state),
139-
you should **remove the following file** from your project:
140-
```
141-
config/packages/sylius_refund.yaml
142-
```
143-
You should remove it **if your project does not use Symfony Workflow**
144-
145-
## Sylius API
146-
In order to create Mollie payment with Sylius API, the following steps must be followed:
147-
148-
- send the following request to the Sylius API in order to retrieve Mollie payment method configuration: /api/v2/shop/orders/{tokenValue}/payments/{paymentId}/configuration
149-
- tokenValue represents order token which is saved in the sylius_order DB table
150-
- response from this endpoint should be in the following format:
151-
152-
```json
153-
{
154-
"method": "ideal",
155-
"issuer": "ideal_ABNANL2A",
156-
"cardToken": null,
157-
"amount": {"value":"18.75","currency":"EUR"},
158-
"customerId": null,
159-
"description": "000000157",
160-
"redirectUrl": "{redirect_url}",
161-
"webhookUrl": "{webhook_url}",
162-
"metadata": {"order_id":170,"customer_id":22,"molliePaymentMethods":"ideal","cartToken":null,"saveCardInfo":null,"useSavedCards":null,"selected_issuer":"ideal_ABNANL2A","methodType":"Payments API","refund_token":"{token}"},
163-
"locale": "en_US"
164-
}
165-
```
166-
- create the payment on Mollie, using Mollie API. Response from the above-mentioned step should be put in the request body.
167-
Request should be sent to the POST: https://api.mollie.com/v2/payments. Bearer token should be sent in the request authorization header.
168-
Token can be copied from the Mollie admin configuration page.
169-
170-
- after payment has been created, API response will contain checkout field. User should enter this url in the browser.
171-
172-
```json
173-
{
174-
"checkout":
175-
{
176-
"href": "https://www.mollie.com/checkout/test-mode?method=ideal&token=6.voklib",
177-
"type": "text/html"
178-
}}
179-
```
180-
- open checkout url in the browser and complete the payment
181-
182-
## Usage
183-
184-
During configuration, first save the keys to the database and then click "Load methods".
23+
📖 Full documentation is available here:
24+
👉 [Mollie Plugin Documentation](https://docs.sylius.com/mollie-plugin)
18525

18626
## Security issues
18727

@@ -190,4 +30,8 @@ Instead, all security issues must be sent to `security@sylius.com`
19030

19131
## Community
19232

193-
For online communication, we invite you to chat with us & other users on [Sylius Slack](https://sylius-devs.slack.com/).
33+
For online communication, we invite you to chat with us and other users on [Sylius Slack](https://sylius.com/slack).
34+
35+
## License
36+
37+
This plugin is released under the [MIT License](LICENSE).

doc/SyliusMolliePlugin.png

-18.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)