Added Logo in Invoice Samples

- Improvement to Sample code demonstrating how to add logo URL to Invoice Item.
This commit is contained in:
Jay Patel
2015-02-25 11:11:10 -06:00
parent f4378f6920
commit 241d80cd17
3 changed files with 21 additions and 179 deletions

View File

@@ -10,6 +10,7 @@ an invoice.</p></div></div><div class="code"><div class="wrapper"><span class="h
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Currency</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">PaymentTerm</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">ShippingInfo</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">InvoiceAddress</span>;
<span class="hljs-variable">$invoice</span> = <span class="hljs-keyword">new</span> Invoice();</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="invoice-info">Invoice Info</h3>
<p>Fill in all the information that is
@@ -74,7 +75,7 @@ detailed breakdown of invoice</p></div></div><div class="code"><div class="wrapp
-&gt;setLastName(<span class="hljs-string">"Patient"</span>)
-&gt;setBusinessName(<span class="hljs-string">"Not applicable"</span>)
-&gt;setPhone(<span class="hljs-keyword">new</span> Phone())
-&gt;setAddress(<span class="hljs-keyword">new</span> Address());
-&gt;setAddress(<span class="hljs-keyword">new</span> InvoiceAddress());
<span class="hljs-variable">$invoice</span>-&gt;getShippingInfo()-&gt;getPhone()
-&gt;setCountryCode(<span class="hljs-string">"001"</span>)
@@ -85,7 +86,8 @@ detailed breakdown of invoice</p></div></div><div class="code"><div class="wrapp
-&gt;setCity(<span class="hljs-string">"Portland"</span>)
-&gt;setState(<span class="hljs-string">"OR"</span>)
-&gt;setPostalCode(<span class="hljs-string">"97217"</span>)
-&gt;setCountryCode(<span class="hljs-string">"US"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>For Sample Purposes Only.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$request</span> = <span class="hljs-keyword">clone</span> <span class="hljs-variable">$invoice</span>;
-&gt;setCountryCode(<span class="hljs-string">"US"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="logo">Logo</h3>
<p>You can set the logo in the invoice by providing the external URL pointing to a logo</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$invoice</span>-&gt;setLogoUrl(<span class="hljs-string">'https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg'</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>For Sample Purposes Only.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$request</span> = <span class="hljs-keyword">clone</span> <span class="hljs-variable">$invoice</span>;
<span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="create-invoice">Create Invoice</h3>
<p>Create an invoice by calling the invoice-&gt;create() method