Skip to content
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

OP-501 - installation.md has been updated #94

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,20 @@ This **open-source plugin was developed to help the Sylius community** and make

We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.

| Package | Version |
| --- |--------------------|
| PHP | ^8.0 |
| ext-json: | * |
| sylius/refund-plugin | ^1.0.0 |
| sylius/resource-bundle | ^1.8 |
| sylius/sylius | ~1.12.0 or ~1.13.0 |
| symfony/messenger | ^5.4 or ^6.0 |
| adyen/php-api-library | ^11.0 |
| Package | Version |
|------------------------|----------------|
| PHP | ^8.0 |
| ext-json: | * |
| sylius/refund-plugin | ^1.0.0 |
| sylius/resource-bundle | ^1.8 |
| sylius/sylius | ~1.12 or ~1.13 |
| symfony/messenger | ^5.4 or ^6.0 |
| adyen/php-api-library | ^11.0 |

----

For the full installation guide please go to [installation](doc/installation.md)
### Full installation guide
- [See the full installation guide](doc/installation.md)

## Customization
----
Expand Down
137 changes: 90 additions & 47 deletions doc/installation.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,53 @@
## Installation

1. Complete [refund plug-in](https://github.com/Sylius/RefundPlugin) installation steps

2. Require with composer

# Installation

## Overview:
GENERAL
- [Requirements](#requirements)
- [Composer](#composer)
- [Basic configuration](#basic-configuration)
---
FRONTEND
- [Templates](#templates)
- [Webpack](#webpack)
---
ADDITIONAL
- [Additional configuration](#additional-configuration)
- [Known Issues](#known-issues)
---

## Requirements:
### Installed BitBagRefundPlugin
Complete installation instructions for the BitBagRefundPlugin can be found here:

- [BitBagRefundPlugin installation](https://github.com/Sylius/RefundPlugin)

We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.

| Package | Version |
|---------------|-----------------|
| PHP | \>8.0 |
| sylius/sylius | 1.12.x - 1.13.x |
| MySQL | \>= 5.7 |
| NodeJS | \>= 18.x |

## Composer:
```bash
composer require bitbag/sylius-adyen-plugin --no-scripts
```
3. When using Symfony flex the proper bundle class will be automatically registered in your bundles.php file. Otherwise, add it to your `config/bundles.php` file:

## Basic configuration:
Add plugin dependencies to your `config/bundles.php` file:

```php
# config/bundles.php

return [
// ...
...
BitBag\SyliusAdyenPlugin\BitBagSyliusAdyenPlugin::class => ['all' => true],
];
```

4. Import required config in your `config/packages/_sylius.yaml` file:
Import required config in your `config/packages/_sylius.yaml` file:

```yaml
# config/packages/_sylius.yaml
Expand All @@ -26,18 +57,28 @@ imports:
- { resource: "@BitBagSyliusAdyenPlugin/Resources/config/config.yaml" }
```
5. Import the routing in your `config/routes.yaml` file:
Add Adyen payment method as a supported refund gateway in `config/packages/_sylius.yaml`:
```yaml
# config/packages/_sylius.yaml
parameters:
sylius_refund.supported_gateways:
- offline
- adyen
```

Import routing in your `config/routes.yaml` file:
```yaml
# config/routes.yaml
bitbag_sylius_adyen_plugin:
resource: "@BitBagSyliusAdyenPlugin/Resources/config/routing.yaml"
```

6. Add logging to your environment in config/packages/{dev, prod, staging}/monolog.yaml

Add logging to your environment in config/packages/{dev, prod, staging}/monolog.yaml
```yaml
# config/packages/{dev, prod, staging}/monolog.yaml
monolog:
channels: [adyen]
handlers: # Add alongside other handlers you might have
Expand All @@ -47,56 +88,58 @@ monolog:
id: bitbag.sylius_adyen_plugin.logging.monolog.doctrine_handler
```

7. Add Adyen payment method as a supported refund gateway in `config/packages/_sylius.yaml`

```yaml
# config/packages/_sylius.yaml
parameters:
sylius_refund.supported_gateways:
- offline
- adyen
### Update your database
First, please run legacy-versioned migrations by using command:
```bash
bin/console doctrine:migrations:migrate
```

8. Configure config/packages/webpack_encore.yaml
```yaml
builds:
*: *
shop: '%kernel.project_dir%/public/build/shop'
admin: '%kernel.project_dir%/public/build/admin'
After migration, please create a new diff migration and update database:
```bash
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
```
### Clear application cache by using command:
```bash
bin/console cache:clear
```
**Note:** If you are running it on production, add the `-e prod` flag to this command.

9. Copy Sylius templates overridden by plug-in to your templates directory (`templates/bundles/`):
## Templates
Copy required templates into correct directories in your project.

**AdminBundle** (`templates/bundles/SyliusAdminBundle`):
```
mkdir -p templates/bundles/SyliusAdminBundle/
mkdir -p templates/bundles/SyliusShopBundle/
cp -R vendor/bitbag/sylius-adyen-plugin/tests/Application/templates/bundles/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
cp -R vendor/bitbag/sylius-adyen-plugin/tests/Application/templates/bundles/SyliusShopBundle/* templates/bundles/SyliusShopBundle/
vendor/bitbag/sylius-adyen-plugin/tests/Application/templates/bundles/SyliusAdminBundle/Order/Show/_payment.html.twig
vendor/bitbag/sylius-adyen-plugin/tests/Application/templates/bundles/SyliusAdminBundle/Order/Show/_payments.html.twig
```
10. Execute migrations

**ShopBundle** (`templates/bundles/SyliusShopBundle`):
```
bin/console doctrine:migrations:migrate
vendor/bitbag/sylius-adyen-plugin/tests/Application/templates/bundles/SyliusShopBundle/Checkout/Complete/_navigation.html.twig
vendor/bitbag/sylius-adyen-plugin/tests/Application/templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_payment.html.twig
```
11. Install assets
```
Install assets:
```bash
bin/console assets:install
```

12. Clear cache
```
bin/console cache:clear
## Webpack
### Run commands
```bash
yarn install
yarn encore dev # or prod, depends on your environment
```

**Note:** If you are running it on production, add the `-e prod` flag to this command.
13. [Obtain Adyen credentials and configure the payment method](configuration.md)
## Additional configuration
- [Obtain Adyen credentials and configure the payment method](https://github.com/BitBagCommerce/SyliusAdyenPlugin/blob/master/doc/configuration.md)

If you want to access the log page, visit /adyen/log.

14. If you want to access the log page, visit /adyen/log.
## Known issues
### Translations not displaying correctly
For incorrectly displayed translations, execute the command:
```bash
bin/console cache:clear
```