2020-10-26 11:02:23 +01:00
|
|
|
<?php
|
2023-02-09 04:06:41 +01:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2024-04-12 06:15:41 +02:00
|
|
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
2023-02-09 04:06:41 +01:00
|
|
|
*
|
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
|
|
*/
|
|
|
|
|
2020-10-26 11:02:23 +01:00
|
|
|
namespace App\Exceptions;
|
|
|
|
|
|
|
|
use Exception;
|
|
|
|
|
|
|
|
class PaymentFailed extends Exception
|
|
|
|
{
|
|
|
|
public function report()
|
|
|
|
{
|
|
|
|
// ..
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render($request)
|
|
|
|
{
|
2023-02-16 02:36:09 +01:00
|
|
|
if (auth()->guard('contact')->user() || ($request->has('cko-session-id') && $request->query('cko-session-id'))) {
|
2020-12-07 14:49:11 +01:00
|
|
|
return render('gateways.unsuccessful', [
|
|
|
|
'message' => $this->getMessage(),
|
|
|
|
'code' => $this->getCode(),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return response([
|
2020-10-26 11:02:23 +01:00
|
|
|
'message' => $this->getMessage(),
|
|
|
|
'code' => $this->getCode(),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|