PHPackages                             elshaden/laravel-tlync - 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. elshaden/laravel-tlync

ActiveLibrary[Payment Processing](/categories/payments)

elshaden/laravel-tlync
======================

Laravel SKD for Tlync Payment Gateway

4.0.0(10mo ago)3433MITPHPCI failing

Since Aug 13Pushed 10mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (37)Used By (0)

Laravel SKD for Tlync Payment Gateway
=====================================

[](#laravel-skd-for-tlync-payment-gateway)

From [Tadawul Digital Solutions Provider , (TDSP)](https://tdsp.ly)
===================================================================

[](#from-tadawul-digital-solutions-provider--tdsp)

[![Latest Version on Packagist](https://camo.githubusercontent.com/65d6dc94eca943264063f8c677204eb8a35b0299dc701b68bc78605846a7f480/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c73686164656e2f6c61726176656c2d746c796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elshaden/laravel-tlync)[![Total Downloads](https://camo.githubusercontent.com/8367c83277c500326dac7b497b698509a0f7201821e804a2a151788906fd56f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c73686164656e2f6c61726176656c2d746c796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elshaden/laravel-tlync)

### Overview

[](#overview)

This Package is a Laravel SDK for Tlync Payment gateway you can read more about Tlync API here [Tlync API Documentation](https://dev-merchant.pay.net.ly/apidocs/index.html)

To use this package you must have an account on Tlync and have your API Key and API Secret

You Also need to create a temporary table in your database to store the new orders before sending them to Tlync This will help in making sure that any completed and paid orders are not sent again to Tlync. and also to make sure that Tlync will only receive unique orders.

#### How it works

[](#how-it-works)

1. Customer places and order on your website, or cart
2. You create a new order in your temporary table in data database
3. You send the order to Tlync as will be explained below
4. Tlync will send a callback to your website with the order status
5. if the order is paid, you can now create the order in your database and send the customer to the success page
6. and delete the temporary order from your temporary table or mark it as paid
7. if the order is not paid, you can send the customer to the failed page and delete the order from your temporary table

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

[](#installation)

You can install the package via composer:

```
composer require elshaden/laravel-tlync
```

You must publish the config file with:

```
php artisan vendor:publish --tag="laravel-tlync-config"
```

This is the contents of the published config file:

```
    /*
     * You can Force test environment even if you application is in production.
     * This will override the environment settings
     * This is useful for testing.
     *
     */
    'force_test_mode' => env('TLYNC_FORCE_TEST_MODE', false),

    /*
     * You can restrict the IP address that can access the callback url.
     * This is useful for security.
     *
     */
    'restrict_ip' => false,

    /*
     * You can add the IP address that can access the callback url.
     * You need to request the IP's from Tlync Support
     */
    'allowed_ips' => [env('TLYNC_ALLOWED_IPS')],

    /*
     * The url that will be used to send the request to Tlync.
     * This is for testing.
     */
    'tlync_test_url' => 'https://c7drkx2ege.execute-api.eu-west-2.amazonaws.com/',

    /*
     * The Store Id in test environment.
     * You must add this in the .env file,
     * do not add here. as this file can be pushed to git.
     */
    'api_test_key' => env('TLYNC_TEST_STORE_ID'),

    /*
     * The Store token that will be used to send the request to Tlync test environment.
     */
    'tlync_test_token' => env('TLYNC_TEST_TOKEN'),

    /*
     * Live Production Environment
     * The url that will be used to send the request to Tlync.
     * This is for live production.
     */
    'tlync_live_url' => 'https://wla3xiw497.execute-api.eu-central-1.amazonaws.com/',

    /*
     * The Store Id in live environment.
     * You must add this in the .env file,
     * do not add here. as this file can be pushed to git.
     */
    'api_live_key' => env('TLYNC_LIVE_STORE_ID'),

    /*
     * The Store token that will be used to send the request to Tlync live environment.
     * You must add this in the .env file,
     * do not add here. as this file can be pushed to git.
     */
    'tlync_live_token' => env('TLYNC_LIVE_TOKEN'),

   /*
   * If you want you can direct the call back coming from Tlync to a specific url.
   * This is useful if you want to handle the call back in a different controller.
   * Leave as it is the package will handle the call back.
   */
    'callback_url' => env('APP_URL') . '/api/tlync/callback',

    /*
     * This where the customer will be redirected after payment.
     * if you want to redirect to another page please add this here
     * example back to MyCart page. or My Orders Page
     */
    'frontend_url' => env('APP_URL') ,

    /*
     * The model class that should be used to mark the payment as paid or failed.
     * Example class \App\Actions\ConfirmOrder\Class.
     *
     */
    'handel_call_back_class' => env('TLYNC_PAYMENT_CLASS', ''),

    /*
     *  The Method  in the handel_call_back_class  that will be used to mark the payment  as paid.
     *  Example method 'confirm' in \App\Actions\ConfirmOrder\Class.
     *  ```
     *    public function confirm($order, $request){
     *    // Change order from temporary to orders and deliver the order.
     *    }
     * ```
     *  And completes the process if the payment is paid.
     *
     */
    'handel_method' => env('METHOD_TO_CONFIRM_PAYMENT', ''),
```

And Also publishes the Hashids file, if you already have that, please add the custom connections to your file The hashids config is responsible for providing a hashed id for the temporary order id, so the customer will not see the real order id

Usage
-----

[](#usage)

### Initiate Payment

[](#initiate-payment)

```
use Elshaden\Tlync\Facades\Tlync;

$Response = Tlync::InitiatePayment
    (
    float $Amount, // The amount of the order
    $para_1,  // this can be the real temprory order id or the customer id
    $para_2,  // this can be the value of the order
    int $para_3, // this must the real temprory order id, AND MUST BE UNIQUE & INTEGER
    string $UserPhone,  // Customer Phone Number
    string $UserEmail  // Customer Email Address OPTIONAL
    )
```

### Initiate Payment Response and Redirect

[](#initiate-payment-response-and-redirect)

#### Success Response

[](#success-response)

if the initiate payment is successful, you will get a response in array

```
 $Response = [
    'Response' => true,
    'message' => 'redirect to url',
    'url' => 'https://store.pay.net.ly/tdi/xxxxxxxxxxxxx......',
  ];

```

You should Redirect the customer to the url provided in the response

if the initiate payment is not successful, you will get a response in array

```
 $Response = [
    'Response' => false,
    'message' => 'Error Message',
  ];

```

### Call Back

[](#call-back)

> This is when Tlync sends a call back to your server Backend with the payment status The route set in the config file will receive the POST call back and will handle it in the Tlync Controller

> The verification of the call back is done by Tlync Callback Method, so you do not need to worry about that.

> When all is done this package will call the class you set up in the config file

```
    'handel_call_back_class' => env('TLYNC_PAYMENT_CLASS', ''),
    'handel_method' => env('METHOD_TO_CONFIRM_PAYMENT', ''),
```

> passing to it the Parameters you sent to the Initiate and the Tlync Response

> To learn more about the Tlync Response please check the [Tlync Documentation](https://dev-merchant.pay.net.ly/apidocs/index.html)

> You will need to handel the call back in your own class and method, and do what ever you want with it Normally if success you will need to create the order in your database and send the customer to the success page and if failed you will need to send the customer to the failed page

You can create your own class and method to handle the call back, and add it to the config file

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/Elshaden/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

-
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance55

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Recently: every ~174 days

Total

35

Last Release

302d ago

Major Versions

1.2.5 → 2.0.02023-02-12

2.1.2 → 3.0.02023-08-15

3.0.4 → 4.0.02025-07-14

PHP version history (4 changes)1.0.0PHP ^8.1

1.0.4PHP ^8.0

2.1.0PHP ^8.0|^8.1

3.0.2PHP ^8.0|^8.1|^8.2

### Community

Maintainers

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

---

Top Contributors

[![Elshaden](https://avatars.githubusercontent.com/u/33955172?v=4)](https://github.com/Elshaden "Elshaden (48 commits)")

---

Tags

laravellaravel-tlyncElshaden

### Embed Badge

![Health badge](/badges/elshaden-laravel-tlync/health.svg)

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

###  Alternatives

[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)[danestves/laravel-polar

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

7812.3k](/packages/danestves-laravel-polar)[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)[creagia/laravel-redsys

Laravel Redsys Payments Gateway

2013.6k](/packages/creagia-laravel-redsys)

PHPackages © 2026

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