forked from LiveCarta/PayPal-PHP-SDK
Add samples for Invoice Template API
This commit is contained in:
18
sample/invoice-templates/GetAllInvoiceTemplates.php
Normal file
18
sample/invoice-templates/GetAllInvoiceTemplates.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use PayPal\Api\Templates;
|
||||
|
||||
require 'CreateInvoiceTemplate.php';
|
||||
|
||||
try {
|
||||
$templates = Templates::getAll(array("fields" => "all"), $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Get all Templates", "Templates", null, null, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Get all Templates", "Templates", null, null, $templates);
|
||||
|
||||
return $templates;
|
||||
Reference in New Issue
Block a user