forked from LiveCarta/PayPal-PHP-SDK
Updated samples and its documentation
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user