Skip to content

italiamultimedia/gestpay

Repository files navigation

italiamultimedia/gestpay

GestPay REST API Implementation.

Notes

  • Supports only apiKey Authorization

Implemented endpoints

  • payment/create
  • payment/detail

Installation

composer require italiamultimedia/gestpay

Usage

Payment API

\ItaliaMultimedia\GestPay\Payment

General payment class initialization

$payment = new \ItaliaMultimedia\GestPay\Payment($apiKey, $logDir);
// Set environment (optional, defaults to 'Environment::SANDBOX')
$payment->setEnvironment(\ItaliaMultimedia\GestPay\Environment::SANDBOX);
// Set currency (optional, defaults to `Currencies::EUR`)
$payment->setCurrency(\ItaliaMultimedia\GestPay\Currencies::EUR);
// Set shopLogin
$payment->setShopLogin($shopLogin);

POST payment/create

https://api.gestpay.it/#post-payment-create

// Set itemType (digital/physical)
$payment->setItemType('digital');
// Set optional data
$extraData = [
    'languageId' => 2,
];
// Create payment
$result = $payment->create($amount, $shopTransactionId, $extraData);
Example

examples/paymentCreate.php

php examples/paymentCreate.php <apiKey> <shopLogin>

POST payment/detail

https://api.gestpay.it/#post-payment-detail

Optionally, authenticate using paymentToken instead of Authorization:

$payment->setPaymentToken($paymentToken);
// Set optional data (you must provide at least one of `shopTransactionID`, `bankTransactionID`, `paymentID`.)
$extraData = [
    'paymentID' => $paymentId,
];
// Get payment detail
$result = $payment->detail($extraData);
Example

examples/paymentDetail.php

php examples/paymentDetail.php <apiKey> <shopLogin> <paymentId>

Lightbox example

examples/lightbox.php

See Gestpay documentation: Using Lightbox solution


About

GestPay REST API Implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages