Recurly_Invoice::invoicePendingCharges PHP Method

invoicePendingCharges() public static method

Creates an invoice for an account using its pending charges
public static invoicePendingCharges ( $accountCode, $attributes = [], $client = null ) : Recurly_Invoice
return Recurly_Invoice invoice on success
    public static function invoicePendingCharges($accountCode, $attributes = array(), $client = null)
    {
        $uri = Recurly_Client::PATH_ACCOUNTS . '/' . rawurlencode($accountCode) . Recurly_Client::PATH_INVOICES;
        $invoice = new self();
        return self::_post($uri, $invoice->setValues($attributes)->xml(), $client);
    }

Usage Example

Exemplo n.º 1
0
 public function testFailedInvoicePendingCharges()
 {
     $this->client->addResponse('POST', '/accounts/abcdef1234567890/invoices', 'invoices/create-422.xml');
     try {
         $invoice = Recurly_Invoice::invoicePendingCharges('abcdef1234567890', $this->client);
         $this->fail("Expected Recurly_ValidationError");
     } catch (Recurly_ValidationError $e) {
         $this->assertEquals($e->errors[0]->symbol, 'will_not_invoice');
     }
 }
All Usage Examples Of Recurly_Invoice::invoicePendingCharges