From ef33cc41fabeccc18c660cb658b5082c35f28152 Mon Sep 17 00:00:00 2001 From: Cristian Nicolescu Date: Thu, 17 Oct 2019 16:11:27 +0300 Subject: [PATCH] added flag for not sending reponse automatically --- src/MobilpayGateway.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/MobilpayGateway.php b/src/MobilpayGateway.php index 782dcb1..570b817 100644 --- a/src/MobilpayGateway.php +++ b/src/MobilpayGateway.php @@ -30,13 +30,16 @@ public function purchase($autoRedirect = true) return $response; } - public function response() + public function response($autoSendResponse = true) { $gateway = Omnipay::create('MobilPay'); $gateway->setPrivateKey(config('mobilpay.private_key_path')); $response = $gateway->completePurchase($_POST)->send(); - $response->sendResponse(); + + if ($autoSendResponse) { + $response->sendResponse(); + } return $response; }