Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Run an outstanding invoice

  • Loading branch information...
commit 984ff31bb7280a9bdf19671cad097275acb0877c 1 parent 3fb4f3d
Marc Guyer authored
Showing with 26 additions and 1 deletion.
  1. +25 −0 Client.php
  2. +1 −1  Response.php
25 Client.php
View
@@ -667,6 +667,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
*
* Get all promotions in the product.
2  Response.php
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.