Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/Message/RestPurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,33 @@ public function setDaysActive($value)
return $this->setParameter('days_active', $value);
}

/**
* Get seconds active.
*
* The number of seconds the payment link will be active for.
* When not specified the default will be 30 days (2592000 seconds).
*
* @return int|null
*/
public function getSecondsActive()
{
return $this->getParameter('seconds_active');
}

/**
* Set seconds active.
*
* The number of seconds the payment link will be active for.
* When not specified the default will be 30 days (2592000 seconds).
*
* @param $value
* @return \Omnipay\Common\Message\AbstractRequest
*/
public function setSecondsActive($value)
{
return $this->setParameter('seconds_active', $value);
}

/**
* Get close window.
*
Expand Down Expand Up @@ -529,6 +556,7 @@ public function getData()
'amount' => $this->getAmountInteger(),
'currency' => $this->getCurrency(),
'days_active' => $this->getDaysActive(),
'seconds_active' => $this->getSecondsActive(),
'description' => $this->getDescription(),
'gateway' => $this->getGateway(),
'google_analytics' => $this->getGoogleAnalyticsCode(),
Expand Down
2 changes: 2 additions & 0 deletions tests/Message/RestPurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ protected function setUp()
'return_url' => 'http://localhost/return',
'close_window' => false,
'days_active' => 3,
'seconds_active' => 100,
'send_mail' => true,
'gateway' => 'IDEAL',
'google_analytics_code' => '123456789',
Expand Down Expand Up @@ -84,6 +85,7 @@ public function testDataIntegrity()
$this->assertEquals('TEST-TRANS-1', $this->request->getTransactionId());
$this->assertEquals(10.00, $this->request->getAmount());
$this->assertEquals(3, $this->request->getDaysActive());
$this->assertEquals(100, $this->request->getSecondsActive());
$this->assertFalse($this->request->getCloseWindow());
$this->assertFalse($this->request->getManual());
$this->assertTrue($this->request->getSendMail());
Expand Down