mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Updated to phantomjscloud v2 API
This commit is contained in:
parent
c6c9a34c04
commit
64fec3b502
@ -443,8 +443,7 @@ if (!defined('CONTACT_EMAIL')) {
|
||||
define('ZAPIER_URL', 'https://zapier.com/zapbook/invoice-ninja');
|
||||
define('OUTDATE_BROWSER_URL', 'http://browsehappy.com/');
|
||||
define('PDFMAKE_DOCS', 'http://pdfmake.org/playground.html');
|
||||
define('PHANTOMJS_CLOUD', 'http://api.phantomjscloud.com/single/browser/v1/');
|
||||
//define('PHANTOMJS_CLOUD', 'http://api.phantomjscloud.com/api/browser/v2/');
|
||||
define('PHANTOMJS_CLOUD', 'http://api.phantomjscloud.com/api/browser/v2/');
|
||||
define('PHP_DATE_FORMATS', 'http://php.net/manual/en/function.date.php');
|
||||
define('REFERRAL_PROGRAM_URL', 'https://www.invoiceninja.com/referral-program/');
|
||||
|
||||
@ -548,6 +547,7 @@ if (!defined('CONTACT_EMAIL')) {
|
||||
}
|
||||
|
||||
// Log all SQL queries to laravel.log
|
||||
/*
|
||||
if (Utils::isNinjaDev()) {
|
||||
Event::listen('illuminate.query', function($query, $bindings, $time, $name) {
|
||||
$data = compact('bindings', 'time', 'name');
|
||||
@ -568,10 +568,14 @@ if (Utils::isNinjaDev()) {
|
||||
Log::info($query, $data);
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
if (Auth::check() && Auth::user()->id === 1)
|
||||
{
|
||||
Auth::loginUsingId(1);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -613,19 +613,27 @@ class Invoice extends EntityModel implements BalanceAffecting
|
||||
$invitation = $this->invitations[0];
|
||||
$link = $invitation->getLink();
|
||||
$curl = curl_init();
|
||||
|
||||
$jsonEncodedData = json_encode([
|
||||
'targetUrl' => "{$link}?phantomjs=true",
|
||||
'requestType' => 'raw',
|
||||
'url' => "{$link}?phantomjs=true",
|
||||
'renderType' => 'html',
|
||||
'outputAsJson' => false,
|
||||
'renderSettings' => [
|
||||
'passThroughHeaders' => true,
|
||||
],
|
||||
'delayTime' => 1000,
|
||||
]);
|
||||
|
||||
$opts = [
|
||||
CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY'),
|
||||
CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY') . '/',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POST => 1,
|
||||
CURLOPT_POSTFIELDS => $jsonEncodedData,
|
||||
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Content-Length: '.strlen($jsonEncodedData)],
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Content-Type: application/json',
|
||||
'Content-Length: '.strlen($jsonEncodedData)
|
||||
],
|
||||
];
|
||||
|
||||
curl_setopt_array($curl, $opts);
|
||||
|
Loading…
x
Reference in New Issue
Block a user