1 | <?php |
||
12 | abstract class AbstractDriver implements PacDriverInterface |
||
13 | { |
||
14 | /** |
||
15 | * The driver username. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $username; |
||
20 | /** |
||
21 | * The driver password. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $password; |
||
26 | /** |
||
27 | * The driver sandbox. |
||
28 | * |
||
29 | * @var bool |
||
30 | */ |
||
31 | protected $sandbox; |
||
32 | /** |
||
33 | * The custom parameters to be sent with the request. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $parameters = []; |
||
38 | /** |
||
39 | * The Guzzle Soap Factory. |
||
40 | * |
||
41 | * @var \Meng\AsyncSoap\Guzzle\Factory |
||
42 | */ |
||
43 | protected $factory; |
||
44 | |||
45 | /** |
||
46 | * Create a new driver instance. |
||
47 | * |
||
48 | * @param string $username |
||
49 | * @param string $password |
||
50 | * @param bool $sandbox |
||
51 | */ |
||
52 | public function __construct($username, $password, $sandbox = true) |
||
53 | { |
||
54 | $this->username = $username; |
||
55 | $this->password = $password; |
||
56 | $this->sandbox = $sandbox; |
||
57 | $this->factory = new SoapFactory(); |
||
58 | } |
||
59 | |||
60 | abstract public function stamp($xml): PacStamp; |
||
61 | |||
62 | abstract public function cancel(array $uuids, $rfc, $cer, $key); |
||
63 | |||
64 | abstract public function addUser($rfc, $params = []): PacUser; |
||
65 | |||
66 | abstract public function editUser($rfc, $params = []); |
||
67 | |||
68 | abstract public function getUsers(): ArrayAccess; |
||
69 | |||
70 | abstract public function getUser($rfc = null): PacUser; |
||
71 | |||
72 | abstract public function assignStamps($rfc = null, $credit = 0); |
||
73 | |||
74 | abstract protected function url($wsdl = null); |
||
75 | |||
76 | public function request($url = null, $method = null, $params = []) |
||
89 | |||
90 | public function xml() |
||
94 | |||
95 | public function user() |
||
99 | } |
||
100 |