/**
  * This function need to be called for any contact used as Registrant contact for .US.
  *
  * @return void
  * @param string Username.
  * @param string Password.
  * @param string Role.
  * @param string Language Preference.
  * @param int Parent id.
  * @param int The Registrant contactId for which applicationPurposedetails, nexusCategory are required. 
  * @param string applicationPurpose e.g P1,P2 etc.
  * @param string nexusCategory e.g. C31
  *
  */
 function setContactDetails($userName, $password, $role, $langpref, $parentid, $contactId, $applicationPurpose, $nexusCategory)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $contactId, $applicationPurpose, $nexusCategory);
     $return = $this->s->call("setContactDetails", $para);
     $this->debugfunction();
     return $return;
 }
Example #2
0
 /**
  *
  * @param entityId The entityid which has to be moved
  * @param newCustomerId The new customer id under which the entity has to be moved
  * @param newResellerId The new reseller id under which the entity has to be moved
  * @return
  */
 function moveWebsite($userName, $password, $role, $langpref, $parentid, $websiteName, $newCustomerId, $defaultContact)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $websiteName, $newCustomerId, $defaultContact);
     $return = $this->s->call("moveWebsite", $para);
     $this->debugfunction();
     return $return;
 }
Example #3
0
 /**
  *
  * @param entityId The entityid which has to be moved
  * @param newCustomerId The new customer id under which the entity has to be moved
  * @param newResellerId The new reseller id under which the entity has to be moved
  * @return
  */
 function sendRfa($userName, $password, $role, $langpref, $parentid, $orderId)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $orderId);
     $return = $this->s->call("sendRfa", $para);
     $this->debugfunction();
     return $return;
 }
Example #4
0
 /**
  * @param  string
  * @param  array
  * @return mixed
  * @access private
  */
 function _performAPICall($apiCall, $parameters)
 {
     $result = $this->_soapClient->call($apiCall, $parameters, "urn:GoogleSearch");
     // if (!PEAR::isError($result)) {
     if (is_array($result)) {
         return $result;
     } else {
         return false;
     }
 }
Example #5
0
 /**
  * This function returns the available balance of a customer.
  *
  * @return AssociativeArray
  * @param string Username.
  * @param string Password.
  * @param string Role.
  * @param string Language Preference.
  * @param int Parent id.
  * @param int Customer id.
  * <br><br><b>Returns:</b>
  * <br>An Associative Array with balance details.
  *
  */
 function getCustomerAvailableBalance($userName, $password, $role, $langpref, $parentid, $customerId)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $customerId);
     $return = $this->s->call("getCustomerAvailableBalance", $para);
     $this->debugfunction();
     return $return;
 }
Example #6
0
 /**
  * Virtually calls the scope's method considering routes
  *
  * @param *string $name the name of the method
  * @param *array  $args arguments to pass
  *
  * @return mixed
  */
 protected function getResults($name, $args)
 {
     if (method_exists($this->scope, $name)) {
         return call_user_func_array(array($this->scope, $name), $args);
     }
     return $this->scope->call($name, $args);
 }
