1 | <?php |
||
19 | class CFDI |
||
20 | { |
||
21 | /** @var string */ |
||
22 | const XSL_ENDPOINT = 'http://www.sat.gob.mx/sitio_internet/cfd/3/cadenaoriginal_3_3/cadenaoriginal_3_3.xslt'; |
||
23 | |||
24 | /** @var string */ |
||
25 | protected $version = '3.3'; |
||
26 | |||
27 | /** @var string */ |
||
28 | protected $key; |
||
29 | |||
30 | /** @var string */ |
||
31 | protected $cer; |
||
32 | |||
33 | /** @var \Kinedu\CfdiXML\Node\Comprobante */ |
||
34 | protected $comprobante; |
||
35 | |||
36 | /** |
||
37 | * Create a new cfdi instance. |
||
38 | * |
||
39 | * @param array $data |
||
40 | * @param string $key |
||
41 | * @param string $cer |
||
42 | */ |
||
43 | public function __construct(array $data, string $key, string $cer) |
||
50 | |||
51 | /** |
||
52 | * Add new node to comprobante instance. |
||
53 | * |
||
54 | * @param \Kinedu\CfdiXML\Common\Node $node |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | public function add(Node $node) |
||
62 | |||
63 | /** |
||
64 | * Gets the original string. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getCadenaOriginal(): string |
||
81 | |||
82 | /** |
||
83 | * Get sello. |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getSello(): string |
||
94 | |||
95 | /** |
||
96 | * Put sello. |
||
97 | * |
||
98 | * @return void |
||
99 | */ |
||
100 | protected function putSello() |
||
109 | |||
110 | /** |
||
111 | * Get certificado. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getCertificado(): string |
||
121 | |||
122 | /** |
||
123 | * Put certificado. |
||
124 | * |
||
125 | * @return void |
||
126 | */ |
||
127 | protected function putCertificado() |
||
136 | |||
137 | /** |
||
138 | * Returns the xml with the stamp and certificate attributes. |
||
139 | * |
||
140 | * @return DOMDocument |
||
141 | */ |
||
142 | protected function xml(): DOMDocument |
||
148 | |||
149 | /** |
||
150 | * Get the xml. |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function getXML(): string |
||
158 | |||
159 | /** |
||
160 | * @param string $filename |
||
161 | */ |
||
162 | public function save(string $filename) |
||
166 | |||
167 | /** |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getXSL() |
||
174 | } |
||
175 |
If you suppress an error, we recommend checking for the error condition explicitly: