Skip to content

Commit

Permalink
chore: prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
olance committed Feb 4, 2021
1 parent 8343294 commit 411cbde
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 303 deletions.
152 changes: 47 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1,54 @@
<p align="center">
<a href="https://sylius.com" target="_blank">
<img src="https://demo.sylius.com/assets/shop/img/logo.png" />
</a>
<img src="https://getalma.eu/static/website/new/img/logo.png" alt="logo alma" />
<img src="https://demo.sylius.com/assets/shop/img/logo.png" height="75" />
</p>

<h1 align="center">Plugin Skeleton</h1>
<h1 align="center">Sylius Alma Payment Plugin</h1>

<p align="center">Skeleton for starting Sylius plugins.</p>
<p align="center">Integrate Alma installments and pay later payments with your Sylius shop</p>

## Documentation

For a comprehensive guide on Sylius Plugins development please go to Sylius documentation,
there you will find the <a href="https://docs.sylius.com/en/latest/plugin-development-guide/index.html">Plugin Development Guide</a>, that is full of examples.

## Quickstart Installation

1. Run `composer create-project sylius/plugin-skeleton ProjectName`.

2. From the plugin skeleton root directory, run the following commands:

```bash
$ (cd tests/Application && yarn install)
$ (cd tests/Application && yarn build)
$ (cd tests/Application && APP_ENV=test bin/console assets:install public)

$ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create)
$ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
```

To be able to setup a plugin's database, remember to configure you database credentials in `tests/Application/.env` and `tests/Application/.env.test`.
## Usage
### Running plugin tests
- PHPUnit
```bash
vendor/bin/phpunit
```
- PHPSpec
```bash
vendor/bin/phpspec run
```
- Behat (non-JS scenarios)
```bash
vendor/bin/behat --strict --tags="~@javascript"
```
- Behat (JS scenarios)
1. [Install Symfony CLI command](https://symfony.com/download).
2. Start Headless Chrome:
```bash
google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
```
3. Install SSL certificates (only once needed) and run test application's webserver on `127.0.0.1:8080`:

```bash
symfony server:ca:install
APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
```

4. Run Behat:

```bash
vendor/bin/behat --strict --tags="@javascript"
```

- Static Analysis

- Psalm

```bash
vendor/bin/psalm
```

- PHPStan

```bash
vendor/bin/phpstan analyse -c phpstan.neon -l max src/
```

- Coding Standard

```bash
vendor/bin/ecs check src
```

### Opening Sylius with your plugin

- Using `test` environment:

```bash
(cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load)
(cd tests/Application && APP_ENV=test bin/console server:run -d public)
```

- Using `dev` environment:

```bash
(cd tests/Application && APP_ENV=dev bin/console sylius:fixtures:load)
(cd tests/Application && APP_ENV=dev bin/console server:run -d public)
```
### Installation
Use Composer to install the plugin:

```
$ composer require alma/sylius-payment-plugin
```

Update your shop's translation catalogs:

```
$ php bin/console translation:update --dump-messages fr AlmaSyliusPaymentPlugin
$ php bin/console translation:update --dump-messages en AlmaSyliusPaymentPlugin
```

Finally, clear your cache:

```
$ php bin/console cache:clear
```

### Requirements
Alma currently accepts Euros only; make sure you activate your payment method on channels that use that currency, else
you won't see it at checkout.

Your Alma payment methods will only show for eligible carts. Eligibility is mainly based on the purchased amount, which
by default should be between 100€ and 2000€; if you want those limits changed, you can talk to your sales representative
at Alma, or contact [[email protected]](mailto:[email protected]).

### Usage
1. Go to the Payment Methods admin page and choose to create a new "Alma Payments" method

2. Grab your API keys [from your dashboard](https://dashboard.getalma.eu/api) and paste them into the appropriate fields

3. Choose the installments count to apply for this payment method. If you want to offer multiple installments counts to
your customers, you can create one Alma payment method per installments count.

4. Set the API mode to Test if you want to first test the integration with a fake credit card, on your preproduction
servers for instance.
When you're ready for production, set the API mode to Live.

5. Choose a name for your method in the languages relevant to your shop.

6. You're done! Save the payment method to start accepting instalments payments on your shop!
122 changes: 0 additions & 122 deletions UPGRADE.md

This file was deleted.

Loading

0 comments on commit 411cbde

Please sign in to comment.