@@ -33,6 +33,18 @@ class Generator {
3333 */
3434 protected $ document ;
3535
36+ /**
37+ * @var string
38+ */
39+ protected $ namespaceRoot = 'http://gateway.ixopay.com ' ;
40+
41+ /**
42+ * @param string $namespaceRoot
43+ */
44+ public function setNamespaceRoot ($ namespaceRoot ) {
45+ $ this ->namespaceRoot = $ namespaceRoot ;
46+ }
47+
3648 /**
3749 * @param string $method
3850 * @param AbstractTransaction $transaction
@@ -44,7 +56,7 @@ class Generator {
4456 public function generateTransaction ($ method , AbstractTransaction $ transaction , $ username , $ password , $ language =null ) {
4557 $ this ->document = new \DOMDocument ('1.0 ' , 'utf-8 ' );
4658 $ this ->document ->formatOutput = true ;
47- $ root = $ this ->document ->createElementNS (' http://gateway.ixopay.com /Schema/V2/Transaction ' , 'transaction ' );
59+ $ root = $ this ->document ->createElementNS ($ this -> namespaceRoot . ' /Schema/V2/Transaction ' , 'transaction ' );
4860
4961 $ this ->_appendTextNode ($ root , 'username ' , $ username );
5062 $ this ->_appendTextNode ($ root , 'password ' , $ password );
@@ -107,7 +119,7 @@ public function generateTransaction($method, AbstractTransaction $transaction, $
107119 public function generateOptions ($ username , $ password , $ identifier , $ parameters =array ()) {
108120 $ this ->document = new \DOMDocument ('1.0 ' , 'utf-8 ' );
109121 $ this ->document ->formatOutput = true ;
110- $ root = $ this ->document ->createElementNS (' http://gateway.ixopay.com /Schema/V2/Options ' , 'options ' );
122+ $ root = $ this ->document ->createElementNS ($ this -> namespaceRoot . ' /Schema/V2/Options ' , 'options ' );
111123 $ this ->document ->appendChild ($ root );
112124
113125 $ this ->_appendTextNode ($ root , 'username ' , $ username );
0 commit comments