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