2017 © Pedro Peláez
 

library thepay-client

Client for thepay payment gate.

image

novotnyj/thepay-client

Client for thepay payment gate.

  • Monday, February 6, 2017
  • by novotnyj
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Thepay Client

CircleCI, (*1)

Unofficial client for ThePay payment gate., (*2)

Instalation

Add following to your config:, (*3)

extensions:
    thepayClient: NovotnyJ\ThepayClient\DI\ThepayClientExtension

thepayClient:
    merchantId: 1
    accountId: 1
    secret: 'xxx'
    apiKey: 'xxx'
    demo: false

Create payment

Create new payment:, (*4)

$payment = new PaymentRequest($method->getId(), 10.00, 'http://my-super-eshop.com/thepay');
$payment->setMerchantData('test data');
$payment->setDescription('test description');
$payment->setBackToEshopUrl('http://my-super-shop.com/');

$url = $this->thepayClient->getPaymentUrl($payment);

Now redirect your customer to the payment gate on $url., (*5)

Process payment response

$get = $this->getParameters();
$response = new PaymentResponse($get);

if ($response->isPaid()) {
    ... 
} 

if ($response->isUnderPaid()) {
    $paymentInfo = $this->thepayClient->getPaymentInfo($response->getPaymentId());
    $paid = $paymentInfo->getReceivedValue();
}

if ($response->isCancelled()) {
    ...
}

if ($response->isError()) {
    ...
}

Available payment methods

To get available payment methods:, (*6)

$methods = $this->thepayClient->getPaymentMethods();

The Versions

06/02 2017

dev-master

9999999-dev

Client for thepay payment gate.

  Sources   Download

The Requires

 

The Development Requires

by Jan Novotny