forked from LiveCarta/PayPal-PHP-SDK
Updates to Sample Code
- Updated UI Presentation on samples - Fixed Bugs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user