1 | <?php |
||
15 | class AuthorizeNetXMLResponse |
||
|
|||
16 | { |
||
17 | |||
18 | public $xml; // Holds a SimpleXML Element with response. |
||
19 | |||
20 | /** |
||
21 | * Constructor. Parses the AuthorizeNet response string. |
||
22 | * |
||
23 | * @param string $response The response from the AuthNet server. |
||
24 | */ |
||
25 | 11 | public function __construct($response) |
|
35 | |||
36 | /** |
||
37 | * Was the transaction successful? |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | 9 | public function isOk() |
|
45 | |||
46 | /** |
||
47 | * Run an xpath query on the cleaned XML response |
||
48 | * |
||
49 | * @param string $path |
||
50 | * @return array Returns an array of SimpleXMLElement objects or FALSE in case of an error. |
||
51 | */ |
||
52 | 1 | public function xpath($path) |
|
56 | |||
57 | /** |
||
58 | * Was there an error? |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function isError() |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getErrorMessage() |
||
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | 3 | public function getRefID() |
|
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | 9 | public function getResultCode() |
|
92 | |||
93 | /** |
||
94 | * @return string |
||
95 | */ |
||
96 | 3 | public function getMessageCode() |
|
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | 3 | public function getMessageText() |
|
108 | |||
109 | /** |
||
110 | * @return dynamic |
||
111 | */ |
||
112 | public function data(){ |
||
115 | 9 | ||
116 | /** |
||
117 | 9 | * Grabs the contents of a unique element. |
|
118 | 9 | * |
|
119 | 9 | * @param string |
|
120 | * @return string |
||
121 | */ |
||
122 | 9 | protected function _getElementContents($elementName) |
|
134 | |||
135 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.