forked from LiveCarta/PayPal-PHP-SDK
Updated Sample Documentation
This commit is contained in:
@@ -14,13 +14,8 @@ API used: /v1/payments/sale/{sale-id}</p></div></div><div class="code"><div clas
|
||||
<span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="retrieve-the-sale-object">Retrieve the sale object</h3>
|
||||
<p>Pass the ID of the sale
|
||||
transaction from your payment resource.</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$sale</span> = Sale::get(<span class="hljs-variable">$saleId</span>, <span class="hljs-variable">$apiContext</span>);
|
||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError(<span class="hljs-string">"Look Up A Sale"</span>, <span class="hljs-string">"Sale"</span>, <span class="hljs-variable">$sale</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Look Up A Sale"</span>, <span class="hljs-string">"Sale"</span>, <span class="hljs-variable">$sale</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||
}
|
||||
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Look Up A Sale"</span>, <span class="hljs-string">"Sale"</span>, <span class="hljs-variable">$sale</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$sale</span>);
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult(<span class="hljs-string">"Look Up A Sale"</span>, <span class="hljs-string">"Sale"</span>, <span class="hljs-variable">$sale</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$sale</span>);
|
||||
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$sale</span>;</div></div></div></div></body></html>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$sale</span>;</div></div></div></div></body></html>
|
||||
Reference in New Issue
Block a user