diff --git a/lib/GaletteHelloasso/Controllers/HelloassoController.php b/lib/GaletteHelloasso/Controllers/HelloassoController.php index f20a88a..c7335cf 100644 --- a/lib/GaletteHelloasso/Controllers/HelloassoController.php +++ b/lib/GaletteHelloasso/Controllers/HelloassoController.php @@ -67,6 +67,7 @@ public function form(Response $response): Response 'page_title' => _T('HelloAsso payment', 'helloasso'), 'message' => null, 'current_url' => rtrim($current_url, '/'), + 'module_id' => $this->getModuleId() ]; if (!$helloasso->isLoaded()) { diff --git a/lib/GaletteHelloasso/Helloasso.php b/lib/GaletteHelloasso/Helloasso.php index bb3ba9d..738226c 100644 --- a/lib/GaletteHelloasso/Helloasso.php +++ b/lib/GaletteHelloasso/Helloasso.php @@ -332,15 +332,17 @@ private function storeTokens(): bool */ public function checkout(array $metadata, float $amount, ?bool $contains_donation = false): array|bool { + global $routeparser; + try { $tokens = $this->getTokens(); $data = [ 'totalAmount' => (int)$amount, 'initialAmount' => (int)$amount, 'itemName' => $metadata['item_name'], - 'backUrl' => $this->preferences->getURL() . '/plugins/helloasso/cancel', - 'errorUrl' => $this->preferences->getURL() . '/plugins/helloasso/error', - 'returnUrl' => $this->preferences->getURL() . '/plugins/helloasso/success', + 'backUrl' => $this->preferences->getURL() . $routeparser->urlFor('helloasso_cancel'), + 'errorUrl' => $this->preferences->getURL() . $routeparser->urlFor('helloasso_error'), + 'returnUrl' => $this->preferences->getURL() . $routeparser->urlFor('helloasso_success'), 'containsDonation' => $contains_donation, 'payer' => [ 'firstName' => array_key_exists('checkout_firstname', $metadata) ? $metadata['checkout_firstname'] : null, diff --git a/templates/default/helloasso_form.html.twig b/templates/default/helloasso_form.html.twig index f3b1c5d..8864c2f 100644 --- a/templates/default/helloasso_form.html.twig +++ b/templates/default/helloasso_form.html.twig @@ -64,13 +64,13 @@ {{ _T("Pay with HelloAsso", "helloasso") }}
- + {{ _T("Secured payment", "helloasso") }} - Logo Visa - Logo Mastercard - Logo CB - Logo PCI + Logo Visa + Logo Mastercard + Logo CB + Logo PCI {% include "components/forms/csrf.html.twig" %} diff --git a/webroot/galette_helloasso.css b/webroot/galette_helloasso.css index 88249b8..4b9a799 100644 --- a/webroot/galette_helloasso.css +++ b/webroot/galette_helloasso.css @@ -13,3 +13,10 @@ em[data-emoji=":helloasso:"]::before, em[data-emoji="helloasso"]::before { background-image: url(./images/helloasso.svg); } + +.secured-payment { + display: flex; + justify-content: center; + gap: 0.5em; + margin-top: 1em; +}