|
|
|
|
@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
|
|
namespace Tansilu\HfPayLib\factory\object\trade; |
|
|
|
|
|
|
|
|
|
use JsonSerializable; |
|
|
|
|
use PHPUnit\Util\Json; |
|
|
|
|
use Tansilu\HfPayLib\exception\ParamsException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -31,7 +33,7 @@ use Tansilu\HfPayLib\exception\ParamsException; |
|
|
|
|
* @property $serviceProviderIp 商户服务IP地址 |
|
|
|
|
* @property $merUrl 商户网址 |
|
|
|
|
*/ |
|
|
|
|
class DeviceInfo |
|
|
|
|
class DeviceInfo implements JsonSerializable |
|
|
|
|
{ |
|
|
|
|
public static function make( |
|
|
|
|
string $devType, |
|
|
|
|
@ -62,6 +64,14 @@ class DeviceInfo |
|
|
|
|
$this->data[$name] = $value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @throws ParamsException |
|
|
|
|
*/ |
|
|
|
|
public function __toString() |
|
|
|
|
{ |
|
|
|
|
return $this->toJson(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function toJSON(): string |
|
|
|
|
{ |
|
|
|
|
@ -76,4 +86,9 @@ class DeviceInfo |
|
|
|
|
} |
|
|
|
|
return json_encode($this->data, JSON_UNESCAPED_UNICODE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function jsonSerialize(): array |
|
|
|
|
{ |
|
|
|
|
return $this->data; |
|
|
|
|
} |
|
|
|
|
} |