Skip to content

Commit

Permalink
Run an outstanding invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
marcguyer committed Nov 6, 2012
1 parent 3fb4f3d commit 984ff31
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,31 @@ public function newOneTimeInvoice($code, $id = null, array $data) {
);
}

/**
* Run an outstanding invoice
*
* An outstanding invoice might be one that hasn't been transacted yet or one that has been attempted unsucessfully.
*
* @link https://cheddargetter.com/developers#run-invoice
* @param string $code Your code for the customer
* @param string|null $id CG id for the customer
* @param array $data [ccCardCode] (optional) {@link https://cheddargetter.com/developers#run-invoice}
* @return CheddarGetter_Response
* @throws CheddarGetter_Response_Exception
*/
public function runOutstandingInvoice($code, $id = null, array $data = null) {
$this->_requireIdentifier($code, $id);
if (!$data) {
$data['bogus'] = 'make this a post';
}
return new CheddarGetter_Response(
$this->request(
'/customers/run-outstanding/' . (($id) ? 'id/'.$id : 'code/'.urlencode($code)),
$data
)
);
}

/**
* Get promotions
*
Expand Down
2 changes: 1 addition & 1 deletion Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public function getCustomerLastBilledInvoice($code = null) {
}

/**
* Get an array representation of a single customer's outstanding invoices
* Get an array representation of a single customer's invoices
*
* @param $code string your code for the customer - required if more than one customer is in the response
* @throws CheddarGetter_Response_Exception if the response type is incompatible or if a $code is not provided and the response contains more than one customer
Expand Down

0 comments on commit 984ff31

Please sign in to comment.