Class: Stripe::PaymentRecord

Inherits:
APIResource show all
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: AmountCanceled, AmountFailed, AmountGuaranteed, AmountRefunded, AmountRequested, CustomerDetails, PaymentMethodDetails, 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 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

#==, #[], #[]=, 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_canceledObject (readonly)

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



60
61
62
# File 'lib/stripe/resources/payment_record.rb', line 60

def amount_canceled
  @amount_canceled
end

#amount_failedObject (readonly)

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



62
63
64
# File 'lib/stripe/resources/payment_record.rb', line 62

def amount_failed
  @amount_failed
end

#amount_guaranteedObject (readonly)

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



64
65
66
# File 'lib/stripe/resources/payment_record.rb', line 64

def amount_guaranteed
  @amount_guaranteed
end

#amount_refundedObject (readonly)

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



66
67
68
# File 'lib/stripe/resources/payment_record.rb', line 66

def amount_refunded
  @amount_refunded
end

#amount_requestedObject (readonly)

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



68
69
70
# File 'lib/stripe/resources/payment_record.rb', line 68

def amount_requested
  @amount_requested
end

#createdObject (readonly)

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



70
71
72
# File 'lib/stripe/resources/payment_record.rb', line 70

def created
  @created
end

#customer_detailsObject (readonly)

Customer information for this payment.



72
73
74
# File 'lib/stripe/resources/payment_record.rb', line 72

def customer_details
  @customer_details
end

#customer_presenceObject (readonly)

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



74
75
76
# File 'lib/stripe/resources/payment_record.rb', line 74

def customer_presence
  @customer_presence
end

#descriptionObject (readonly)

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



76
77
78
# File 'lib/stripe/resources/payment_record.rb', line 76

def description
  @description
end

#idObject (readonly)

Unique identifier for the object.



78
79
80
# File 'lib/stripe/resources/payment_record.rb', line 78

def id
  @id
end

#latest_payment_attempt_recordObject (readonly)

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



80
81
82
# File 'lib/stripe/resources/payment_record.rb', line 80

def latest_payment_attempt_record
  @latest_payment_attempt_record
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



82
83
84
# File 'lib/stripe/resources/payment_record.rb', line 82

def livemode
  @livemode
end

#metadataObject (readonly)

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



84
85
86
# File 'lib/stripe/resources/payment_record.rb', line 84

def 
  @metadata
end

#objectObject (readonly)

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



86
87
88
# File 'lib/stripe/resources/payment_record.rb', line 86

def object
  @object
end

#payment_method_detailsObject (readonly)

Information about the Payment Method debited for this payment.



88
89
90
# File 'lib/stripe/resources/payment_record.rb', line 88

def payment_method_details
  @payment_method_details
end

#payment_referenceObject (readonly)

An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID.



90
91
92
# File 'lib/stripe/resources/payment_record.rb', line 90

def payment_reference
  @payment_reference
end

#shipping_detailsObject (readonly)

Shipping information for this payment.



92
93
94
# File 'lib/stripe/resources/payment_record.rb', line 92

def shipping_details
  @shipping_details
end

Class Method Details

.object_nameObject



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.


97
98
99
100
101
102
103
104
# File 'lib/stripe/resources/payment_record.rb', line 97

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.


119
120
121
122
123
124
125
126
# File 'lib/stripe/resources/payment_record.rb', line 119

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.


141
142
143
144
145
146
147
148
# File 'lib/stripe/resources/payment_record.rb', line 141

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.


163
164
165
166
167
168
169
170
# File 'lib/stripe/resources/payment_record.rb', line 163

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.


185
186
187
188
189
190
191
192
# File 'lib/stripe/resources/payment_record.rb', line 185

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

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.


108
109
110
111
112
113
114
115
# File 'lib/stripe/resources/payment_record.rb', line 108

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.


130
131
132
133
134
135
136
137
# File 'lib/stripe/resources/payment_record.rb', line 130

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.


152
153
154
155
156
157
158
159
# File 'lib/stripe/resources/payment_record.rb', line 152

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.


174
175
176
177
178
179
180
181
# File 'lib/stripe/resources/payment_record.rb', line 174

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