paid. This amount can be less than the amount_requested if the PaymentIntent’s amount_received is not sufficient to pay all of the invoices that it is attached to.
* @property int $amount_requested Amount intended to be paid toward this invoice, in cents (or local equivalent)
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
* @property Invoice|string $invoice The invoice that was paid.
* @property bool $is_default Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s amount_remaining. The PaymentIntent associated with the default payment can’t be edited or canceled directly.
* @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
* @property (object{charge?: Charge|string, payment_intent?: PaymentIntent|string, type: string}&StripeObject) $payment
* @property string $status The status of the payment, one of open, paid, or canceled.
* @property (object{canceled_at: null|int, paid_at: null|int}&StripeObject) $status_transitions
*/
class InvoicePayment extends ApiResource
{
const OBJECT_NAME = 'invoice_payment';
/**
* When retrieving an invoice, there is an includable payments property containing
* the first handful of those items. There is also a URL where you can retrieve the
* full (paginated) list of payments.
*
* @param null|array{ending_before?: string, expand?: string[], invoice?: string, limit?: int, payment?: array{payment_intent?: string, type: string}, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return Collection of ApiResources
*
* @throws Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, Collection::class, $params, $opts);
}
/**
* Retrieves the invoice payment with the given ID.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return InvoicePayment
*
* @throws Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}