Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Release 6.35.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngenicoEPayments committed Feb 3, 2023
1 parent ed9b6f7 commit 56ac228
Show file tree
Hide file tree
Showing 23 changed files with 119 additions and 66 deletions.
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/BodyObfuscator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct()
/**
* @param string $contentType
* @param string $body
* @return mixed
* @return string
*/
public function obfuscateBody($contentType, $body)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/Communicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ protected function getCommunicatorConfiguration()
}

/**
* @param CommunicatorConfiguration
* @param CommunicatorConfiguration $communicatorConfiguration
* @return Communicator
*/
public function setCommunicatorConfiguration(CommunicatorConfiguration $communicatorConfiguration)
Expand Down
52 changes: 23 additions & 29 deletions lib/Ingenico/Connect/Sdk/CommunicatorLoggerHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@ public function logRequest(
array $requestHeaders,
$requestBody = ''
) {
if ($communicatorLogger) {
$communicatorLogger->log(sprintf(
"Outgoing request to %s (requestId='%s')\n%s",
$this->getEndpoint($requestUri),
$requestId,
$this->getHttpObfuscator()->getRawObfuscatedRequest(
$requestMethod,
$this->getRelativeUriPathWithRequestParameters($requestUri),
$requestHeaders,
$requestBody
)
));
}
$communicatorLogger->log(sprintf(
"Outgoing request to %s (requestId='%s')\n%s",
$this->getEndpoint($requestUri),
$requestId,
$this->getHttpObfuscator()->getRawObfuscatedRequest(
$requestMethod,
$this->getRelativeUriPathWithRequestParameters($requestUri),
$requestHeaders,
$requestBody
)
));
}

/**
Expand All @@ -52,14 +50,12 @@ public function logRequest(
*/
public function logResponse(CommunicatorLogger $communicatorLogger, $requestId, $requestUri, ConnectionResponse $response)
{
if ($communicatorLogger) {
$communicatorLogger->log(sprintf(
"Incoming response from %s (requestId='%s')\n%s",
$this->getEndpoint($requestUri),
$requestId,
$this->getHttpObfuscator()->getRawObfuscatedResponse($response)
));
}
$communicatorLogger->log(sprintf(
"Incoming response from %s (requestId='%s')\n%s",
$this->getEndpoint($requestUri),
$requestId,
$this->getHttpObfuscator()->getRawObfuscatedResponse($response)
));
}

/**
Expand All @@ -70,13 +66,11 @@ public function logResponse(CommunicatorLogger $communicatorLogger, $requestId,
*/
public function logException(CommunicatorLogger $communicatorLogger, $requestId, $requestUri, Exception $exception)
{
if ($communicatorLogger) {
$communicatorLogger->logException(sprintf(
"Error occurred while executing request to %s (requestId='%s')",
$this->getEndpoint($requestUri),
$requestId
), $exception);
}
$communicatorLogger->logException(sprintf(
"Error occurred while executing request to %s (requestId='%s')",
$this->getEndpoint($requestUri),
$requestId
), $exception);
}

