Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
557c793
Merge pull request #13 from alma/develop
Benjamin-Freoua-Alma Sep 21, 2023
e8fa969
Add Aqua scanner on PR. (#15)
remic-alma Jan 23, 2024
bc87204
[Security] Update deprecated Aqua scanner options
remic-alma May 23, 2024
d1394a1
Merge pull request #17 from alma/security/update_aqua_scanner_depreca…
Francois-Gomis Jun 10, 2024
fd793a4
fix: call to member function getPath() on null
Francois-Gomis Dec 12, 2024
a5ac041
Core: change version and changelog
Francois-Gomis Dec 12, 2024
22d1d2f
Merge pull request #21 from alma/feature/ecom-2262-home-maison-error-…
Francois-Gomis Dec 13, 2024
64a40d4
[security] ensure used GH Actions are pinned using SHA.
thomas-e-alma Mar 24, 2026
750a80c
Merge pull request #28 from alma/security/pin_down_github_actions
thomas-e-alma Mar 24, 2026
c36a399
[Security] Enable Vulnerability scanner on PR targeting develop (#16)
remic-alma Feb 13, 2024
07d733c
feat: update README version compatibility
Benjamin-Freoua-Alma Mar 10, 2025
ea205cf
feat: compatibility v1.14
Benjamin-Freoua-Alma Apr 23, 2026
5d346b7
feat: allow plugin rector/extension-installer true
Benjamin-Freoua-Alma Apr 24, 2026
6dcf382
feat: remove iframe mode
Benjamin-Freoua-Alma Apr 24, 2026
3d95921
chore: update version 2.2.0
Benjamin-Freoua-Alma Apr 27, 2026
f58b39b
chore: rollback update version 2.1.0
Benjamin-Freoua-Alma Apr 27, 2026
3b4ade7
chore: update version 2.2.0
Benjamin-Freoua-Alma Apr 27, 2026
56551f1
chore: update changelog
Benjamin-Freoua-Alma Apr 27, 2026
4438b2f
Merge pull request #33 from alma/release/2-2-0
Benjamin-Freoua-Alma Apr 28, 2026
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
31 changes: 31 additions & 0 deletions .github/workflows/aqua.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Aqua
on:
pull_request:
branches:
- main
- develop

jobs:
aqua:
name: Aqua scanner
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Aqua scanner
uses: docker://aquasec/aqua-scanner
with:
args: trivy fs --sast --reachability --scanners config,vuln,secret .
# To customize which severities add the following flag: --severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
# To enable SAST scanning, add: --sast
# To enable reachability scanning, add: --reachability
# To enable npm/dotnet non-lock file scanning, add: --package-json / --dotnet-proj
env:
AQUA_KEY: ${{ secrets.AQUA_KEY }}
AQUA_SECRET: ${{ secrets.AQUA_SECRET }}
GITHUB_TOKEN: ${{ github.token }}
AQUA_URL: https://api.eu-1.supply-chain.cloud.aquasec.com
CSPM_URL: https://eu-1.api.cloudsploit.com
TRIVY_RUN_AS_PLUGIN: "aqua"
# For http/https proxy configuration add env vars: HTTP_PROXY/HTTPS_PROXY, CA-CRET (path to CA certificate)
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
working-directory: .

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f #v2
with:
php-version: 8.0

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

v2.2.0
------

- Feat: Compatibility Sylius 1.14

v2.1.0
------

- Fix: CartBuilder fix call to member function getPath() on null

v2.0.0
------

Expand Down
38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
<p align="center">
<img src="src/Resources/public/img/alma-logo.svg" alt="logo alma" height="75" style="margin-right:30px" />
<img src="https://demo.sylius.com/assets/shop/img/logo.png" height="75" />
<img src="src/Resources/public/img/sylius-logo.png" alt="logo sylius" height="75" />
</p>

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

<p align="center">Integrate Alma installments and pay later payments with your Sylius shop</p>

## Requirements

### Compatibility
- **Sylius**: Compatible with versions `1.9.x` to `1.12.x`
- **PHP**: Compatible with versions `7.3` to `8.0`

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 [support@getalma.eu](mailto:support@getalma.eu).

## Documentation

### Account Setup (Required)

Before configuring the module, you need to create your merchant account on [dashboard.getalma.eu](https://dashboard.getalma.eu).

1. Go to [registration page](https://dashboard.getalma.eu/register) and create an account.
2. Retrieve your API key from the dashboard.
3. Use these credentials in the module configuration.

### Installation
1. Use Composer to install the plugin:

Expand Down Expand Up @@ -53,18 +74,6 @@ $ php bin/console translation:update --dump-messages en AlmaSyliusPaymentPlugin
$ php bin/console cache:clear
```

### Requirements

- PHP version >= 7.3
- Sylius version >= 1.9.0

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 [support@getalma.eu](mailto:support@getalma.eu).

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

Expand All @@ -80,3 +89,6 @@ at Alma, or contact [support@getalma.eu](mailto:support@getalma.eu).
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!

## Support
If you encounter any issues or have questions, feel free to contact us at [support@getalma.eu](mailto:support@getalma.eu.).
33 changes: 17 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "alma/sylius-payment-plugin",
"type": "sylius-plugin",
"version": "2.2.0",
"keywords": [
"alma",
"buy now pay later",
Expand All @@ -13,9 +14,9 @@
"description": "Payment plugin to integrate Alma installments and pay later payments with your Sylius shop",
"license": "MIT",
"require": {
"php": "~7.3 || ~7.4 || ~8.0 || ~8.1 || ~8.2",
"php": "~7.4 || ~8.0 || ~8.1 || ~8.2 || ~8.3",
"alma/alma-php-client": ">=1.11.2",
"sylius/sylius": ">=v1.9.0",
"sylius/sylius": ">=v1.9.0 <2.0",
"ext-json": "*"
},
"require-dev": {
Expand All @@ -34,19 +35,18 @@
"lakion/mink-debug-extension": "^2.0.0",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "0.12.88",
"phpstan/phpstan-doctrine": "0.12.37",
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpunit/phpunit": "^9.5",
"sensiolabs/security-checker": "^6.0",
"sylius-labs/coding-standard": "^3.1",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"vimeo/psalm": "4.6.4"
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^9.5 || ^10.0",
"sylius-labs/coding-standard": "^3.1 || ^4.0",
"symfony/browser-kit": "^4.4 || ^5.2 || ^6.0",
"symfony/debug-bundle": "^4.4 || ^5.2 || ^6.0",
"symfony/dotenv": "^4.4 || ^5.2 || ^6.0",
"symfony/intl": "^4.4 || ^5.2 || ^6.0",
"symfony/web-profiler-bundle": "^4.4 || ^5.2 || ^6.0",
"vimeo/psalm": "^4.6 || ^5.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -74,7 +74,8 @@
"symfony/thanks": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"symfony/flex": true
"symfony/flex": true,
"rector/extension-installer": true
}
}
}
2 changes: 1 addition & 1 deletion src/AlmaSyliusPaymentPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

final class AlmaSyliusPaymentPlugin extends Bundle
{
const VERSION = "2.0.0";
const VERSION = "2.2.0";

use SyliusPluginTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/DataBuilder/CartDataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ private function getProductPictureUrl(ProductVariantInterface $variant): string
/** @var ImageInterface[] $images */
$images = $subject->getImages();

if (count($mainPictures) > 0) {
if (!empty($mainPictures) && $mainPictures[0] !== null ) {
$path = $mainPictures[0]->getPath();
} elseif (count($images) > 0) {
} elseif (!empty($images) && $images[0] !== null) {
$path = $images[0]->getPath();
}

Expand Down
5 changes: 1 addition & 4 deletions src/Form/Type/AlmaGatewayConfigurationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
ChoiceType::class,
[
'choices' => [
$this->translator->trans(
'alma_sylius_payment_plugin.config.payment_page_mode_in_page'
) => GatewayConfigInterface::PAYMENT_PAGE_MODE_IN_PAGE,
$this->translator->trans(
'alma_sylius_payment_plugin.config.payment_page_mode_redirect'
) => GatewayConfigInterface::PAYMENT_PAGE_MODE_REDIRECT,
Expand All @@ -127,7 +124,7 @@ public function onPreSetData(FormEvent $event): void
// Set default values for the different form fields (useful for gateway creations)
$data->defaults([
GatewayConfigInterface::CONFIG_INSTALLMENTS_COUNT => 3,
GatewayConfigInterface::CONFIG_PAYMENT_PAGE_MODE => GatewayConfigInterface::PAYMENT_PAGE_MODE_IN_PAGE,
GatewayConfigInterface::CONFIG_PAYMENT_PAGE_MODE => GatewayConfigInterface::PAYMENT_PAGE_MODE_REDIRECT,
GatewayConfigInterface::CONFIG_API_MODE => AlmaClient::TEST_MODE
]);

Expand Down
18 changes: 1 addition & 17 deletions src/Payum/Action/CaptureAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,7 @@ public function execute($request): void
{
RequestNotSupportedException::assertSupports($this, $request);

$config = $this->api->getGatewayConfig();

$paymentPageMode = $config->getPaymentPageMode();
switch ($paymentPageMode) {
case GatewayConfigInterface::PAYMENT_PAGE_MODE_IN_PAGE:
$this->gateway->execute(new RenderInPagePayment($request->getModel()));
break;

case GatewayConfigInterface::PAYMENT_PAGE_MODE_REDIRECT:
$this->gateway->execute(new RedirectToPaymentPage($request));
break;

default:
throw new RuntimeException(
"[Alma] Unknown payment page mode '${paymentPageMode}'. Check gateway config"
);
}
$this->gateway->execute(new RedirectToPaymentPage($request));
}

public function supports($request): bool
Expand Down
2 changes: 1 addition & 1 deletion src/Payum/Gateway/AlmaGatewayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected function populateConfig(ArrayObject $config): void
'payum.factory_name' => self::FACTORY_NAME,
'payum.factory_title' => 'Alma Payments',
GatewayConfigInterface::CONFIG_INSTALLMENTS_COUNT => 3,
GatewayConfigInterface::CONFIG_PAYMENT_PAGE_MODE => GatewayConfigInterface::PAYMENT_PAGE_MODE_IN_PAGE,
GatewayConfigInterface::CONFIG_PAYMENT_PAGE_MODE => GatewayConfigInterface::PAYMENT_PAGE_MODE_REDIRECT,
GatewayConfigInterface::CONFIG_PAYMENT_FORM_TEMPLATE => '@AlmaSyliusPaymentPlugin/Action/payment_form.html.twig',
]);

Expand Down
1 change: 0 additions & 1 deletion src/Payum/Gateway/GatewayConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface GatewayConfigInterface {
const CONFIG_PAYMENT_PAGE_MODE = 'payment_page_mode';
const CONFIG_PAYMENT_FORM_TEMPLATE = 'payum.template.payment_form_template';

const PAYMENT_PAGE_MODE_IN_PAGE = 'payment_page_mode.in_page';
const PAYMENT_PAGE_MODE_REDIRECT = 'payment_page_mode.redirect';

public function __construct(ArrayObject $config);
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/config/services/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ services:
$eligibilityHelper: '@alma.sylius_payment_plugin.helper.eligibility'
$logger: '@logger'
tags: [ 'controller.service_arguments' ]

alma_sylius_payment_plugin.controller.installments: '@Alma\SyliusPaymentPlugin\Controller\InstallmentsController'
Binary file added src/Resources/public/img/sylius-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/Resources/translations/messages.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ alma_sylius_payment_plugin:
installments_count_label: Raten zählen
installments_count_choice_label: '%installments_count% Ratenzahlungen'
payment_page_mode_label: Modus der Zahlungsseite
payment_page_mode_in_page: Iframe
payment_page_mode_redirect: Weiterleitung zu Alma (empfohlen)
errors:
invalid_api_key: API-Schlüssel ist ungültig
Expand Down
1 change: 0 additions & 1 deletion src/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ alma_sylius_payment_plugin:
installments_count_label: Installments count
installments_count_choice_label: '%installments_count% installments'
payment_page_mode_label: Payment page mode
payment_page_mode_in_page: Iframe
payment_page_mode_redirect: Redirect to Alma (Recommended)
errors:
invalid_api_key: API key is invalid
Expand Down
1 change: 0 additions & 1 deletion src/Resources/translations/messages.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ alma_sylius_payment_plugin:
installments_count_label: Los plazos cuentan
installments_count_choice_label: '%installments_count% plazos'
payment_page_mode_label: Modo de página de pago
payment_page_mode_in_page: Iframe
payment_page_mode_redirect: Redirigir a Alma (Recomendado)
errors:
invalid_api_key: La clave API no es válida
Expand Down
1 change: 0 additions & 1 deletion src/Resources/translations/messages.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ alma_sylius_payment_plugin:
installments_count_label: Nombre d'échéances
installments_count_choice_label: '%installments_count% échéances'
payment_page_mode_label: Mode de la page de paiement
payment_page_mode_in_page: Intégré (iframe)
payment_page_mode_redirect: Redirection vers Alma (Recommandé)
errors:
invalid_api_key: Clé d'API invalide
Expand Down
1 change: 0 additions & 1 deletion src/Resources/translations/messages.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ alma_sylius_payment_plugin:
installments_count_label: Conteggio delle rate
installments_count_choice_label: '%installments_count% rate'
payment_page_mode_label: Modalità della pagina di pagamento
payment_page_mode_in_page: Iframe
payment_page_mode_redirect: Reindirizzamento ad Alma (consigliato)
errors:
invalid_api_key: La chiave API non è valida
Expand Down
1 change: 0 additions & 1 deletion src/Resources/translations/messages.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ alma_sylius_payment_plugin:
installments_count_label: Termijnen tellen
installments_count_choice_label: '%installments_count% termijnen'
payment_page_mode_label: Modus betalingspagina
payment_page_mode_in_page: Iframe
payment_page_mode_redirect: Doorverwijzen naar Alma (aanbevolen)
errors:
invalid_api_key: API-sleutel is ongeldig
Expand Down
1 change: 0 additions & 1 deletion src/Resources/translations/messages.pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ alma_sylius_payment_plugin:
installments_count_label: As prestações contam
installments_count_choice_label: '%installments_count% prestações'
payment_page_mode_label: Modo da página de pagamento
payment_page_mode_in_page: Iframe
payment_page_mode_redirect: Redirecionar para Alma (Recomendado)
errors:
invalid_api_key: A chave da API é inválida
Expand Down
Loading
Loading