From e6f37adf7c6a97588fad4d5851febfa251732151 Mon Sep 17 00:00:00 2001 From: Guillaume AGNIERAY Date: Sat, 8 Aug 2026 12:29:50 +0200 Subject: [PATCH 1/8] Display more details about payments in the list --- templates/default/helloasso_history.html.twig | 86 ++++++++++++++++--- 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/templates/default/helloasso_history.html.twig b/templates/default/helloasso_history.html.twig index 58f7d04..aaac803 100644 --- a/templates/default/helloasso_history.html.twig +++ b/templates/default/helloasso_history.html.twig @@ -36,18 +36,37 @@ 'collapse': true }, { - 'label': _T("Name"), + 'label': _T("Payment nb.", "helloasso"), 'collapse': true }, { - 'label': _T("Subject"), + 'label': _T("Payer name", "helloasso"), + 'collapse': true + }, + { + 'label': _T("Member"), + 'collapse': true + }, + { + 'label': _T("Contribution type"), 'collapse': true }, { 'label': _T("Amount"), 'collapse': true }, - {'label': _T("Request", "helloasso")} + { + 'label': _T("Method", "helloasso"), + 'collapse': true + }, + { + 'label': _T("Status", "helloasso"), + 'collapse': true + }, + { + 'label': _T("Actions"), + 'collapse': true + } ] %} {{ parent() }} {% endblock %} @@ -63,6 +82,9 @@ {{ log.history_date|date(_T("Y-m-d H:i:s")) }} + + + {{ log.checkout_id }} {% if log.duplicate is defined %} @@ -70,34 +92,70 @@ {% endif %} - + {% if log.request is iterable %} - {% if log.request.metadata.member_id is defined %} - - {% endif %} {{ log.request.data.payer.lastName|upper }} {{ log.request.data.payer.firstName }} + {% else %} + {{ _T("No request or unable to read request.", "helloasso") }} + {% endif %} + + + {% if log.request is iterable %} {% if log.request.metadata.member_id is defined %} + + {{ log.request.metadata.member_id }} {% endif %} {% else %} {{ _T("No request or unable to read request.", "helloasso") }} {% endif %} - + {% if log.request is iterable %} {% if log.request.metadata.item_name is defined %} - - {{ _T("Payment nb.", "helloasso") }} - {{ log.checkout_id }} - - | {{ log.request.metadata.item_name }} + {{ log.request.metadata.item_name }} {% endif %} + {% else %} + {{ _T("No request or unable to read request.", "helloasso") }} {% endif %} {{ log.amount }} - + + {% if log.request is iterable %} + {% if log.request.data.paymentMeans is defined %} + {{ log.request.data.paymentMeans }} + {% endif %} + {% else %} + {{ _T("No request or unable to read request.", "helloasso") }} + {% endif %} + + + {% if log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_NONE') or log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_PROCESSED') %} + + + + {{ _T("Payment properly processed", "helloasso") }} + + + {% elseif log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_ERROR') %} + + + + {{ _T("An error occurred and the corresponding contribution has not been created", "helloasso") }} + + + {% elseif log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_ALREADYDONE') %} + + + + {{ _T("Duplicate", "helloasso") }} + + + {% endif %} + +
{{ _T("Show/hide full request", "helloasso") }} From c84beff40b47ad40a95ff556df5955c1971f4220 Mon Sep 17 00:00:00 2001 From: Guillaume AGNIERAY Date: Sat, 8 Aug 2026 12:33:21 +0200 Subject: [PATCH 2/8] Display full request in a modal --- templates/default/helloasso_history.html.twig | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/templates/default/helloasso_history.html.twig b/templates/default/helloasso_history.html.twig index aaac803..91bb60d 100644 --- a/templates/default/helloasso_history.html.twig +++ b/templates/default/helloasso_history.html.twig @@ -156,14 +156,12 @@ {% endif %} -
- - {{ _T("Show/hide full request", "helloasso") }} - -
-
{{ log.raw_request }}
-
-
+ + + + {{ _T("View full request of payment nb. %1$s", "helloasso")|replace({"%1$s":log.checkout_id}) }} + + {% else %} @@ -171,10 +169,41 @@ {% endfor %} {% endblock %} +{% block content %} + {{ parent() }} + + {% for log in logs %} + + {% endfor %} +{% endblock %} + {% block javascripts %} {% endblock %} From a5cd253be9d681a6695e10535d8ffb4f1a0f3e59 Mon Sep 17 00:00:00 2001 From: Guillaume AGNIERAY Date: Sat, 8 Aug 2026 12:35:42 +0200 Subject: [PATCH 3/8] Remove Duplicate icon Duplicates are now better identified in the status column --- lib/GaletteHelloasso/HelloassoHistory.php | 6 ------ templates/default/helloasso_history.html.twig | 6 ------ 2 files changed, 12 deletions(-) diff --git a/lib/GaletteHelloasso/HelloassoHistory.php b/lib/GaletteHelloasso/HelloassoHistory.php index af83573..180b771 100644 --- a/lib/GaletteHelloasso/HelloassoHistory.php +++ b/lib/GaletteHelloasso/HelloassoHistory.php @@ -123,7 +123,6 @@ public function getHelloassoHistory(): array { $orig = $this->getHistory(); $new = []; - $dedup = []; if (count($orig) > 0) { foreach ($orig as $o) { try { @@ -135,11 +134,6 @@ public function getHelloassoHistory(): array $o['raw_request'] = print_r($oa, true); $o['request'] = $oa; - if (in_array($o['checkout_id'], $dedup)) { - $o['duplicate'] = true; - } else { - $dedup[] = $o['checkout_id']; - } $new[] = $o; } catch (\Exception $e) { diff --git a/templates/default/helloasso_history.html.twig b/templates/default/helloasso_history.html.twig index 91bb60d..6548361 100644 --- a/templates/default/helloasso_history.html.twig +++ b/templates/default/helloasso_history.html.twig @@ -85,12 +85,6 @@ {{ log.checkout_id }} - {% if log.duplicate is defined %} - - - {{ _T("Duplicate", "helloasso") }} - - {% endif %} {% if log.request is iterable %} From 33d5fd03455a1f426fa809c001c6b2a816b953eb Mon Sep 17 00:00:00 2001 From: Guillaume AGNIERAY Date: Tue, 11 Aug 2026 22:23:28 +0200 Subject: [PATCH 4/8] Display member full name in the list --- lib/GaletteHelloasso/HelloassoHistory.php | 27 +++++++++++++++++++ templates/default/helloasso_history.html.twig | 4 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/GaletteHelloasso/HelloassoHistory.php b/lib/GaletteHelloasso/HelloassoHistory.php index 180b771..71c67ea 100644 --- a/lib/GaletteHelloasso/HelloassoHistory.php +++ b/lib/GaletteHelloasso/HelloassoHistory.php @@ -16,6 +16,7 @@ use Galette\Core\Login; use Galette\Core\History; use Galette\Core\Preferences; +use Galette\Entity\Adherent; use Galette\Filters\HistoryList; /** @@ -132,6 +133,9 @@ public function getHelloassoHistory(): array $oa = Galette::jsonDecode($o['request']); } + $member_id = $oa['metadata']['member_id'] ?? 0; + + $o['member_fullname'] = $this->getMemberFullName($member_id); $o['raw_request'] = print_r($oa, true); $o['request'] = $oa; @@ -148,6 +152,29 @@ public function getHelloassoHistory(): array return $new; } + /** + * Gets Member full name + * + * @param int $id ID of the member to retrieve + * @return string + */ + protected function getMemberFullName(int $id): string + { + $fullname = _T('None', 'helloasso'); + + $select = $this->zdb->select(Adherent::TABLE); + $select->columns(['prenom_adh', 'nom_adh']); + $select->where(['id_adh' => $id]); + $result = $this->zdb->execute($select); + $row = $result->current(); + + if ($row) { + $fullname = mb_strtoupper($row['nom_adh']) . ' ' . $row['prenom_adh']; + } + + return $fullname; + } + /** * Builds the order clause * diff --git a/templates/default/helloasso_history.html.twig b/templates/default/helloasso_history.html.twig index 6548361..09152de 100644 --- a/templates/default/helloasso_history.html.twig +++ b/templates/default/helloasso_history.html.twig @@ -97,7 +97,9 @@ {% if log.request is iterable %} {% if log.request.metadata.member_id is defined %} - {{ log.request.metadata.member_id }} + {% endif %} + {{ log.member_fullname }} + {% if log.request.metadata.member_id is defined %} {% endif %} {% else %} From f5bc5522a2a8a1adff4b099b89970dc357e5a5c0 Mon Sep 17 00:00:00 2001 From: Guillaume AGNIERAY Date: Sat, 8 Aug 2026 15:02:29 +0200 Subject: [PATCH 5/8] Fix undetected duplicates on public donations --- lib/GaletteHelloasso/Controllers/HelloassoController.php | 6 ++++++ lib/GaletteHelloasso/HelloassoHistory.php | 6 +++--- templates/default/helloasso_history.html.twig | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/GaletteHelloasso/Controllers/HelloassoController.php b/lib/GaletteHelloasso/Controllers/HelloassoController.php index 241dbd2..d8f2950 100644 --- a/lib/GaletteHelloasso/Controllers/HelloassoController.php +++ b/lib/GaletteHelloasso/Controllers/HelloassoController.php @@ -416,6 +416,12 @@ public function webhook(Request $request, Response $response): Response return $response->withStatus(500, 'Internal error'); } return $response->withStatus(200); + } else { + Analog::log( + 'A Helloasso payment has been successfully stored as a public donation', + Analog::DEBUG + ); + $hh->setState(HelloassoHistory::STATE_PUBLIC); } } return $response->withStatus(200); diff --git a/lib/GaletteHelloasso/HelloassoHistory.php b/lib/GaletteHelloasso/HelloassoHistory.php index 71c67ea..a2b3e6d 100644 --- a/lib/GaletteHelloasso/HelloassoHistory.php +++ b/lib/GaletteHelloasso/HelloassoHistory.php @@ -33,7 +33,8 @@ class HelloassoHistory extends History public const int STATE_NONE = 0; public const int STATE_PROCESSED = 1; public const int STATE_ERROR = 2; - public const int STATE_ALREADYDONE = 3; + public const int STATE_PUBLIC = 3; + public const int STATE_ALREADYDONE = 4; private int $id; @@ -156,7 +157,6 @@ public function getHelloassoHistory(): array * Gets Member full name * * @param int $id ID of the member to retrieve - * @return string */ protected function getMemberFullName(int $id): string { @@ -202,7 +202,7 @@ public function isProcessed(array $request): bool $select->where( [ 'checkout_id' => $request['data']['id'], - 'state' => self::STATE_PROCESSED + 'state' => [self::STATE_PROCESSED, self::STATE_PUBLIC] ] ); $results = $this->zdb->execute($select); diff --git a/templates/default/helloasso_history.html.twig b/templates/default/helloasso_history.html.twig index 09152de..81da19a 100644 --- a/templates/default/helloasso_history.html.twig +++ b/templates/default/helloasso_history.html.twig @@ -128,7 +128,7 @@ {% endif %} - {% if log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_NONE') or log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_PROCESSED') %} + {% if log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_PUBLIC') or log.state == constant('GaletteHelloasso\\HelloassoHistory::STATE_PROCESSED') %} @@ -155,7 +155,7 @@ - {{ _T("View full request of payment nb. %1$s", "helloasso")|replace({"%1$s":log.checkout_id}) }} + {{ _T("View full request of payment nb. %1$s", "helloasso")|replace({"%1$s": log.checkout_id}) }} @@ -171,7 +171,7 @@ {% for log in logs %}