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);
}
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'); } }