Updated samples and its documentation

This commit is contained in:
brluk and japatel
2017-10-24 12:05:49 -05:00
parent ddc8b6d482
commit 0303e2c0c9
98 changed files with 3063 additions and 1068 deletions

View File

@@ -8,13 +8,12 @@
// payments list.
// API used: GET /v1/payments/payments
$createdPayment = require __DIR__ . '/CreatePaymentUsingPayPal.php';
/** @var Payment $createdPayment */
use PayPal\Api\Payment;
// Replace $paymentId with any static Id you might already have.
$paymentId = "<your paymentid here>";
// ### Retrieve payment
// Retrieve the payment object by calling the
// static `get` method
@@ -22,7 +21,7 @@ $paymentId = "<your paymentid here>";
// Payment ID
// (See bootstrap.php for more on `ApiContext`)
try {
$payment = Payment::get($paymentId, $apiContext);
$payment = Payment::get($createdPayment->getId(), $apiContext);
} catch (Exception $ex) {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Get Payment", "Payment", null, null, $ex);