setId($createProfileResponse->getId()); try { // Execute the delete method $webProfile->delete($apiContext); } catch (\Exception $ex) { echo "Exception: " . $ex->getMessage() . PHP_EOL; if (is_a($ex, '\PayPal\Exception\PPConnectionException')) { /** @var $ex \PayPal\Exception\PPConnectionException */ var_dump($ex->getData()); } exit(1); } print_result("Deleted Web Profile", "Web Profile", $createProfileResponse->getId());