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:
@@ -83,16 +83,19 @@ try {
|
||||
$result = $createdPayment->update($patchRequest, $apiContext);
|
||||
|
||||
} catch (Exception $ex) {
|
||||
ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Update Payment", "PatchRequest", $payment->getId(), $patchRequest, null);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Update Payment", "PatchRequest", $payment->getId(), $patchRequest, null);
|
||||
|
||||
// ### Getting Updated Payment Object
|
||||
if ($result == true) {
|
||||
$result = Payment::get($createdPayment->getId(), $apiContext);
|
||||
ResultPrinter::printResult("Get Payment", "Payment", $result->getId(), null, $result);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Get Payment", "Payment", $result->getId(), null, $result);
|
||||
|
||||
|
||||
// ### Get redirect url
|
||||
@@ -106,7 +109,8 @@ foreach ($result->getLinks() as $link) {
|
||||
}
|
||||
}
|
||||
|
||||
ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $result);
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $result);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user