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: Capture, 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.



86
87
88
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 86

def amount_capturable
  @amount_capturable
end

#amount_requestedObject (readonly)

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



88
89
90
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 88

def amount_requested
  @amount_requested
end

#cadenceObject (readonly)

The frequency of the underlying payment.



90
91
92
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 90

def cadence
  @cadence
end

#captureObject (readonly)

Details about the capture configuration for the OffSessionPayment.



92
93
94
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 92

def capture
  @capture
end

#compartment_idObject (readonly)

ID of the owning compartment.



94
95
96
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 94

def compartment_id
  @compartment_id
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.



97
98
99
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 97

def created
  @created
end

#customerObject (readonly)

ID of the Customer to which this OffSessionPayment belongs.



99
100
101
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 99

def customer
  @customer
end

#failure_reasonObject (readonly)

The reason why the OffSessionPayment failed.



101
102
103
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 101

def failure_reason
  @failure_reason
end

#idObject (readonly)

Unique identifier for the object.



103
104
105
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 103

def id
  @id
end

#last_authorization_attempt_errorObject (readonly)

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



105
106
107
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 105

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.



107
108
109
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 107

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.



109
110
111
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 109

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).



114
115
116
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 114

def 
  @metadata
end

#objectObject (readonly)

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



116
117
118
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 116

def object
  @object
end

#on_behalf_ofObject (readonly)

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



118
119
120
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 118

def on_behalf_of
  @on_behalf_of
end

#payment_methodObject (readonly)

ID of the payment method used in this OffSessionPayment.



120
121
122
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 120

def payment_method
  @payment_method
end

#payment_recordObject (readonly)

Payment record associated with the OffSessionPayment.



122
123
124
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 122

def payment_record
  @payment_record
end

#payments_orchestrationObject (readonly)

Details about the payments orchestration configuration.



124
125
126
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 124

def payments_orchestration
  @payments_orchestration
end

#retry_detailsObject (readonly)

Details about the OffSessionPayment retries.



126
127
128
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 126

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).



131
132
133
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 131

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.



135
136
137
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 135

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`.



138
139
140
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 138

def status
  @status
end

#test_clockObject (readonly)

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



140
141
142
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 140

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).



142
143
144
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 142

def transfer_data
  @transfer_data
end

Class Method Details

.field_remappingsObject



153
154
155
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 153

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



144
145
146
147
148
149
150
151
# File 'lib/stripe/resources/v2/payments/off_session_payment.rb', line 144

def self.inner_class_types
  @inner_class_types = {
    capture: Capture,
    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