Skip to content

Commit

Permalink
Merge branch 'master' of github.com:daanrijpkema/bluem-php
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanRijpkema committed Jul 7, 2021
2 parents b648c12 + ebbc764 commit df20499
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/Bluem.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
if (!defined("BLUEM_STATIC_MERCHANT_ID")) {
define("BLUEM_STATIC_MERCHANT_ID", "0020009469");
}
if (!defined("BLUEM_LOCAL_DATE_FORMAT")) {
define("BLUEM_LOCAL_DATE_FORMAT", "Y-m-d\TH:i:s");
}

/**
* Bluem Integration main class
Expand Down Expand Up @@ -459,13 +462,15 @@ public function PerformRequest(BluemRequest $transaction_request)
// set this to true if you want more internal information when debugging or extending
$verbose = false;

// make sure the timezone is set correctly..
$now = Carbon::now()->timezone('Europe/Amsterdam');
$now = Carbon::now();

$xttrs_filename = $transaction_request->transaction_code . "-{$this->_config->senderID}-BSP1-" . $now->format('YmdHis') . "000.xml";

// conform Rfc1123 standard in GMT time
$xttrs_date = $now->toRfc7231String();
$rfc7231format = "D, d M Y H:i:s \G\M\T";
// Since v2.0.5 : use preset format instead of
// function to allow for Carbon 1.21 legacy compatibility
$xttrs_date = $now->format($rfc7231format);

$request_url = $transaction_request->HttpRequestUrl();

Expand Down
2 changes: 1 addition & 1 deletion src/Requests/BluemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct(\stdclass $config, string $entranceCode = "", string

$this->accessToken = $config->accessToken;

$this->createDateTime = Carbon::now()->timezone('Europe/Amsterdam')->toDateTimeLocalString() . ".000Z";
$this->createDateTime = Carbon::now()->timezone('Europe/Amsterdam')->format(BLUEM_LOCAL_DATE_FORMAT) . ".000Z";

/**
* unique identifier of payee for this transaction
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/PaymentBluemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function __construct(
}

if (is_null($dueDateTime)) {
$this->dueDateTime = Carbon::now()->addDays(1)->toDateTimeLocalString() . ".000Z";
$this->dueDateTime = Carbon::now()->addDays(1)->format(BLUEM_LOCAL_DATE_FORMAT) . ".000Z";
} else {
$this->dueDateTime = Carbon::parse($dueDateTime)->toDateTimeLocalString() . ".000Z";
$this->dueDateTime = Carbon::parse($dueDateTime)->format(BLUEM_LOCAL_DATE_FORMAT) . ".000Z";
}

$this->debtorReference = $debtorReference;
Expand Down

0 comments on commit df20499

Please sign in to comment.