Skip to content
Snippets Groups Projects
Commit 78975218 authored by Anas Mawlawi's avatar Anas Mawlawi
Browse files

Issue #3445236 by Anas_maw: Drupal 10 compatibility

parent ede83b17
No related branches found
Tags 1.0.0-alpha17
No related merge requests found
......@@ -2,6 +2,6 @@ name: Commerce Hyperpay
type: module
description: "Provides Commerce integration for Hyperpay Payments."
package: Commerce (contrib)
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.3 || ^10
dependencies:
- commerce:commerce_payment
{
"name": "drupal/commerce_hyperpay",
"type": "drupal-module",
"description": "Provides Drupal Commerce integration for Hyperpay Payments.",
"keywords": ["Drupal", "Hyperpay", "Drupal commerce"],
"minimum-stability": "dev",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Anas Mawlawi ",
"homepage": "https://www.drupal.org/u/anas_maw",
"role": "Maintainer"
}
],
"homepage": "https://www.drupal.org/project/commerce_hyperpay",
"support": {
"issues": "https://drupal.org/project/issues/commerce_hyperpay",
"source": "https://git.drupalcode.org/project/commerce_hyperpay"
},
"require": {
"php": ">=8.0",
"drupal/core": "^9.3 || ^10",
"drupal/commerce": "^2.25"
}
}
......@@ -4,7 +4,7 @@ namespace Drupal\commerce_hyperpay\Event;
use Drupal\commerce_order\Entity\OrderInterface;
use Drupal\commerce_price\Price;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Defines the event for altering the charged payment amount of Hyperpay payments.
......
......@@ -535,7 +535,7 @@ class HyperPayCopyAndPay extends OffsitePaymentGatewayBase implements HyperPayIn
*/
public function getPayableAmount(OrderInterface $order) {
$event = new AlterHyperpayAmountEvent($order);
$this->eventDispatcher->dispatch(HyperpayPaymentEvents::ALTER_AMOUNT, $event);
$this->eventDispatcher->dispatch($event, HyperpayPaymentEvents::ALTER_AMOUNT);
$payment_amount = $event->getPaymentAmount();
return $this->rounder->round($payment_amount);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment