Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 18 additions & 0 deletions lib/GoCardless/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

}

}