| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- declare(strict_types=1);
- namespace SixShop\Lakala\Dto;
- class LocationInfo implements \JsonSerializable
- {
- /**
- * @param string $requestIP 请求方的IP地址,存在必填,格式如36.45.36.95
- * @param string $baseStation 客户端设备的基站信息(主扫时基站信息使用该字段)
- * @param string $location 纬度,经度
- *
- * 商户终端的地理位置,银联二维码交易必填,整体格式:纬度,经度,+表示北纬、东经,-表示南纬、 西经。
- *
- * 经度格式:1位正负号+3位整数+1位小数点+5位小数;
- *
- * 纬度格式:1位正负号+2位整数+1位小数点+6位小数;
- *
- * 举例:+31.221345,+121.12345
- */
- public function __construct(
- private string $requestIP,
- private string $baseStation = '',
- private string $location = ''
- )
- {
- }
- public function jsonSerialize(): array
- {
- return [
- 'request_ip' => $this->requestIP,
- 'base_station' => $this->baseStation,
- 'location' => $this->location
- ];
- }
- }
|