vtcpay / soap-client
A PHP client for the Vtcpay SOAP API
Installs: 1 239
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 1
Requires
- psr/log: *
- vhtvn/vht-common: dev-master
Suggests
- monolog/monolog: For logging transactions
This package is not auto-updated.
Last update: 2024-12-17 19:47:58 UTC
README
A PHP client for the VtcPay SOAP API
Introduction
Features
This library's features include the following.
- Added an EventDispatcher to your Soap client. It will trigger events at all important phases of the SOAP call
- Easily extensible through events: add custom logging, caching, error handling etc
- Completely tested
Installation
This library is available on Packagist. The recommended way to install this library is through Composer:
$ php composer.phar require vtcpay/soap-client dev-master
Usage
The client
First construct a client using the builder:
$builder = new \Vtcpay\SoapClient\ClientBuilder( '/path/to/your/vtcpay/wsdl/sandbox.enterprise.wsdl.xml' ); $client = $builder->build();
Logging
To enable logging for the client, call withLog()
on the builder. For instance when using Monolog:
$log = new \Monolog\Logger('vtcpay'); $log->pushHandler(new \Monolog\Handler\StreamHandler('/path/to/your.log')); $builder = new \Vtcpay\SoapClient\ClientBuilder( '/path/to/your/vtcpay/wsdl/sandbox.enterprise.wsdl.xml' ); $client = $builder->withLog($log) ->build();
All requests to the VnPay API, as well as the responses and any errors that it returns, will now be logged.