Example #7
0
 /** Gets the Details of the specified order based on given option
  *
  *
  * @return AssociativeArray
  * @param zoneid The zoneid under which the details is to be listed
  * @param options Vector for listing Orders with various options
  * <br> Valid values are: All,OrderDetails,PricingDetails
  * <br><br><b>Returns:</b>
  * <br>An Associative Array with the result
  * Values returned by the HashMap are
  * customerdetails=
  * resellerdetails=
  * orderdetails=
  * <br>Each further returns an AssociativeArray containing repective details
  */
 function getDetails($userName, $password, $role, $langpref, $parentid, $zoneid, $options)
 {
     $param = array($userName, $password, $role, $langpref, $parentid, $zoneid, $options);
     $return = $this->s->call("getDetails", $param);
     $this->debugfunction();
     return $return;
 }
 /**
  * Attempts to place a Transfer order for the specified domain name(s).
  *
  * @return AssociativeArray
  * @param string Username.
  * @param string Password.
  * @param string Role.
  * @param string Language Preference.
  * @param int Parent id.
  * @param AssociativeArray This should contain the domain name(s) which are to be registered. The AssociativeArray should have the domainname as the key, and the domain transfer secret as the value. In case of domains which do not have a transfer secret, an empty string should be passed. ex. {domain1.com=secret1,domain2.net=secret2}
  * @param int The contact to be used as the Registrant for all the specified domains.
  * @param int The contact to be used as the Admin Contact for all the specified domains.
  * @param int The contact to be used as the Tech Contact for all the specified domains.
  * @param int The contact to be used as the Billing Contact for all the specified domains.
  * @param int The customer under whom the orders should be added
  * @param string This parameter will decide how the Customer Invoices will be handled. NoInvoice - If this value is passed, then no customer invoice will be generated for the domains. PayInvoice - If this value is passed, then a customer invoice will be generated for the domains in the first step. If there is sufficient balance in the Customer's Debit Account, then the invoices will be paid and the domains will be registered. If a customer has less balance than required, then as many domains as possible will be registered with the existing funds. All other orders will remain pending in the system. KeepInvoice - If this value is passed, then a customer invoice will be generated for the domains. However, these invoices will not be paid. They will be kept pending, while the orders will be executed. 
  * <br><br>This method performs the action in two steps - 1. It adds an order in the system for the domain name. 2. It attempts to register the domainname in the Registry. Your Reseller account must have sufficient funds to register the domain names since this is a billable action. 
  * <br><br><b>Returns:</b>
  * <br>AssociativeArray.
  * <br>A AssociativeArray with the result of the Transfer order. The AssociativeArray has the domainnames as the key, and a AssociativeArray as the value. The inner AssociativeArray will have key-values as follows: 
  * <br>	entityid=435
  * <br>	description=apitest04.com
  * <br>	actiontype=AddTransferDomain
  * <br>	actiontypedesc=Transfer of apitest04.com from old Registrar alongwith 1 year Renewal
  * <br>	actionstatus=RFASent
  * <br>	actionstatusdesc=Transfer waiting for Admin Contact Approval
  * <br>	status=Success
  * <br>	eaqid=1169
  * <br>Incase you have chosen "KeepInvoice" or "PayInvoice", the return key-value paired array will also contain the following data: 
  * <br>	customerid=8
  * <br>	invoiceid=727
  * <br>	sellingcurrencysymbol=INR
  * <br>	sellingamount=-500.000
  * <br>	unutilisedsellingamount=-500.000
  * <br>invoiceid is the Id that you will need to pass to Fund.payCustomerTransaction if you wish to pay the invoice at a later date. selllingamount is the Invoice amount in your Selling Currency unutilisedselllingamount is the Pending Invoice amount in your Selling Currency. In case of "KeepInvoice", the pending amount will always be equal to the invoice amount. In case of "PayInvoice", if the Customer does not have sufficient funds to pay the entire invoice amount, unutilisedsellingamount will reflect the balance amount that is pending. If the invoice has been completely paid, the unutilisedsellingamount will be 0.
  *
  */
 function transferDomain($userName, $password, $role, $langpref, $parentid, $domainHash, $registrantContactId, $adminContactId, $techContactId, $billingContactId, $customerId, $invoiceOption)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $domainHash, $registrantContactId, $adminContactId, $techContactId, $billingContactId, $customerId, $invoiceOption);
     $return = $this->s->call("transferDomain", $para);
     $this->debugfunction();
     return $return;
 }
 /**
  * This function authenticates the Customer.This fuction is invoked only if the role is customer.
  *
  * @return AssociativeArray
  * @param string Username.
  * @param string Password.
  * @param string Role.
  * @param string Language Preference.
  * @param int Parent id.
  * <br><br><b>Returns:</b>
  * <br>AssociativeArray
  * <br>A AssociativeArray with the Customer information.
  *
  */
 function authenticateCustomer($userName, $password, $role, $langpref, $parentid, $customerUserName, $customerPasswd)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $customerUserName, $customerPasswd);
     $return = $this->s->call("authenticateCustomer", $para);
     $this->debugfunction();
     return $return;
 }
