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 lib/GaletteHelloasso/Controllers/HelloassoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
8 changes: 5 additions & 3 deletions lib/GaletteHelloasso/Helloasso.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions templates/default/helloasso_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
{{ _T("Pay with HelloAsso", "helloasso") }}
</button>
<br/>
<span class="ui small text">
<span class="ui small text secured-payment">
<i class="lock icon"></i>
{{ _T("Secured payment", "helloasso") }}
<img src="{{ url_for("plugin_res", {"plugin": "plugin-helloasso", "path": "images/logo-visa.svg"}) }}" alt="Logo Visa" />
<img src="{{ url_for("plugin_res", {"plugin": "plugin-helloasso", "path": "images/logo-mastercard.svg"}) }}" alt="Logo Mastercard" />
<img src="{{ url_for("plugin_res", {"plugin": "plugin-helloasso", "path": "images/logo-cb.svg"}) }}" alt="Logo CB" />
<img src="{{ url_for("plugin_res", {"plugin": "plugin-helloasso", "path": "images/logo-pci.svg"}) }}" alt="Logo PCI" />
<img src="{{ url_for("plugin_res", {"plugin": module_id, "path": "images/logo-visa.svg"}) }}" alt="Logo Visa" />
<img src="{{ url_for("plugin_res", {"plugin": module_id, "path": "images/logo-mastercard.svg"}) }}" alt="Logo Mastercard" />
<img src="{{ url_for("plugin_res", {"plugin": module_id, "path": "images/logo-cb.svg"}) }}" alt="Logo CB" />
<img src="{{ url_for("plugin_res", {"plugin": module_id, "path": "images/logo-pci.svg"}) }}" alt="Logo PCI" />
</span>
{% include "components/forms/csrf.html.twig" %}
</div>
Expand Down
7 changes: 7 additions & 0 deletions webroot/galette_helloasso.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}