/** * @param $result * @throws \Exception */ public function __construct($result) { if (QuickAddress::check_soap($result) != NULL) { if (isset($result->QAPicklist)) { $this->picklist = new Picklist($result); } if (isset($result->QAAddress)) { $this->address = new FormattedAddress($result); } $this->sVerifyLevel = $result->VerifyLevel; } }
*/ // Set the username and password. define("USERNAME", "ws_eval_3371_ext"); define("PASSWORD", "Younique123"); // URL of local isntance of QASOnDemand.txt. This is pointing to the "qas" folder. $WSDL = dirname(__FILE__) . DIRECTORY_SEPARATOR . "qas" . DIRECTORY_SEPARATOR . "QASOnDemand.txt"; // Get search information $action = isset($_REQUEST['action']) ? rawurldecode($_REQUEST['action']) : ""; $addLayout = isset($_REQUEST['addlayout']) ? rawurldecode($_REQUEST['addlayout']) : ""; $country = isset($_REQUEST['country']) ? rawurldecode($_REQUEST['country']) : ""; $searchstring = isset($_REQUEST['searchstring']) ? rawurldecode($_REQUEST['searchstring']) : ""; $moniker = isset($_REQUEST['moniker']) ? rawurldecode($_REQUEST['moniker']) : ""; $refineText = isset($_REQUEST['refinetext']) ? rawurldecode($_REQUEST['refinetext']) : ""; // Instantiate the client. try { $qAddress = new QuickAddress($WSDL); $qAddress->setEngineType(QAS_VERIFICATION_ENGINE); $qAddress->setFlatten(true); // Perform action based on request. if ($action == "search") { $result = $qAddress->search($country, explode(",", $searchstring), QAS_DEFAULT_PROMPT, $addLayout); ?> <verifylevel><?php echo $result->sVerifyLevel; ?> </verifylevel> <?php if ($result->sVerifyLevel == "Verified" || $result->sVerifyLevel == "InteractionRequired") { ?> <dpvstatus><?php echo $result->address->sDpvStatus;
/** * Pick an address from a list * @param integer $answerId If set we are updating an existing answer * @param array $postData */ public function do_pickAddress($answerId, $postData) { if (empty($postData['addressMoniker'])) { throw new \Jazzee\Exception('Tried to do QASAddress::do_pickAddress with no addressMoniker'); } $qas = new \QuickAddress($this->_applicationPage->getPage()->getVar('wsdlAddress')); $address = $qas->getFormattedAddress("Database layout", $postData['addressMoniker']); $arr = $address->atAddressLines; $originalInput = unserialize(base64_decode($postData['originalInput'])); $input = new \Foundation\Form\Input($postData); $input->set('el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_ADDRESS1)->getId(), $arr[0]->Line); $input->set('el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_ADDRESS2)->getId(), $arr[1]->Line); $input->set('el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_ADDRESS3)->getId(), $originalInput->get('address3')); $input->set('el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_CITY)->getId(), $arr[3]->Line); $input->set('el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_STATE)->getId(), $arr[4]->Line); $input->set('el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_POSTALCODE)->getId(), $arr[5]->Line); $input->set('el' . $this->_applicationPage->getPage()->getElementByFixedId(self::FID_COUNTRY)->getId(), $originalInput->get('countryName')); if (!empty($answerId)) { $this->updateAnswer($input, $answerId); $this->_controller->setVar('currentAnswerID', null); } else { $this->newAnswer($input); } }