diff --git a/CHANGELOG.md b/CHANGELOG.md index bb97d6d..fa5111a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.3 - April 24, 2014 + +- Adds support for refunding a bill via the API + ## 0.4.2 - January 15, 2014 - Adds support for charge_customer_at and cancelling payments diff --git a/lib/GoCardless/Bill.php b/lib/GoCardless/Bill.php index 6a324fa..544d018 100644 --- a/lib/GoCardless/Bill.php +++ b/lib/GoCardless/Bill.php @@ -110,4 +110,22 @@ public function cancel() { } + /** + * Refund a bill in the API + * + * Please note that the ability to refund bills via the API is + * disabled by default. Please contact help@gocardless.com if you + * have put through greater than 50 bills and require access to + * the refund API endpoint. + * + * @return object The result of the refund query + */ + public function refund() { + + $endpoint = self::$endpoint . '/' . $this->id . '/refund'; + + return new self($this->client, $this->client->request('post', $endpoint)); + + } + }