PHPackages                             webgriffe/lib-quipago - 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. webgriffe/lib-quipago

ActiveLibrary[Payment Processing](/categories/payments)

webgriffe/lib-quipago
=====================

4.0.0(3mo ago)151.8k—0%1MITPHPPHP ^8.2CI failing

Since Jul 11Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/webgriffe/lib-quipago)[ Packagist](https://packagist.org/packages/webgriffe/lib-quipago)[ RSS](/packages/webgriffe-lib-quipago/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (14)Used By (1)

Webgriffe QuiPago (Key Client/CartaSì) PHP library
==================================================

[](#webgriffe-quipago-key-clientcartasì-php-library)

[![Build Status](https://camo.githubusercontent.com/aa1b516a2930b2309e9653a9c7883f021c28fe6a0dd8810a376fc52cafea1097/68747470733a2f2f7472617669732d63692e6f72672f7765626772696666652f6c69622d7175697061676f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webgriffe/lib-quipago)

A PHP library for Nexi/QuiPago (Key Client/CartaSì) payment gateway.

Usage
-----

[](#usage)

You can generate a payment initialization URL using the `UrlGenerator`:

```
$urlGenerator = new Webgriffe\LibQuiPago\PaymentInit\UrlGenerator();
$url = $urlGenerator->generate(
	'https://ecommerce.nexi.it/ecomm/ecomm/DispatcherServlet',
    'merchant_alias',
    'secret_key',
    'sha1',
    50.50,
    '1200123',
    'http-cancel-url', // The URL where the user is redirected on failed payment
    'customer@mail.com',
    'http-succes-url', // The URL where the user is redirected on successful payment
    'SESSID123',
    'ITA',
    'http-post-url' // The URL for the server-to-server notification
);

// Returned $url is https://ecommerce.nexi.it/ecomm/ecomm/DispatcherServlet?alias=merchant_alias&importo=5050&divisa=EUR&codTrans=1200123&url_back=http-cancel-url&mail=customer%40mail.com&url=http-succes-url&session_id=SESSID123&languageId=ITA&urlpost=http-post-url&mac=0fa0ca05a13c6b5d0bd1466461319658f7f990bf

```

You can also handle a server-to-server notification by QuiPago using the notification `Handler`:

```
// These request params array comes from the QuiPago's HTTP notification request
$requestParams = array(
    'codTrans' => '1200123',
    'esito' => 'OK',
    'importo' => '5050',
    'divisa' => 'EUR',
    'data' => '20160221',
    'orario' => '181854',
    'codAut' => '123abc',
    'mac' => 'c83cee2a5422189cab2b54ef685b29dc428741dc',
    'alias' => 'merchant_123',
    'session_id' => '123123',
    '$BRAND' => 'Visa',
    'nome' => 'John',
    'cognome' => 'Doe',
    'mail' => 'jd@mail.com',
);

$handler = new Webgriffe\LibQuiPago\Notification\Handler();
$handler->handle('secret_key', 'sha1', $requestParams)

// You'll get all parameters mapped
$handler->getTransactionCode(); // '1200123'
$handler->getAmount(); // 50.50
$handler->getCurrency(); //'EUR'
$handler->getTransactionDate(); // \DateTime('21/02/2016 18:18:54')
$handler->getAuthCode(); // '123abc'
$handler->getMacFromRequest(); // 'c83cee2a5422189cab2b54ef685b29dc428741dc'
$handler->getMerchantAlias(); // 'merchant_123'
$handler->getSessionId(); // '123123'
$handler->getCardBrand(); // 'Visa'
$handler->getFirstName(); // 'John'
$handler->getLastName(); // 'Doe'
$handler->getEmail(); // 'jd@mail.com'

// And you know if the transaction has been authorized or not by calling
$handler->isTransactionResultPositive(); // true

```

You can inject a `Psr\Log\LoggerInterface` logger to both `Webgriffe\LibQuiPago\PaymentInit\UrlGenerator` and `Webgriffe\LibQuiPago\Notification\Handler` to enable logging of internal operations.

ECREQ/ECRES API
---------------

[](#ecreqecres-api)

You can also send *ECREQ* messages through API `Client` and receive *ECRES* response messages. Capture and void methods are supported:

```
require 'vendor/autoload.php';

$client = new Webgriffe\LibQuiPago\Api\Client(
    new GuzzleHttp\Client(),
    'payment_3444153',
    'TLGHTOWIZXQPTIZRALWKG',
    'Manu'
);

/** @var Webgriffe\LibQuiPago\Api\EcResponse $response */
$response = $client->capture(
    '000000123', // Transaction Code
    Webgriffe\LibQuiPago\Api\EcRequest::REQUEST_TYPE_FIRST_ATTEMPT,
    '000000123', // Operation Id
    105, // Original Amount
    '978', // Currency ISO code
    'TESTOK', // Auth Code
    105, // Operation Amount
    true // Is test request?
);

/** @var Webgriffe\LibQuiPago\Api\EcResponse $response */
$response = $client->void(
    '000000123', // Transaction Code
    Webgriffe\LibQuiPago\Api\EcRequest::REQUEST_TYPE_FIRST_ATTEMPT,
    '000000123', // Operation Id
    105, // Original Amount
    '978', // Currency ISO code
    'TESTOK', // Auth Code
    105, // Operation Amount
    true // Is test request?
);

```

See the `Webgriffe\LibQuiPago\Api\EcResponse` class to know which data you can retrive from that object.

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

[](#contributing)

- clone this repo
- composer install
- do your changes
- vendor/bin/phpspec run
- vendor/bin/phpcs --standard=PSR2 src/
- submit a pull request

License
-------

[](#license)

This library is under the MIT license. See the complete license in the LICENSE file.

Credits
-------

[](#credits)

Developed by [Webgriffe®](http://www.webgriffe.com/).

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity30

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

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

Every ~289 days

Recently: every ~538 days

Total

13

Last Release

118d ago

Major Versions

1.0.7 → 2.0.02020-02-19

2.2.0 → 3.0.02024-07-08

3.0.0 → 4.0.02026-01-12

PHP version history (2 changes)2.2.0PHP ^8.0

4.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![mmenozzi](https://avatars.githubusercontent.com/u/1199914?v=4)](https://github.com/mmenozzi "mmenozzi (52 commits)")[![azambon](https://avatars.githubusercontent.com/u/2920227?v=4)](https://github.com/azambon "azambon (23 commits)")[![lruozzi9](https://avatars.githubusercontent.com/u/26346480?v=4)](https://github.com/lruozzi9 "lruozzi9 (13 commits)")[![LucaGallinari](https://avatars.githubusercontent.com/u/5822554?v=4)](https://github.com/LucaGallinari "LucaGallinari (4 commits)")[![lamasfoker](https://avatars.githubusercontent.com/u/12940668?v=4)](https://github.com/lamasfoker "lamasfoker (2 commits)")

---

Tags

cartasinexipaymentpayment-methodpayment-methodsphp-libraryquipagowebgriffe

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/webgriffe-lib-quipago/health.svg)

```
[![Health](https://phpackages.com/badges/webgriffe-lib-quipago/health.svg)](https://phpackages.com/packages/webgriffe-lib-quipago)
```

###  Alternatives

[dnetix/redirection

Library to connect with PlacetoPay Checkout service

17123.3k2](/packages/dnetix-redirection)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[amazonpaymentservices/aps-php-sdk

Amazon Payment Services PHP SDK

3114.6k](/packages/amazonpaymentservices-aps-php-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[mrprompt/cielo

Integration with Cielo gateway.

481.9k1](/packages/mrprompt-cielo)

PHPackages © 2026

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