json, $opts); $obj->setLastResponse($response); return $obj; } /** * @param array|string|null $opts * * @return Invoice The saved invoice. */ public function save($opts = null) { return $this->_save($opts); } /** * @return Invoice The paid invoice. */ public function pay($opts = null) { $url = $this->instanceUrl() . '/pay'; list($response, $opts) = $this->_request('post', $url, null, $opts); $this->refreshFrom($response, $opts); return $this; } }