This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/sample/doc/invoice/ListInvoice.html
japatel 0cb302326a Enabled Payment Experience
- Updated Api to enabled Payment Experience
- Updated Tests and Samples
- Added Json Validator
- Ability for PPModel to return array of self objects
2014-10-13 12:00:31 -05:00

26 lines
2.9 KiB
HTML

<!DOCTYPE html><html lang="en"><head><title>invoice/ListInvoice</title></head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"><meta name="groc-relative-root" content="../"><meta name="groc-document-path" content="invoice/ListInvoice"><meta name="groc-project-path" content="invoice/ListInvoice.php"><link rel="stylesheet" type="text/css" media="all" href="../assets/style.css"><script type="text/javascript" src="../assets/behavior.js"></script><body><div id="meta"><div class="file-path">invoice/ListInvoice.php</div></div><div id="document"><div class="segment"><div class="code"><div class="wrapper"><span class="hljs-preprocessor">&lt;?php</span></div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h1 id="list-invoices-sample">List Invoices Sample</h1>
<p>This sample code demonstrate how you can get
all invoice from history.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">require</span> <span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">'/../bootstrap.php'</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Invoice</span>;
<span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="retrieve-invoices">Retrieve Invoices</h3>
<p>Retrieve the Invoice History object by calling the
static <code>get_all</code> method on the Invoice class.
Refer the method doc for valid values for keys
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::get_all(<span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (PayPal\<span class="hljs-keyword">Exception</span>\PPConnectionException <span class="hljs-variable">$ex</span>) {
<span class="hljs-keyword">echo</span> <span class="hljs-string">"Exception:"</span> . <span class="hljs-variable">$ex</span>-&gt;getMessage() . PHP_EOL;
var_dump(<span class="hljs-variable">$ex</span>-&gt;getData());
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
}
<span class="hljs-preprocessor">?&gt;</span>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Lookup invoice history&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;Got invoices &lt;/div&gt;
&lt;pre&gt;<span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-keyword">echo</span> <span class="hljs-variable">$invoices</span>-&gt;toJSON(JSON_PRETTY_PRINT); <span class="hljs-preprocessor">?&gt;</span>&lt;/pre&gt;
&lt;a href=<span class="hljs-string">'../index.html'</span>&gt;Back&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</div></div></div></div></body></html>