/home/techb158/ileadtechnology.com/SSM/vendor/stripe/stripe-php/lib/SubscriptionItem.php (3997B)
Related guides: Set up a subscription and more about products and plans.
* @property int $quantity The quantity of the plan to which the customer should be subscribed. * @property string $subscription Thesubscription this subscription_item belongs to.
* @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item.
*/
class SubscriptionItem extends ApiResource
{
const OBJECT_NAME = 'subscription_item';
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
use ApiOperations\Update;
const PATH_USAGE_RECORDS = '/usage_records';
/**
* @param null|string $id the ID of the subscription item on which to create the usage record
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\UsageRecord
*/
public static function createUsageRecord($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts);
}
/**
* @deprecated usageRecordSummaries is deprecated. Please use SubscriptionItem::allUsageRecordSummaries instead.
*
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection the list of usage record summaries
*/
public function usageRecordSummaries($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/usage_record_summaries';
list($response, $opts) = $this->_request('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);
return $obj;
}
const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries';
/**
* @param string $id the ID of the subscription item on which to retrieve the usage record summaries
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection the list of usage record summaries
*/
public static function allUsageRecordSummaries($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_USAGE_RECORD_SUMMARIES, $params, $opts);
}
}