Download the PHP package webgriffe/lib-quipago without Composer

On this page you can find all versions of the php package webgriffe/lib-quipago. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lib-quipago

Webgriffe QuiPago (Key Client/CartaSì) PHP library

Build Status

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

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
    '[email protected]',
    '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' => '[email protected]',
);

$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(); // '[email protected]'

// 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

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

License

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

Credits

Developed by Webgriffe®.


All versions of lib-quipago with dependencies

PHP Build Version
Package Version
Requires ext-ctype Version *
ext-json Version *
psr/log Version ^2.0
guzzlehttp/guzzle Version ^6.2
respect/validation Version ^1.1
php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webgriffe/lib-quipago contains the following files

Loading the files please wait ....