Example #10
0
 function addCustomerFund($userName, $password, $role, $langpref, $parentid, $customerId, $sellingAmount, $description, $type, $transactionKey, $updateTotalReceipt)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $customerId, $sellingAmount, $description, $type, $transactionKey, $updateTotalReceipt);
     $return = $this->s->call("addCustomerFund", $para);
     $this->debugfunction();
     return $return;
 }
 /**
  * Modifies the details for the specified contact. 
  *
  * @return AssociativeArray
  * @param string Username.
  * @param string Password.
  * @param string Role.
  * @param string Language Preference.
  * @param int Parent id.
  * @param int The contact whose details are to be modified. 
  * @param string Name.
  * @param string Company.
  * @param string E-Mail.
  * @param string Address1.
  * @param string Address2.
  * @param string Address3.
  * @param string City.
  * @param string State.
  * @param string Country.
  * @param string Zip.
  * @param string Country Code.
  * @param string Tel. No.
  * @param string Country Code.
  * @param string Fax No.
  * <br><br><b>Returns:</b>
  * <br>AssociativeArray.
  * <br>A AssociativeArray with the result of the modification. 
  * <br>	entityid=245
  * <br>	description=DomainContact
  * <br>	actiontype=Mod
  * <br>	actiontypedesc=Modification of Contact Details in the Registry
  * <br>	actionstatus=Success
  * <br>	actionstatusdesc=Contact modification completed successfully in all registry
  * <br>	status=Success
  *
  */
 function mod($userName, $password, $role, $langpref, $parentid, $contactId, $name, $company, $emailAddr, $address1, $address2, $address3, $city, $state, $country, $zip, $telNoCc, $telNo, $faxNoCc, $faxNo)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $contactId, $name, $company, $emailAddr, $address1, $address2, $address3, $city, $state, $country, $zip, $telNoCc, $telNo, $faxNoCc, $faxNo);
     $return = $this->s->call("mod", $para);
     $this->debugfunction();
     return $return;
 }
Example #12
0
 function del($userName, $password, $role, $langpref, $parentid, $contactId)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $contactId);
     $return = $this->s->call("delete", $para);
     $this->debugfunction();
     return $return;
 }
 function cancelTransferRequest($userName, $password, $role, $langpref, $parentid, $entityId)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $entityId);
     $return = $this->s->call("cancelTransferRequest", $para);
     $this->debugfunction();
     return $return;
 }
Example #14
0
 function listOrder($userName, $password, $role, $langpref, $parentid, $customerId, $resellerId, $username, $name, $company, $city, $country, $customerStatus, $creationDTRangStart, $creationDTRangEnd, $totalReceiptStart, $totalReceiptEnd, $numOfRecordPerPage, $pageNum, $orderBy)
 {
     $para = array($userName, $password, $role, $langpref, $parentid, $customerId, $resellerId, $username, $name, $company, $city, $country, $customerStatus, $creationDTRangStart, $creationDTRangEnd, $totalReceiptStart, $totalReceiptEnd, $numOfRecordPerPage, $pageNum, $orderBy);
     $return = $this->s->call("list", $para);
     $this->debugfunction();
     return $return;
 }
 /**
  * Get translated string
  *
  * @param string $string This is NOT the stringID, this is a real string.
  *                       The method will search for its matching stringID, 
  *                       and then it will return the associate string in the 
  *                       selected language.
  * @param string $pageID page/group ID
  *
  * @return string
  */
 function getStringID($string, $pageID = TRANSLATION2_DEFAULT_PAGEID)
 {
     // WITHOUT THIS, IT DOESN'T WORK
     global $translation2_cachelitefunction_temp;
     //generate temp variable
     $translation2_cachelitefunction_temp = $this->translation2;
     if ($pageID == TRANSLATION2_DEFAULT_PAGEID) {
         $pageID = $this->translation2->currentPageID;
     }
     $this->_prepare();
     return $this->cacheLiteFunction->call('translation2_cachelitefunction_temp->getStringID', $string, $pageID);
 }
