| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/middletvnew/wp-content/plugins/armember/lib/authorizenet/ |
Upload File : |
<?php
/**
* A simple wrapper for the SOAP API as well as a helper function
* to generate a documentation file from the WSDL.
*
* @package AuthorizeNet
* @subpackage AuthorizeNetSoap
*/
/**
* A simple wrapper for the SOAP API as well as a helper function
* to generate a documentation file from the WSDL.
*
* @package AuthorizeNet
* @subpackage AuthorizeNetSoap
* @todo Make the doc file a usable class.
*/
class AuthorizeNetSOAP extends SoapClient
{
const WSDL_URL = "https://api.authorize.net/soap/v1/Service.asmx?WSDL";
const LIVE_URL = "https://api.authorize.net/soap/v1/Service.asmx";
const SANDBOX_URL = "https://apitest.authorize.net/soap/v1/Service.asmx";
public $sandbox;
/**
* Constructor
*/
public function __construct()
{
parent::__construct(self::WSDL_URL);
$this->__setLocation(self::SANDBOX_URL);
}
/**
* Switch between the sandbox or production gateway.
*
* @param bool
*/
public function setSandbox($bool)
{
$this->__setLocation(($bool ? self::SANDBOX_URL : self::LIVE_URL));
}
/**
* Get all types as PHP Code.
* @return string
*/
public function getSoapTypes()
{
$string = "";
$types = $this->__getTypes();
foreach ($types as $type) {
if (preg_match("/struct /",$type)) {
$type = preg_replace("/struct /","class ",$type);
$type = preg_replace("/ (\w+) (\w+);/"," // $1\n public \$$2;",$type);
$string .= $type ."\n";
}
}
return $string;
}
/**
* Get all methods as PHP Code.
* @return string
*/
public function getSoapMethods()
{
$string = "";
$functions = array();
$methods = $this->__getFunctions();
foreach ($methods as $index => $method) {
$sig = explode(" ", $method, 2);
if (!isset($functions[$sig[1]])) {
$string .= " /**\n * @return {$sig[0]}\n */\n public function {$sig[1]} {}\n\n";
$functions[$sig[1]] = true;
}
}
return $string;
}
/**
* Create a file from the WSDL for reference.
*/
public function saveSoapDocumentation($path)
{
$string = "<?php\n";
$string .= "/**\n";
$string .= " * Auto generated documentation for the AuthorizeNetSOAP API.\n";
$string .= " * Generated " . date("m/d/Y") . "\n";
$string .= " */\n";
$string .= "class AuthorizeNetSOAP\n";
$string .= "{\n" . $this->getSoapMethods() . "\n}\n\n" . $this->getSoapTypes() ."\n\n ?>";
return file_put_contents($path, $string);
}
}