diff --git a/src/Api/Refund/Info.php b/src/Api/Refund/Info.php
new file mode 100644
index 00000000..5286e3cd
--- /dev/null
+++ b/src/Api/Refund/Info.php
@@ -0,0 +1,65 @@
+
+ *
+ * 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 .
+ */
+
+namespace Paynl\Api\Refund;
+
+use Paynl\Error;
+
+/**
+ * Description of Info
+ *
+ * @author Andy Pieters
+ */
+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');
+ }
+}
\ No newline at end of file
diff --git a/src/Refund.php b/src/Refund.php
index 5b7ba4fd..397c1a99 100644
--- a/src/Refund.php
+++ b/src/Refund.php
@@ -94,4 +94,22 @@ public static function add(array $options = array())
return new Result\Add($result);
}
+
+ /**
+ * Get the refund
+ *
+ * @param string $refundId
+ *
+ * @return Result\Refund
+ */
+ public static function get($refundId)
+ {
+ $api = new Api\Info();
+ $api->setRefundId($refundId);
+ $result = $api->doRequest();
+
+ $result['refundId'] = $refundId;
+
+ return new Result\Refund($result);
+ }
}
\ No newline at end of file
diff --git a/src/Result/Refund/Refund.php b/src/Result/Refund/Refund.php
new file mode 100644
index 00000000..8901ecbb
--- /dev/null
+++ b/src/Result/Refund/Refund.php
@@ -0,0 +1,38 @@
+
+ *
+ * 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 .
+ */
+
+namespace Paynl\Result\Refund;
+
+use Paynl\Error\Error;
+use Paynl\Result\Result;
+
+/**
+ * Description of Refund
+ *
+ * @author Andy Pieters
+ */
+class Refund extends Result
+{
+ /**
+ * @return string The Refund id
+ */
+ public function getId()
+ {
+ return $this->data['refundId'];
+ }
+}
diff --git a/src/Result/Result.php b/src/Result/Result.php
index fc4365e6..b2e4b818 100644
--- a/src/Result/Result.php
+++ b/src/Result/Result.php
@@ -30,7 +30,22 @@ class Result
public function __construct($data)
{
$this->data = $data;
- }
+ }
+
+ public function isRefunded()
+ {
+ return $this->data['refund']['statusName'] == 'Verwerkt';
+ }
+
+ public function getRequest()
+ {
+ return $this->data['request'];
+ }
+
+ public function getRefund()
+ {
+ return $this->data['refund'];
+ }
/**
* Get the complete result as an array