PHPackages                             mbentertainment/trustpay-php-sdk - 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. mbentertainment/trustpay-php-sdk

ActiveLibrary[API Development](/categories/api)

mbentertainment/trustpay-php-sdk
================================

Easy unofficial trustpay PHP SDK

3.00.03(8y ago)03.0kproprietaryPHP &gt;=5.5

Since Sep 21Compare

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

READMEChangelog (4)Dependencies (1)Versions (13)Used By (0)

trustpay-php-sdk
================

[](#trustpay-php-sdk)

Easy unofficial trustpay PHP SDK, forked from

Technical documentation -

Install
-------

[](#install)

```
composer require mbentertainment/trustpay-php-sdk
```

Usage
-----

[](#usage)

### Payment

[](#payment)

```
$configuration = new \TrustPay\Configuration();
$configuration->setSuccessUrl("https://example.com/success");
$configuration->setErrorUrl("https://example.com/error");
$configuration->setCancelUrl("https://example.com/cancel");
$configuration->setNotificationUrl("https://example.com/notification");

$configuration->setAccountId("987654321");
$configuration->setSecret("abcd1234");

$configuration->setCurrency(\TrustPay\Enums\Currency::_EUR_);
$configuration->setLanguage(\TrustPay\Enums\Language::SK);

$trustPay = new \TrustPay\TrustPay($configuration);

$request = $trustPay->payment(
    0.01,
    "reference/Variable Symbol",
    "email.address-of-customer@example.com",
    "Payment description (Order ID 1234) etc... "
);

echo $request->getUrl(); // redirect to this url
```

### Returns Url

[](#returns-url)

```
$trustPay = new \TrustPay\TrustPay();

$data = $_GET;

// for testing
$data = [
    'RES' => 0,
    'REF' => 999666333,
];

$response = $trustPay->parsePayment($data);
var_dump($response->getError());
var_dump($response->getMessage());
var_dump($response->getProcessingId());
var_dump($response->getReference());
var_dump($response->getResult());
```

### Notification URL

[](#notification-url)

```
$configuration = new \TrustPay\Configuration();
$configuration->setSecret("abcd1234");
$trustPay = new \TrustPay\TrustPay($configuration);

$data = $_GET;

// for testing
$url = "AID=9876543210&TYP=CRDT&AMT=123.45&CUR=EUR&REF=1234567890&RES=3&TID=3213123123&OID=0&TSS=Y&CardID=&CardMask=1234******3212&CardExp=0999&AuthNumber=5411612&AcqResId=&CardRecTxSec=&SIG=CBAA57C482332A924A58F69B29973A28EC6E26B9A39FADAB344D3E4A4EDEAF58&SIG2=B6FFC3B9C428CC1CD23FB51A78A290C8A902EE4A98C18D8451070AEC8F702B26";
parse_str($url, $data);

$response = $trustPay->parseNotification($data);

// or paste secret as second parameter to parseNotification if you not provided configuration with secret
// $trustPay = new \TrustPay\TrustPay();
// $response = $trustPay->parseNotification($data, 'abcd1234');

printf("IS PAID: %s\n", var_export($response->isPaid(), true));
printf("getAmount: %s\n", $response->getAmount());
printf("isCardPayment: %s\n", var_export($response->isCardPayment(), true));
printf("isProcessing: %s\n", var_export($response->isProcessing(), true));
printf("isOnlyAuthorized: %s\n", var_export($response->isOnlyAuthorized(), true));
printf("getMessage: %s\n", $response->getMessage());
printf("getReference: %s\n", $response->getReference());
printf("getResult: %s\n", $response->getResult());
printf("getCardAcquirerResponseId: %s\n", $response->getCardAcquirerResponseId());
printf("getCardAuthorizationNumber: %s\n", $response->getCardAuthorizationNumber());
printf("getCardMask: %s\n", $response->getCardMask());
printf("getCardId: %s\n", $response->getCardId());
printf("getCardExpiration: %s\n", $response->getCardExpiration());
printf("getCardToken: %s\n", $response->getCardToken());
printf("getCardToken (composed from): %s\n", print_r((new \TrustPay\CardOnFile\Serializer())->deserialize($response->getCardToken()), true));
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

12

Last Release

3175d ago

Major Versions

1.0.1 → 2.0.02016-09-24

2.0.5 → 3.02017-08-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5aa5076f1e3072e3054ce9187ea2338e3179788a72976f705370576788f3834?d=identicon)[tomas.geci](/maintainers/tomas.geci)

### Embed Badge

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

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M993](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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