-
Notifications
You must be signed in to change notification settings - Fork 8
/
hmrc-rti.php
60 lines (40 loc) · 1.16 KB
/
hmrc-rti.php
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
class hmrc_rti extends check {
protected $details = [];
public function details_set($details) {
$this->details = array_merge(array(
'year' => NULL,
'final' => NULL,
'currency' => 'GBP',
'sender' => 'Employer',
), $details);
}
public function message_keys_get() {
return array(
'TaxOfficeNumber' => $this->details['tax_office_number'],
'TaxOfficeReference' => $this->details['tax_office_reference'],
);
}
public function request_header_get_xml() {
$period_end = ($this->details['year'] + 1) . '-04-05';
$xml = '
<IRheader>
<Keys>';
foreach ($this->message_keys_get() as $key_name => $key_value) {
$xml .= '
<Key Type="' . xml($key_name) . '">' . xml($key_value) . '</Key>';
}
$xml .= '
</Keys>
<PeriodEnd>' . xml($period_end) . '</PeriodEnd>
<DefaultCurrency>' . xml($this->details['currency']) . '</DefaultCurrency>
<IRmark Type="generic">XXX</IRmark>
<Sender>' . xml($this->details['sender']) . '</Sender>
</IRheader>';
return $xml;
}
public function response_details($response_object) {
return [];
}
}
?>