Drupal is a registered trademark of Dries Buytaert

comgate

1 sites No security coverage
View on drupal.org

Basic integration of a Czech payment gateway Comgate.

This module provides a simple API that allows calling Comgate methods for creating payments, handling returns from the gateway and reading payment statuses. Basically this is just a Comgate PHP SDK wrapped in a simple Drupal package (with the author's blessing).

Please note that this module does not depend on Drupal Commerce intentionally and can be used without it.

Features

  • API for payment creation
  • Controller for secure payment status handling
  • Simple configuration using settings.php
  • Necessary Drupal permissions only

Post-Installation

After enabling the module, you should put following block to your settings.php and make sure to grant the "use comgate" permission.

/**
 * Comgate payments integration.
 */
if (getenv('COMGATE_MERCHANT')) {
  $settings['comgate'] = [
    'merchant' => getenv('COMGATE_MERCHANT'),
    'secret' => getenv('COMGATE_SECRET'),
    'test' => getenv('COMGATE_TEST'),
  ];
}

*You will get the merchant and secret values in your Comgate account.

Example usage

   // Inject the service.
   private ComgateService $comgateService = ...;

   // Prepare a payment.
   $comgate_payment = \Drupal\comgate\Dto\Payment::create()
      ->withPrice(200.00)
      ->withCurrency('CZK')
      ->withMethod('ALL')
      ->withCountry('ALL')
      ->withLabel('Invoice 1234')
      ->withReferenceId('1234')
      ->withEmail('[email protected]');

    // Contact the gateway.
    $redirect = $comgateService->createPayment($comgate_payment);

Maintenance and development

The module is considered feature complete and supported by the author as it is being operated in production. Security is our main concern with this module.
In future we would like to remove the Comgate SDK code and use it as Composer dependency instead (contributions are welcome).

Activity

Total releases
1
First release
May 2025
Latest release
9 months ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.1.x-dev Dev May 26, 2025