/** * {@inheritDoc} */ public function apply($method, \Klarna_Checkout_ResourceInterface $resource, array $options = null) { $previousContentType = \Klarna_Checkout_Order::$contentType; $options['url'] = isset($options['url']) ? $options['url'] : $this->baseUri; \Klarna_Checkout_Order::$contentType = $this->contentType; if ($this->baseUri == $options['url'] && false == isset($options['data']['merchant']['id']) && $this->merchantId) { $options['data']['merchant']['id'] = (string) $this->merchantId; } try { $this->internalConnector->apply($method, $resource, $options); \Klarna_Checkout_Order::$contentType = $previousContentType; } catch (\Exception $e) { \Klarna_Checkout_Order::$contentType = $previousContentType; throw $e; } }
/** * Update order data * * @param array $data data to update order resource with * * @return void */ public function update( array $data ) { $options = array( 'url' => $this->_location, 'data' => $data ); $this->connector->apply('POST', $this, $options); }