forked from LiveCarta/PayPal-PHP-SDK
Sample ResultPrinter Not to be Used
- Comment everywhere the ResultPrinter is used to not use outside sample
This commit is contained in:
@@ -21,13 +21,16 @@ try {
|
||||
if ($payoutItem->getTransactionStatus() == 'UNCLAIMED') {
|
||||
// Cancel the Payout Item
|
||||
$output = \PayPal\Api\PayoutItem::cancel($payoutItemId, $apiContext);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Cancel Unclaimed Payout Item", "PayoutItem", $output->getPayoutItemId(), null, $output);
|
||||
} else {
|
||||
// The item transaction status is not unclaimed. You can only cancel an unclaimed transaction.
|
||||
ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, new Exception("Payout Item Status is not UNCLAIMED"));
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, new Exception("Payout Item Status is not UNCLAIMED"));
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, $ex);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,10 +115,12 @@ $request = clone $payouts;
|
||||
try {
|
||||
$output = $payouts->create(null, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output);
|
||||
|
||||
return $output;
|
||||
|
||||
@@ -64,10 +64,12 @@ $request = clone $payouts;
|
||||
try {
|
||||
$output = $payouts->createSynchronous($apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $ex);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output);
|
||||
|
||||
return $output;
|
||||
|
||||
@@ -16,10 +16,12 @@ $payoutBatchId = $payoutBatch->getBatchHeader()->getPayoutBatchId();
|
||||
try {
|
||||
$output = \PayPal\Api\Payout::get($payoutBatchId, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $ex);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output);
|
||||
|
||||
return $output;
|
||||
|
||||
@@ -18,10 +18,12 @@ $payoutItemId = $payoutItem->getPayoutItemId();
|
||||
try {
|
||||
$output = \PayPal\Api\PayoutItem::get($payoutItemId, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $ex);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output);
|
||||
|
||||
return $output;
|
||||
|
||||
Reference in New Issue
Block a user