Class: Stripe::PaymentRecord

Inherits:
APIResource show all
Extended by:
APIOperations::List
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

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

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

included

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

#amountObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



2164
2165
2166
# File 'lib/stripe/resources/payment_record.rb', line 2164

def amount
  @amount
end

#amount_authorizedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



2166
2167
2168
# File 'lib/stripe/resources/payment_record.rb', line 2166

def amount_authorized
  @amount_authorized
end

#amount_canceledObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



2168
2169
2170
# File 'lib/stripe/resources/payment_record.rb', line 2168

def amount_canceled
  @amount_canceled
end

#amount_failedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



2170
2171
2172
# File 'lib/stripe/resources/payment_record.rb', line 2170

def amount_failed
  @amount_failed
end

#amount_guaranteedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



2172
2173
2174
# File 'lib/stripe/resources/payment_record.rb', line 2172

def amount_guaranteed
  @amount_guaranteed
end

#amount_refundedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



2174
2175
2176
# File 'lib/stripe/resources/payment_record.rb', line 2174

def amount_refunded
  @amount_refunded
end

#amount_requestedObject (readonly)

A representation of an amount of money, consisting of an amount and a currency.



2176
2177
2178
# File 'lib/stripe/resources/payment_record.rb', line 2176

def amount_requested
  @amount_requested
end

#applicationObject (readonly)

ID of the Connect application that created the PaymentRecord.



2178
2179
2180
# File 'lib/stripe/resources/payment_record.rb', line 2178

def application
  @application
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



2180
2181
2182
# File 'lib/stripe/resources/payment_record.rb', line 2180

def created
  @created
end

#customer_detailsObject (readonly)

Customer information for this payment.



2182
2183
2184
# File 'lib/stripe/resources/payment_record.rb', line 2182

def customer_details
  @customer_details
end

#customer_presenceObject (readonly)

Indicates whether the customer was present in your checkout flow during this payment.



2184
2185
2186
# File 'lib/stripe/resources/payment_record.rb', line 2184

def customer_presence
  @customer_presence
end

#descriptionObject (readonly)

An arbitrary string attached to the object. Often useful for displaying to users.



2186
2187
2188
# File 'lib/stripe/resources/payment_record.rb', line 2186

def description
  @description
end

#idObject (readonly)

Unique identifier for the object.



2188
2189
2190
# File 'lib/stripe/resources/payment_record.rb', line 2188

def id
  @id
end

#latest_payment_attempt_recordObject (readonly)

ID of the latest Payment Attempt Record attached to this Payment Record.



2190
2191
2192
# File 'lib/stripe/resources/payment_record.rb', line 2190

def latest_payment_attempt_record
  @latest_payment_attempt_record
end

#livemodeObject (readonly)

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.



2192
2193
2194
# File 'lib/stripe/resources/payment_record.rb', line 2192

def livemode
  @livemode
end

#metadataObject (readonly)

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



2194
2195
2196
# File 'lib/stripe/resources/payment_record.rb', line 2194

def 
  @metadata
end

#objectObject (readonly)

String representing the object's type. Objects of the same type share the same value.



2196
2197
2198
# File 'lib/stripe/resources/payment_record.rb', line 2196

def object
  @object
end

#payment_method_detailsObject (readonly)

Information about the Payment Method debited for this payment.



2198
2199
2200
# File 'lib/stripe/resources/payment_record.rb', line 2198

def payment_method_details
  @payment_method_details
end

#processor_detailsObject (readonly)

Processor information associated with this payment.



2200
2201
2202
# File 'lib/stripe/resources/payment_record.rb', line 2200

def processor_details
  @processor_details
end

#reported_byObject (readonly)

Indicates who reported the payment.



2202
2203
2204
# File 'lib/stripe/resources/payment_record.rb', line 2202

def reported_by
  @reported_by
end

#shipping_detailsObject (readonly)

Shipping information for this payment.



2204
2205
2206
# File 'lib/stripe/resources/payment_record.rb', line 2204

def shipping_details
  @shipping_details
end

Class Method Details

.field_remappingsObject



2369
2370
2371
# File 'lib/stripe/resources/payment_record.rb', line 2369

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
# File 'lib/stripe/resources/payment_record.rb', line 2353

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

.list(params = {}, opts = {}) ⇒ Object

List all the Payment Records for a given merchant.



2207
2208
2209
# File 'lib/stripe/resources/payment_record.rb', line 2207

def self.list(params = {}, opts = {})
  request_stripe_object(method: :get, path: "/v1/payment_records", params: params, opts: opts)
end

.object_nameObject



13
14
15
# File 'lib/stripe/resources/payment_record.rb', line 13

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.



2214
2215
2216
2217
2218
2219
2220
2221
# File 'lib/stripe/resources/payment_record.rb', line 2214

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.



2236
2237
2238
2239
2240
2241
2242
2243
# File 'lib/stripe/resources/payment_record.rb', line 2236

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.



2258
2259
2260
2261
2262
2263
2264
2265
# File 'lib/stripe/resources/payment_record.rb', line 2258

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.



2280
2281
2282
2283
2284
2285
2286
2287
# File 'lib/stripe/resources/payment_record.rb', line 2280

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.



2302
2303
2304
2305
2306
2307
2308
2309
# File 'lib/stripe/resources/payment_record.rb', line 2302

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.



2322
2323
2324
2325
2326
2327
2328
2329
# File 'lib/stripe/resources/payment_record.rb', line 2322

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.



2344
2345
2346
2347
2348
2349
2350
2351
# File 'lib/stripe/resources/payment_record.rb', line 2344

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.



2225
2226
2227
2228
2229
2230
2231
2232
# File 'lib/stripe/resources/payment_record.rb', line 2225

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.



2247
2248
2249
2250
2251
2252
2253
2254
# File 'lib/stripe/resources/payment_record.rb', line 2247

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.



2269
2270
2271
2272
2273
2274
2275
2276
# File 'lib/stripe/resources/payment_record.rb', line 2269

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.



2291
2292
2293
2294
2295
2296
2297
2298
# File 'lib/stripe/resources/payment_record.rb', line 2291

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.



2312
2313
2314
2315
2316
2317
2318
2319
# File 'lib/stripe/resources/payment_record.rb', line 2312

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.



2333
2334
2335
2336
2337
2338
2339
2340
# File 'lib/stripe/resources/payment_record.rb', line 2333

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