Skip to content

Commit

Permalink
Fix issues in prod environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Kovačić committed May 10, 2023
1 parent da1c3ad commit 1fd0357
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Bornfight\ErsteBankClient\models\paramObjects\ApiUser;
use Bornfight\ErsteBankClient\models\paramObjects\SSLCertificates;
use DateTime;
use GuzzleHttp\Client;
use GuzzleHttp\RequestOptions;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -42,9 +43,6 @@ public function getConsent(): ResponseInterface
RequestOptions::HEADERS => [
'X-Request-ID' => Uuid::uuid4()->toString(),
'psu-ip-address' => '127.0.0.1',
'signature' => 'test',
'digest' => 'test',
'tpp-signature-certificate' => 'test',
'web-api-key' => $this->apiUser->getWebApiKey(),
],
RequestOptions::JSON => [
Expand All @@ -54,7 +52,7 @@ public function getConsent(): ResponseInterface
'transactions' => [],
],
'recurringIndicator' => false,
'validUntil' => '2030-06-30',
'validUntil' => (new DateTime())->modify('+85 days')->format('Y-m-d'),
'frequencyPerDay' => 4,
'combinedServiceIndicator' => false,
],
Expand Down Expand Up @@ -85,12 +83,11 @@ public function getTokenByRefreshToken(string $refreshToken): ResponseInterface
'client_id' => $this->apiUser->getClientId(),
'client_secret' => $this->apiUser->getClientSecret(),
'grant_type' => 'refresh_token',
'code_verifier' => 'loremipsum',
'refresh_token' => $refreshToken,
];

return $this->client->get(sprintf('%s/token', $this->tokenEndpoint), [
RequestOptions::QUERY => $queryParams,
return $this->client->post(sprintf('%s/token', $this->tokenEndpoint), [
RequestOptions::FORM_PARAMS => $queryParams,
]
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/TransactionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class TransactionType

public function __construct(object $data)
{
$this->setBooked($data->booked);
$this->setPending($data->pending);
$this->setBooked($data->booked ?? []);
$this->setPending($data->pending ?? []);
}

/**
Expand Down

0 comments on commit 1fd0357

Please sign in to comment.