get() public static method

Lookup an invoice by its ID
public static get ( $invoiceNumber, $client = null ) : Recurly_Invoice
return Recurly_Invoice invoice
Exemplo n.º 1
0
 public function testMarkFailed()
 {
     // See the notes in testMarkSuccessful().
     $this->client->addResponse('PUT', 'https://api.recurly.com/v2/invoices/abcdef1234567890/mark_failed', 'invoices/mark_failed-200.xml');
     $invoice = Recurly_Invoice::get('abcdef1234567890', $this->client);
     $invoice->markFailed();
     $this->assertEquals($invoice->state, 'failed');
 }
Exemplo n.º 2
0
 public function testRefund()
 {
     $this->client->addResponse('POST', 'https://api.recurly.com/v2/invoices/1001/refund', 'invoices/refund-201.xml');
     $invoice = Recurly_Invoice::get('1001', $this->client);
     $line_items = $invoice->line_items;
     $adjustment_map = function ($line_item) {
         return $line_item->toRefundAttributes();
     };
     $adjustments = array_map($adjustment_map, $line_items);
     $refund_invoice = $invoice->refund($adjustments);
     $this->assertEquals($refund_invoice->subtotal_in_cents, -1000);
 }