dev-php56
dev-php56 https://github.com/newPOPE/webpay-phpGP Webpay API Wrapper
MIT
The Requires
- php 5.*
- ext-openssl *
The Development Requires
by Adam Štipák
php webpay
GP Webpay API Wrapper
Full featured PHP SDK for GP Webpay payments., (*2)
The best way to install GP Webpay PHP SDK is using Composer:, (*3)
$ composer require vitexus/webpay-php5 dev-php56 ## Setup ```php $signer = new \AdamStipak\Webpay\Signer( $privateKeyFilepath, // Path of private key. $privateKeyPassword, // Password for private key. $publicKeyFilepath // Path of public key. ); $api = new \AdamStipak\Webpay\Api( $merchantNumber, // Merchant number. $webpayUrl, // URL of webpay. $signer // instance of \AdamStipak\Webpay\Signer. );
```php use \AdamStipak\Webpay\PaymentRequest;, (*4)
$request = new PaymentRequest(...);, (*5)
$url = $api->createPaymentRequestUrl($request); // $api instance of \AdamStipak\Webpay\Api, (*6)
// use $url as you want. In most cases for redirecting to GP Webpay., (*7)
```, (*8)
use \AdamStipak\Webpay\PaymentResponse; use \AdamStipak\Webpay\Exception; $response = new PaymentResponse(...); // fill response with response parameters (from request). try { $api->verifyPaymentResponse($response); } catch (PaymentResponseException $e) { // PaymentResponseException has $prCode, $srCode for properties for logging GP Webpay response error codes. } catch (Exception $e) { // Digest is not correct. }
GP Webpay PHP SDK is developed in Docker container via docker-compose
command., (*9)
Example:, (*10)
$ docker-compose run --rm default install # install deps via composer $ docker-compose run --rm default # runs tests in container
Attach to container:, (*11)
$ docker-compose run --rm default bash # runs bash in container and attach tty
GP Webpay API Wrapper
MIT
php webpay