Get Customer Data

@param array $arg_params
@return null|object
@throws \Exception
344658
public static function get(array $arg_params)
    {
        //validate params
        $data = self::getParams($arg_params);
        $url = '/ecommerce/customers';
        if(!empty($data['id'])){
            $url .= '/'.$data['id'];
        }else{
            return null;
        }

        //submit to api
        $customer_data = APIRequests::request(
            $url,
            APIRequests::METHOD_GET
        );

        //return response
        return self::toObj($customer_data['body']);
    }
59770
public function get_parameters($param=null)
    {
        $params = $this->params;
        $params['MAILBOX'] = $this->mailbox;
        $params['ORDER']   = $this->order;

        if ($param !== null) {
            return $params[$param];
        }

        return $params;
    }
464588
public function find($args = null)
    {
        $this->areArgumentsValid($args, ['getProgress', 'showTaskLists', 'showTasks']);

        return $this->client->get("$this->endpoint/$this->id", $args)->response();
    }
519360
private function args_get()
    {
        $default = [];
        foreach ($this->config['args'] as $arg => $info) {
            if (isset($info['default']))
                $default[str_replace(':', '', $arg)] = $info['default'];
        }
        $this->args = array_merge(
            $default, getopt('h', array_keys($this->config['args']))
        );
    }
1138126
public function getData ()
	{
		
		// PaymentMethod independant checks
		$this->validate( 'transactionReference', 'currency', 'siteId', 'amount', 'description', 'returnUrl', 
				'notifyUrl', 'ipaddress' );
		
		// PaymentMethod specific checks
		$this->validatePaymentMethodSpecific();
		
		// Transaction data
		$data = array( 
				'ref' => $this->getTransactionReference(), 
				'currency' => $this->getCurrency(), 
				'site_id' => $this->getSiteId(), 
				'amount' => $this->getAmountInteger(), 
				'description' => $this->getDescription(), 
				'control_url' => $this->getNotifyUrl(), 
				'return_url' => $this->getReturnUrl(), 
				'return_url_failed' => $this->getCancelUrl(), 
				'ip_address' => $this->getIpAddress(), 
				'language' => $this->getLanguage() 
		);
		if ( $this->getPaymentMethod() == 'ideal' ) {
			$data['issuer_id'] = $this->getIssuer();
		}
		
		// Customer data
		$customerData = new CreditCard( $_POST );
		if ( $customerData && strlen( $customerData->getFirstName() ) && strlen( $customerData->getLastName() ) ) {
			$data['customer'] = array( 
					'first_name' => $customerData->getFirstName(), 
					'last_name' => $customerData->getLastName(), 
					'company_name' => $customerData->getCompany(), 
					'address' => $customerData->getAddress1(), 
					'city' => $customerData->getCity(), 
					'state' => $customerData->getState(), 
					'postal_code' => $customerData->getPostcode(), 
					'country_code' => $customerData->getCountry(), 
					'phone_number' => $customerData->getPhone(), 
					'email' => $customerData->getEmail() 
			);
		}
		
		return $data;
	}
982988
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);
    }
842089
public function get( array $args = [], array $assoc_args = [] ) {

		$site_id = (int) $args[ 0 ];
		$site    = get_blog_details( $site_id );
		if ( ! $site ) {
			WP_CLI::error( "A site with ID {$site_id} does not exist" );
		}

		// trailing-slash it, as URLs ends always with a trailing slash in context of the wp_blogs table
		WP_CLI::line( trailingslashit( $site->siteurl ) );
		exit( 0 );
	}
54832
protected function loadParams()
    {
        $patientNr           = $this->_getParam(\MUtil_Model::REQUEST_ID1);
        $this->appointmentId = $this->_getParam(\Gems_Model::APPOINTMENT_ID);

        if ($this->appointmentId) {
            $select = $this->db->select();
            $select->from('gems__appointments', array('gap_id_user', 'gap_id_organization'))
                    ->joinInner(
                            'gems__respondent2org',
                            'gap_id_user = gr2o_id_user AND gap_id_organization = gr2o_id_organization',
                            array('gr2o_patient_nr')
                            )
                    ->where('gap_id_appointment = ?', $this->appointmentId);
            $data = $this->db->fetchRow($select);

            if ($data) {
                $this->organizationId = $data['gap_id_organization'];
                $this->respondentId   = $data['gap_id_user'];
                $patientNr            = $data['gr2o_patient_nr'];
            }
        } else {
            $this->organizationId = $this->_getParam(\MUtil_Model::REQUEST_ID2);

            if ($patientNr && $this->organizationId) {
                $this->respondentId   = $this->util->getDbLookup()->getRespondentId(
                        $patientNr,
                        $this->organizationId
                        );
            }
        }

        if (! $this->respondentId) {
            throw new \Gems_Exception($this->_('Requested agenda data not available!'));
        } else {
            $orgs = $this->currentUser->getAllowedOrganizations();

            if (! isset($orgs[$this->organizationId])) {
                $org = $this->loader->getOrganization($this->organizationId);

                if ($org->exists()) {
                    throw new \Gems_Exception(
                            sprintf($this->_('You have no access to %s appointments!'), $org->getName())
                            );
                } else {
                    throw new \Gems_Exception($this->_('Organization does not exist.'));
                }
            }
        }

        $source = $this->menu->getParameterSource();
        if ($this->appointmentId) {
            $source->setAppointmentId($this->appointmentId);
        }
        if ($patientNr && $this->organizationId) {
            $source->setPatient($patientNr, $this->organizationId);
        }
    }
