PHPackages                             duronrulez/ginger-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. duronrulez/ginger-php

ActiveLibrary[Payment Processing](/categories/payments)

duronrulez/ginger-php
=====================

The Ginger Payments PHP 5.3 SDK

0.1.0(11y ago)07MITPHPPHP &gt;=5.4.0

Since Mar 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/duronrulez/ginger-php)[ Packagist](https://packagist.org/packages/duronrulez/ginger-php)[ Docs](https://github.com/gingerpayments/php-sdk)[ RSS](/packages/duronrulez-ginger-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

Ginger Payments PHP Bindings
============================

[](#ginger-payments-php-bindings)

[![Build Status](https://camo.githubusercontent.com/734dd2cd3806104acc4a762d4149fd91fa39af85e1a0faf8c726962df1dd4953/68747470733a2f2f7472617669732d63692e6f72672f67696e6765727061796d656e74732f67696e6765722d7068702e737667)](https://travis-ci.org/gingerpayments/ginger-php)[![Code Coverage](https://camo.githubusercontent.com/63b8e46280e9e93043ccd971bc3c65c290a5af01512153fd4993bafaf929f8d4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67696e6765727061796d656e74732f67696e6765722d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gingerpayments/ginger-php/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2aff5b25a39112a1714f8014c598732f80d22782a9e5f65a6dfafe398db249a5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67696e6765727061796d656e74732f67696e6765722d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gingerpayments/ginger-php/?branch=master)[![MIT License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://github.com/gingerpayments/ginger-php/blob/master/LICENSE)

You can sign up for a Ginger Payments account at

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

[](#requirements)

- PHP 5.4 or later.

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

[](#installation)

You can install the PHP bindings using composer:

```
composer require gingerpayments/ginger-php

```

You can also use the PHP bindings without using Composer by registering an autoloader function:

```
spl_autoload_register(function($class) {
    $prefix = 'GingerPayments\\Payment\\';

    if (!substr($class, 0, 23) === $prefix) {
        return;
    }

    $class = substr($class, strlen($prefix));
    $location = __DIR__ . 'path/to/gingerpayments/ginger-php/src/' . str_replace('\\', '/', $class) . '.php';

    if (is_file($location)) {
        require_once($location);
    }
});
```

Getting started
---------------

[](#getting-started)

First create a new API client with your API key:

```
use \GingerPayments\Payment\Ginger;

$client = Ginger::createClient('your-api-key');
```

### Create a new order

[](#create-a-new-order)

Creating a new order is easy:

```
$order = $client->createOrder(
    2500,                           // The amount in cents
    'EUR',                          // The currency
    'ideal',                        // The payment method
    ['issuer_id' => 'INGBNL2A'],    // Extra details required for this payment method
    'A great order',                // A description (optional)
    'order-234192',                 // Your identifier for the order (optional)
    'http://www.example.com',       // The return URL (optional)
    'PT15M'                         // The expiration period in ISO 8601 format (optional)
);
```

You can also use the `createIdealOrder` method to create a new order using the iDEAL payment method:

```
$order = $client->createIdealOrder(
    2500,                           // The amount in cents
    'EUR',                          // The currency
    'INGBNL2A',                     // The iDEAL issuer
    'A great order',                // A description (optional)
    'order-234192',                 // Your identifier for the order (optional)
    'http://www.example.com',       // The return URL (optional)
    'PT15M'                         // The expiration period in ISO 8601 format (optional)
);
```

Or the `createCreditCardOrder` method:

```
$order = $client->createCreditCardOrder(
    2500,                           // The amount in cents
    'EUR',                          // The currency
    'A great order',                // A description (optional)
    'order-234192',                 // Your identifier for the order (optional)
    'http://www.example.com',       // The return URL (optional)
    'PT15M'                         // The expiration period in ISO 8601 format (optional)
);
```

Once you've created your order, a transaction is created and associated with it. You will need to redirect the user to the transaction's payment URL, which you can retrieve as follows:

```
$paymentUrl = $order->firstTransactionPaymentUrl();
```

It is also recommended that you store the order's ID somewhere, so you can retrieve information about it later:

```
$orderId = $order->id();
```

You can also access other information related to the order. Inspect the `GingerPayments\Payment\Order` class for more information. If you just want everything as a simple array, you can also use the `Order::toArray` method.

### Getting an order

[](#getting-an-order)

If you want to retrieve an existing order, use the `getOrder` method on the client:

```
$order = $client->getOrder($orderId);
```

You can iterate over all transactions in the order as follows:

```
foreach ($order->transactions() as $transaction) {
    $transaction->status()->isCompleted(); // Check the status
    $transaction->amount(); // How much paid
}
```

You can access other information related to order transactions as well. Inspect the `GingerPayments\Payment\Order\Transaction` class for more information.

### Getting the iDEAL issuers

[](#getting-the-ideal-issuers)

When you create an order with the iDEAL payment method, you need to provide an issuer ID. The issuer ID is an identifier of the bank the user has selected. You can retrieve all possible issuers by using the `getIdealIssuers` method:

```
$issuers = $client->getIdealIssuers();
```

You can then use this information to present a list to the user of possible banks to choose from.

API documentation
-----------------

[](#api-documentation)

Full API documentation is available [here](https://www.gingerpayments.com/api).

Tests
-----

[](#tests)

In order to run the tests first install PHPUnit via Composer:

```
composer install --dev

```

Then run the test suite:

```
./vendor/bin/phpunit

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

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

4079d ago

### Community

Maintainers

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

---

Top Contributors

[![fvdb](https://avatars.githubusercontent.com/u/25526?v=4)](https://github.com/fvdb "fvdb (42 commits)")[![duronrulez](https://avatars.githubusercontent.com/u/981088?v=4)](https://github.com/duronrulez "duronrulez (2 commits)")

---

Tags

paymentpaymerchante-commerce

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/duronrulez-ginger-php/health.svg)

```
[![Health](https://phpackages.com/badges/duronrulez-ginger-php/health.svg)](https://phpackages.com/packages/duronrulez-ginger-php)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[omnipay/payfast

PayFast driver for the Omnipay payment processing library

24626.9k3](/packages/omnipay-payfast)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)

PHPackages © 2026

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