Example #16
0
 /**
  * Private method to all API requests
  * @since  1.0.0
  * @param  string    $resource Method name
  * @param  array     $filter   The filter
  * @return mixed               The result
  */
 private function _get_api_result($resource, $filter)
 {
     $result = false;
     try {
         $this->soap_client = Soap_Client::get_client($this->wsdl);
         $this->session = Soap_Client::get_session($this->user_name, $this->api_key);
         if ($this->soap_client) {
             if ($filter) {
                 $result = $this->soap_client->call($this->session, $resource, array($filter));
             } else {
                 $result = $this->soap_client->call($this->session, $resource);
             }
         }
     } catch (\SoapFault $e) {
         error_log(sprintf('%s - %s - %s', $resource, $e->getMessage(), $e->getTraceAsString()));
     } catch (\Exception $e) {
         error_log(sprintf('%s - %s - %s', $resource, $e->getMessage(), $e->getTraceAsString()));
     }
     return $result;
 }
Example #17
0
 public static function call($api, $param = '', $method = 'GET')
 {
     return self::$handler->call($api, $param, $method);
 }
 /**
  * Validator sytem call
  *
  * @param object $obj     Service object
  * @param object $session Session object
  * @param string $sql     SQL Query to validate
  * @param string $method  Data return type
  *
  * @return object  stClass return with data
  *
  * @access private
  */
 function _validateSQL($obj, $session, $sql, $method)
 {
     $use_array = array("a_sessionId" => $session->sessionId, "a_sessionKey" => $session->sessionKey, "a_SQL" => $sql, "a_resultType" => $this->output_type);
     if ($GLOBALS['sqlvalidator_soap'] == 'PHP') {
         $res = $obj->__soapCall("validateSQL", $use_array);
     } else {
         $res = $obj->call("validateSQL", $use_array);
     }
     return $res;
 }
Example #19
0
 /**
  * Gather account information froma specific list
  *
  * Reference: http://apidocs.mailchimp.com/api/2.0/lists/member-info.php
  *
  * @param string email
  *   Target email address to lookup
  * @param string $listID
  *   The list to lookup the email address on.
  */
 public function memberInfo($email, $listID)
 {
     $mailchimpStatus = $this->mailChimp->call("/lists/member-info", ['id' => $listID, 'emails' => [0 => ['email' => $email]]]);
     return $mailchimpStatus;
 }
