-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PPL-170 , cancel invoice version 2 api added.
- Loading branch information
Showing
3 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use angelleye\PayPal\rest\invoice\InvoiceAPIv2; | ||
|
||
// Include required library files. | ||
require_once('../../../autoload.php'); | ||
require_once('../../../includes/config.php'); | ||
|
||
$configArray = array( | ||
'Sandbox' => $sandbox, | ||
'ClientID' => $rest_client_id, | ||
'ClientSecret' => $rest_client_secret, | ||
'LogResults' => $log_results, | ||
'LogPath' => $log_path, | ||
'LogLevel' => $log_level | ||
); | ||
$PayPal = new InvoiceAPIv2($configArray); | ||
|
||
$cancelNotification = array( | ||
'subject' => 'Past due', // Subject of the notification. | ||
'note' => 'Canceling invoice', // Note to the payer. | ||
'send_to_invoicer' => true, // Indicates whether to send a copy of the notification to the merchant. | ||
'send_to_recipient' => true, // Indicates whether to send a copy of the notification to the payer. | ||
'additional_recipients' => array(), // Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported. | ||
); | ||
|
||
$InvoiceID = 'INV2-YZZF-D7VN-P2YM-9ZH2'; // Required. Specify the ID of the invoice to cancel. | ||
|
||
$returnArray = $PayPal->CancelInvoice($cancelNotification,$InvoiceID); | ||
echo "<pre>"; | ||
print_r($returnArray); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters