Skip to content

Commit d8fe821

Browse files
authored
minor #50 readme with instructions how to install plugin (SirDomin, Zales0123)
This PR was merged into the 1.0-dev branch. Discussion ---------- ![image](https://user-images.githubusercontent.com/22825722/90122868-41deb480-dd5e-11ea-9a88-a353dcc678c9.png) Commits ------- 47c3a8c readme with instructions how to install plugin 59545ad Instalation instruction improvements
2 parents 0a52e32 + 59545ad commit d8fe821

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,63 @@
66

77
<h1 align="center">PayPal Plugin</h1>
88

9+
## Installation
10+
11+
1. Run
12+
13+
```bash
14+
composer require sylius/paypal-plugin
15+
```
16+
17+
2. Import routes
18+
19+
```yaml
20+
# config/routes/sylius_shop.yaml
21+
22+
sylius_paypal:
23+
resource: "@SyliusPayPalPlugin/Resources/config/shop_routing.yaml"
24+
prefix: /{_locale}
25+
requirements:
26+
_locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$
27+
28+
#config/routes/sylius_admin.yaml
29+
30+
sylius_paypal_admin:
31+
resource: "@SyliusPayPalPlugin/Resources/config/admin_routing.yml"
32+
prefix: /admin
33+
```
34+
35+
3. Import configuration
36+
37+
```yaml
38+
# config/packages/_sylius.yaml
39+
40+
imports:
41+
# ...
42+
- { resource: "@SyliusPayPalPlugin/Resources/config/config.yaml" }
43+
```
44+
45+
3. Override Sylius' templates
46+
47+
```bash
48+
cp -R vendor/sylius/paypal-plugin/src/Resources/views/bundles/* templates/bundles/
49+
```
50+
51+
4. Add env variables
52+
53+
```
54+
#.env
55+
56+
PAYPAL_API_BASE_URL='https://api.sandbox.paypal.com/'
57+
# just for now, it will be eventually hardcoded (as we always want to use Sylius PayPal facilitator)
58+
PAYPAL_FACILITATOR_URL='https://paypal.sylius.com'
59+
```
60+
61+
> BEWARE!
62+
63+
To make PayPal integration working, your local Sylius URL should be accessible for the PayPal servers. Therefore you can
64+
add the proper directive to your `/etc/hosts` (something like `127.0.0.1 sylius.local`) or use a service as [ngrok](https://ngrok.com/).
65+
966
## PayPal reports
1067
1168
To be able to download reports about your payouts, you need to have reports feature enabled on your PayPal account. Also,

0 commit comments

Comments
 (0)