PHPackages                             melogail/telr-laravel - 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. melogail/telr-laravel

ActiveLibrary[Payment Processing](/categories/payments)

melogail/telr-laravel
=====================

Laravel Telr payment gateway solutions package.

1.0.6(2y ago)01631[4 PRs](https://github.com/melogail/telr-laravel/pulls)MITPHPPHP ^8.1CI passing

Since Apr 24Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/melogail/telr-laravel)[ Packagist](https://packagist.org/packages/melogail/telr-laravel)[ Docs](https://github.com/melogail/telr-laravel)[ RSS](/packages/melogail-telr-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (8)Used By (0)

Laravel Telr Payment Gateway
============================

[](#laravel-telr-payment-gateway)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8a3b03b48d03afda5744c0480e247b148d1b97a7cff0dc4b1e01bc50070848d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d656c6f6761696c2f74656c722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/melogail/telr-laravel)![GitHub Tests Action Status](https://camo.githubusercontent.com/78ff77b625a28f1b0ea89ad82148c0fff43c4d413884d76f77aeac7c33cddad8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d656c6f6761696c2f74656c722d6c61726176656c2f72756e2d74657374732e796d6c3f6c6162656c3d7465737473267374796c653d666c61742d737175617265)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5316526488000bcade47bcfb710d9dc404f37975e7d170665c1b6a97b545461d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d656c6f6761696c2f74656c722d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/melogail/telr-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c61d739d8da8d44a4c8ecf88b71f7f2a1f53afaca759f843c359a84353a76581/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d656c6f6761696c2f74656c722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/melogail/telr-laravel)

Laravel package to make online payments from your website via ["Telr"](https://telr.com/) payment gateway.

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

[](#installation)

You can install the package via composer:

```
composer require melogail/telr-laravel
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Melogail\TelrLaravel\TelrLaravelServiceProvider" --tag="migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Melogail\TelrLaravel\TelrLaravelServiceProvider" --tag="config"
```

This will add the `config/telr-laravel.php` config file inside your project config folder.

Inside the `config/telr-laravel.php` config file you will need to add the relative path to success, decline, and cancel page according to your project route.

```
return [

    // ...other configs

    'response_path' => [
        'return_auth' => '/:path/to_success_page',
        'return_decl' => '/:path/to_decline_page',
        'return_can' => '/:path/to_cancel_page',
    ],
];
```

Add the following code to your `.env` file and change the values to your payment values.

```
TELR_STORE_ID=      # Payment API key [its different from your "Service API" key].
TELR_AUTH_KEY=      # Payment API key.
TELR_TEST_MODE=     # 1=Test mode | 0=Live mode.
TELR_CURRENCY=      # Currency used for payment.
```

Add `TelrLaravel` facade inside your `config/app.php` file.

```
'aliases' => Facade::defaultAliases()->merge([
        // 'ExampleClass' => App\Example\ExampleClass::class,
        'TelrLaravel' => \Melogail\TelrLaravel\Facades\TelrLaravel::class,

    ])->toArray(),
```

Usage
-----

[](#usage)

To make payment you need to invoke the `TelrLaravel` class in your controller.

```
use Melogail\TelrLaravel\TelrLaravel;

$telr_laravel = new TelrLaravel();
```

Use `makePayment()` method to make payment.

```
$telr_laravel->makePayment('183-487-143', 9.50, 'Cart generated by John Doe on 2023-1-16');
```

After calling the `makePayment()` method, then you call for `pay()` method to perform the payment.

The `makePayment(string $order_id, float $amount, string $description)` method requires three parameters:

- `string $order_id` : The order ID generated by your system.
- `float $amount` : The amount to be paid in decimals ex: 9.50.
- `string $description` : A short description for the payment, max length 63 characters.

While the `pay()` method accepts one optional parameter as an array that holds the essential billing information required by the payment gateway. If these parameters are ignored in your system, the payment gateway page will prompt the user to add these information.

The required information is as follows:

- `bill_fname` : The user first name.
- `bill_sname` : The user sure name.
- `bill_addr1` : The main billing address.
- `bill_phone` : The user phone number.
- `bill_city` : The city, ex: Dubai.
- `bill_country` : The country, MUST be supplied as a two character ISO 3166 country code, ex: US, GB, EG.
- `bill_email` : User main email.

```
$billing_parameters = [
    'bill_fname' => $first_name,
    'bill_sname' => $sure_name,
    'bill_addr1' => $address1,
    'bill_phone' => $phone,
    'bill_city' => $city,
    'bill_country' => $country,
    'bill_email' => $email
];

$telr_laravel->makePayment('183-487-143', 9.50, 'Cart generated by John Doe on 2023-1-16')
    ->pay($billing_parameters);
```

Full code example:

```
use Melogail\TelrLaravel\TelrLaravel;

$telr_laravel = new TelrLaravel();

$billing_parameters = [
    'bill_fname' => $first_name,
    'bill_sname' => $sure_name,
    'bill_addr1' => $address1,
    'bill_phone' => $phone,
    'bill_city' => $city,
    'bill_country' => $country,
    'bill_email' => $email
];

$telr_laravel->makePayment('183-487-143', 9.50, 'Cart generated by John Doe on 2023-1-16')->pay($billing_parameters);
```

For more information about the billing parameters, check the platform documentation [here](https://telr.com/support/knowledge-base/hosted-payment-page-integration-guide/)

Confirm Transaction and Update Transaction Status
-------------------------------------------------

[](#confirm-transaction-and-update-transaction-status)

After setting up payment status path pages inside your `config/telr-laravel.php` file, you need to create three different views, each for each status (Success, Decline, Cancel).

Inside each view you need to call the `setTransactionStatus(Request $request)` method on the `Telr` facade to update the transaction status based on its response return.

```
use Illuminate\Http\Request;
use \Melogail\TelrLaravel\Facades\TelrLaravel;

class PaymentController extends Controller {

    public function success(Request $request){

        // Calling setTransactionStatus facade.
        TelrLaravel::setTransactionStatus($request);

        return view( //... success view page);
    }

    public function decline(Request $request){

        // Calling setTransactionStatus facade.
        TelrLaravel::setTransactionStatus($request);

        return view( //... decline view page);
    }

    public function cancel(Request $request){

        // Calling setTransactionStatus facade.
        TelrLaravel::setTransactionStatus($request);

        return view( //... cancel view page);
    }

}
```

Testing Cards
-------------

[](#testing-cards)

You can use the following cards to test your payment gateway integration.

Card numberTypeCVVMPI4000 0000 0000 0002Visa123No4111 1111 1111 1111Visa123Yes4444 3333 2222 1111Visa123Yes4444 4244 4444 4440Visa123Yes4444 4444 4444 4448Visa123Yes4012 8888 8888 1881Visa123Yes5105 1051 0510 5100Mastercard123No5454 5454 5454 5454Mastercard123Yes5555 5555 5555 4444Mastercard123Yes5555 5555 5555 5557Mastercard123Yes5581 5822 2222 2229Mastercard123Yes5641 8209 0009 7002Maestro UK123Yes6767 0957 4000 0005Solo123No3434 343434 34343American Express1234No3566 0020 2014 0006JCB123No3111 1111 1111 1111MADA123NoChangelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Mohamed Elogail](https://github.com/melogail)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance52

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~11 days

Total

3

Last Release

1093d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/32fdc1add44d0db5e4e2a50454ca0217c43bdc158008d6a3e937cddc773a8ac1?d=identicon)[aemaddin](/maintainers/aemaddin)

---

Top Contributors

[![melogail](https://avatars.githubusercontent.com/u/7257046?v=4)](https://github.com/melogail "melogail (15 commits)")[![aemaddin](https://avatars.githubusercontent.com/u/11630742?v=4)](https://github.com/aemaddin "aemaddin (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![grosjo](https://avatars.githubusercontent.com/u/2287111?v=4)](https://github.com/grosjo "grosjo (1 commits)")

---

Tags

laraveltelrmelogailtelr\_laravel

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/melogail-telr-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/melogail-telr-laravel/health.svg)](https://phpackages.com/packages/melogail-telr-laravel)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

7812.3k](/packages/danestves-laravel-polar)[spatie/laravel-mailcoach-sdk

An SDK to easily work with the Mailcoach API in Laravel apps

41290.2k1](/packages/spatie-laravel-mailcoach-sdk)

PHPackages © 2026

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