protected function getEbayHeaders()
    {
        $headers = [];

        // Add required headers first.
        $headers[self::HDR_AUTHORIZATION] = 'Bearer '.$this->getConfig('authorization');

        // Add optional headers.
        if ($this->getConfig('marketplaceId')) {
            $headers[self::HDR_MARKETPLACE_ID] = $this->getConfig('marketplaceId');
        }

        $endUserCTX = [];
        if ($this->getConfig('affiliateCampaignId')) {
            $endUserCTX[ ] = 'affiliateCampaignId='.$this->getConfig('affiliateCampaignId');
        }
        if ($this->getConfig('affiliateReferenceId')) {
            $endUserCTX[ ] = 'affiliateReferenceId='.$this->getConfig('affiliateReferenceId');
        }
        if ($this->getConfig('contextualLocation')) {
            $endUserCTX[ ] = 'contextualLocation='.$this->getConfig('contextualLocation');
        }
        if (count($endUserCTX)) {
            $headers[self::HDR_END_USER_CTX ] = implode(',', $endUserCTX);
        }

        return $headers;
    }
protected function getEbayHeaders()
    {
        $headers = [];

        
        $headers[self::HDR_AUTHORIZATION] = 'Bearer '.$this->getConfig('authorization');

        
        if ($this->getConfig('marketplaceId')) {
            $headers[self::HDR_MARKETPLACE_ID] = $this->getConfig('marketplaceId');
        }

        $endUserCTX = [];
        if ($this->getConfig('affiliateCampaignId')) {
            $endUserCTX[ ] = 'affiliateCampaignId='.$this->getConfig('affiliateCampaignId');
        }
        if ($this->getConfig('affiliateReferenceId')) {
            $endUserCTX[ ] = 'affiliateReferenceId='.$this->getConfig('affiliateReferenceId');
        }
        if ($this->getConfig('contextualLocation')) {
            $endUserCTX[ ] = 'contextualLocation='.$this->getConfig('contextualLocation');
        }
        if (count($endUserCTX)) {
            $headers[self::HDR_END_USER_CTX ] = implode(',', $endUserCTX);
        }

        return $headers;
    }
protected function getEbayHeaders ( ) { $ headers = [ ] ; // Add required headers first. $ headers [ self :: HDR_AUTHORIZATION ] = 'Bearer ' . $ this -> getConfig ( 'authorization' ) ; // Add optional headers. if ( $ this -> getConfig ( 'marketplaceId' ) ) { $ headers [ self :: HDR_MARKETPLACE_ID ] = $ this -> getConfig ( 'marketplaceId' ) ; } $ endUserCTX = [ ] ; if ( $ this -> getConfig ( 'affiliateCampaignId' ) ) { $ endUserCTX [ ] = 'affiliateCampaignId=' . $ this -> getConfig ( 'affiliateCampaignId' ) ; } if ( $ this -> getConfig ( 'affiliateReferenceId' ) ) { $ endUserCTX [ ] = 'affiliateReferenceId=' . $ this -> getConfig ( 'affiliateReferenceId' ) ; } if ( $ this -> getConfig ( 'contextualLocation' ) ) { $ endUserCTX [ ] = 'contextualLocation=' . $ this -> getConfig ( 'contextualLocation' ) ; } if ( count ( $ endUserCTX ) ) { $ headers [ self :: HDR_END_USER_CTX ] = implode ( ',' , $ endUserCTX ) ; } return $ headers ; }
Builds the needed eBay HTTP headers.

@return array An associative array of eBay HTTP headers.
Builds the needed eBay HTTP headers .