1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00
invoiceninja/app/Exceptions/PaymentRefundFailed.php

51 lines
1.0 KiB
PHP
Raw Normal View History

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;
2020-10-28 11:10:49 +01:00
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class PaymentRefundFailed extends Exception
{
/**
* Report the exception.
*
* @return void
*/
public function report()
{
//
}
/**
* Render the exception into an HTTP response.
*
2020-10-28 11:10:49 +01:00
* @param Request $request
* @return Response
*/
public function render($request)
{
2021-08-25 06:36:30 +02:00
// $msg = 'Unable to refund the transaction';
$msg = ctrans('texts.warning_local_refund');
if ($this->getMessage() && strlen($this->getMessage()) >= 1) {
2021-08-25 06:36:30 +02:00
$msg = $this->getMessage();
}
2021-08-25 06:36:30 +02:00
return response()->json([
'message' => $msg,
], 401);
}
}