Total Complexity | 2 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
20 | abstract class RequestMessage extends Message { |
||
21 | /** |
||
22 | * Merchant. |
||
23 | * |
||
24 | * @var Merchant |
||
25 | */ |
||
26 | protected $merchant; |
||
27 | |||
28 | /** |
||
29 | * Customer. |
||
30 | * |
||
31 | * @var Customer |
||
32 | */ |
||
33 | protected $customer; |
||
34 | |||
35 | /** |
||
36 | * Transaction. |
||
37 | * |
||
38 | * @var Transaction |
||
39 | */ |
||
40 | protected $transaction; |
||
41 | |||
42 | /** |
||
43 | * Get the DOM document |
||
44 | * |
||
45 | * @return DOMDocument |
||
46 | */ |
||
47 | protected function get_document() { |
||
48 | $document = new DOMDocument( parent::XML_VERSION, parent::XML_ENCODING ); |
||
49 | |||
50 | // We can't disable preserve white space and format the output |
||
51 | // this is causing 'Invalid electronic signature' errors. |
||
52 | $document->preserveWhiteSpace = true; |
||
53 | $document->formatOutput = true; |
||
54 | |||
55 | // Root. |
||
56 | $root = $document->createElement( $this->get_name() ); |
||
57 | |||
58 | $document->appendChild( $root ); |
||
59 | |||
60 | return $document; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Create a string representation |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function __toString() { |
||
72 | } |
||
73 | } |
||
74 |