1286794
public static function doCardRefund($arg_params)
    {
        //validate params
        $data = array();
        if(is_array($arg_params)){
            $data = self::getParams($arg_params);
        }else{
            $transaction = json_decode(json_encode($arg_params), true);
            if(!empty($transaction['id'])){
                $data = array('transaction_id'=>$transaction['id']);
            }
        }
        //submit to api
        $refund_data = APIRequests::request(
            '/ecommerce/refund/card',
            APIRequests::METHOD_POST,
            array('payload'=>$data)
        );

        //return response
        return self::toObj($refund_data['body']);
    }
1216577
function getRequestToken($args = array()) {/*{{{*/
    $r = $this->oAuthRequest($this->requestTokenURL(), $args);
    $token = $this->oAuthParseResponse($r);
    $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
    return $token;
  }
890615
public function getEntities(array $args = [])
    {
        $alias = $this->getTableAlias();

        $q = $this->_em
            ->createQueryBuilder()
            ->select($alias)
            ->from('MauticContactClientBundle:ContactClient', $alias, $alias.'.id');

        if (empty($args['iterator_mode'])) {
            $q->leftJoin($alias.'.category', 'c');
        }

        $args['qb'] = $q;

        return parent::getEntities($args);
    }
509599
private function getParams(array $args)
    {
        if (count($args) == 0) {
            return [];
        }

        $params = array_slice($args, -1)[0];

        return is_array($params) ? $params : [];
    }
629577
private function _getMessage() {
		set_error_handler(array(
			$this,
			'_messageErrorHandler'
		), E_ALL);

		$args = func_get_args();
		if (isset($this->messages[$args[0]])) {
			$msg = $this->messages[$args[0]];

			try {
				array_shift($args);
				$formattedMsg = vsprintf($msg, $args);
			} catch (Exception $e) {
				$formattedMsg = $msg;
			}

			set_error_handler(array(
				$this,
				'customErrorHandler'
			), E_ALL);

			return $formattedMsg;
		}

		return FALSE;
	}
414942
public function getValue ($arrParams, $fetchMode = \PDO::FETCH_BOTH)
	{

		// If the params are not valid return FALSE

		if (!$this->validateParams ($arrParams))
		{
			return FALSE;
		}
		
		// Limit to 1 result

		$arrParams['limit']	= '1';

		// Query
		
		$query = $this->genQuery ($arrParams);
		
		// Execute

		$query->execute ();

		// Fetch the first set of results

		$arrResult	= $query->fetch ($fetchMode);
		
		// If there is only 1 column

		if (is_array ($arrResult) && count ($arrResult) === 1)
		{

			// Return the first column only
			
			return array_shift ($arrResult);

		}

		// else

		else
		{

			// Return result

			return $arrResult;

		}

	}
1254850
private static function _getConnectParam($paramName, $params = null)
    {
        $oauthParam = ($params && array_key_exists($paramName, $params))
        ? $params[$paramName] : null;

        if ($oauthParam === null) {
            $funcName = 'get' . Util\Util::toCamelCase($paramName, true);
            $oauthParam = Sumup::{$funcName}();
        }

        if ($oauthParam === null) {
            $msg = 'No '.$paramName.' provided. You can find your '. $paramName
            . ' in your Sumup dashboard at '
            . 'https://me.sumup.com/developers, '
            . 'after registering your account as a platform. See '
            . 'https://sumupus.desk.com/ for details, '
            . 'or email support@sumup.com if you have any questions.';
            throw new Error\AuthenticationError($msg);
        }

        return $oauthParam;
    }
723479
protected function getParameter($args, $key, $defaultValue = NULL)
    {
        $value = util::array_get($args[$key]);
        return is_null($value) ? $defaultValue : $value;
    }
656168
function parseQueryParams()
    {
        $request = $this->getMessageObject();

        $data = array();
        $url  = $request->getTarget();
        if ($p = parse_url($url, PHP_URL_QUERY))
            parse_str($p, $data);

        return $data;
    }