44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace wchat\wx\V3\Libs;
|
||
|
|
|
||
|
|
class XPayGoodsDeliverNotify
|
||
|
|
{
|
||
|
|
public string $ToUserName;
|
||
|
|
public string $FromUserName;
|
||
|
|
public int $CreateTime;
|
||
|
|
public string $MsgType;
|
||
|
|
public string $Event;
|
||
|
|
public string $OpenId;
|
||
|
|
public string $OutTradeNo;
|
||
|
|
public WeChatPayInfo $WeChatPayInfo;
|
||
|
|
public int $Env;
|
||
|
|
public GoodsInfo $GoodsInfo;
|
||
|
|
public int $RetryTimes;
|
||
|
|
|
||
|
|
public function __construct(array $data)
|
||
|
|
{
|
||
|
|
$this->ToUserName = $data['ToUserName'];
|
||
|
|
$this->FromUserName = $data['FromUserName'];
|
||
|
|
$this->CreateTime = $data['CreateTime'];
|
||
|
|
$this->MsgType = $data['MsgType'];
|
||
|
|
$this->Event = $data['Event'];
|
||
|
|
$this->OpenId = $data['OpenId'];
|
||
|
|
$this->OutTradeNo = $data['OutTradeNo'];
|
||
|
|
$this->WeChatPayInfo = new WeChatPayInfo($data['WeChatPayInfo']);
|
||
|
|
$this->Env = $data['Env'];
|
||
|
|
$this->GoodsInfo = new GoodsInfo($data['GoodsInfo']);
|
||
|
|
$this->RetryTimes = $data['RetryTimes'];
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 从 JSON 字符串创建对象
|
||
|
|
*/
|
||
|
|
public static function fromJson(string $json): self
|
||
|
|
{
|
||
|
|
$data = json_decode($json, true);
|
||
|
|
return new self($data);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|