2017 © Pedro Peláez
 

library thepay

image

webchemistry/thepay

  • Wednesday, July 18, 2018
  • by Antik
  • Repository
  • 1 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 37 % Grown

The README.md

Build Status, (*1)

Integration of payment gate thepay. This library uses their component, version 3.2.2, 16.2.2017 (you can see in 'lib' directory), (*2)

Installation with Nette

extensions:
    thePay: WebChemistry\ThePay\DI\ThePayExtension

Configuration with Nette

thePay:
    merchantId: 1
    accountId: 3
    password: myPassword

Configuration without Nette


$config = [ 'merchantId' => 100, 'accountId' => 100, 'password' => 'pswd', 'dataApiPassword' => 'apiPswd' ]; $thepay = new WebChemistry\ThePay\ThePay($config);

Display payment component

/** @var WebChemistry\ThePay\ThePay */
$thepay;

$sender = $thePay->createSender(199); // Price

$sender->setDescription('Super product'); // Description for easier identification in administration
$sender->setMerchantData('Customer id is 150.');
// or
$sender->setMerchantData([
    'customer' => 150
]);

echo $sender->render();

Receives payment

/** @var WebChemistry\ThePay\ThePay */
$thepay;

$receiver = $thepay->getReceiver();

if (!$receiver->verifySignature(FALSE)) {
    die('Bad request.');
}
if (!$receiver->isSuccess()) {
    die('Payment was not successful.');
}
// Get info from api
$remotePayment = $receiver->getRemotePayment();
if ($remotePayment) {
    $remotePayment->getValue(); // Price
}

Permanent payments

$payment = $thepay->createPermanent('merchantData', 'description', 'localhost/returnUrl.php');

$payment->getMethods(); // Array of methods with payment information

The Versions

18/07 2018
06/07 2016

1.0.0

1.0.0.0

  Sources   Download

The Requires

  • php >=5.5

 

The Development Requires