PHPackages                             haybtech/drupal-commerce - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. haybtech/drupal-commerce

ActiveDrupal-module[Payment Processing](/categories/payments)

haybtech/drupal-commerce
========================

HayBTech Payment Gateway for Drupal Commerce

v1.0.0(2w ago)00MITPHP

Since May 22Pushed 2w agoCompare

[ Source](https://github.com/HayBTech/haybtech_commerce_plugin)[ Packagist](https://packagist.org/packages/haybtech/drupal-commerce)[ RSS](/packages/haybtech-drupal-commerce/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

HayBTech Commerce (Drupal)
==========================

[](#haybtech-commerce-drupal)

Official Drupal Commerce payment gateway module for HayBTech -- accept mobile money payments on your Drupal Commerce store.

[![Drupal](https://camo.githubusercontent.com/2fa1de97c338074335a20ea8bb8ffe125de335daf9a61127a33276cac788aab1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44727570616c2d3925323025374325323031302d3036373842452e737667)](https://www.drupal.org/)[![Commerce](https://camo.githubusercontent.com/e25e9a0e443948d71c8d0c029b59b8f670753431ed151d07050928250a405da0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d6d657263652d322e782d677265656e2e737667)](https://www.drupal.org/project/commerce)[![PHP](https://camo.githubusercontent.com/45d36955804bf3f4f17097b05a7f41a28e578dc24e0d3ad0d21ae9d9762f44c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312b2d626c75652e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

---

Features
--------

[](#features)

- Native Drupal Commerce 2.x offsite payment gateway
- Admin configuration form with test/live key management
- Automatic webhook (IPN) verification with HMAC-SHA256 signatures
- Full support for Test and Live modes
- Zero external Composer dependencies (embedded SDK)
- Handles `onReturn`, `onCancel`, and `onNotify` lifecycle events

---

Requirements
------------

[](#requirements)

RequirementVersionDrupal9.x or 10.xCommerce2.xCommerce Payment2.xCommerce Order2.xPHP8.1+---

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
composer require haybtech/commerce
drush en haybtech_commerce -y
drush cr
```

### Manual

[](#manual)

1. Copy the `haybtech_commerce` directory to `/modules/custom/`.
2. Enable via admin: **Extend &gt; HayBTech Commerce &gt; Install**.
3. Or via Drush:

```
drush en haybtech_commerce -y
drush cr
```

---

Configuration
-------------

[](#configuration)

1. Go to **Commerce &gt; Configuration &gt; Payment gateways**.
2. Click **Add payment gateway**.
3. Select \*\*HayBTech \*\* as the plugin.
4. Configure:

FieldDescription**Display name**Name shown to customers at checkout**Mode**Test or Live**Test Secret Key**Your `sk_test_...` key**Live Secret Key**Your `sk_live_...` key**Webhook Secret**Your `whsec_...` signing secret5. Click **Save**.

---

Webhook Setup
-------------

[](#webhook-setup)

1. In your **HayBTech Dashboard**, go to **Settings &gt; Webhooks**.
2. Add a new endpoint:

```
https://your-site.com/payment/notify/haybtech_offsite

```

3. Copy the webhook secret into the gateway configuration.

---

How It Works
------------

[](#how-it-works)

1. Customer selects **HayBTech** at checkout.
2. Drupal Commerce redirects to the HayBTech hosted payment page.
3. Customer pays via mobile money.
4. HayBTech sends a signed IPN (webhook) to your `onNotify` endpoint.
5. The module verifies the HMAC-SHA256 signature, creates a Commerce Payment entity, and marks the order as completed.
6. Customer is redirected back via the `onReturn` handler.

---

---

Module Structure
----------------

[](#module-structure)

```
haybtech_commerce/
  haybtech_commerce.info.yml          # Module metadata and dependencies
  src/
    Plugin/Commerce/PaymentGateway/
      HayBTech.php                    # Offsite gateway (config, onReturn, onNotify)
  lib/
    sdk/                              # Embedded HayBTech PHP SDK
      HayBTech.php, HayBTechClient.php, HayBTechResponse.php,
      Webhook.php
      Resources/
        Payments.php, Webhooks.php
      Exceptions/
        ApiException.php, HayBTechException.php, SignatureException.php

```

---

Security
--------

[](#security)

- **HMAC-SHA256 Webhook Verification** with constant-time comparison
- **Zero External Dependencies** -- embedded SDK, no supply chain risk
- **Secret Masking** in logs and debug output
- **1 MB Payload Limit** to prevent DoS
- **CRLF Guard** against HTTP header injection
- **Drupal Logging** -- errors are logged via `\Drupal::logger('haybtech')`

---

Troubleshooting
---------------

[](#troubleshooting)

IssueSolutionModule not appearingRun `drush cr` to clear cachesGateway not in listVerify `commerce_payment` and `commerce_order` are enabledWebhooks returning 403Check webhook secret matches the HayBTech dashboardOrders not completingCheck Drupal logs at **Reports &gt; Recent log messages**---

MIT License

haybtech\_commerce\_plugin
==========================

[](#haybtech_commerce_plugin)

haybtech\_commerce\_plugin
==========================

[](#haybtech_commerce_plugin-1)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance96

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

18d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6216ba4e6ef250120e78f3c44b8c261f40e2e833bccc38de1e058a3745b92c44?d=identicon)[HayBTech](/maintainers/HayBTech)

---

Top Contributors

[![MoustaphaMANGANE01](https://avatars.githubusercontent.com/u/53624207?v=4)](https://github.com/MoustaphaMANGANE01 "MoustaphaMANGANE01 (3 commits)")

### Embed Badge

![Health badge](/badges/haybtech-drupal-commerce/health.svg)

```
[![Health](https://phpackages.com/badges/haybtech-drupal-commerce/health.svg)](https://phpackages.com/packages/haybtech-drupal-commerce)
```

###  Alternatives

[yenepay/php-sdk

YenePay SDK for PHP

112.7k](/packages/yenepay-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