Example #20
0
 /**
  * This method handles any request which isn't a valid rpc request.
  * @param object $rpcServer A reference to the active rpc server.
  */
 public function handle($rpcServer)
 {
     $methods = $rpcServer->call('system.listMethods');
     echo '<!DOCTYPE html>';
     echo '<html><head><title>' . $this->name . '</title>';
     if (isset($this->css)) {
         if (strpos($this->css, "\n") !== false) {
             echo '<style type="text/css">' . $this->css . '</style>';
         } else {
             echo '<link rel="stylesheet" type="text/css" href="' . $this->css . '">';
         }
     }
     echo '</head><body>';
     echo '<div class="content">';
     echo '<h1>' . $this->name . '</h1>';
     echo $this->header;
     echo '<p>';
     $showWSDL = false;
     switch ($this->version) {
         case 'xmlrpc':
             echo 'This server implements the <a href="http://www.xmlrpc.com/spec">XML-RPC specification</a>';
             break;
         case 'simple':
             echo 'This server implements the <a href="http://sites.google.com/a/simplerpc.org/simplerpc/Home/simplerpc-specification-v09">SimpleRPC 1.0 specification</a>';
             break;
         case 'auto':
             echo 'This server implements the <a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508/">SOAP 1.1</a>, <a href="http://www.xmlrpc.com/spec">XML-RPC</a> and <a href="http://sites.google.com/a/simplerpc.org/simplerpc/Home/simplerpc-specification-v09">SimpleRPC 1.0</a> specification.';
             $showWSDL = true;
             break;
         case 'soap 1.1':
             echo 'This server implements the <a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508/">SOAP 1.1 specification</a>.';
             $showWSDL = true;
             break;
     }
     echo '</p>';
     if ($showWSDL && ($this->wsdl || $this->wsdl2)) {
         echo '<ul>';
         if ($this->wsdl) {
             echo '<li><a href="' . $this->root . '?wsdl">WSDL 1.1 Description</a></li>';
         }
         if ($this->wsdl2) {
             echo '<li><a href="' . $this->root . '?wsdl2">WSDL 2.0 Description</a></li>';
         }
         echo '</ul>';
     }
     $methods = $rpcServer->call('system.describeMethods');
     $allMethods = array();
     $allFunctions = array();
     foreach ($methods['methodList'] as $index => $method) {
         if (strpos($method, '.') !== false) {
             $allMethods[$method['name']] = $index;
         } else {
             $allFunctions[$method['name']] = $index;
         }
     }
     ksort($allMethods);
     ksort($allFunctions);
     $allMethods = $allFunctions + $allMethods;
     echo '<div class="index"><h2>Methods</h2><ul>';
     foreach ($allMethods as $methodName => $methodIndex) {
         echo '<li><a href="#method_' . (int) $methodIndex . '">' . $methodName . '</a></li>';
     }
     echo '</ul></div>';
     $currentClass = '';
     echo '<div class="functions">';
     foreach ($allMethods as $methodName => $methodIndex) {
         $method = $methods['methodList'][$methodIndex];
         $pos = strpos($methodName, '.');
         if ($pos !== false) {
             $class = substr($methodName, 0, $pos);
         }
         if ($currentClass != $class) {
             echo '</div>';
             echo '<div class="class_' . $class . '">';
             $currentClass = $class;
         }
         echo '<h2 id="method_' . $methodIndex . '">' . $method['name'] . '</h2>';
         if ($method['signatures']) {
             foreach ($method['signatures'] as $signature) {
                 echo '<div class="signature">';
                 if (is_array($signature['returns'])) {
                     $return = $signature['returns'][0];
                     echo '(' . $return['type'] . ') ';
                 }
                 echo $method['name'] . '(';
                 $paramInfo = false;
                 if (is_array($signature['params'])) {
                     $paramInfo = $signature['params'];
                     $params = '';
                     foreach ($signature['params'] as $param) {
                         $params .= ', (' . $param['type'] . ') ' . $param['name'] . ' ';
                     }
                     echo substr($params, 1);
                 }
                 echo ')</div>';
                 if (is_array($paramInfo)) {
                     echo '<div class="params"><h3>Parameters</h3><ul>';
                     foreach ($paramInfo as $param) {
                         echo '<li class="param">';
                         echo '<label>(' . $param['type'] . ') ' . $param['name'] . '</label> ';
                         echo '<span>' . $param['description'] . '</span>';
                         echo '</li>';
                     }
                     echo '</ul></div>';
                 }
             }
         }
         if ($method['purpose']) {
             echo '<div class="purpose">' . $method['purpose'] . '</div>';
         }
         if (is_array($method['notes'])) {
             echo '<div class="notes"><h3>Notes</h3><ol>';
             foreach ($method['notes'] as $note) {
                 echo '<li><span>' . $note . '</span></li>';
             }
             echo '</ol></div>';
         }
         if (is_array($method['see'])) {
             echo '<div class="see">';
             echo '<h3>See</h3>';
             echo '<ul>';
             foreach ($method['see'] as $link => $description) {
                 echo '<li>';
                 if (isset($allMethods[$link])) {
                     echo '<a href="#method_' . (int) $allMethods[$link] . '">' . $link . '</a> <span>' . $description . '</span>';
                 } else {
                     echo '<span>' . $link . ' ' . $description . '</span>';
                 }
                 echo '</li>';
             }
             echo '</ul></div>';
         }
     }
     echo '</div>';
     echo $this->footer;
     echo '<div class="footer">';
     echo 'Powered by <a href="http://ripcord.googlecode.com/">Ripcord : Simple RPC Server</a>.';
     echo '</div>';
     echo '</div></body></html>';
 }
