Skip to content

Commit

Permalink
Bugfix: Remove time from ExpiresAt value as it's not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
michielgerritsen committed Mar 25, 2024
1 parent 21cb2e1 commit 950549b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Service/Mollie/Order/Transaction/Expires.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function atDateForMethod(string $method = null, $storeId = null): string
$date = $this->timezone->scopeDate($storeId);
$date->add(new \DateInterval('P' . $days . 'D'));

return $date->format('Y-m-d H:i:s');
return $date->format('Y-m-d');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Test/Integration/Block/Form/PaymentlinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testReturnsTheCorrectDate()
$now = $this->objectManager->create(TimezoneInterface::class)->scopeDate(null);
$expected = $now->add(new \DateInterval('P10D'));

$this->assertEquals($expected->format('Y-m-d H:i:s'), $instance->getExpiresAt());
$this->assertEquals($expected->format('Y-m-d'), $instance->getExpiresAt());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Test/Integration/Model/Client/OrdersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function testStartTransactionIncludesTheExpiresAtParameter(
$now = $this->objectManager->create(TimezoneInterface::class)->scopeDate(null);
$expected = $now->add(new \DateInterval('P' . $days . 'D'));

$this->assertEquals($expected->format('Y-m-d H:i:s'), $orderData['expiresAt']);
$this->assertEquals($expected->format('Y-m-d'), $orderData['expiresAt']);

return true;
}))->willReturn($mollieOrderMock);
Expand Down
2 changes: 1 addition & 1 deletion Test/Integration/Service/Order/Transaction/ExpiresTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function testReturnsTheCorrectDate()
/** @var Expires $instance */
$instance = $this->objectManager->create(Expires::class);

$this->assertEquals($expected->format('Y-m-d H:i:s'), $instance->atDateForMethod('ideal'));
$this->assertEquals($expected->format('Y-m-d'), $instance->atDateForMethod('ideal'));
}

public function testIsAvailableWhenSetInTheRequest()
Expand Down

0 comments on commit 950549b

Please sign in to comment.