Updates to Sample Code

- Updated UI Presentation on samples
- Fixed Bugs
This commit is contained in:
japatel
2014-11-02 17:06:58 -06:00
parent 4d481ad104
commit 3c02790138
97 changed files with 904 additions and 1249 deletions

View File

@@ -37,9 +37,8 @@ try {
// notification object
// (See bootstrap.php for more on `ApiContext`)
$cancelStatus = $invoice->cancel($notify, $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
} catch (Exception $ex) {
ResultPrinter::printError("Cancel Invoice", "Invoice", null, $notify, $ex);
exit(1);
}

View File

@@ -101,9 +101,8 @@ try {
// Create an invoice by calling the invoice->create() method
// with a valid ApiContext (See bootstrap.php for more on `ApiContext`)
$invoice->create($apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
} catch (Exception $ex) {
ResultPrinter::printError("Invoice Creation", "Invoice", null, $request, $ex);
exit(1);
}

View File

@@ -17,9 +17,8 @@ $invoiceId = "INV2-W4LC-6QS9-JZ62-VE4P";
// (See bootstrap.php for more on `ApiContext`)
try {
$invoice = Invoice::get($invoiceId, $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception:" . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
} catch (Exception $ex) {
ResultPrinter::printError("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $ex);
exit(1);
}

View File

@@ -14,9 +14,8 @@ try {
// Refer the method doc for valid values for keys
// (See bootstrap.php for more on `ApiContext`)
$invoices = Invoice::get_all($apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception:" . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
} catch (Exception $ex) {
ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex);
exit(1);
}
ResultPrinter::printResult("Lookup Invoice History", "Invoice", null, null, $invoices);

View File

@@ -35,9 +35,8 @@ try {
// notification object
// (See bootstrap.php for more on `ApiContext`)
$remindStatus = $invoice->remind($notify, $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
} catch (Exception $ex) {
ResultPrinter::printError("Remind Invoice", "Invoice", null, $notify, $ex);
exit(1);
}

View File

@@ -21,9 +21,8 @@ try {
// Send a legitimate invoice to the payer
// with a valid ApiContext (See bootstrap.php for more on `ApiContext`)
$sendStatus = $invoice->send($apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
} catch (Exception $ex) {
ResultPrinter::printResult("Send Invoice", "Invoice", null, null, $ex);
exit(1);
}