forked from LiveCarta/PayPal-PHP-SDK
Update Invoicing Samples
This commit is contained in:
@@ -4,19 +4,13 @@
|
||||
// This sample code demonstrate how you can cancel
|
||||
// an invoice.
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
/** @var Invoice $invoice */
|
||||
$invoice = require 'SendInvoice.php';
|
||||
|
||||
use PayPal\Api\Invoice;
|
||||
use PayPal\Api\CancelNotification;
|
||||
|
||||
try {
|
||||
// ### Retrieve Invoice
|
||||
// Retrieve the invoice object by calling the
|
||||
// static `get` method
|
||||
// on the Payment class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
$invoice = Invoice::get("INV2-CJL7-PF4G-BLQF-5FWG", $apiContext);
|
||||
|
||||
// ### Cancel Notification Object
|
||||
// This would send a notification to both merchant as well
|
||||
|
||||
@@ -108,3 +108,4 @@ try {
|
||||
|
||||
ResultPrinter::printResult("Invoice Creation", "Invoice", $invoice->getId(), $request, $invoice);
|
||||
|
||||
return $invoice;
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
// This sample code demonstrate how you can retrieve
|
||||
// an invoice.
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
/** @var Invoice $invoice */
|
||||
$invoice = require 'CreateInvoice.php';
|
||||
use PayPal\Api\Invoice;
|
||||
|
||||
$invoiceId = "INV2-W4LC-6QS9-JZ62-VE4P";
|
||||
$invoiceId = $invoice->getId();
|
||||
|
||||
// ### Retrieve Invoice
|
||||
// Retrieve the invoice object by calling the
|
||||
@@ -23,3 +24,5 @@ try {
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $invoice);
|
||||
|
||||
return $invoice;
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
// This sample code demonstrate how you can get
|
||||
// all invoice from history.
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
/** @var Invoice $invoice */
|
||||
$invoice = require 'CreateInvoice.php';
|
||||
use PayPal\Api\Invoice;
|
||||
|
||||
try {
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
// This sample code demonstrate how you can remind
|
||||
// an invoice to the payer
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
/** @var Invoice $invoice */
|
||||
$invoice = require 'SendInvoice.php';
|
||||
|
||||
use PayPal\Api\Invoice;
|
||||
use PayPal\Api\Notification;
|
||||
@@ -16,7 +17,7 @@ try {
|
||||
// on the Invoice class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
$invoice = Invoice::get("INV2-W4LC-6QS9-JZ62-VE4P", $apiContext);
|
||||
$invoice = Invoice::get($invoice->getId(), $apiContext);
|
||||
|
||||
// ### Notification Object
|
||||
// This would send a notification to both merchant as well
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
// This sample code demonstrate how you can send
|
||||
// a legitimate invoice to the payer
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
/** @var Invoice $invoice */
|
||||
$invoice = require 'CreateInvoice.php';
|
||||
|
||||
use PayPal\Api\Invoice;
|
||||
|
||||
@@ -15,7 +16,7 @@ try {
|
||||
// on the Invoice class by passing a valid
|
||||
// Invoice ID
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
$invoice = Invoice::get("INV2-W4LC-6QS9-JZ62-VE4P", $apiContext);
|
||||
$invoice = Invoice::get($invoice->getId(), $apiContext);
|
||||
|
||||
// ### Send Invoice
|
||||
// Send a legitimate invoice to the payer
|
||||
@@ -27,3 +28,5 @@ try {
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Send Invoice", "Invoice", $invoice->getId(), null, null);
|
||||
|
||||
return $invoice;
|
||||
|
||||
Reference in New Issue
Block a user