PHPackages                             karim007/laravel-tap - 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. karim007/laravel-tap

ActiveLibrary[Payment Processing](/categories/payments)

karim007/laravel-tap
====================

Tap payment gateway for laravel

v1.2(1y ago)5232MITBladePHP ^7.4|^8.0|^8.1|^8.2

Since May 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/karim-007/laravel-tap)[ Packagist](https://packagist.org/packages/karim007/laravel-tap)[ RSS](/packages/karim007-laravel-tap/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Trust Axiata Pay (TAP) Payment Gateway for PHP/Laravel Framework
================================================================

[](#trust-axiata-pay-tap-payment-gateway-for-phplaravel-framework)

[![Downloads](https://camo.githubusercontent.com/036a0f4e93312f092091744531da21be7fc8fbdad707315ef4e7b220aca27161/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6172696d3030372f6c61726176656c2d746170)](https://packagist.org/packages/karim007/laravel-tap)[![Starts](https://camo.githubusercontent.com/e32d097b52e801c80564a20d3b5a392869419fc4be184354069ea72f50a18e55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f6b6172696d3030372f6c61726176656c2d746170)](https://packagist.org/packages/karim007/laravel-tap)

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

[](#requirements)

- PHP &gt;=7.4
- Laravel &gt;= 6

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

[](#installation)

```
composer require karim007/laravel-tap
```

Examples
--------

[](#examples)

![]()[![tap](example/tap1.png)](example/tap1.png)![]()[![tap](example/tap4.png)](example/tap4.png)![]()[![tap](example/tap5.png)](example/tap5.png)

### vendor publish (config)

[](#vendor-publish-config)

```
php artisan vendor:publish --provider="Karim007\LaravelTap\LaravelTapServiceProvider" --tag="config"
```

After publish config file setup your credential. you can see this in your config directory tap.php file

```
"sandbox"         => env("TAP_SANDBOX", true),

"authAPIKey"     => env("TAP_AUTH_API_KEY", ""),
"auth_token" => env("TAP_AUTH_TOKEN", ""),
"username"      => env("TAP_USERNAME", ""),
"password"     => env("TAP_PASSWORD", ""),

"authAPIKey_2"     => env("TAP_AUTH_API_KEY_2", ""),
"auth_token_2" => env("TAP_AUTH_TOKEN_2", ""),
"username_2"      => env("TAP_USERNAME_2", ""),
"password_2"     => env("TAP_PASSWORD_2", ""),

//so on ...

"callbackURL"     => env("TAP_CALLBACK_URL", "http://127.0.0.1:8000/tap/callback"),

```

### Set .env configuration

[](#set-env-configuration)

```
TAP_SANDBOX=true  #for production use false

TAP_AUTH_API_KEY=""
TAP_AUTH_TOKEN=""
TAP_USERNAME=""
TAP_PASSWORD=""

#for multi account
TAP_AUTH_API_KEY_2=""
TAP_AUTH_TOKEN_2=""
TAP_USERNAME_2=""
TAP_PASSWORD_2=""

#so on just use _number likes _3, _4, _5

TAP_CALLBACK_URL=""

```

Usage
-----

[](#usage)

### 1. publish a controller

[](#1-publish-a-controller)

```
php artisan vendor:publish --provider="Karim007\LaravelTap\TapPaymentController" --tag="controllers"

```

### 2. you need to add on route list

[](#2-you-need-to-add-on-route-list)

```
    Route::get('/tap/create-payment', [App\Http\Controllers\TapPaymentController::class,'createPayment'])->name('tap-create-payment');
    Route::get('/tap/callback', [App\Http\Controllers\TapPaymentController::class,'callBack'])->name('tap-callBack');
```

### 3. create payment

[](#3-create-payment)

you will find it App\\Http\\Controllers\\LaravelTapServiceProvider

```
    public function createPayment(Request $request)
    {
        $inv = uniqid();
        $data['requestorReferenceId'] = $inv;
        $data['amount'] = 10;
        $data['invoiceNumber'] = $inv;
        $data['additionalInformation'] = "Far far away, behind the word mountains";
        $data['callBackUrl'] = config("tap.callbackURL");

        return TapPayment::tPayment($data);
    }
```

### 4. callback function

[](#4-callback-function)

```
    public function callBack(Request $request)
    {
        if ($request->status == 'completed'){
            $response = TapPayment::validatePayment($request->transactionId);
            //$response = TapPayment::validatePayment($request->transactionId, 1); //last parameter is your account number for multi account its like, 1,2,3,4,cont..
            if (!$response){ //if validatePayment payment not found call checkTransaction
                $response = TapPayment::checkTransaction($request->requestorReferenceId);
                //$response = TapPayment::checkTransaction($request->requestorReferenceId,1); //last parameter is your account number for multi account its like, 1,2,3,4,cont..
            }
            if (isset($response['status']) && $response['status'] == "completed") {
                /*
                 * for future use need to store
                 * transactionId, requestorReferenceId and coreTransactionId
                 * */
                return TapPayment::success('Thank you for your payment', $response['coreTransactionId']);
            }
            return TapPayment::failure($response['statusMessage']);
        }else if ($request->status == 'cancel'){
            return TapPayment::cancel('Your payment is canceled');
        }else{
            return TapPayment::failure('Your transaction is failed');
        }
    }
```

### 5. validatePayment function

[](#5-validatepayment-function)

```
public function validatePayment($transactionId)
    {
        $response = TapPayment::validatePayment($transactionId);
        //$response = TapPayment::validatePayment($transactionId, 1); //last parameter is your account number for multi account its like, 1,2,3,4,cont..
        return $response;
    }
```

### 6. chkTransaction function

[](#6-chktransaction-function)

```
    public function chkTransaction($requestorReferenceId)
    {
        $response = TapPayment::checkTransaction($requestorReferenceId);
        //$response = TapPayment::checkTransaction($requestorReferenceId, 1); //last parameter is your account number for multi account its like, 1,2,3,4,cont..
        return $response;
    }
```

Contributions to the TAP Payment Gateway package you are welcome. Please note the following guidelines before submitting your pull request.

- Follow [PSR-4](http://www.php-fig.org/psr/psr-4/) coding standards.
- Read TAP API documentations first. Please contact with TAP for their api documentation and sandbox access.

License
-------

[](#license)

This repository is licensed under the [MIT License](http://opensource.org/licenses/MIT).

Copyright 2022 [md abdul karim](https://github.com/karim-007). We are not affiliated with tap and don't give any guarantee.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

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

Total

3

Last Release

708d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1628a1636c45e8e246f880d1f2401497d66af3f657dba80a0f189b102e4b4ce7?d=identicon)[karim.cse007](/maintainers/karim.cse007)

---

Top Contributors

[![karim-007](https://avatars.githubusercontent.com/u/54572884?v=4)](https://github.com/karim-007 "karim-007 (9 commits)")

---

Tags

taptap-paymenttap-payment-gatewaylaravel-taplaravel-tap-payment

### Embed Badge

![Health badge](/badges/karim007-laravel-tap/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18558.8k1](/packages/omnipay-coinbase)

PHPackages © 2026

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