code: 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;
      }
docs: Builds the needed eBay HTTP headers.
  
  @return array An associative array of eBay HTTP headers.