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; }