From 1d2c5f5b59ea1f15366e90581fe8067e05010560 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 10 Jul 2017 11:07:52 +0300 Subject: [PATCH] Add secret to phantomjscloud link --- app/Models/Invoice.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 239745a275..b4dbbbf8fa 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -1147,17 +1147,18 @@ class Invoice extends EntityModel implements BalanceAffecting $invitation = $this->invitations[0]; $link = $invitation->getLink('view', true); $pdfString = false; + $phantomjsSecret = env('PHANTOMJS_SECRET'); try { if (env('PHANTOMJS_BIN_PATH')) { - $pdfString = CurlUtils::phantom('GET', $link . '?phantomjs=true&phantomjs_secret=' . env('PHANTOMJS_SECRET')); + $pdfString = CurlUtils::phantom('GET', $link . "?phantomjs=true&phantomjs_secret={$phantomjsSecret}"); } if (! $pdfString && ($key = env('PHANTOMJS_CLOUD_KEY'))) { if (Utils::isNinjaDev()) { $link = env('TEST_LINK'); } - $url = "http://api.phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$link}?phantomjs=true%22,renderType:%22html%22%7D"; + $url = "http://api.phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$link}?phantomjs=true&phantomjs_secret={$phantomjsSecret}%22,renderType:%22html%22%7D"; $pdfString = CurlUtils::get($url); }