forked from LiveCarta/PayPal-PHP-SDK
Added Logo in Invoice Samples
- Improvement to Sample code demonstrating how to add logo URL to Invoice Item.
This commit is contained in:
@@ -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
|
||||
->setLastName(<span class="hljs-string">"Patient"</span>)
|
||||
->setBusinessName(<span class="hljs-string">"Not applicable"</span>)
|
||||
->setPhone(<span class="hljs-keyword">new</span> Phone())
|
||||
->setAddress(<span class="hljs-keyword">new</span> Address());
|
||||
->setAddress(<span class="hljs-keyword">new</span> InvoiceAddress());
|
||||
|
||||
<span class="hljs-variable">$invoice</span>->getShippingInfo()->getPhone()
|
||||
->setCountryCode(<span class="hljs-string">"001"</span>)
|
||||
@@ -85,7 +86,8 @@ detailed breakdown of invoice</p></div></div><div class="code"><div class="wrapp
|
||||
->setCity(<span class="hljs-string">"Portland"</span>)
|
||||
->setState(<span class="hljs-string">"OR"</span>)
|
||||
->setPostalCode(<span class="hljs-string">"97217"</span>)
|
||||
->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>;
|
||||
->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>->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->create() method
|
||||
|
||||
Reference in New Issue
Block a user