instanceUrl() . '/finalize'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } /** * @param array|null $params * @param array|string|null $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return Invoice The uncollectible invoice. */ public function markUncollectible($params = null, $opts = null) { $url = $this->instanceUrl() . '/mark_uncollectible'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } /** * @param array|null $params * @param array|string|null $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return Invoice The paid invoice. */ public function pay($params = null, $opts = null) { $url = $this->instanceUrl() . '/pay'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } /** * @param array|null $params * @param array|string|null $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return Invoice The sent invoice. */ public function sendInvoice($params = null, $opts = null) { $url = $this->instanceUrl() . '/send'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } /** * @param array|null $params * @param array|string|null $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return Invoice The upcoming invoice. */ public static function upcoming($params = null, $opts = null) { $url = static::classUrl() . '/upcoming'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); $obj = Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; } /** * @param array|null $params * @param array|string|null $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return Invoice The voided invoice. */ public function voidInvoice($params = null, $opts = null) { $url = $this->instanceUrl() . '/void'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } }