-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from marcelschoolenberg/add_refund-info
add get refund/info function to api
- Loading branch information
Showing
4 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
/* | ||
* Copyright (C) 2015 Andy Pieters <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Paynl\Api\Refund; | ||
|
||
use Paynl\Error; | ||
|
||
/** | ||
* Description of Info | ||
* | ||
* @author Andy Pieters <[email protected]> | ||
*/ | ||
class Info extends Refund | ||
{ | ||
protected $apiTokenRequired = true; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $refundId; | ||
/** | ||
* Set the refundId | ||
* | ||
* @param string $refundId | ||
*/ | ||
public function setRefundId($refundId){ | ||
$this->refundId = $refundId; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
* @throws Error\Required RefundId is required | ||
*/ | ||
protected function getData() { | ||
if(empty($this->refundId)){ | ||
throw new Error\Required('RefundId required'); | ||
} | ||
|
||
$this->data['refundId'] = $this->refundId; | ||
|
||
return parent::getData(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function doRequest($endpoint = null, $version = null) { | ||
return parent::doRequest('refund/info'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/* | ||
* Copyright (C) 2015 Andy Pieters <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Paynl\Result\Refund; | ||
|
||
use Paynl\Error\Error; | ||
use Paynl\Result\Result; | ||
|
||
/** | ||
* Description of Refund | ||
* | ||
* @author Andy Pieters <[email protected]> | ||
*/ | ||
class Refund extends Result | ||
{ | ||
/** | ||
* @return string The Refund id | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->data['refundId']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters