* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @copyright PayPal */ namespace PaypalAddons\classes\API\Request; use PaypalAddons\classes\AbstractMethodPaypal; use PaypalAddons\services\FormatterPaypal; use PaypalAddons\services\PaypalContext; use PayPalCheckoutSdk\Core\PayPalHttpClient; abstract class RequestAbstract implements RequestInteface { /** PayPalHttpClient*/ protected $client; /** @var \Context */ protected $context; /** @var AbstractMethodPaypal */ protected $method; /** @var \Module */ protected $module; /** @var FormatterPaypal */ protected $formatter; /** @var PaypalContext */ protected $paypalContext; public function __construct(PayPalHttpClient $client, AbstractMethodPaypal $method) { $this->client = $client; $this->method = $method; $this->context = \Context::getContext(); $this->module = \Module::getInstanceByName($method->name); $this->formatter = new FormatterPaypal(); $this->paypalContext = PaypalContext::getContext(); } /** * @return array */ protected function getHeaders() { $headers = [ 'PayPal-Partner-Attribution-Id' => $this->method->getPaypalPartnerId(), ]; return $headers; } abstract public function execute(); }