- Added
_5048
substate
isProductionMode
is now deprecated and will be removedgatewayUrl
parameter is preferred way to set gateway urlSupercash
payment method is no longer supported by the payment gateways, relevant code marked as deprecated
- Dropped support for Guzzle 5 depedency
- Added Guzzle 7 support
isProductionMode
may now take anything that can be resolved as a boolean via filter_var ("yes", "true", true ...)
- Added EET Support
- Fix
GoPay\Definition\Payment\BankSwiftCode::KOMERCNI_BANKA
- Composer
autoload-dev
- Update badges in readme (#2)
- Add travis-ci
- Simplified token caching, based on python-sdk
TokenCache
handles only set/get token, noisExpired
method$client
is passed as first argument instead ofsetClient
methodgetAccessToken
can return null if token does not exist
<?php
use GoPay\Token\TokenCache;
use GoPay\Token\AccessToken;
class PrimitiveFileCache extends TokenCache
{
private $file;
public function setClient($client)
{
$this->file = __DIR__ . "/{$client}";
}
public function setAccessToken(AccessToken $t)
{
file_put_contents($this->file, serialize($t);
}
public function getAccessToken()
{
if (file_exists($this->file)) {
return unserialize(file_get_contents($this->file));
}
return $this->getExpiredToken();
}
}
<?php
use GoPay\Token\TokenCache;
use GoPay\Token\AccessToken;
class PrimitiveFileCache implements TokenCache
{
private $file;
private function setClient($client)
{
$this->file = __DIR__ . "/{$client}";
}
public function setAccessToken($client, AccessToken $t)
{
$this->setClient($client);
file_put_contents($this->file, serialize($t);
}
public function getAccessToken($client)
{
$this->setClient($client);
if (file_exists($this->file)) {
return unserialize(file_get_contents($this->file));
}
return null;
}
}
- Add phpunit's bootstrap (#1)
- Call every API method without validation
- Cache access token
- Log HTTP communication