|
10 | 10 |
|
11 | 11 | <p align="center">This plugin provides basic refunds functionality for Sylius application.</p> |
12 | 12 |
|
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +## Business value |
| 18 | + |
| 19 | +In contrast to basic Refund functionality delivered by core Sylius bundles, Refund Plugin offers much wider range of |
| 20 | +possibilities and business scenarios. |
| 21 | + |
| 22 | +Once an Order is paid, an Administrator is able to access Refunds section of a given Order and perform a Refund |
| 23 | +of chosen items or shipments. What's more, if a more detailed scenario occurs, an Administrator is able to refund an item |
| 24 | +partially. |
| 25 | + |
| 26 | +From Administrator's point of view, every Refund request results in creating two entities: |
| 27 | +* Credit Memo - a document representing a list of refunded items (downloadable and sent to Customer via .pdf file) |
| 28 | +* Refund Payment - entity representing payment in favour of the Customer |
| 29 | + |
13 | 30 | ## Installation |
14 | 31 |
|
15 | 32 | 1. Require plugin with composer: |
@@ -52,3 +69,26 @@ to your migrations directory and run `bin/console doctrine:migrations:migrate` |
52 | 69 |
|
53 | 70 | 7. Copy templates from `vendor/sylius/refund-plugin/src/Resources/views/SyliusAdminBundle/` |
54 | 71 | to `app/Resources/SyliusAdminBundle/views/` |
| 72 | +
|
| 73 | +## Extension points |
| 74 | +
|
| 75 | +Refund Plugin is strongly based on both commands and events. Let's take RefundUnitsAction as an example. The whole |
| 76 | +process consists of following steps: |
| 77 | +
|
| 78 | +* Getting data from request |
| 79 | +* Create a Command and fill it with data |
| 80 | +* Dispatch Command |
| 81 | +* Handle Command |
| 82 | +* Fire Event |
| 83 | +* Catch Event in Listener class |
| 84 | +
|
| 85 | +Using command pattern and events make each step independent which means that providing custom implementation of given |
| 86 | +part of refunding process doesn't affect any other step. |
| 87 | +
|
| 88 | +Apart from Events and Commands Refund Plugin is also based on mechanisms derived from core Sylius bundles such as: |
| 89 | +
|
| 90 | +* [Resources](https://docs.sylius.com/en/1.2/components_and_bundles/components/Resource/index.html) |
| 91 | +* [Grids](https://docs.sylius.com/en/1.2/components_and_bundles/bundles/SyliusGridBundle/index.html) |
| 92 | +* [State Machine](https://docs.sylius.com/en/1.2/book/architecture/state_machine.html) |
| 93 | +
|
| 94 | +Configuration of all elements mentioned above can be found and customized in `config.yml` file. |
0 commit comments