PHPackages                             easytransac/easytransac-sdk-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. [API Development](/categories/api)
4. /
5. easytransac/easytransac-sdk-php

ActiveLibrary[API Development](/categories/api)

easytransac/easytransac-sdk-php
===============================

Easytransac payment gateway PHP SDK

2.2.2(1mo ago)328.9k↑61.1%3[1 PRs](https://github.com/easytransac/easytransac-sdk-php/pulls)MITPHPPHP &gt;=7.4CI passing

Since Jan 3Pushed 1mo agoCompare

[ Source](https://github.com/easytransac/easytransac-sdk-php)[ Packagist](https://packagist.org/packages/easytransac/easytransac-sdk-php)[ RSS](/packages/easytransac-easytransac-sdk-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (4)Versions (39)Used By (0)

EasyTransac SDK (PHP)
=====================

[](#easytransac-sdk-php)

[![Build](https://github.com/easytransac/easytransac-sdk-php/actions/workflows/build.yml/badge.svg)](https://github.com/easytransac/easytransac-sdk-php/actions/workflows/build.yml)[![PSR12](https://github.com/easytransac/easytransac-sdk-php/actions/workflows/psr12.yml/badge.svg)](https://github.com/easytransac/easytransac-sdk-php/actions/workflows/psr12.yml)[![Test](https://github.com/easytransac/easytransac-sdk-php/actions/workflows/test.yml/badge.svg)](https://github.com/easytransac/easytransac-sdk-php/actions/workflows/test.yml)[![Coverage Status](https://github.com/easytransac/easytransac-sdk-php/raw/code_quality/coverage_badge.svg?branch=code_quality)](https://github.com/easytransac/easytransac-sdk-php/actions/workflows/coverage-badge.yml)[![Latest Stable Version](https://camo.githubusercontent.com/ad07223c01baccc796fb2602ab391f906d2adceeabe849db6a351e2f29163321/68747470733a2f2f706f7365722e707567782e6f72672f656173797472616e7361632f656173797472616e7361632d73646b2d7068702f76657273696f6e)](https://packagist.org/packages/easytransac/easytransac-sdk-php)

Make your EasyTransac API implementation easier with our SDK.

The EasyTransac SDK is a tool to process payments with the [EasyTransac API](https://www.easytransac.com/).

What's New (v2.2.2)
-------------------

[](#whats-new-v222)

- Added `setEnvironment('sandbox')` for clean sandbox/production separation
- Full PHP `7.4` to `8.4` compatibility
- Deprecated PHP 5.6 support
- Improved response helpers and strict typing
- Added backend Drop-in session support
- Updated documentation

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

[](#requirements)

You need at least:

- PHP &gt;= 7.4
- cURL in order to get clear error messages
- An API key provided by EasyTransac
- OpenSSL version 1.0.1 to support TLS v1.2 ciphers

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

[](#installation)

### By composer

[](#by-composer)

```
composer require easytransac/easytransac-sdk-php
```

Or add this in your `composer.json`:

```
{
  "require": {
    "easytransac/easytransac-sdk-php": "*"
  }
}
```

### Manually

[](#manually)

In order to use it, you only need to require the autoload file `easytransac/easytransac-sdk-php/sdk/EasyTransac/autoload.php`.

Unit Testing
------------

[](#unit-testing)

Our test cases are written under PHPUnit. Please check the required PHPUnit version in the `composer.json` file.

Sandbox Support
---------------

[](#sandbox-support)

As of v2.0.0, the sandbox API is hosted separately at:

```
https://sandbox.easytransac.com

```

Use the new method to enable sandbox mode:

```
\EasyTransac\Core\Services::getInstance()->setEnvironment('sandbox');
```

No need to override API URLs manually.

Samples
-------

[](#samples)

### Set up the configuration

[](#set-up-the-configuration)

```
require_once(__DIR__ . '/vendor/easytransac/easytransac-sdk-php/sdk/EasyTransac/autoload.php');

\EasyTransac\Core\Services::getInstance()->provideAPIKey('YOUR_API_KEY_HERE');
\EasyTransac\Core\Services::getInstance()->setEnvironment('sandbox');
\EasyTransac\Core\Services::getInstance()->setDebug(true);
\EasyTransac\Core\Services::getInstance()->setRequestTimeout(30);
```

### Make a direct payment request

[](#make-a-direct-payment-request)

```
$customer = (new EasyTransac\Entities\Customer())
    ->setFirstname('Demo')
    ->setLastname('Mini SDK')
    ->setCity('Strasbourg')
    ->setUid('a1b2c3d4');

$card = (new EasyTransac\Entities\CreditCard())
    ->setNumber('1111111111111111')
    ->setMonth('10')
    ->setYear('2025')
    ->setCVV('123');

$transaction = (new EasyTransac\Entities\DirectTransaction())
    ->setAmount(100)
    ->setClientIp('127.0.0.1')
    ->setCustomer($customer)
    ->setCreditCard($card);

$request = new EasyTransac\Requests\DirectPayment();
$response = $request->execute($transaction);

if ($response->isSuccess()) {
    $transactionItem = $response->getContent();

    if ($transactionItem->getSecure()) {
        echo $transactionItem->getSecureUrl();
    } else {
        var_dump($transactionItem->getStatus());
        var_dump($transactionItem->getTid());
    }
} else {
    var_dump($response->getErrorMessage());
}
```

### Push payment notification

[](#push-payment-notification)

```
$response = \EasyTransac\Core\PaymentNotification::getContent($_POST, $myApiKey);

var_dump($response->toArray());
var_dump($response->getStatus());
var_dump($_POST);
```

### Get base API response in JSON and Array

[](#get-base-api-response-in-json-and-array)

```
$request = new EasyTransac\Requests\DirectPayment();
$response = $request->execute($transaction);

var_dump($response->getRealJsonResponse());
var_dump($response->getRealArrayResponse());
```

### Create a Drop-in session token

[](#create-a-drop-in-session-token)

The Drop-in flow starts on the backend with `POST /api/dropin/session`.

Important:

- `Providers` is required by the EasyTransac API
- pass it on the transaction with `->setProviders(...)`
- `setProviders()` accepts either a comma-separated string or an array
- array values are trimmed, lowercased, deduplicated, and serialized for the API
- examples: `card`, `applepay,googlepay,card`, or `['applepay', 'googlepay']`

```
use EasyTransac\Core\Services;
use EasyTransac\Entities\Customer;
use EasyTransac\Entities\DropinSessionTransaction;
use EasyTransac\Requests\DropinSession;

Services::getInstance()
    ->provideAPIKey('your_api_key')
    ->setEnvironment(Services::ENV_SANDBOX);

$customer = (new Customer())
    ->setFirstname('John')
    ->setLastname('Doe')
    ->setEmail('john.doe@example.com');

$transaction = (new DropinSessionTransaction())
    ->setOrderId('ORDER-123')
    ->setAmount(1000)
    ->setDescription('Drop-in test order')
    ->setLanguage('FRE')
    ->setReturnUrl('https://merchant.test/return')
    ->setCancelUrl('https://merchant.test/cancel')
    ->setNotificationUrl('https://merchant.test/notify')
    ->setProviders(['applepay', 'googlepay'])
    ->setCustomer($customer);

$response = (new DropinSession())->execute($transaction);

if (!$response->isSuccess()) {
    var_dump($response->getErrorCode(), $response->getErrorMessage());
    exit(1);
}

$session = $response->getContent();
var_dump([
    'token' => $session->getToken(),
    'request_id' => $session->getRequestId(),
    'status' => $session->getStatus(),
]);
```

You can now pass the returned session token to the EasyTransac frontend Drop-in widget.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~59 days

Total

35

Last Release

45d ago

Major Versions

1.3.7 → v2.1.02025-09-23

PHP version history (5 changes)1.0.1PHP &gt;=5.4

1.0.4PHP &gt;=5.5

1.3.0PHP &gt;=5.6

v2.1.0PHP &gt;=7.4 &lt;9.0

v2.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/9802aa4ca9b868a50b327b0ad26ca3c001ea5cbcd08ca291865c59f0b6ea617c?d=identicon)[easytransac](/maintainers/easytransac)

---

Top Contributors

[![Mirana-madixy](https://avatars.githubusercontent.com/u/221990126?v=4)](https://github.com/Mirana-madixy "Mirana-madixy (27 commits)")[![eTryp](https://avatars.githubusercontent.com/u/10864112?v=4)](https://github.com/eTryp "eTryp (21 commits)")[![hakurou](https://avatars.githubusercontent.com/u/5420359?v=4)](https://github.com/hakurou "hakurou (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![Chonne](https://avatars.githubusercontent.com/u/208256?v=4)](https://github.com/Chonne "Chonne (2 commits)")[![maxime-killinger](https://avatars.githubusercontent.com/u/15786158?v=4)](https://github.com/maxime-killinger "maxime-killinger (2 commits)")[![Jedayh](https://avatars.githubusercontent.com/u/20578300?v=4)](https://github.com/Jedayh "Jedayh (1 commits)")

---

Tags

easytransacpayment-gatewayphpsdkphpapisdkpaymentgatewayeasytransac

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/easytransac-easytransac-sdk-php/health.svg)

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

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[wallee/sdk

wallee SDK for PHP

12392.3k19](/packages/wallee-sdk)

PHPackages © 2026

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