Example #21
0
    /**
     * READ ONLY test
     * Test that the same number of members are returned
     * for each existing group in the system
     * @param object $client
     */
    function moodle_group_get_groupmembers($client) {
        global $DB;

        $groups = $DB->get_records('groups');
        $groupids = array();
        foreach ($groups as $group) {
            $groupids[] = $group->id;
        }
        $function = 'moodle_group_get_groupmembers';
        $params = array('groupids' => $groupids);
        $groupsmembers = $client->call($function, $params);

        foreach($groupsmembers as $groupmembers) {
            $dbgroupmembers = groups_get_members($groupmembers['groupid']);
            unset($groups[$groupmembers['groupid']]);
            $this->assertEqual(count($dbgroupmembers), count($groupmembers['userids']));
        }

        //check that all existing groups have been returned by the web service function
        $this->assertTrue(empty($groups));
       
        
    }
 /** 
  * Main function that processes addresses
  *
  * It might be a good idea to move the caching up one level?
  * 
  * @param string $methodName Lookup method
  * @param array  $inputArray Formatted address array
  * @return array
  * @access private
  */
 function _processArray($methodName, $inputArray)
 {
     $i = 0;
     foreach ($inputArray as $entry) {
         $entry = $this->_verifyInputFormat($entry);
         if (isset($entry["TARGET"]) && !isset($entry["INPUT_ERROR"])) {
             // set up the cache work around
             $GLOBALS[$this->netgeo_global] =& $this;
             if ($this->service == "localizer") {
                 $response = $this->cache->call('localizer_search', $entry["TARGET"]);
             } else {
                 // else do the HTTP request
                 $url = sprintf("%s?method=%s&target=%s", $this->default_server, $methodName, $entry["TARGET"]);
                 $response =& $this->cache->call($this->netgeo_global . '->_executeHttpRequest', $url);
             }
             if (!isset($response)) {
                 $entry["STATUS"] = NETGEO_HTTP_ERROR;
             }
             // parse it all into something useful
             // at this point we should look for NETGEO_LIMIT_EXCEEDED as well
             $dataArray[$i] = $this->_processResult($response);
         } else {
             $dataArray[$i] = $entry;
         }
         $i++;
     }
     if (is_array($dataArray)) {
         return $dataArray;
     } else {
         return array("STATUS" => NETGEO_HTTP_ERROR);
     }
 }
/**
 * Process_eWay payment.
 *
 * Processes an eWay token payment
 *
 * @param object $soap_client
 *          An eWay SOAP client set up and ready to go
 * @param string $managed_customer_id
 *          The eWay token ID for the credit card you want to process
 * @param string $amount_in_cents
 *          The amount in cents to charge the customer
 * @param string $invoice_reference
 *          InvoiceReference to send to eWay
 * @param string $invoice_description
 *   InvoiceDescription to send to eWay
 *
 * @throws SoapFault exceptions
 *
 * @return array
 *   eWay response
 */
function process_eway_payment($soap_client, $managed_customer_id, $amount_in_cents, $invoice_reference, $invoice_description)
{
    // PHP bug: https://bugs.php.net/bug.php?id=49669. issue with value greater than 2147483647.
    settype($managed_customer_id, "float");
    // @todo call the new ewayrecurring.payment api to do this & rely on it setting trxn_id
    // or throwing an Exception.
    $paymentinfo = array('man:managedCustomerID' => $managed_customer_id, 'man:amount' => $amount_in_cents, 'man:InvoiceReference' => $invoice_reference, 'man:InvoiceDescription' => $invoice_description);
    $soapaction = 'https://www.eway.com.au/gateway/managedpayment/ProcessPayment';
    $result = $soap_client->call('man:ProcessPayment', $paymentinfo, '', $soapaction);
    return $result;
}