body = self::buildRequestBody(); $client = PayPalClient::client(); $response = $client->execute($request); if ($debug) { print "Status Code: {$response->statusCode}\n"; print "Status: {$response->result->status}\n"; print "Capture ID: {$response->result->id}\n"; print "Links:\n"; foreach($response->result->links as $link) { print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; } // To toggle printing the whole response body comment/uncomment below line echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; } return $response; } } /** * Driver function for invoking the capture flow. */ if (!count(debug_backtrace())) { CaptureOrder::captureOrder('18A38324BV5456924', true); }