PHPackages                             jestillore/omnipay-paytabs - 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. jestillore/omnipay-paytabs

ActiveLibrary

jestillore/omnipay-paytabs
==========================

PayTabs driver for the Omnipay payment processing library

1644PHP

Since May 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jestillore/omnipay-paytabs)[ Packagist](https://packagist.org/packages/jestillore/omnipay-paytabs)[ RSS](/packages/jestillore-omnipay-paytabs/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Omnipay: PayTabs
================

[](#omnipay-paytabs)

**PayTabs driver for the Omnipay PHP payment processing library**

[![Latest Stable Version](https://camo.githubusercontent.com/5e62512134d31b0ad3a067a26497701aad19db0d746fefa460cf239227f83a10/68747470733a2f2f706f7365722e707567782e6f72672f6a657374696c6c6f72652f6f6d6e697061792d706179746162732f76657273696f6e2e706e67)](https://packagist.org/packages/jestillore/omnipay-paytabs)[![Total Downloads](https://camo.githubusercontent.com/40d47af7ad569999e5a633dd11eaeb69874016939b2497b1398d1a2803519426/68747470733a2f2f706f7365722e707567782e6f72672f6a657374696c6c6f72652f6f6d6e697061792d706179746162732f642f746f74616c2e706e67)](https://packagist.org/packages/jestillore/omnipay-paytabs)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements PayTabs support for Omnipay.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "jestillore/omnipay-paytabs": "~2.0"
    }
}
```

And run composer to update your dependencies:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

```

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- PayTabs

Create a Gateway instance:

```
$gateway = Omnipay::create('PayTabs');
$gateway->setMerchantEmail('email@example.com');
$gateway->setSecretKey('SECRET_KEY');
$gateway->setSiteUrl('http://example.com');
$gateway->setMerchantIp('192.168.143.44');
```

Validate Secret Key:

```
$response = $gateway->validateSecretKey()->send();
if ($response->isSuccessful())
{
    // secret key valid
}
else
{
    // secret key invalid
}
```

Purchase:

```
$card = new CreditCard(array(
	'firstName' => 'John',
	'lastName' => 'doe',
	'address1' => 'Address One',
	'address2' => 'Address Two',
	'city' => 'Sampe City',
	'postCode' => '1234',
	'state' => '', // When the country is selected as USA or CANADA, the statfield should contain a string of 2 characters containing the ISO state code otherwise the payments may be rejected. For other countries, the state can be a string of up to 32 characters.
	'country' => 'PHL', // 3 characters ISO code
	'phone' => '639123456789',
	'email' => 'email@example.com'
));

$items = new ItemBag();

$item1 = new Item(array(
	'name' => 'One',
	'price' => 10,
	'quantity' => 2
	));

$item2 = new Item(array(
	'name' => 'Two',
	'price' => 20,
	'quantity' => 3
	));

$items->add($item1);
$items->add($item2);

$purchase = $gateway->purchase(array(
	'card' => $card,
	'amount' => '80.00',
	'currency' => 'PHP',
	'transactionId' => '123456789',
	'clientIp' => '192.168.1.2',
	'returnUrl' => 'http://example.com/complete_purchase',
	'title' => 'Bill',
	'items' => $items
));

$data = $purchase->getData();

// other_charges and discount fields are required
$data['other_charges'] = '0';
$data['discount'] = '0';

$response = $purchase->sendData($data);

if ($response->isSuccessful())
{
	// always returns false since PayTabs is an off-site gateway
}
else if ($response->isRedirect())
{
    // always returns false since PayTabs is an off-site gateway
	$response->redirect();
}
else
{
	// paypage is not created
}
```

Create Recurring Pay Page:

```
// You need to pass all the same parameters used for create pay page, in addition to the following fields

$data = $purchase->getData();

// set is recurrence to true
$data['is_recurrence_payments'] = 'TRUE';

// Start date on which this recurrence should start with the format DD/MM/YYYY. Date must be a future date.
$data['recurrence_start_date'] = '24/04/2015';

// Frequency is how many times you want to bill your customer. Maximum number of allowed recurrences is 24
$data['recurrence_frequency'] = '4';

// What billing cycle you are going to use (monthly , weekly, daily, yearly)
$data['recurrence_billing_cycle'] = 'monthly';

$response = $purchase->sendData($data);

if ($response->isSuccessful())
{
	// always returns false since PayTabs is an off-site gateway
}
else if ($response->isRedirect())
{
    // always returns false since PayTabs is an off-site gateway
	$response->redirect();
}
else
{
	// paypage is not created
}
```

Create Tokenization Profile for Customers:

```
// You need to pass all the same parameters used for create pay page, in addition to the following fields

$data = $purchase->getData();

// set is tokenization to true
$data['is_tokenization'] = 'TRUE';

// FALSE: If you want to create an existing token
// TRUE: If you want to use an existing token for a returning
$data['is_existing_customer'] = 'FALSE';

// This pt_token is received in the API post response after completing the payment; it will be redirected to return_url. While returning back to that URL, iwill send a POST request to that page.
$data['pt_token'] = 'R7ANsPK1q91fv5QObmQ3';

// The customer email linked to the tokenization profile used, by default when the profile is created at the first successful payment, it will use customer_email value sent in the API to link it to the token.
$data['pt_customer_email'] = 'email@example.com';

// This pt_ customer_password is received in the API post response after completing the payment; it will be redirected to return_url. While returning back to that URL, it will send a POST request to that page.
$data['pt_customer_password'] = '1q91fv5QOb';

$response = $purchase->sendData($data);

if ($response->isSuccessful())
{
	// always returns false since PayTabs is an off-site gateway
}
else if ($response->isRedirect())
{
    // always returns false since PayTabs is an off-site gateway
	$response->redirect();
}
else
{
	// paypage is not created
}
```

Verify Payment:

```
$transactionReference = $_POST['payment_reference'];
$purchase = $gateway->completePurchase(array(
	'transactionReference' => $transactionReference,
));
$response = $purchase->send();
if ($response->isSuccessful())
{
	// payment is sucessful
}
else
{
	// paypage failed
}
```

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)repository.

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/thephpleague/omnipay-2checkout/issues), or better yet, fork the library and submit a pull request.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6522dbe642bf5afbde727b895988e2f14dd0ac2e5c263c7076b0fb969775b76d?d=identicon)[jestillore](/maintainers/jestillore)

---

Top Contributors

[![jestillore](https://avatars.githubusercontent.com/u/3094154?v=4)](https://github.com/jestillore "jestillore (13 commits)")[![divan-mt](https://avatars.githubusercontent.com/u/26517090?v=4)](https://github.com/divan-mt "divan-mt (1 commits)")

### Embed Badge

![Health badge](/badges/jestillore-omnipay-paytabs/health.svg)

```
[![Health](https://phpackages.com/badges/jestillore-omnipay-paytabs/health.svg)](https://phpackages.com/packages/jestillore-omnipay-paytabs)
```

PHPackages © 2026

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