Transfer.php
770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Created by PhpStorm.
* User: Hanson
* Date: 2017/1/15
* Time: 12:29
*/
namespace Hanson\Robot\Message\Entity;
use Hanson\Robot\Message\MessageInterface;
class Transfer extends Message implements MessageInterface
{
/**
* 转账金额 单位 元
*
* @var string
*/
public $fee;
public function __construct($msg)
{
parent::__construct($msg);
$this->make();
}
public function make()
{
$array = (array)simplexml_load_string($this->msg['Content'], 'SimpleXMLElement', LIBXML_NOCDATA);
$des = (array)$array['appmsg']->des;
$fee = (array)$array['appmsg']->wcpayinfo;
$this->content = current($des);
$this->fee = substr($fee['feedesc'], 3);
}
}