class InvoiceItem extends Resource implements InvoiceItemInterface

Sometimes you want to add a charge or credit to a customer, but actually charge or credit the customer's card only at the end of a regular billing cycle. This is useful for combining several charges (to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals.

Traits

Retrieve.
Update.
List All.
Delete.

Properties

string $id A unique identifier for the resource. from Resource
protected mixed $response A response from Stripe. from Resource

Methods

string
getId()

Returns the unique identifier for this resource.

from Resource
mixed
getResponse()

Returns the raw Stripe response.

from Resource
void
setProperties()

Set the response data as properties on the class.

from Resource
retrieve(string $id)

Get a resource by the ID.

from Retrieve
update(string $id, array $data)

Update a resource.

from Update
listAll(array $arguments = [])

List all the resources.

from ListAll
delete(string $id)

Delete a resource.

from Delete
create(CustomerInterface $customer, InvoiceItemTypeInterface $type, array $arguments = [], string $key = null, string $currency = 'usd')

Creates an item to be added to a draft invoice. If no invoice is specified, the item will be on the next invoice created for the customer specified.

void
stripe(string $method, $arguments, string $idempotencyKey = null)

No description

Details

in Resource at line 29
string getId()

Returns the unique identifier for this resource.

Return Value

string

in Resource at line 39
mixed getResponse()

Returns the raw Stripe response.

Return Value

mixed

in Resource at line 47
protected void setProperties()

Set the response data as properties on the class.

Return Value

void

in Retrieve at line 17
Retrieve retrieve(string $id)

Get a resource by the ID.

Parameters

string $id

Return Value

Retrieve

in Update at line 18
Update update(string $id, array $data)

Update a resource.

Parameters

string $id
array $data

Return Value

Update

in ListAll at line 21
ListAll listAll(array $arguments = [])

List all the resources.

This will list all of the resources from which this trait belongs to. It will then return itself, so you can method chain it, or reuse the same instantiation.

Parameters

array $arguments

Return Value

ListAll

in Delete at line 21
Delete delete(string $id)

Delete a resource.

Delete a resource associated with the class this trait is being used. You must pass in the ID of the resource that you wish to delete. Then it will return the same instance of the class from which it was called.

Parameters

string $id

Return Value

Delete

at line 38
InvoiceItemInterface create(CustomerInterface $customer, InvoiceItemTypeInterface $type, array $arguments = [], string $key = null, string $currency = 'usd')

Creates an item to be added to a draft invoice. If no invoice is specified, the item will be on the next invoice created for the customer specified.

Parameters

CustomerInterface $customer
InvoiceItemTypeInterface $type
array $arguments
string $key
string $currency

Return Value

InvoiceItemInterface

at line 48
protected void stripe(string $method, $arguments, string $idempotencyKey = null)

Parameters

string $method
$arguments
string $idempotencyKey

Return Value

void