Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for push notifications #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: php

dist: precise

php:
- 5.3
- 5.4
Expand Down
47 changes: 47 additions & 0 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,51 @@ public function setErrorUrl($value)
return $this->setParameter('errorUrl', $value);
}

/**
* returns the push URL
*
* @return string pushUrl
*/
public function getPushUrl()
{
return $this->getParameter('pushUrl');
}

/**
* sets the push URL which is used by buckaroo when
* the payment results is sent via push
*
* @param $value
*
* @return \Omnipay\Common\Message\AbstractRequest
*/
public function setPushUrl($value)
{
return $this->setParameter('pushUrl', $value);
}

/**
* returns the push failure URL
*
* @return string pushfailureUrl
*/
public function getPushFailureUrl()
{
return $this->getParameter('pushfailureUrl');
}

/**
* sets the push failure URL which is used by buckaroo when
* the payment error results is sent via push
*
* @param $value
*
* @return \Omnipay\Common\Message\AbstractRequest
*/
public function setPushFailureUrl($value)
{
return $this->setParameter('pushfailureUrl', $value);
}

public function getData()
{
Expand All @@ -100,6 +145,8 @@ public function getData()
$data['Brq_returnreject'] = $this->getRejectUrl();
$data['Brq_returnerror'] = $this->getErrorUrl();
$data['Brq_culture'] = $this->getCulture();
$data['Brq_push'] = $this->getPushUrl();
$data['Brq_pushfailure'] = $this->getPushFailureUrl();

return $data;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/Message/AbstractRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public function testGetData()
'errorUrl' => 'https://www.example.com/error',
'rejectUrl' => 'https://www.example.com/reject',
'culture' => 'nl-NL',
'pushUrl' => 'https://www.example.com/push',
'pushfailureUrl' => 'https://www.example.com/pushfailure',
));

$data = $this->request->getData();
Expand All @@ -47,6 +49,8 @@ public function testGetData()
$this->assertSame('https://www.example.com/error', $data['Brq_returnerror']);
$this->assertSame('https://www.example.com/reject', $data['Brq_returnreject']);
$this->assertSame('nl-NL', $data['Brq_culture']);
$this->assertSame('https://www.example.com/push', $data['Brq_push']);
$this->assertSame('https://www.example.com/pushfailure', $data['Brq_pushfailure']);
}

public function testGenerateSignature()
Expand Down