Recurly_Invoice::previewPendingCharges PHP 메소드

previewPendingCharges() 공개 정적인 메소드

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

Usage Example

예제 #1
0
 public function testFailedPreviewPendingCharges()
 {
     $this->client->addResponse('POST', '/accounts/abcdef1234567890/invoices/preview', 'invoices/create-422.xml');
     try {
         $invoice = Recurly_Invoice::previewPendingCharges('abcdef1234567890', array(), $this->client);
         $this->fail("Expected Recurly_ValidationError");
     } catch (Recurly_ValidationError $e) {
         $this->assertEquals($e->errors[0]->symbol, 'will_not_invoice');
     }
 }