Class: Stripe::V2::Payments::OffSessionPayment

Inherits:
APIResource show all
Defined in:
lib/stripe/resources/v2/payments/off_session_payment.rb

Overview

An OffSessionPayment allows you to create your own payment flow for recurring and unscheduled payments. In a single API request, you can initiate a payment and leverage Stripe’s AI-powered [Smart Retries](docs.stripe.com/payments/off-session-payments/smart-retries) to choose the best times to retry failures to increase the chance of a successful payment. To properly interface with OffSessionPayments, we recommend setting up an event destination to listen to webhook notifications, as the OffSessionPayment will transition through its lifecycle asynchronously. Related guide: [Off-Session Payments API](docs.stripe.com/payments/off-session-payments).

Defined Under Namespace

Classes: AmountDetails, Capture, PaymentDetails, PaymentsOrchestration, RetryDetails, TransferData

Constant Summary collapse

OBJECT_NAME =
"v2.payments.off_session_payment"

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

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

#amount_capturableObject (readonly)

The amount available to be captured.



207
208
209
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 207

def amount_capturable
  @amount_capturable
end

#amount_detailsObject (readonly)

Provides industry-specific information about the amount.



209
210
211
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 209

def amount_details
  @amount_details
end

#amount_requestedObject (readonly)

The “presentment amount” to be collected from the customer.



211
212
213
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 211

def amount_requested
  @amount_requested
end

#application_fee_amount_requestedObject (readonly)

The amount of the application fee requested to be applied to the payment.



213
214
215
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 213

def application_fee_amount_requested
  @application_fee_amount_requested
end

#cadenceObject (readonly)

The frequency of the underlying payment.



215
216
217
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 215

def cadence
  @cadence
end

#captureObject (readonly)

Details about the capture configuration for the OffSessionPayment.



217
218
219
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 217

def capture
  @capture
end

#createdObject (readonly)

Creation time of the OffSessionPayment. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.



220
221
222
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 220

def created
  @created
end

#customerObject (readonly)

ID of the Customer to which this OffSessionPayment belongs.



222
223
224
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 222

def customer
  @customer
end

#descriptionObject (readonly)

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



224
225
226
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 224

def description
  @description
end

#failure_reasonObject (readonly)

The reason why the OffSessionPayment failed.



226
227
228
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 226

def failure_reason
  @failure_reason
end

#idObject (readonly)

Unique identifier for the object.



228
229
230
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 228

def id
  @id
end

#last_authorization_attempt_errorObject (readonly)

The payment error encountered in the previous attempt to authorize the payment.



230
231
232
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 230

def last_authorization_attempt_error
  @last_authorization_attempt_error
end

#latest_payment_attempt_recordObject (readonly)

Payment attempt record for the latest attempt, if one exists.



232
233
234
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 232

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.



234
235
236
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 234

def livemode
  @livemode
end

#metadataObject (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. Learn more about [storing information in metadata](docs.stripe.com/payments/payment-intents#storing-information-in-metadata).



239
240
241
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 239

def 
  @metadata
end

#objectObject (readonly)

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



241
242
243
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 241

def object
  @object
end

#on_behalf_ofObject (readonly)

The account (if any) for which the funds of the OffSessionPayment are intended.



243
244
245
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 243

def on_behalf_of
  @on_behalf_of
end

#payment_detailsObject (readonly)

Provides industry-specific information about the payment.



245
246
247
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 245

def payment_details
  @payment_details
end

#payment_methodObject (readonly)

ID of the payment method used in this OffSessionPayment.



247
248
249
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 247

def payment_method
  @payment_method
end

#payment_recordObject (readonly)

Payment record associated with the OffSessionPayment.



249
250
251
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 249

def payment_record
  @payment_record
end

#payments_orchestrationObject (readonly)

Details about the payments orchestration configuration.



251
252
253
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 251

def payments_orchestration
  @payments_orchestration
end

#retry_detailsObject (readonly)

Details about the OffSessionPayment retries.



253
254
255
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 253

def retry_details
  @retry_details
end

#statement_descriptorObject (readonly)

Text that appears on the customer’s statement as the statement descriptor for a non-card charge. This value overrides the account’s default statement descriptor. For information about requirements, including the 22-character limit, see the [Statement Descriptor docs](docs.stripe.com/get-started/account/statement-descriptors).



258
259
260
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 258

def statement_descriptor
  @statement_descriptor
end

#statement_descriptor_suffixObject (readonly)

Provides information about a card charge. Concatenated to the account’s [statement descriptor prefix](docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer’s statement.



262
263
264
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 262

def statement_descriptor_suffix
  @statement_descriptor_suffix
end

#statusObject (readonly)

Status of this OffSessionPayment, one of ‘pending`, `pending_retry`, `processing`, `failed`, `canceled`, `requires_capture`, or `succeeded`.



265
266
267
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 265

def status
  @status
end

#test_clockObject (readonly)

Test clock that can be used to advance the retry attempts in a sandbox.



267
268
269
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 267

def test_clock
  @test_clock
end

#transfer_dataObject (readonly)

The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for [connected accounts](docs.stripe.com/payments/connected-accounts).



269
270
271
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 269

def transfer_data
  @transfer_data
end

Class Method Details

.field_remappingsObject



282
283
284
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 282

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



271
272
273
274
275
276
277
278
279
280
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 271

def self.inner_class_types
  @inner_class_types = {
    amount_details: AmountDetails,
    capture: Capture,
    payment_details: PaymentDetails,
    payments_orchestration: PaymentsOrchestration,
    retry_details: RetryDetails,
    transfer_data: TransferData,
  }
end

.object_nameObject



15
16
17
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 15

def self.object_name
  "v2.payments.off_session_payment"
end