M2_AuthorizeNetGetSubscriptionList

A class that contains all fields for an AuthorizeNet ARB SubscriptionList.

Defined (1)

The class is defined in the following location(s).

/lib/authorize.net/lib/shared/AuthorizeNetTypes.php  
  1. class M2_AuthorizeNetGetSubscriptionList 
  2. public $searchType; 
  3. public $sorting; 
  4. public $paging; 
  5.  
  6. public function getXml() 
  7. $emptyString = ""; 
  8. $sortingXml = (is_null($this->sorting)) ? $emptyString : $this->sorting->getXml(); 
  9. $pagingXml = (is_null($this->paging)) ? $emptyString : $this->paging->getXml(); 
  10.  
  11. $xml = " 
  12. <searchType>{$this->searchType}</searchType>" 
  13. .$sortingXml 
  14. .$pagingXml 
  15.  
  16. $xml_clean = ""; 
  17. // Remove any blank child elements 
  18. foreach (preg_split("/(\r?\n)/", $xml) as $key => $line) { 
  19. if (!preg_match('/><\//', $line)) { 
  20. $xml_clean .= $line . "\n"; 
  21.  
  22. // Remove any blank parent elements 
  23. $element_removed = 1; 
  24. // Recursively repeat if a change is made 
  25. while ($element_removed) { 
  26. $element_removed = 0; 
  27. if (preg_match('/<[a-z]+>[\r?\n]+\s*<\/[a-z]+>/i', $xml_clean)) { 
  28. $xml_clean = preg_replace('/<[a-z]+>[\r?\n]+\s*<\/[a-z]+>/i', '', $xml_clean); 
  29. $element_removed = 1; 
  30.  
  31. // Remove any blank lines 
  32. // $xml_clean = preg_replace('/\r\n[\s]+\r\n/', '', $xml_clean); 
  33. return $xml_clean;