PHPackages                             robustastudio/payfort-start-php - 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. robustastudio/payfort-start-php

ActiveLibrary[Payment Processing](/categories/payments)

robustastudio/payfort-start-php
===============================

Payfort Start makes accepting online payments in the Middle East a piece of cake

v1.0(8y ago)038PHP

Since Mar 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/RobustaStudio/payfort-start-php)[ Packagist](https://packagist.org/packages/robustastudio/payfort-start-php)[ RSS](/packages/robustastudio-payfort-start-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/7300a7952f16914de3eb30edecc2a4b1f492ca477dd7f23f44ea8c018bb34a96/68747470733a2f2f7472617669732d63692e6f72672f706179666f72742f73746172742d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/payfort/start-php)

Start PHP
=========

[](#start-php)

Start makes accepting payments in the Middle East ridiculously easy. Sign up for an account at .

Getting Started
---------------

[](#getting-started)

Using Start with your PHP project is simple.

### Install via Composer

[](#install-via-composer)

If you're using [Composer](https://getcomposer.org/doc/00-intro.md#installation-nix) (and really, who isn't these days amirite?), you can simply run:

```
php composer.phar require robustastudio/payfort-start-php
```

.. or add a line to your `composer.json` file:

```
{
    "require": {
        "robustastudio/payfort-start-php": "*"
    }
}
```

Now, running `php composer.phar install` will pull the library directly to your local `vendor` folder.

### Install Manually

[](#install-manually)

Get source code of the latest release from github repository:  and copy it to your project.

Inside your php file add this:

```

```

**Note for Windows:** Before you start development with start-php, please check that your php\_curl can work with our ssl certificate (TLSv1.2). You can do this by running unit tests. If you see "SSL connection error" it means that you need to install a new php version (at least 5.5.19).

**Note:** If you're running on a shared host, then you may need to set the `allow_url_fopen` flag for the `php` commands. For the install command, for example, this would look like `php -d allow_url_fopen=On composer.phar install`. The `-d` overrides the `php.ini` settings, where `allow_url_fopen` is usually set to `Off`.

Using Start
-----------

[](#using-start)

You'll need an account with Start if you don't already have one (grab one real quick at [start.payfort.com](https://start.payfort.com) and come right back .. we'll wait).

Got an account? Great .. let's do this.

### 1. Initializing Start

[](#1-initializing-start)

To get started, you'll need to initialize Start with your secret API key. Here's how that looks (fear not .. we're using a test key, so no real money will be exchanging hands):

```
require_once('vendor/autoload.php'); # At the top of your PHP file

# Initialize Start object
Start::setApiKey('test_sec_k_25dd497d7e657bb761ad6');
```

That's it! You probably want to do something with the Start object though -- it gets really bored when it doesn't have anything to do.

Let's run a transaction, shall we.

### 2. Processing a transaction through Start

[](#2-processing-a-transaction-through-start)

Now, for the fun part. Here's all the code you need to process a transaction with Start:

```
Start_Charge::create(array(
  "amount" => 10500, // AED 105.00
  "currency" => "aed",
  "card" => array(
    "number" => "4242424242424242",
    "exp_month" => 11,
    "exp_year" => 2016,
    "cvc" => "123"
  ),
  "description" => "Charge for test@example.com"
));
```

This transaction should be successful since we used the `4242 4242 4242 4242` test credit card. For a complete list of test cards, and their expected output you can check out this link [here](https://whitepayments.com/docs/testing/).

How can you tell that it was successful? Well, if no exception is raised then you're in the clear.

### 3. Handling Errors

[](#3-handling-errors)

Any errors that may occur during a transaction is raised as an Exception. Here's an example of how you can handle errors with Start:

```
try {
  // Use Start's bindings...
} catch(Start_Error_Banking $e) {
  // Since it's a decline, Start_Error_Banking will be caught
  print('Status is:' . $e->getHttpStatus() . "\n");
  print('Code is:' . $e->getErrorCode() . "\n");
  print('Message is:' . $e->getMessage() . "\n");

} catch (Start_Error_Request $e) {
  // Invalid parameters were supplied to Start's API

} catch (Start_Error_Authentication $e) {
  // There's a problem with that API key you provided

} catch (Start_Error $e) {
  // Display a very generic error to the user, and maybe send
  // yourself an email

} catch (Exception $e) {
  // Something else happened, completely unrelated to Start

}
```

Testing Start
-------------

[](#testing-start)

It's probably a good idea to run the unit tests to make sure that everything is fine and dandy. That's also simple.. just run this command from the root of your project folder:

```
php vendor/bin/phpunit tests --bootstrap vendor/autoload.php
```

**Note:** you'll need to pull the development dependencies as well, using `composer update --dev` in order to run the test suites.

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

[](#contributing)

Read our [Contributing Guidelines](CONTRIBUTING.md) for details

Copyright (c) Payfort.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

2985d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

paymentsonline paymentspayfortmiddle-east

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/robustastudio-payfort-start-php/health.svg)

```
[![Health](https://phpackages.com/badges/robustastudio-payfort-start-php/health.svg)](https://phpackages.com/packages/robustastudio-payfort-start-php)
```

###  Alternatives

[amzn/amazon-pay-sdk-php

Amazon Pay SDK (PHP)

20512.1M3](/packages/amzn-amazon-pay-sdk-php)[unicodeveloper/laravel-paystack

A Laravel Package for Paystack

650975.6k11](/packages/unicodeveloper-laravel-paystack)[ignited/laravel-omnipay

Integrates Omnipay with Laravel and provides an easy configuration.

5211.1M12](/packages/ignited-laravel-omnipay)[recurly/recurly-client

The PHP client library for the Recurly API

1736.3M7](/packages/recurly-recurly-client)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[amzn/amazon-pay-api-sdk-php

Amazon Pay API SDK (PHP)

505.1M9](/packages/amzn-amazon-pay-api-sdk-php)

PHPackages © 2026

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