Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
Tikkie API expects ISO-8601 Zulu
Browse files Browse the repository at this point in the history
  • Loading branch information
JochemKlingeler committed Jun 18, 2018
1 parent 6ea3a08 commit 719667a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/PHPTikkie.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace PHPTikkie;

use DateTime;
use DateTimeInterface;
use PHPTikkie\Entities\PaymentRequest;
use PHPTikkie\Entities\Platform;
Expand Down Expand Up @@ -64,11 +65,15 @@ public function paymentRequests(string $platformToken, string $userToken, int $o
$params = compact('offset', 'limit');

if ($fromDate) {
$params['fromDate'] = $fromDate->format('c');
$params['fromDate'] = (new DateTime())->setTimestamp($fromDate->getTimestamp())
->setTimezone('UTC')
->format('Y-m-d\TH:i:s\Z');
}

if ($toDate) {
$params['toDate'] = $toDate->format('c');
$params['toDate'] = (new DateTime())->setTimestamp($toDate->getTimestamp())
->setTimezone('UTC')
->format('Y-m-d\TH:i:s\Z');
}

$response = $this->environment->getRequest("/v1/tikkie/platforms/{$platformToken}/users/{$userToken}/paymentrequests", $params);
Expand Down

0 comments on commit 719667a

Please sign in to comment.