Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .composer-require-checker.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"GALETTE_NIGHTLY",
"GALETTE_PHOTOS_PATH",
"GALETTE_PLUGINS_PATH",
"GALETTE_PLUGINS_DATA_PATH",
"GALETTE_ROOT",
"GALETTE_TELEMETRY_URI",
"GALETTE_TEMPIMAGES_PATH",
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

strategy:
matrix:
php-versions: [ '8.1', '8.4' ]
php-versions: [ '8.2', '8.4' ]
coverage: [none]
fail-fast: false

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
../../vendor/bin/phpcs lib/ ./*.php

- name: CS Fixer
if: matrix.php-versions == '8.1'
if: matrix.php-versions == '8.2'
run: |
cd galette-core/galette/plugins/plugin-helloasso
../../vendor/bin/php-cs-fixer check --show-progress=dots --verbose --diff
Expand Down Expand Up @@ -106,22 +106,20 @@ jobs:
strategy:
matrix:
include:
#always tests higher stable php version with lower db version
#enable coverage on higher stable php version with higher postrgesql version
#higher stable php version
- { php-version: "8.4", db-image: "postgres:13", coverage: none, always: true }
- { php-version: "8.4", db-image: "postgres:17", coverage: none, always: true }
- { php-version: "8.4", db-image: "postgres:18", coverage: none, always: true }
- { php-version: "8.4", db-image: "mysql:8.0", coverage: none, always: true }
- { php-version: "8.4", db-image: "mysql:9.1", coverage: none, always: false }
- { php-version: "8.4", db-image: "mariadb:10.5", coverage: none, always: true }
- { php-version: "8.4", db-image: "mariadb:11.6", coverage: none, always: false }
- { php-version: "8.4", db-image: "mysql:9.4", coverage: none, always: true }
- { php-version: "8.4", db-image: "mariadb:10.6", coverage: none, always: true }
- { php-version: "8.4", db-image: "mariadb:12.0", coverage: none, always: true }
#lower php version
- { php-version: "8.1", db-image: "postgres:13", coverage: none, always: false }
- { php-version: "8.1", db-image: "postgres:17", coverage: none, always: false }
- { php-version: "8.1", db-image: "mysql:8.0", coverage: none, always: false }
- { php-version: "8.1", db-image: "mysql:9.1", coverage: none, always: false }
- { php-version: "8.1", db-image: "mariadb:10.5", coverage: none, always: false }
- { php-version: "8.1", db-image: "mariadb:11.6", coverage: none, always: false }
- { php-version: "8.2", db-image: "postgres:13", coverage: none, always: true }
- { php-version: "8.2", db-image: "postgres:18", coverage: none, always: true }
- { php-version: "8.2", db-image: "mysql:8.0", coverage: none, always: true }
- { php-version: "8.2", db-image: "mysql:9.4", coverage: none, always: true }
- { php-version: "8.2", db-image: "mariadb:10.6", coverage: none, always: true }
- { php-version: "8.2", db-image: "mariadb:12.0", coverage: none, always: true }
fail-fast: false

env:
Expand Down
2 changes: 1 addition & 1 deletion _define.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'Helloasso integration', //Short description
'Guillaume AGNIERAY', //Author
'1.0.0-dev', //Version
'1.2.0', //Galette compatible version
'1.2.1', //Galette compatible version
'helloasso', //routing name and translation domain
'2025-07-23', //Release date
[ //Permissions needed
Expand Down
13 changes: 6 additions & 7 deletions lib/GaletteHelloasso/Controllers/HelloassoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public function form(Request $request, Response $response): Response
if (!$helloasso->isLoaded()) {
$this->flash->addMessageNow(
'error',
_T("<strong>Payment could not work</strong>: An error occurred (that has been logged) while loading Helloasso settings from the database.<br/>Please report the issue to the staff.", "helloasso") .
'<br/>' . _T("Our apologies for the annoyance.", "helloasso")
_T("<strong>Payment could not work</strong>: An error occurred (that has been logged) while loading Helloasso settings from the database.<br/>Please report the issue to the staff.", "helloasso")
. '<br/>' . _T("Our apologies for the annoyance.", "helloasso")
);
}

Expand Down Expand Up @@ -432,19 +432,18 @@ public function webhook(Request $request, Response $response): Response
// all goes well, we can proceed
if ($real_contrib) {
// Check contribution to set $contrib->errors to [] and handle contribution overlap
$valid = $contrib->check($check_contrib_args, [], []);
$valid = $contrib->setNoCheckLogin()->check($check_contrib_args, [], []);
if ($valid !== true) {
Analog::log(
'Cannot create invalid contribution from Helloasso payment:' .
implode("\n ", $valid),
'Cannot create invalid contribution from Helloasso payment:'
. implode("\n ", $valid),
Analog::ERROR
);
$hh->setState(HelloassoHistory::STATE_ERROR);
return $response->withStatus(500, 'Internal error');
}

$store = $contrib->store();
if ($store === true) {
if ($contrib->store()) {
// contribution has been stored :)
Analog::log(
'Helloasso payment has been successfully registered as a contribution',
Expand Down
24 changes: 12 additions & 12 deletions lib/GaletteHelloasso/Helloasso.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ public function load(): void
default:
//we've got a preference not intended
Analog::log(
'[' . get_class($this) . '] unknown preference `' .
$row->nom_pref . '` in the database.',
'[' . get_class($this) . '] unknown preference `'
. $row->nom_pref . '` in the database.',
Analog::WARNING
);
}
Expand All @@ -146,8 +146,8 @@ public function load(): void
$this->loadContributionsTypes();
} catch (\Exception $e) {
Analog::log(
'[' . get_class($this) . '] Cannot load helloasso settings |' .
$e->getMessage(),
'[' . get_class($this) . '] Cannot load helloasso settings |'
. $e->getMessage(),
Analog::ERROR
);
//consider plugin is not loaded when missing the main settings
Expand All @@ -169,8 +169,8 @@ private function loadContributionsTypes(): void
$this->amounts_loaded = true;
} catch (\Exception $e) {
Analog::log(
'[' . get_class($this) . '] Cannot load amounts from core contributions types' .
'` | ' . $e->getMessage(),
'[' . get_class($this) . '] Cannot load amounts from core contributions types'
. '` | ' . $e->getMessage(),
Analog::ERROR
);
//amounts are not loaded at this point
Expand Down Expand Up @@ -262,16 +262,16 @@ public function store(): bool
$edit = $this->zdb->execute($update);

Analog::log(
'[' . get_class($this) .
'] Helloasso settings were sucessfully stored',
'[' . get_class($this)
. '] Helloasso settings were sucessfully stored',
Analog::DEBUG
);

return true;
} catch (\Exception $e) {
Analog::log(
'[' . get_class($this) . '] Cannot store helloasso settings' .
'` | ' . $e->getMessage(),
'[' . get_class($this) . '] Cannot store helloasso settings'
. '` | ' . $e->getMessage(),
Analog::ERROR
);
return false;
Expand Down Expand Up @@ -377,8 +377,8 @@ public function checkout(array $metadata, float $amount): array|bool
return json_decode($contents, true);
} catch (\Exception $e) {
Analog::log(
'[' . get_class($this) . '] Cannot create Helloasso checkout' .
'` | ' . $e->getMessage(),
'[' . get_class($this) . '] Cannot create Helloasso checkout'
. '` | ' . $e->getMessage(),
Analog::ERROR
);
return false;
Expand Down
4 changes: 2 additions & 2 deletions lib/GaletteHelloasso/HelloassoHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ public function getHelloassoHistory(): array
$new[] = $o;
} catch (\Exception $e) {
Analog::log(
'Error loading helloasso history entry #' . $o[$this->getPk()] .
' ' . $e->getMessage(),
'Error loading helloasso history entry #' . $o[$this->getPk()]
. ' ' . $e->getMessage(),
Analog::WARNING
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteHelloasso/PluginGaletteHelloasso.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static function getDashboardsContents(): array
global $preferences;
$contents = [];

if ($preferences->showPublicPages($login)) {
if ($preferences->showPublicPage($login, 'pref_publicpages_visibility_generic')) {
$contents[] = [
'label' => _T("Payment form", "helloasso"),
'route' => [
Expand Down