capture method // with a valid ApiContext (See bootstrap.php for more on `ApiContext`) try { // Create a new authorization to get authorization Id // createAuthorization defined in common.php $authId = createAuthorization($apiContext); $amt = new Amount(); $amt->setCurrency("USD") ->setTotal("1.00"); ### Capture $capture = new Capture(); $capture->setId($authId) ->setAmount($amt); // Lookup the authorization. $authorization = Authorization::get($authId, $apiContext); // Perform a capture $getCapture = $authorization->capture($capture, $apiContext); } catch (PayPal\Exception\PPConnectionException $ex) { echo "Exception: " . $ex->getMessage() . PHP_EOL; var_dump($ex->getData()); exit(1); } ?>
toJSON(128);?>Back