/** @return HttpObfuscator */
Expand Down Expand Up @@ -111,7 +105,7 @@ public function setHeaderObfuscator(HeaderObfuscator $headerObfuscator)
public function getEndpoint($requestUri)
{
$index = strpos($requestUri, '://');
if ($index != FALSE) {
if ($index !== FALSE) {
$index = strpos($requestUri, '/', $index + 3);
// $index === FALSE means there's no / after the host; there is no relative URI
return $index !== FALSE ? substr($requestUri, 0, $index) : $requestUri;
Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/DefaultConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private function executeCurlHandleShared($multiHandle, $curlHandle)
/**
* @param resource $curlHandle
* @param callable $responseHandler
* @return DefaultConnectionResponse|null
* @return ConnectionResponse|null
* @throws Exception
*/
private function executeCurlHandle($curlHandle, callable $responseHandler)
Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/DefaultConnectionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function getDispositionFilename($headers)
}
if (preg_match('/(?i)(?:^|;)\s*fileName\s*=\s*(.*?)\s*(?:;|$)/', $headerValue, $matches)) {
$filename = $matches[1];
return static::trimQuotes($filename);
return self::trimQuotes($filename);
}
return null;
}
Expand Down
5 changes: 1 addition & 4 deletions lib/Ingenico/Connect/Sdk/MultipartFormDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getFiles()

/**
* @param string $parameterName
* @param string value
* @param string $value
*/
public function addValue($parameterName, $value)
{
Expand All @@ -89,9 +89,6 @@ public function addFile($parameterName, UploadableFile $file)
if (is_null($parameterName) || strlen(trim($parameterName)) == 0) {
throw new UnexpectedValueException("boundary is required");
}
if (is_null($file)) {
throw new UnexpectedValueException("file is required");
}
if (array_key_exists($parameterName, $this->values) || array_key_exists($parameterName, $this->files)) {
throw new UnexpectedValueException('Duplicate parameter name: ' . $parameterName);
}
Expand Down
20 changes: 10 additions & 10 deletions lib/Ingenico/Connect/Sdk/ProxyConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
class ProxyConfiguration
{
/**
* @var string
* @var string|null
*/
protected $host = null;
/**
* @var null|string|int
* @var string|int|null
*/
protected $port = null;
/**
* @var null|string
* @var string|null
*/
protected $username = null;
/**
* @var null|string
* @var string|null
*/
protected $password = null;

/**
* @param $host
* @param null $port
* @param null $username
* @param null $password
* @param string $host
* @param string|int|null $port
* @param string|null $username
* @param string|null $password
*/
public function __construct($host, $port = null, $username = null, $password = null)
{
Expand All @@ -47,7 +47,7 @@ public function __construct($host, $port = null, $username = null, $password = n
public function getCurlProxy()
{
if (!is_null($this->host)) {
return $this->host . (is_null($this->port) ? '' : ':'. (string) $this->port);
return $this->host . (is_null($this->port) ? '' : ':'. $this->port);
}
return '';
}
Expand All @@ -58,7 +58,7 @@ public function getCurlProxy()
public function getCurlProxyUserPwd()
{
if (!is_null($this->host)) {
return ((string) $this->username) . (is_null($this->password) ? '' : ':'. (string) $this->password);
return ((string) $this->username) . (is_null($this->password) ? '' : ':'. $this->password);
}
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/RequestHeaderGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class RequestHeaderGenerator
{
const SDK_VERSION = '6.34.0';
const SDK_VERSION = '6.35.0';

const AUTHORIZATION_ID = 'GCS';

Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getCommunicator()
/**
* Returns the client headers with this resource.
*
* @return array
* @return string
*/
protected function getClientMetaInfo()
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/ResourceLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function log($message)
/** @inheritdoc */
public function logException($message, Exception $exception)
{
fwrite($this->resource, $this->getDatePrefix() . $message . PHP_EOL . (string) $exception . PHP_EOL);
fwrite($this->resource, $this->getDatePrefix() . $message . PHP_EOL . $exception . PHP_EOL);
}

/** @return string */
Expand Down
9 changes: 1 addition & 8 deletions lib/Ingenico/Connect/Sdk/ResponseExceptionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ class ResponseExceptionFactory
* @param $httpStatusCode
* @param DataObject $errorObject
* @param CallContext $callContext
* @return DeclinedPaymentException
* | DeclinedPayoutException
* | DeclinedRefundException
* | ValidationException
* | AuthorizationException
* | ReferenceException
* | GlobalCollectException
* | ApiException
* @return ResponseException
*/
public function createException(
$httpStatusCode,
Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function createResponse(
/**
* @param ConnectionResponse $response
* @param ResponseClassMap $responseClassMap
* @return DataObject
* @return DataObject|null
*/
protected function getResponseObject(
ConnectionResponse $response,
Expand Down
2 changes: 1 addition & 1 deletion lib/Ingenico/Connect/Sdk/SplFileObjectLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function log($message)
/** @inheritdoc */
public function logException($message, Exception $exception)
{
$this->splFileObject->fwrite($this->getDatePrefix() . $message . PHP_EOL . (string) $exception . PHP_EOL);
$this->splFileObject->fwrite($this->getDatePrefix() . $message . PHP_EOL . $exception . PHP_EOL);
}

/** @return string */
Expand Down
4 changes: 2 additions & 2 deletions lib/Ingenico/Connect/Sdk/Webhooks/InMemorySecretKeyStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*/
class InMemorySecretKeyStore implements SecretKeyStore
{
/** @var array[string]string */
/** @var array<string, string> */
private $secretKeys;

/**
* @param array[string]string $secretKeys
* @param array<string, string> $secretKeys
*/
public function __construct($secretKeys = array())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SecretKeyNotAvailableException extends SignatureValidationException
/**
* @param string $keyId
* @param string $message
* @param Exception @previous
* @param Exception $previous
*/
public function __construct($keyId, $message = null, $previous = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SignatureValidationException extends RuntimeException
{
/**
* @param string $message
* @param Exception @previous
* @param Exception $previous
*/
public function __construct($message = null, $previous = null)
{
Expand Down
16 changes: 16 additions & 0 deletions src/Ingenico/Connect/Sdk/Domain/Payout/CreatePayoutRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Ingenico\Connect\Sdk\Domain\Payout\Definitions\CardPayoutMethodSpecificInput;
use Ingenico\Connect\Sdk\Domain\Payout\Definitions\PayoutCustomer;
use Ingenico\Connect\Sdk\Domain\Payout\Definitions\PayoutDetails;
use Ingenico\Connect\Sdk\Domain\Payout\Definitions\PayoutMerchant;
use Ingenico\Connect\Sdk\Domain\Payout\Definitions\PayoutReferences;
use UnexpectedValueException;

Expand Down Expand Up @@ -55,6 +56,11 @@ class CreatePayoutRequest extends DataObject
*/
public $customer = null;

/**
* @var PayoutMerchant
*/
public $merchant = null;

/**
* @var string
* @deprecated Moved to BankTransferPayoutMethodSpecificInput
Expand Down Expand Up @@ -108,6 +114,9 @@ public function toObject()
if (!is_null($this->customer)) {
$object->customer = $this->customer->toObject();
}
if (!is_null($this->merchant)) {
$object->merchant = $this->merchant->toObject();
}
if (!is_null($this->payoutDate)) {
$object->payoutDate = $this->payoutDate;
}
Expand Down Expand Up @@ -176,6 +185,13 @@ public function fromObject($object)
$value = new PayoutCustomer();
$this->customer = $value->fromObject($object->customer);
}
if (property_exists($object, 'merchant')) {
if (!is_object($object->merchant)) {
throw new UnexpectedValueException('value \'' . print_r($object->merchant, true) . '\' is not an object');
}
$value = new PayoutMerchant();
$this->merchant = $value->fromObject($object->merchant);
}
if (property_exists($object, 'payoutDate')) {
$this->payoutDate = $object->payoutDate;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/*
* This class was auto-generated from the API references found at
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
*/
namespace Ingenico\Connect\Sdk\Domain\Payout\Definitions;

use Ingenico\Connect\Sdk\DataObject;
use UnexpectedValueException;

/**
* @package Ingenico\Connect\Sdk\Domain\Payout\Definitions
*/
class PayoutMerchant extends DataObject
{
/**
* @var string
*/
public $configurationId = null;

/**
* @return object
*/
public function toObject()
{
$object = parent::toObject();
if (!is_null($this->configurationId)) {
$object->configurationId = $this->configurationId;
}
return $object;
}

/**
* @param object $object
* @return $this
* @throws UnexpectedValueException
*/
public function fromObject($object)
{
parent::fromObject($object);
if (property_exists($object, 'configurationId')) {
$this->configurationId = $object->configurationId;
}
return $this;
}
}
Loading

0 comments on commit 56ac228

Please sign in to comment.