Skip to content

Commit db002aa

Browse files
authored
Merge pull request #67 from bartoszpietrzak1994/documentation-update
Documentation update
2 parents 5231a22 + 43f209d commit db002aa

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@
1010

1111
<p align="center">This plugin provides basic refunds functionality for Sylius application.</p>
1212

13+
![Screenshot showing order's refund section](docs/refunds.png)
14+
15+
![Screenshot showing order's credit memos and refund payments](docs/credit_memo.png)
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+
1330
## Installation
1431

1532
1. Require plugin with composer:
@@ -52,3 +69,26 @@ to your migrations directory and run `bin/console doctrine:migrations:migrate`
5269
5370
7. Copy templates from `vendor/sylius/refund-plugin/src/Resources/views/SyliusAdminBundle/`
5471
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.

docs/credit_memo.png

74.3 KB
Loading

docs/refunds.png

224 KB
Loading

0 commit comments

Comments
 (0)