45 lines
717 B
PHP
45 lines
717 B
PHP
<?php
|
|
/**
|
|
* Author: sai
|
|
* Date: 2020/1/15
|
|
* Time: 14:31
|
|
*/
|
|
|
|
namespace App\Exceptions;
|
|
|
|
class ApiUnionpayException extends \Exception
|
|
{
|
|
|
|
const ERROR_CODE = 1001;
|
|
const ERROR_MSG = 'ApiUnionpayException';
|
|
|
|
private $data = [];
|
|
|
|
/**
|
|
* BusinessException constructor.
|
|
* @param string $message
|
|
* @param string $code
|
|
* @param array $data
|
|
*/
|
|
public function __construct($data = [])
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getData()
|
|
{
|
|
return $this->data;
|
|
}
|
|
|
|
/**
|
|
* 异常输出
|
|
*/
|
|
public function render($request)
|
|
{
|
|
return response()->json($this->getData(), 200);
|
|
}
|
|
|
|
} |