Class: Stripe::PaymentRecord
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::PaymentRecord
- Defined in:
- lib/stripe/resources/payment_record.rb
Overview
A Payment Record is a resource that allows you to represent payments that occur on- or off-Stripe. For example, you can create a Payment Record to model a payment made on a different payment processor, in order to mark an Invoice as paid and a Subscription as active. Payment Records consist of one or more Payment Attempt Records, which represent individual attempts made on a payment network.
Defined Under Namespace
Classes: Amount, AmountAuthorized, AmountCanceled, AmountFailed, AmountGuaranteed, AmountRefunded, AmountRequested, CustomerDetails, PaymentMethodDetails, ProcessorDetails, ShippingDetails
Constant Summary collapse
- OBJECT_NAME =
"payment_record"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_authorized ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_canceled ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_failed ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_guaranteed ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_refunded ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#amount_requested ⇒ Object
readonly
A representation of an amount of money, consisting of an amount and a currency.
-
#application ⇒ Object
readonly
ID of the Connect application that created the PaymentRecord.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#customer_details ⇒ Object
readonly
Customer information for this payment.
-
#customer_presence ⇒ Object
readonly
Indicates whether the customer was present in your checkout flow during this payment.
-
#description ⇒ Object
readonly
An arbitrary string attached to the object.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#latest_payment_attempt_record ⇒ Object
readonly
ID of the latest Payment Attempt Record attached to this Payment Record.
-
#livemode ⇒ Object
readonly
If the object exists in live mode, the value is ‘true`.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#payment_method_details ⇒ Object
readonly
Information about the Payment Method debited for this payment.
-
#processor_details ⇒ Object
readonly
Processor information associated with this payment.
-
#reported_by ⇒ Object
readonly
Indicates who reported the payment.
-
#shipping_details ⇒ Object
readonly
Shipping information for this payment.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
- .object_name ⇒ Object
-
.report_payment(params = {}, opts = {}) ⇒ Object
Report a new Payment Record.
-
.report_payment_attempt(id, params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record.
-
.report_payment_attempt_canceled(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was canceled.
-
.report_payment_attempt_failed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record failed or errored.
-
.report_payment_attempt_guaranteed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was guaranteed.
-
.report_payment_attempt_informational(id, params = {}, opts = {}) ⇒ Object
Report informational updates on the specified Payment Record.
-
.report_refund(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was refunded.
Instance Method Summary collapse
-
#report_payment_attempt(params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record.
-
#report_payment_attempt_canceled(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was canceled.
-
#report_payment_attempt_failed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record failed or errored.
-
#report_payment_attempt_guaranteed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was guaranteed.
-
#report_payment_attempt_informational(params = {}, opts = {}) ⇒ Object
Report informational updates on the specified Payment Record.
-
#report_refund(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record was refunded.
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?, field_encodings, #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 ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
2132 2133 2134 |
# File 'lib/stripe/resources/payment_record.rb', line 2132 def amount @amount end |
#amount_authorized ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
2134 2135 2136 |
# File 'lib/stripe/resources/payment_record.rb', line 2134 def @amount_authorized end |
#amount_canceled ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
2136 2137 2138 |
# File 'lib/stripe/resources/payment_record.rb', line 2136 def amount_canceled @amount_canceled end |
#amount_failed ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
2138 2139 2140 |
# File 'lib/stripe/resources/payment_record.rb', line 2138 def amount_failed @amount_failed end |
#amount_guaranteed ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
2140 2141 2142 |
# File 'lib/stripe/resources/payment_record.rb', line 2140 def amount_guaranteed @amount_guaranteed end |
#amount_refunded ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
2142 2143 2144 |
# File 'lib/stripe/resources/payment_record.rb', line 2142 def amount_refunded @amount_refunded end |
#amount_requested ⇒ Object (readonly)
A representation of an amount of money, consisting of an amount and a currency.
2144 2145 2146 |
# File 'lib/stripe/resources/payment_record.rb', line 2144 def amount_requested @amount_requested end |
#application ⇒ Object (readonly)
ID of the Connect application that created the PaymentRecord.
2146 2147 2148 |
# File 'lib/stripe/resources/payment_record.rb', line 2146 def application @application end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
2148 2149 2150 |
# File 'lib/stripe/resources/payment_record.rb', line 2148 def created @created end |
#customer_details ⇒ Object (readonly)
Customer information for this payment.
2150 2151 2152 |
# File 'lib/stripe/resources/payment_record.rb', line 2150 def customer_details @customer_details end |
#customer_presence ⇒ Object (readonly)
Indicates whether the customer was present in your checkout flow during this payment.
2152 2153 2154 |
# File 'lib/stripe/resources/payment_record.rb', line 2152 def customer_presence @customer_presence end |
#description ⇒ Object (readonly)
An arbitrary string attached to the object. Often useful for displaying to users.
2154 2155 2156 |
# File 'lib/stripe/resources/payment_record.rb', line 2154 def description @description end |
#id ⇒ Object (readonly)
Unique identifier for the object.
2156 2157 2158 |
# File 'lib/stripe/resources/payment_record.rb', line 2156 def id @id end |
#latest_payment_attempt_record ⇒ Object (readonly)
ID of the latest Payment Attempt Record attached to this Payment Record.
2158 2159 2160 |
# File 'lib/stripe/resources/payment_record.rb', line 2158 def latest_payment_attempt_record @latest_payment_attempt_record end |
#livemode ⇒ Object (readonly)
If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.
2160 2161 2162 |
# File 'lib/stripe/resources/payment_record.rb', line 2160 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
2162 2163 2164 |
# File 'lib/stripe/resources/payment_record.rb', line 2162 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
2164 2165 2166 |
# File 'lib/stripe/resources/payment_record.rb', line 2164 def object @object end |
#payment_method_details ⇒ Object (readonly)
Information about the Payment Method debited for this payment.
2166 2167 2168 |
# File 'lib/stripe/resources/payment_record.rb', line 2166 def payment_method_details @payment_method_details end |
#processor_details ⇒ Object (readonly)
Processor information associated with this payment.
2168 2169 2170 |
# File 'lib/stripe/resources/payment_record.rb', line 2168 def processor_details @processor_details end |
#reported_by ⇒ Object (readonly)
Indicates who reported the payment.
2170 2171 2172 |
# File 'lib/stripe/resources/payment_record.rb', line 2170 def reported_by @reported_by end |
#shipping_details ⇒ Object (readonly)
Shipping information for this payment.
2172 2173 2174 |
# File 'lib/stripe/resources/payment_record.rb', line 2172 def shipping_details @shipping_details end |
Class Method Details
.field_remappings ⇒ Object
2332 2333 2334 |
# File 'lib/stripe/resources/payment_record.rb', line 2332 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 |
# File 'lib/stripe/resources/payment_record.rb', line 2316 def self.inner_class_types @inner_class_types = { amount: Amount, amount_authorized: AmountAuthorized, amount_canceled: AmountCanceled, amount_failed: AmountFailed, amount_guaranteed: AmountGuaranteed, amount_refunded: AmountRefunded, amount_requested: AmountRequested, customer_details: CustomerDetails, payment_method_details: PaymentMethodDetails, processor_details: ProcessorDetails, shipping_details: ShippingDetails, } end |
.object_name ⇒ Object
11 12 13 |
# File 'lib/stripe/resources/payment_record.rb', line 11 def self.object_name "payment_record" end |
.report_payment(params = {}, opts = {}) ⇒ Object
Report a new Payment Record. You may report a Payment Record as it is
initialized and later report updates through the other report_* methods, or report Payment
Records in a terminal state directly, through this method.
2177 2178 2179 2180 2181 2182 2183 2184 |
# File 'lib/stripe/resources/payment_record.rb', line 2177 def self.report_payment(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/payment_records/report_payment", params: params, opts: opts ) end |
.report_payment_attempt(id, params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record. A new payment
attempt can only be specified if all other payment attempts are canceled or failed.
2199 2200 2201 2202 2203 2204 2205 2206 |
# File 'lib/stripe/resources/payment_record.rb', line 2199 def self.report_payment_attempt(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_payment_attempt_canceled(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was canceled.
2221 2222 2223 2224 2225 2226 2227 2228 |
# File 'lib/stripe/resources/payment_record.rb', line 2221 def self.report_payment_attempt_canceled(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_payment_attempt_failed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
failed or errored.
2243 2244 2245 2246 2247 2248 2249 2250 |
# File 'lib/stripe/resources/payment_record.rb', line 2243 def self.report_payment_attempt_failed(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_payment_attempt_guaranteed(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was guaranteed.
2265 2266 2267 2268 2269 2270 2271 2272 |
# File 'lib/stripe/resources/payment_record.rb', line 2265 def self.report_payment_attempt_guaranteed(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_payment_attempt_informational(id, params = {}, opts = {}) ⇒ Object
Report informational updates on the specified Payment Record.
2285 2286 2287 2288 2289 2290 2291 2292 |
# File 'lib/stripe/resources/payment_record.rb', line 2285 def self.report_payment_attempt_informational(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_informational", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.report_refund(id, params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was refunded.
2307 2308 2309 2310 2311 2312 2313 2314 |
# File 'lib/stripe/resources/payment_record.rb', line 2307 def self.report_refund(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_refund", { id: CGI.escape(id) }), params: params, opts: opts ) end |
Instance Method Details
#report_payment_attempt(params = {}, opts = {}) ⇒ Object
Report a new payment attempt on the specified Payment Record. A new payment
attempt can only be specified if all other payment attempts are canceled or failed.
2188 2189 2190 2191 2192 2193 2194 2195 |
# File 'lib/stripe/resources/payment_record.rb', line 2188 def report_payment_attempt(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_payment_attempt_canceled(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was canceled.
2210 2211 2212 2213 2214 2215 2216 2217 |
# File 'lib/stripe/resources/payment_record.rb', line 2210 def report_payment_attempt_canceled(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_payment_attempt_failed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
failed or errored.
2232 2233 2234 2235 2236 2237 2238 2239 |
# File 'lib/stripe/resources/payment_record.rb', line 2232 def report_payment_attempt_failed(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_payment_attempt_guaranteed(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was guaranteed.
2254 2255 2256 2257 2258 2259 2260 2261 |
# File 'lib/stripe/resources/payment_record.rb', line 2254 def report_payment_attempt_guaranteed(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_payment_attempt_informational(params = {}, opts = {}) ⇒ Object
Report informational updates on the specified Payment Record.
2275 2276 2277 2278 2279 2280 2281 2282 |
# File 'lib/stripe/resources/payment_record.rb', line 2275 def report_payment_attempt_informational(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_payment_attempt_informational", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#report_refund(params = {}, opts = {}) ⇒ Object
Report that the most recent payment attempt on the specified Payment Record
was refunded.
2296 2297 2298 2299 2300 2301 2302 2303 |
# File 'lib/stripe/resources/payment_record.rb', line 2296 def report_refund(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payment_records/%<id>s/report_refund", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |