Class: Stripe::InvoicePayment
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::InvoicePayment
- Extended by:
- APIOperations::List
- Defined in:
- lib/stripe/resources/invoice_payment.rb
Overview
Invoice Payments represent payments made against invoices. Invoice Payments can be accessed in two ways:
-
By expanding the ‘payments` field on the [Invoice](stripe.com/docs/api#invoice) resource.
-
By using the Invoice Payment retrieve and list endpoints.
Invoice Payments include the mapping between payment objects, such as Payment Intent, and Invoices. This resource and its endpoints allows you to easily track if a payment is associated with a specific invoice and monitor the allocation details of the payments.
Defined Under Namespace
Classes: ListParams, Payment, StatusTransitions
Constant Summary collapse
- OBJECT_NAME =
"invoice_payment"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#amount_paid ⇒ Object
readonly
Amount that was actually paid for this invoice, in cents (or local equivalent).
-
#amount_requested ⇒ Object
readonly
Amount intended to be paid toward this invoice, in cents (or local equivalent).
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#currency ⇒ Object
readonly
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#invoice ⇒ Object
readonly
The invoice that was paid.
-
#is_default ⇒ Object
readonly
Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s ‘amount_remaining`.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#payment ⇒ Object
readonly
Attribute for field payment.
-
#status ⇒ Object
readonly
The status of the payment, one of ‘open`, `paid`, or `canceled`.
-
#status_transitions ⇒ Object
readonly
Attribute for field status_transitions.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
When retrieving an invoice, there is an includable payments property containing the first handful of those items.
- .object_name ⇒ Object
Methods included from APIOperations::List
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#amount_paid ⇒ Object (readonly)
Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is ‘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.
104 105 106 |
# File 'lib/stripe/resources/invoice_payment.rb', line 104 def amount_paid @amount_paid end |
#amount_requested ⇒ Object (readonly)
Amount intended to be paid toward this invoice, in cents (or local equivalent)
106 107 108 |
# File 'lib/stripe/resources/invoice_payment.rb', line 106 def amount_requested @amount_requested end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
108 109 110 |
# File 'lib/stripe/resources/invoice_payment.rb', line 108 def created @created end |
#currency ⇒ Object (readonly)
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).
110 111 112 |
# File 'lib/stripe/resources/invoice_payment.rb', line 110 def currency @currency end |
#id ⇒ Object (readonly)
Unique identifier for the object.
112 113 114 |
# File 'lib/stripe/resources/invoice_payment.rb', line 112 def id @id end |
#invoice ⇒ Object (readonly)
The invoice that was paid.
114 115 116 |
# File 'lib/stripe/resources/invoice_payment.rb', line 114 def invoice @invoice end |
#is_default ⇒ Object (readonly)
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.
116 117 118 |
# File 'lib/stripe/resources/invoice_payment.rb', line 116 def is_default @is_default end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
118 119 120 |
# File 'lib/stripe/resources/invoice_payment.rb', line 118 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
120 121 122 |
# File 'lib/stripe/resources/invoice_payment.rb', line 120 def object @object end |
#payment ⇒ Object (readonly)
Attribute for field payment
122 123 124 |
# File 'lib/stripe/resources/invoice_payment.rb', line 122 def payment @payment end |
#status ⇒ Object (readonly)
The status of the payment, one of ‘open`, `paid`, or `canceled`.
124 125 126 |
# File 'lib/stripe/resources/invoice_payment.rb', line 124 def status @status end |
#status_transitions ⇒ Object (readonly)
Attribute for field status_transitions
126 127 128 |
# File 'lib/stripe/resources/invoice_payment.rb', line 126 def status_transitions @status_transitions end |
Class Method Details
.field_remappings ⇒ Object
137 138 139 |
# File 'lib/stripe/resources/invoice_payment.rb', line 137 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
133 134 135 |
# File 'lib/stripe/resources/invoice_payment.rb', line 133 def self.inner_class_types @inner_class_types = { payment: Payment, status_transitions: StatusTransitions } end |
.list(params = {}, opts = {}) ⇒ Object
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.
129 130 131 |
# File 'lib/stripe/resources/invoice_payment.rb', line 129 def self.list(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/invoice_payments", params: params, opts: opts) end |
.object_name ⇒ Object
17 18 19 |
# File 'lib/stripe/resources/invoice_payment.rb', line 17 def self.object_name "invoice_payment" end |