PHPackages                             rwbuild/guhemba-web-element - 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. rwbuild/guhemba-web-element

ActiveLibrary[Payment Processing](/categories/payments)

rwbuild/guhemba-web-element
===========================

A laravel-php package that facilitates the integration of guhemba payment in your application

3.0.11(1y ago)3464↓50%MITPHPPHP &gt;=7

Since Sep 22Pushed 1y ago3 watchersCompare

[ Source](https://github.com/RWBuild/package_guhemba-payment-laravel)[ Packagist](https://packagist.org/packages/rwbuild/guhemba-web-element)[ RSS](/packages/rwbuild-guhemba-web-element/feed)WikiDiscussions test Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (26)Used By (0)

Guhemba payment package
=======================

[](#guhemba-payment-package)

A laravel-php package that facilitates the integration of guhemba payment api in your application

[Official Documentation](https://yupidoc.com/projects/guhemba-webelement/preview)
=================================================================================

[](#official-documentation)

From the version `>=3.0.0` , You can find the official [documentation here](https://yupidoc.com/projects/guhemba-webelement/preview)

OLD VERSIONS DOCUMENTATION(&lt;=v2.1.2)
=======================================

[](#old-versions-documentationv212)

At this page you will see the documentation of this package form v0 - v2.1.2

1. Prerequisite
---------------

[](#1-prerequisite)

- laravel framework

2. Installation
---------------

[](#2-installation)

```
 composer require rwbuild/guhemba-web-element

```

3. Configuration
----------------

[](#3-configuration)

### 3.1 Publish config file

[](#31-publish-config-file)

This configuration concerns systems that use a single merchant wallet for receiving payment, In order to start enjoying the package, you will need to publish the config file that support `Guhemba`

```
 php artisan vendor:publish --tag=config

```

After running this command you should see a `guhemba-webelement` file under the directory `config`, then you will need to provide all information required in that file.

### 3.2 Configuration for close partners

[](#32-configuration-for-close-partners)

If you don't have a guhemba partner key, then you should skip this section. Otherwise Make sure that you put the bellow code on top of all your requests:

```
    \RWBuild\Guhemba\Facades\Guhemba::partnerKeys([
        'GUHEMBA_PUBLIC_PARTNER_KEY' => 'request-this-on-guhemba',
        'GUHEMBA_PARTNER_KEY' => 'request-this-on-guhemba',
        'GUHEMBA_BASE_URL' => 'guhemba-base-url'// Ask guhemba support team
    ]);
```

I advice you to put the above code in one of your service providers class in `boot` method, Then you should provide the bellow information on each request that you are performing:

```
    Guhemba::dynamicMerchant([
        'GUHEMBA_API_KEY' => 'wallet-merchant-integration-api-key',

        'GUHEMBA_MERCHANT_KEY' => 'wallet-merchant-key',

        'GUHEMBA_PUBLIC_KEY' => 'wallet-merchant-integration-public-key',

        'GUHEMBA_REDIRECT_URL' => 'your-dynamic-url'
    ]);
```

Now at this stage, I really feel like you are ready to go. let's enjoy the package now 😎.

4. Generating a payment Qrcode
------------------------------

[](#4-generating-a-payment-qrcode)

To generate a payment qrcode, all what you need is to place the bellow script in your code

```
    $amount = 1000;

    $paymentReference = 'order_id';

    $confirmPaymentKey = 'Unique_key';

    $qrcode = Guhemba::generateQrcode(
        $amount,
        $paymentReference,
        $confirmPaymentKey
    )->getQrcode();
```

Note: when you are expecting guhemba to send you a feedback when a transaction is done, then you should send the `$paymentReference` when generating a Qrcode, this is the reference of the product or group of products that your customer is buying. But also you need to provide a `payment_confirmation_endpoint` in your wallet settings on Guhemba. this endpoint must accept `POST` request. The endpoint will be hitted when the transaction is completed and it's will contain the following response:

```
    [
        'payment_reference' => 'Your-provided-payment-ref',
        'transaction_token' => 'string',
        'confirm_payment_key' => 'string'
    ]
```

The `confirm_payment_key` will help you to secure your provided `payment_confirmation_endpoint`, You shoud keep it safe After generating the qrcode because it is the unique key that will help you to check if the request is coming from guhemba.

5. Redirect user to guhemba
---------------------------

[](#5-redirect-user-to-guhemba)

As guhemba payment gives a good `user interface` where the `qrcode` will appear so that user can scan it or can decide to hit the `pay` button for completing the payment on guhemba.

Let's say, user decides to complete the payment on guhemba web then he hits the `pay` button, you will need to redirect him on guhemba. To do that, just have a look:

```
    function redirectToGuhemba()
    {
        $qrcodeSlug ='91da-5a565f0b173c';
        $paymentRef = 6;

        return Guhemba::redirect($qrcodeSlug, $paymentRef)
    }
```

By default this method will redirect user where he can choose a payment option(card,mtn,...). means if you already know the method that a user will pay with, you can pass the `paymentOption` to the redirect method:

```
    function redirectToGuhemba()
    {
        $qrcodeSlug ='91da-5a565f0b173c';
        $paymentRef = 6;
        $paymentOption = "card";// can be:  mtn,card or choice(the default)

        return Guhemba::redirect($qrcodeSlug, $paymentRef,$paymentOption)
    }
```

The `slug` of the qrcode, you will get it after generating a qrcode and The `paymentRef` is the reference of the order that your customer want to pay, this reference may help you to know which product your customer has paid after accomplishing his payment on guhemba.

`Note` : Please make sure all information are well set in the `config file` of guhemba

If you need to check the formated full url before your customer get redirected to guhemba, we give you the ability to dump the url

```
    function redirectToGuhemba()
    {
        $qrcodeSlug ='91da-5a565f0b173c';
        $paymentRef = 6;

        return Guhemba::dump()->redirect($qrcodeSlug, $paymentRef)
    }
```

But also the package provide another alternative for checking the redirection full url by logging it:

```
    function redirectToGuhemba()
    {
        $qrcodeSlug ='91da-5a565f0b173c';
        $paymentRef = 6;

        return Guhemba::shouldLog()->redirect($qrcodeSlug, $paymentRef)
    }
```

6. Fetch transaction Info
-------------------------

[](#6-fetch-transaction-info)

You can fetch a transaction data in different ways:

### 6.1 Get transaction Info from a callback

[](#61-get-transaction-info-from-a-callback)

When the user completes the payment on guhemba, he will be redirected back to your system using the value of `GUHEMBA_REDIRECT_URL` that you have set in the config file.

Now to grab the transaction information that he has performed use this script:

```
    function guhembaCallback()
    {
        $transaction = Guhemba::transaction()->getTransaction();
    }
```

For stateless, you can get the transaction in the following way

```
    function guhembaCallback()
    {
        $transaction = Guhemba::stateless()->transaction()->getTransaction();
    }
```

This time An extra field: `reference` will be added on the transaction `object`.

### 6.2 Get transaction Info using transaction token

[](#62-get-transaction-info-using-transaction-token)

It may happen that you need to check if a payment transaction Having a given token exits in your merchant wallet on guhemba, to do that you only need the bellow script:

```
  $token = 'S-7578987654';

  $transaction = Guhemba::transactionFromToken(
                    $token
                )->getTransaction();
```

### 6.3 Get transaction Info using a payment reference

[](#63-get-transaction-info-using-a-payment-reference)

You may need to check what happened to the transaction that you have initiated yet you don't have the transaction token, the package provides a way to check using the payment reference that you have provided when generating the qrcode

```
    $paymentRef = "2";
    $paymentConfirmKey = "09876545";
    $response = Guhemba::transactionFromPaymentReference(
        $paymentRef,
        $paymentConfirmKey
    );

    if (!$response->isOk()) dd($response->getMessage());

    $transaction = $response->getTransaction();
```

`Note`: the `$paymentConfirmKey` is optional but it is very important for fetching result with precision in case you are using your merchant wallet on different e-commerce

### 6.3 Get transaction Info using a Qrcode Id

[](#63-get-transaction-info-using-a-qrcode-id)

You can also check if a transaction exists using the payment qrcode id that you have generated

```
    $qrcodeId = 4;
    $response = Guhemba::transactionFromQrcode(
        $qrcodeId
    );

    if (!$response->isOk()) dd($response->getMessage());

    $transaction = $response->getTransaction();
```

7. Other methods that you need to use specially for Error handling
------------------------------------------------------------------

[](#7-other-methods-that-you-need-to-use-specially-for-error-handling)

### 7.1 getResponse()

[](#71-getresponse)

You can call this method on all requests except the `redirect` method. For example you want to generate a qrcode:

```
    $amount = 1000;
    $response = Guhemba::generateQrcode($amount)->getResponse();
```

The above script will give you the object that contains all properties of the response

### 7.1 isOk() and getMessage()

[](#71-isok-and-getmessage)

To check if the request was successfully done you can use the `isOk` method to avoid bugs in your system. and also it may happen that the request was not successfully performed, at that time you will need to use the method `getMessage()`

```
    $amount = 1000;
    $generateQrcode = Guhemba::generateQrcode($amount);

    if (! $generateQrcode->isOk()) return $generateQrcode->getMessage();

    $qrcode = $generateQrcode->getQrcode();
```

`Note`: The method `isOkay` is a boolean and `getMessage()` returns a string.

Enjoy guys.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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

Every ~67 days

Total

22

Last Release

685d ago

Major Versions

v1.4 → v2.0.02023-03-15

2.1.2 → v3.0.02023-11-17

PHP version history (2 changes)v2.1.1PHP &gt;=7.0

v3.0.0PHP &gt;=7

### Community

Maintainers

![](https://www.gravatar.com/avatar/988cbdacb19b632229a0cf2746b84b6cdbd4a81624b86a5ad4b1e27db48778a3?d=identicon)[kakaprodo](/maintainers/kakaprodo)

![](https://www.gravatar.com/avatar/e3a6d635b2bda9623418d599663a429096fa7a8fb02fffaca60da4af5a8126f1?d=identicon)[CommonWorld](/maintainers/CommonWorld)

---

Top Contributors

[![kakaprodo](https://avatars.githubusercontent.com/u/30261670?v=4)](https://github.com/kakaprodo "kakaprodo (59 commits)")

### Embed Badge

![Health badge](/badges/rwbuild-guhemba-web-element/health.svg)

```
[![Health](https://phpackages.com/badges/rwbuild-guhemba-web-element/health.svg)](https://phpackages.com/packages/rwbuild-guhemba-web-element)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3310.1k](/packages/duncanmcclean-statamic-cargo)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)[wandesnet/mercadopago-laravel

PHP SDK for integration with Mercado Pago

252.8k](/packages/wandesnet-mercadopago-laravel)

PHPackages © 2026

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