2017 © Pedro Peláez
 

yii2-extension yii2-experian-qas

Experian QAS Pro On Demand Postocde lookup SOAP service integration for the Yii framework. See also http://support.qas.com/experian_qas_pro_ondemand__php_only__technical_update_2021.htm

image

exertis/yii2-experian-qas

Experian QAS Pro On Demand Postocde lookup SOAP service integration for the Yii framework. See also http://support.qas.com/experian_qas_pro_ondemand__php_only__technical_update_2021.htm

  • Tuesday, November 17, 2015
  • by russellhutsonmicro-p
  • Repository
  • 4 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-experian-qas

Packaging Experian QAS Pro On Demand for Yii2 and Packagist, (*1)

Rough Usage Example, (*2)

This example is based on the Yii2 Framework, hence \Yii::$app->params['qas.username'] and \Yii::$app->params['qas.password'] will yield username and password from the Yii parameters file., (*3)

This example performs the setup and search., (*4)

        define("CONTROL_WSDL_URN", "https://your.wsdl.storage/ProOnDemandService.wsdl");

        $qas = new \exertis\experianqas\QuickAddress(CONTROL_WSDL_URN);

        if (empty($qas)) {
            throw new Exception('QAS: Initial connection failed');
        }

        $qas->setQASCredentials(\Yii::$app->params['qas.username'], \Yii::$app->params['qas.password']);

        // Find out available DataSets
        $aDataSets = $qas->getAllDataSets();
        $sPromptSet = $qas->getPromptSet('GBR');
        $layouts = $qas->getAllLayouts('GBR');

        # Perform the initial search (singleline engine, flattened picklists)
        $qas->setEngineType(QAS_SINGLELINE_ENGINE);
        $qas->setFlatten(TRUE);
        $picklist = $qas->searchSingleline('GBR', [$postcode], 'Optimal');

The result is a 'picklist' which you could process as follows:, (*5)

        if (!empty($picklist->atItems) && is_array($picklist->atItems)) {
            // loop through each possible matched address
            $addresses = [];

            foreach ($picklist->atItems as $atItem) {

                //$formattedAddress = $qas->getFormattedAddress('QADefault', $atItem->Moniker);
                $formattedAddress = $qas->getFormattedAddress('FullPAF', $atItem->Moniker); // FormattedAddress

                $address = [

                        'picklistvalue' => $atItem->Picklist,
                        'flatNumber' => $formattedAddress->atAddressLines[5]->Line, // Sub-building name
                        'houseName' => $formattedAddress->atAddressLines[7]->Line, // Building name
                        'houseNumber' => $formattedAddress->atAddressLines[8]->Line, // Building number
                        'streetName' => $formattedAddress->atAddressLines[15]->Line, // Thoroughfare
                        'locality' => $formattedAddress->atAddressLines[18]->Line, // Dependent locality
                        'town' => $formattedAddress->atAddressLines[20]->Line, // Town
                        'county' => $formattedAddress->atAddressLines[21]->Line, // County
                        'id' => $atItem->Moniker,
                ];

                $addresses[] = $address;
            } // foreach

The Versions

17/11 2015

dev-master

9999999-dev

Experian QAS Pro On Demand Postocde lookup SOAP service integration for the Yii framework. See also http://support.qas.com/experian_qas_pro_ondemand__php_only__technical_update_2021.htm

  Sources   Download

BSD-3-Clause

The Requires

 

by Russell Hutson

php yii2 postcode qas lookup experian pro on demand