Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
1570f14
chore(sf): [dir] move configs/templates/assets/migrations to new file…
maxperei Apr 15, 2025
0a27f3a
Merge pull request #157 from synolia/chore/modernize-dir-structure
maxperei Apr 23, 2025
774e0cb
feat(templating): [admin] use twig hooks for payment gateway config
maxperei Apr 17, 2025
19c4523
Merge pull request #158 from synolia/feature/admin-gateway-config-twi…
maxperei Apr 23, 2025
b3b5518
WIP: Allow to install on v2
Jibbarth Apr 18, 2025
ba4b3ed
refactor(di): [wip] overall services syntax
maxperei Apr 16, 2025
ca96763
refactor(lint): [grump] run quality tools
maxperei Apr 16, 2025
a4ad381
refactor(di): [wip] turn most services injection from xml to yaml
maxperei Apr 16, 2025
d299a34
refactor(client): [deprecation] sylius core bundle version instead of…
maxperei Apr 16, 2025
920bb02
refactor(routing): [config] change from yaml to php attributes
maxperei Apr 17, 2025
c42fb78
fix(tests): [behat] patch mocker to run something somehow
maxperei Apr 17, 2025
99dd5a3
fix(gateway): [admin] missing twig hooks for payment method update
maxperei Apr 25, 2025
d750d04
Merge pull request #159 from synolia/chore/modernize-dependency-injec…
Jibbarth Apr 28, 2025
1fb92e3
feat(ux): [product] rework oney popin
maxperei Apr 25, 2025
7887ace
fix(oney_popin): Move images logo from productMeta to imagesMap
Jibbarth Apr 28, 2025
a33fecc
chore(di): separate prepend twig specific
Jibbarth Apr 28, 2025
857d8c6
Merge pull request #161 from synolia/feat/ux-product-oney-popin
Jibbarth Apr 28, 2025
8b7391c
feat(display): [oney] simulation pop-in on cart summary
maxperei Apr 28, 2025
636ca8c
chore(state_machine): Use StateMachineInterface from sylius on AppleP…
Jibbarth Apr 29, 2025
65235c9
chore(state_machine): Use StateMachineInterface from sylius on Captur…
Jibbarth Apr 29, 2025
1bd4ed8
PPSYL-136 - sylius v2 - Adapt Account > Saved cards to upgrade (only …
thomas-vermot-synolia Apr 24, 2025
acb4c0e
PPSYL-136 - sylius v2 - Checkout payment - Move style from block to hook
thomas-vermot-synolia Apr 24, 2025
95678ae
PPSYL-136 - sylius v2 - Checkout payment - Move template in hook (+ s…
thomas-vermot-synolia Apr 28, 2025
c3fcbd2
PPSYL-136 - sylius v2 - Checkout payment - Replace 'integrated paymen…
thomas-vermot-synolia Apr 28, 2025
30c9260
chore(state_machine): Use StateMachineInterface from sylius on Paymen…
Jibbarth Apr 29, 2025
d7b0788
chore(state_machine): Use StateMachineInterface from sylius on Status…
Jibbarth Apr 29, 2025
2e79dae
fix(route): [path] missing `{paymentMethodId}` param in action initPa…
maxperei Apr 29, 2025
ff8ec3e
chore(state_machine): Use StateMachineInterface from sylius on OrderC…
Jibbarth Apr 29, 2025
82e8fea
chore(state_machine): Use StateMachineInterface from sylius on PostPa…
Jibbarth Apr 29, 2025
39bf580
chore(state_machine): Use StateMachineInterface from sylius on OrderP…
Jibbarth Apr 29, 2025
f9efa63
chore(state_machine): Use StateMachineInterface from sylius on Refund…
Jibbarth Apr 29, 2025
087c462
chore(state_machine): Update PaymentsProcessor to add a WorkflowEvent…
Jibbarth Apr 29, 2025
992f0c6
chore(state_machine): Clean old winzou state machine
Jibbarth Apr 29, 2025
e6b2a3a
PPSYL-136 - sylius v2 - Checkout payment - Integrated - Fix js
thomas-vermot-synolia Apr 29, 2025
4d5ba5a
PPSYL-136 - sylius v2 - Checkout payment - Oney integration
thomas-vermot-synolia Apr 29, 2025
664d993
PPSYL-136 - sylius v2 - Checkout payment - AmericanExpress integration
thomas-vermot-synolia Apr 30, 2025
b22e6e3
PPSYL-136 - sylius v2 - Checkout payment - Bancontact integration (wi…
thomas-vermot-synolia Apr 30, 2025
ec220f1
Merge pull request #163 from synolia/feat/oney-simulation-cart-summary
Jibbarth May 6, 2025
8caba5f
Merge pull request #164 from synolia/feature/PPSYL-133-state-machine-…
Jibbarth May 6, 2025
79f1e1d
PPSYL-136 - sylius v2 - Checkout payment - Integrated - remove field …
thomas-vermot-synolia May 6, 2025
3a34b87
fix(action): [alias] wrong duplicates
maxperei May 7, 2025
9863e74
fix(di): [action] wrong service ids
maxperei May 13, 2025
d198af1
PPSYL-136 - sylius v2 - Adapt Account > Saved cards to upgrade (only …
thomas-vermot-synolia Apr 24, 2025
473e85f
PPSYL-136 - sylius v2 - Adapt Account > Change template namespace
thomas-vermot-synolia Apr 28, 2025
5b82e59
PPSYL-136 - Improvement
Jibbarth May 28, 2025
c76d4e8
Merge pull request #160 from synolia/feature/PPSYL-136-v2-account-sav…
Jibbarth May 28, 2025
fe50f76
Merge branch 'feature/upgrade-v2' into feature/PPSYL-136-v2-checkout-…
Jibbarth May 28, 2025
d3cf9ca
PPSYL-136 - Remove again twig_hooks in shop
Jibbarth May 28, 2025
9014379
Merge pull request #162 from synolia/feature/PPSYL-136-v2-checkout-pa…
Jibbarth May 28, 2025
a747107
Merge pull request #165 from synolia/feature/PPSYL-136-v2-checkout-pa…
Jibbarth May 28, 2025
5838388
Merge pull request #166 from synolia/feature/PPSYL-136-v2-checkout-pa…
Jibbarth May 28, 2025
4ed12bf
fix(stimulus): do not add integrated-payment controller if not enabled
Jibbarth May 28, 2025
951499a
Account Saved Cards : Remove old semantic classes
Jibbarth Jun 1, 2025
70182b8
Trigger hook for every factoryName
Jibbarth Jun 1, 2025
4017f3f
Use shared hook for select payment to have it working both on checkou…
Jibbarth Jun 1, 2025
c7e3580
Unify block_prefix for oney_payment_choice
Jibbarth Jun 1, 2025
de8e432
Integrated Payment: bootstrapt btn
Jibbarth Jun 1, 2025
11516e5
Clean comments
Jibbarth Jun 1, 2025
5487035
Merge pull request #168 from synolia/fix/retry-page-hooks
Jibbarth Jun 17, 2025
1fae6ef
fix(display): [integrated] better rendering
maxperei Jun 20, 2025
9dcfe62
fix(checkout): [storefront] rework select payment
maxperei Jun 24, 2025
be2bf50
feat(checkout): [oney] complete info
maxperei Jun 24, 2025
4d2cadd
feat(checkout): [applepay] migrate to stimulus
maxperei Jun 24, 2025
486de10
fix(checkout): [oney] modal behaviour on page load
maxperei Jun 24, 2025
b15ac67
PPSYL-151 - Improve capture docs with symfony workflow
Jibbarth Jun 24, 2025
3d37808
PPSYL-151 - Clean unused use
Jibbarth Jun 25, 2025
5823786
Merge pull request #171 from synolia/fix/checkout
Jibbarth Jun 25, 2025
cb96907
Merge pull request #172 from synolia/fix/PPSYL-151-capture-on-ship
Jibbarth Jun 25, 2025
c2ae7a9
Fix path for css
Jibbarth Jun 25, 2025
4b7bef3
PPSYL-150 - Remove findForChannel and use findForOrder method for Ref…
Jibbarth Jun 25, 2025
8751c51
Merge pull request #173 from synolia/feature/PPSYL-150-refunds
Jibbarth Jun 25, 2025
53ccf94
PPSYL-138 - Use Payment request flow for payplug
Jibbarth May 27, 2025
d362e25
PPSYL-138 - Autoconfigure gateway_configuration_type
Jibbarth May 28, 2025
9f2272a
PPSYL-138 - Disable payum gateway for gateway payplug
Jibbarth May 28, 2025
3c3fa5b
PPSYL-138 - Fix call to paymentDataCreator
Jibbarth Jun 1, 2025
ec468e4
PPSYL-138 - Add command provider for others gateway
Jibbarth Jun 1, 2025
4a9eea9
PPSYL-138 - Allow cancel url
Jibbarth Jun 1, 2025
f1a0ac2
PPSYL-138 - IntegratedPayment - do not dispatch CapturePaymentRequest…
Jibbarth Jun 1, 2025
2df316b
Add priority to gateways
Jibbarth Jun 1, 2025
759bd9e
fixup! PPSYL-138 - IntegratedPayment - do not dispatch CapturePayment…
Jibbarth Jun 1, 2025
df00d8d
PPSYL-138 - Handle Notification
Jibbarth Jul 15, 2025
f7bba93
PPSYL-138 - Coding standards
Jibbarth Jul 17, 2025
0ee4e93
[CI] Update action/cache version and sf/sylius dependencies
Jibbarth Jul 18, 2025
9bbb0e3
[CI] Fix Phpstan issues
Jibbarth Jul 18, 2025
5521850
[CI] Update rulesets
Jibbarth Jul 18, 2025
b5c4d54
[CI] Remove phpspec
Jibbarth Jul 18, 2025
29542d3
[CI] Remove phpspec in gha
Jibbarth Jul 18, 2025
80c1a84
[CI] Remove spec folder in ecs
Jibbarth Jul 21, 2025
db8314c
[Stimulus] Extends form select to be able to run on checkout and afte…
Jibbarth Jul 21, 2025
cca5d01
[Tests] Initialize TestApplication
Jibbarth Jul 21, 2025
c707d0c
[CI] Update makefile and gha for use testApplication
Jibbarth Jul 21, 2025
2520fff
[CI] Update dev tools
Jibbarth Jul 21, 2025
cd7c87e
fixup! [CI] Update makefile and gha for use testApplication
Jibbarth Jul 21, 2025
15f1652
[CI] Update PHPunit to use it through testApplication
Jibbarth Jul 21, 2025
a6a41ff
Clean install folder (no more required)
Jibbarth Jul 21, 2025
58a50a8
Do not trigger sonarcloud on fork
Jibbarth Jul 21, 2025
a22938b
[Tests] Force sync transport payment request
Jibbarth Jul 25, 2025
f0e491f
Merge pull request #175 from synolia/fix/call-controllers-on-retry-page
Jibbarth Jul 29, 2025
86a3cb0
Merge pull request #169 from synolia/feature/PPSYL-138-payment-request
Jibbarth Jul 29, 2025
5a0546a
Merge pull request #174 from synolia/feature/update-ci
Jibbarth Jul 29, 2025
6d1ede5
Merge pull request #177 from synolia/feature/phpunit
Jibbarth Jul 29, 2025
ec8b57f
Add mandatory assets entrypoint
Jibbarth Jul 29, 2025
2ec91bb
Merge pull request #176 from synolia/feature/test-application
Jibbarth Jul 29, 2025
45227bb
PPSYL-159 - Make CardsOwnerInterface compatible with trait
Jibbarth Aug 22, 2025
23d98b5
PPSYL-162 - Retry to pay when paiement is not cancelled
Jibbarth Aug 22, 2025
fb4ff7f
PPSYL-131 - Do not load payum gateways anymore
Jibbarth Aug 27, 2025
5566248
PPSYL-131 - Clean validators
Jibbarth Aug 27, 2025
6b7b0f8
Update translation, no html is possible here
Jibbarth Aug 27, 2025
e2c767a
Version 2.x
Jibbarth Aug 27, 2025
7307c21
The popin doesn't need to be in form_theme
Jibbarth Aug 27, 2025
a88e16c
Clean old js/css import
Jibbarth Aug 27, 2025
5961189
PPSYL-163 - Replace secretKey by live checkbox
Jibbarth Aug 29, 2025
70839bb
PPSYL-163 - Remove secretKey from form
Jibbarth Aug 29, 2025
5222bda
PPSYL-163 - Handle Oauth redirection and creation of clients
Jibbarth Aug 29, 2025
147b3e2
PPSYL-163 - Retrieve access_token and use it in PayplugApiClient
Jibbarth Aug 29, 2025
1b347d2
PPSYL-163 - Remove usage of initialize method from PayplugApiClient
Jibbarth Aug 29, 2025
91ba46c
PPSYL-163 - Allow renew oauth when updating payment method
Jibbarth Aug 29, 2025
eee9f67
PPSYL-163 - Delegate constraint check after submit
Jibbarth Aug 29, 2025
40837b0
PPSYL-163 - Add custom flashes error message to display html
Jibbarth Sep 5, 2025
6d19c1b
PPSYL-163 - Add translations
Jibbarth Sep 5, 2025
7c7020f
PPSYL-163 - Bump payplug sdk
Jibbarth Sep 5, 2025
bb74f87
PPSYL-163 - Improve error catching and log on dedicated channel
Jibbarth Sep 5, 2025
45279d0
PPSYL-163 - Fix Oney validation
Jibbarth Sep 5, 2025
4d940b5
PPSYL-163 - Fix prevent start oauth on non payplug payment
Jibbarth Sep 5, 2025
527ccfc
Clean old css hook
Jibbarth Sep 8, 2025
0d9f38e
Merge pull request #178 from synolia/feature/august-tests
Jibbarth Sep 8, 2025
2b0aa28
Merge branch 'master' into feature/upgrade-v2
Jibbarth Sep 8, 2025
4169582
Hotfix - Remove stylesheet hook on saved cards
Jibbarth Sep 8, 2025
0105ad9
Hotfix - Reapply fix Apple pay notification
Jibbarth Sep 8, 2025
376d9f3
Merge branch 'feature/upgrade-v2' into feature/PPSYL-163-unified-auth
Jibbarth Sep 8, 2025
de63653
PPSYL-163 - Do not validate when paymentmethod is not payplug on update
Jibbarth Sep 8, 2025
ee8e9d3
PPSYL-163 - Fix retrieving cards
Jibbarth Sep 9, 2025
541463f
PPSYL-163 - PHPStan getSession flashbag - Ignore error
Jibbarth Sep 9, 2025
58a1013
PPSYL-163 - PHPStan Clean issues
Jibbarth Sep 9, 2025
99cc145
PPSYL-163 - Add Changelog
Jibbarth Sep 9, 2025
305dd7a
Merge pull request #179 from synolia/feature/PPSYL-163-unified-auth
oallain Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 6 additions & 11 deletions .github/workflows/analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
php:
- 8.2
symfony:
- '6.2.*'
- '6.4.*'
env:
APP_ENV: test
steps:
Expand All @@ -38,7 +38,7 @@ jobs:
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"'
-
name: 'Composer - Set cache'
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: '${{ steps.composer-cache.outputs.dir }}'
key: 'php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles(''**/composer.json'') }}'
Expand All @@ -58,17 +58,12 @@ jobs:
id: end-of-setup
-
name: 'PHPStan - Run'
run: 'if [ -f rulesets/phpstan.neon ]; then vendor/bin/phpstan analyse -c rulesets/phpstan.neon src/ ; else echo PHPStan rulesets file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
-
name: 'PHPSpec - Run'
run: 'if [ -f phpspec.yml.dist ]; then vendor/bin/phpspec run ; else echo PHPSpec config file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
-
name: 'Checks security issues - Run'
run: 'symfony security:check'
run: 'if [ -f ruleset/phpstan.neon ]; then vendor/bin/phpstan analyse -c ruleset/phpstan.neon src/ ; else echo PHPStan rulesets file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
# TODO: launch Grumphp

sonarcloud:
if: github.event.repository.fork != true
runs-on: ubuntu-latest
continue-on-error: true
steps:
Expand Down
47 changes: 19 additions & 28 deletions .github/workflows/sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ jobs:
matrix:
php:
- 8.2
- 8.4
sylius:
- 1.12.0
- 2.1.0
- 2.0.0
symfony:
- 6.2
- 6.4
- 7.3
node:
- 14.x
- 20.x
env:
APP_ENV: test
package-name: payplug/sylius-payplug-plugin
Expand All @@ -43,9 +46,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '${{ matrix.node }}'
-
name: 'Wkhtmltopdf - Install'
run: "sudo apt-get update\nsudo apt-get install xvfb libfontconfig wkhtmltopdf\nprintf '#!/bin/bash\\nxvfb-run -a --server-args=\"-screen 0, 1024x768x24\" /usr/bin/wkhtmltopdf -q $*' | sudo tee /usr/bin/wkhtmltopdf.sh\nsudo chmod a+x /usr/bin/wkhtmltopdf.sh\nsudo ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf\n"
-
uses: actions/checkout@v3
-
Expand All @@ -54,7 +54,7 @@ jobs:
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
-
name: 'Composer - Set cache'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-composer
with:
path: '${{ steps.composer-cache.outputs.dir }}'
Expand All @@ -73,48 +73,39 @@ jobs:
run: 'echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT'
-
name: 'Yarn - Set Cache'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '${{ steps.yarn-cache.outputs.dir }}'
key: 'node-${{ matrix.node }}-yarn-${{ hashFiles(''**/package.json **/yarn.lock'') }}'
restore-keys: "node-${{ matrix.node }}-yarn-\n"
-
name: 'Install Sylius-Standard and Plugin'
run: 'make install -e SYLIUS_VERSION=${{ matrix.sylius }} SYMFONY_VERSION=${{ matrix.symfony }} PHP_VERSION=${{ matrix.php }}'
-
name: 'Output PHP version for Symfony CLI'
working-directory: ./tests/Application
run: 'php -v | head -n 1 | awk ''{ print $2 }'' > .php-version'
run: 'make install -e SYLIUS_VERSION=${{ matrix.sylius }} SYMFONY_VERSION=${{ matrix.symfony }}'
-
name: 'Install certificates'
working-directory: ./tests/Application
run: 'symfony server:ca:install'
-
name: 'Run Chrome headless'
working-directory: ./tests/Application
run: '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=''*'' https://127.0.0.1 > /dev/null 2>&1 &'
-
name: 'Run webserver'
working-directory: ./tests/Application
run: 'symfony server:start --port=8080 --dir=public --daemon'
run: 'symfony server:start --port=8080 --daemon'
id: end-of-setup-sylius
-
name: 'Doctrine Schema Validate - Run'
working-directory: ./tests/Application
run: 'php bin/console doctrine:schema:validate --skip-sync'
run: 'vendor/bin/console doctrine:schema:validate --skip-sync'
-
name: 'Run PHPUnit'
run: 'make phpunit'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Configure Behat'
run: 'make behat-configure'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Run behat'
working-directory: ./tests/Application
run: 'vendor/bin/behat --strict --no-interaction -f progress || vendor/bin/behat --strict -vvv --no-interaction --rerun'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
# -
# name: 'Configure Behat'
# run: 'make behat-configure'
# if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
# -
# name: 'Run behat'
# run: 'vendor/bin/behat --strict --no-interaction -f progress || vendor/bin/behat --strict -vvv --no-interaction --rerun'
# if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
uses: actions/upload-artifact@v4
if: failure()
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@

/.idea
*.map

/tests/TestApplication/.env.local
/tests/TestApplication/.env.*.local
/var/
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - Unreleased

### Added
- Support for Sylius v2.0+
- PHP 8.2+ compatibility
- Use Payment Request API from Sylius
- New Unified Authentication System (OAuth2)

> [!IMPORTANT]
> Merchants will need to contact support to switch to the new authentication method.

### Changed
- Plugin structure has been changed to follow the new Symfony bundle structure
- Front assets have been migrated to use Stimulus

### Removed
- Drop Payum support
- Drop Sylius 1.x support
- Drop usage of Secret key - Use OAuth2 instead

Please refer to [github releases](https://github.com/payplug/SyliusPayPlugPlugin/releases) for historical release information.

---

For migration guides and upgrade instructions, see [UPGRADE.md](UPGRADE.md).
For contributing guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ From the plugin root directory, run the following commands:
$ make install -e SYLIUS_VERSION=XX SYMFONY_VERSION=YY PHP_VERSION=ZZ
```

Default values : XX=1.12.0 and YY=6.1 and ZZ=8.1
Default values : XX=1.14.0 and YY=6.4 and ZZ=8.2

To be able to setup the plugin database, remember to configure you database credentials
in `install/Application/.env.local` and `install/Application/.env.test.local`.
Expand All @@ -22,7 +22,7 @@ $ make reset

- GrumPHP (see configuration [grumphp.yml](grumphp.yml).)

GrumPHP is executed by the Git pre-commit hook, but you can launch it manualy with :
GrumPHP is executed by the Git pre-commit hook, but you can launch it manually with :

```bash
$ make grumphp
Expand Down
81 changes: 16 additions & 65 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,91 +1,42 @@
.DEFAULT_GOAL := help
SHELL=/bin/bash
COMPOSER_ROOT=composer
TEST_DIRECTORY=tests/Application
CONSOLE=cd tests/Application && php bin/console -e test
COMPOSER=cd tests/Application && composer
YARN=cd tests/Application && yarn

SYLIUS_VERSION=1.12.0
SYMFONY_VERSION=6.1
PHP_VERSION=8.1
TEST_DIRECTORY=tests/TestApplication
CONSOLE=vendor/bin/console
COMPOSER=composer
SYLIUS_VERSION=2.1.0
SYMFONY_VERSION=6.4
PLUGIN_NAME=payplug/sylius-payplug-plugin

###
### DEVELOPMENT
### ¯¯¯¯¯¯¯¯¯¯¯

install: sylius ## Install Plugin on Sylius [SYLIUS_VERSION=1.12.0] [SYMFONY_VERSION=6.1] [PHP_VERSION=8.1]
install: sylius ## Install all dependencies with [SYLIUS_VERSION=2.1.0] [SYMFONY_VERSION=6.4]
.PHONY: install

reset: ## Remove dependencies
ifneq ("$(wildcard tests/Application/bin/console)","")
${CONSOLE} doctrine:database:drop --force --if-exists || true
endif
rm -rf tests/Application
rm -rf vendor
.PHONY: reset

phpunit: phpunit-configure phpunit-run ## Run PHPUnit
phpunit: ## Run PHPUnit tests
./vendor/bin/phpunit
.PHONY: phpunit

###
### OTHER
### ¯¯¯¯¯¯

sylius: sylius-standard install-plugin install-sylius
sylius: install-sylius
.PHONY: sylius

sylius-standard:
ifeq ($(shell [[ $(SYLIUS_VERSION) == *dev ]] && echo true ),true)
${COMPOSER_ROOT} create-project sylius/sylius-standard:${SYLIUS_VERSION} ${TEST_DIRECTORY} --no-install --no-scripts
else
${COMPOSER_ROOT} create-project sylius/sylius-standard ${TEST_DIRECTORY} "~${SYLIUS_VERSION}" --no-install --no-scripts
endif
${COMPOSER} config allow-plugins true
ifeq ($(shell [[ $(SYLIUS_VERSION) == *dev ]] && echo true ),true)
${COMPOSER} require sylius/sylius:"${SYLIUS_VERSION}"
else
${COMPOSER} require sylius/sylius:"~${SYLIUS_VERSION}"
endif

install-plugin:
${COMPOSER} config repositories.plugin '{"type": "path", "url": "../../"}'
${COMPOSER} config extra.symfony.allow-contrib true
${COMPOSER} config minimum-stability "dev"
${COMPOSER} config prefer-stable true
${COMPOSER} require "${PLUGIN_NAME}:*" --prefer-source --no-scripts

cp -r install/Application tests
sed -i "4a \ \ \ \ form_themes: ['form/form_gateway_config_row.html.twig']" ${TEST_DIRECTORY}/config/packages/twig.yaml
mkdir -p ${TEST_DIRECTORY}/templates/form/
cp -R src/Resources/views/form/* ${TEST_DIRECTORY}/templates/form/

# As of sylius/refund-plugin 1.2 the folder does not exist anymore
ifneq ($(PHP_VERSION), 8)
mkdir -p ${TEST_DIRECTORY}/templates/bundles/SyliusAdminBundle/
cp -R src/Resources/views/SyliusAdminBundle/* ${TEST_DIRECTORY}/templates/bundles/SyliusAdminBundle/
endif

install-sylius:
#${CONSOLE} sylius:install -n -s default
${CONSOLE} doctrine:database:create -n
${CONSOLE} messenger:setup-transports -n
${CONSOLE} doctrine:migration:migrate -n
${CONSOLE} sylius:fixture:load -n
${YARN} install
${YARN} build
${YARN} gulp
${CONSOLE} translation:extract en PayPlugSyliusPayPlugPlugin --dump-messages
${CONSOLE} translation:extract fr PayPlugSyliusPayPlugPlugin --dump-messages

${CONSOLE} cache:clear
@echo "Installing Sylius ${SYLIUS_VERSION} using TestApplication"
${COMPOSER} config extra.symfony.require "^${SYMFONY_VERSION}"
${COMPOSER} install
${COMPOSER} require --dev sylius/test-application:"^${SYLIUS_VERSION}@alpha" -n -W # TODO: Remove alpha when stable
${COMPOSER} test-application:install

phpunit-configure:
cp phpunit.xml.dist ${TEST_DIRECTORY}/phpunit.xml
echo -e "\nMOCK_SERVER_HOST=localhost\nMOCK_SERVER_PORT=8987\n" >> ${TEST_DIRECTORY}/.env.test.local

phpunit-run:
cd ${TEST_DIRECTORY} && ./vendor/bin/phpunit

behat-configure: ## Configure Behat
(cd ${TEST_DIRECTORY} && cp behat.yml.dist behat.yml)
Expand All @@ -101,7 +52,7 @@ grumphp:
vendor/bin/grumphp run

help: SHELL=/bin/bash
help: ## Dislay this help
help: ## Display this help
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?##.*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
echo $$line | awk 'BEGIN {FS = "## "}; {printf "\033[33m %s\033[0m\n", $$2}'; else \
echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m%s\n", $$1, $$2}'; fi; \
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ In local environment, the plugin will not work properly because you will not be

```shell
mkdir -p templates/bundles/SyliusAdminBundle/
cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
```

4. Add Payplug to refundable payment method for Sylius Refund Plugin in `config/services.yaml`
Expand All @@ -70,7 +70,7 @@ In local environment, the plugin will not work properly because you will not be

```yaml
sylius_payplug:
resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/routing.yaml"
resource: "@PayPlugSyliusPayPlugPlugin/config/routing.yaml"
```

8. Add Traits for Customer and PaymentMethod entities
Expand All @@ -85,6 +85,7 @@ In local environment, the plugin will not work properly because you will not be
namespace App\Entity\Customer;

use Doctrine\ORM\Mapping as ORM;
use PayPlug\SyliusPayPlugPlugin\Entity\CardsOwnerInterface;
use PayPlug\SyliusPayPlugPlugin\Entity\Traits\CustomerTrait;
use Sylius\Component\Core\Model\Customer as BaseCustomer;

Expand All @@ -94,7 +95,7 @@ In local environment, the plugin will not work properly because you will not be
*/
#[ORM\Entity]
#[ORM\Table(name: 'sylius_customer')]
class Customer extends BaseCustomer
class Customer extends BaseCustomer implements CardsOwnerInterface
{
use CustomerTrait;
}
Expand Down Expand Up @@ -209,9 +210,9 @@ Copy Sylius templates overridden in plugin to your templates directory (e.g temp
mkdir -p templates/bundles/SyliusAdminBundle/
mkdir -p templates/bundles/SyliusShopBundle/
mkdir -p templates/bundles/SyliusUiBundle/
cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusShopBundle/* templates/bundles/SyliusShopBundle/
cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusUiBundle/* templates/bundles/SyliusUiBundle/
cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusShopBundle/* templates/bundles/SyliusShopBundle/
cp -R vendor/payplug/sylius-payplug-plugin/templates/SyliusUiBundle/* templates/bundles/SyliusUiBundle/
```

You also need to edit your twig config to add your path to avoid our configuration to be prepended :
Expand Down
4 changes: 3 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Release Process

Upon releasing a new version there are checks and updates to be made:
* Update plugin's version inside `src/PayPlugSyliusPayPlugPlugin.php` and `src/Resources/dev/package.json`
* Update plugin's version inside `src/PayPlugSyliusPayPlugPlugin.php`
* Ensure that the `CHANGELOG.md` is up to date with the changes made
* Ensure that the date of the release version is updated in `CHANGELOG.md`
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions assets/admin/entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Mandatory by test application
Loading
Loading