forked from LiveCarta/PayPal-PHP-SDK
Updated Invoice Object to retrieve payments and refunds
- getPaymentDetails is now getPayments - getRefundDetails is now getRefunds - Updated Sample to Get Invoice at the end of each operation - Updated Tests
This commit is contained in:
@@ -36,4 +36,19 @@ try {
|
||||
|
||||
ResultPrinter::printResult("Payment for Invoice", "Invoice", $invoice->getId(), $record, null);
|
||||
|
||||
// ### Retrieve Invoice
|
||||
// Retrieve the invoice object by calling the
|
||||
// static `get` method
|
||||
// on the Invoice class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
try {
|
||||
$invoice = Invoice::get($invoice->getId(), $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice);
|
||||
|
||||
return $invoice;
|
||||
|
||||
@@ -35,4 +35,19 @@ try {
|
||||
|
||||
ResultPrinter::printResult("Refund for Invoice", "Invoice", $invoice->getId(), $refund, null);
|
||||
|
||||
// ### Retrieve Invoice
|
||||
// Retrieve the invoice object by calling the
|
||||
// static `get` method
|
||||
// on the Invoice class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
try {
|
||||
$invoice = Invoice::get($invoice->getId(), $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice);
|
||||
|
||||
return $invoice;
|
||||
|
||||
@@ -36,3 +36,19 @@ try {
|
||||
|
||||
ResultPrinter::printResult("Remind Invoice", "Invoice", null, $notify, null);
|
||||
|
||||
// ### Retrieve Invoice
|
||||
// Retrieve the invoice object by calling the
|
||||
// static `get` method
|
||||
// on the Invoice class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
try {
|
||||
$invoice = Invoice::get($invoice->getId(), $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice);
|
||||
|
||||
return $invoice;
|
||||
|
||||
@@ -22,4 +22,19 @@ try {
|
||||
|
||||
ResultPrinter::printResult("Send Invoice", "Invoice", $invoice->getId(), null, null);
|
||||
|
||||
// ### Retrieve Invoice
|
||||
// Retrieve the invoice object by calling the
|
||||
// static `get` method
|
||||
// on the Invoice class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
try {
|
||||
$invoice = Invoice::get($invoice->getId(), $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice);
|
||||
|
||||
return $invoice;
|
||||
|
||||
@@ -35,4 +35,19 @@ try {
|
||||
|
||||
ResultPrinter::printResult("Invoice Updated", "Invoice", $invoice->getId(), $request, $invoice);
|
||||
|
||||
// ### Retrieve Invoice
|
||||
// Retrieve the invoice object by calling the
|
||||
// static `get` method
|
||||
// on the Invoice class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
try {
|
||||
$invoice = Invoice::get($invoice->getId(), $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice);
|
||||
|
||||
return $invoice;
|
||||
|
||||
Reference in New Issue
Block a user