From 531b70794592cfa086769c94e26f3ea64833304c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 2 Dec 2016 15:37:25 +0200 Subject: [PATCH] Support setting redirect URL for buy now button --- app/Http/Controllers/OnlinePaymentController.php | 3 ++- resources/lang/en/texts.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/OnlinePaymentController.php b/app/Http/Controllers/OnlinePaymentController.php index f30c47b870..61526a6163 100644 --- a/app/Http/Controllers/OnlinePaymentController.php +++ b/app/Http/Controllers/OnlinePaymentController.php @@ -162,7 +162,8 @@ class OnlinePaymentController extends BaseController private function completePurchase($invitation, $isOffsite = false) { if ($redirectUrl = session('redirect_url:' . $invitation->invitation_key)) { - return redirect()->to($redirectUrl . '?invoice_id=' . $invitation->invoice->public_id); + $separator = strpos($redirectUrl, '?') === false ? '?' : '&'; + return redirect()->to($redirectUrl . $separator . 'invoice_id=' . $invitation->invoice->public_id); } else { // Allow redirecting to iFrame for offsite payments return redirect()->to($invitation->getLink('view', ! $isOffsite)); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 850cd8d406..d60bf3466a 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2256,7 +2256,7 @@ $LANG = array( 'force_pdfjs_help' => 'Replace the built-in PDF viewer in :chrome_link and :firefox_link.
Enable this if your browser is automatically downloading the PDF.', 'force_pdfjs' => 'PDF Viewer', 'redirect_url' => 'Redirect URL', - 'redirect_url_help' => 'Optionally specify a URL to redirect to after a payment is made.', + 'redirect_url_help' => 'Optionally specify a URL to redirect to after a payment is made entered.', );