Class: Stripe::Treasury::InboundTransfer

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Defined in:
lib/stripe/resources/treasury/inbound_transfer.rb

Overview

Use [InboundTransfers](docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.

Related guide: [Moving money with Treasury using InboundTransfer objects](docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers)

Defined Under Namespace

Classes: FailureDetails, LinkedFlows, OriginPaymentMethodDetails, StatusTransitions, TestHelpers

Constant Summary collapse

OBJECT_NAME =
"treasury.inbound_transfer"

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::Create

create

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?, #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)

Amount (in cents) transferred.



143
144
145
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 143

def amount
  @amount
end

#cancelableObject (readonly)

Returns ‘true` if the InboundTransfer is able to be canceled.



145
146
147
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 145

def cancelable
  @cancelable
end

#createdObject (readonly)

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



147
148
149
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 147

def created
  @created
end

#currencyObject (readonly)

Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



149
150
151
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 149

def currency
  @currency
end

#descriptionObject (readonly)

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



151
152
153
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 151

def description
  @description
end

#failure_detailsObject (readonly)

Details about this InboundTransfer’s failure. Only set when status is ‘failed`.



153
154
155
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 153

def failure_details
  @failure_details
end

#financial_accountObject (readonly)

The FinancialAccount that received the funds.



155
156
157
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 155

def 
  @financial_account
end

#hosted_regulatory_receipt_urlObject (readonly)

A [hosted transaction receipt](stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe’s money transmission licenses.



157
158
159
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 157

def hosted_regulatory_receipt_url
  @hosted_regulatory_receipt_url
end

#idObject (readonly)

Unique identifier for the object.



159
160
161
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 159

def id
  @id
end

#linked_flowsObject (readonly)

Attribute for field linked_flows



161
162
163
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 161

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



163
164
165
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 163

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.



165
166
167
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 165

def 
  @metadata
end

#objectObject (readonly)

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



167
168
169
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 167

def object
  @object
end

#origin_payment_methodObject (readonly)

The origin payment method to be debited for an InboundTransfer.



169
170
171
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 169

def origin_payment_method
  @origin_payment_method
end

#origin_payment_method_detailsObject (readonly)

Details about the PaymentMethod for an InboundTransfer.



171
172
173
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 171

def origin_payment_method_details
  @origin_payment_method_details
end

#returnedObject (readonly)

Returns ‘true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state.



173
174
175
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 173

def returned
  @returned
end

#statement_descriptorObject (readonly)

Statement descriptor shown when funds are debited from the source. Not all payment networks support ‘statement_descriptor`.



175
176
177
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 175

def statement_descriptor
  @statement_descriptor
end

#statusObject (readonly)

Status of the InboundTransfer: ‘processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been “confirmed” and a `transaction` is created and posted. The status changes to `failed` if the transfer fails.



177
178
179
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 177

def status
  @status
end

#status_transitionsObject (readonly)

Attribute for field status_transitions



179
180
181
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 179

def status_transitions
  @status_transitions
end

#transactionObject (readonly)

The Transaction associated with this object.



181
182
183
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 181

def transaction
  @transaction
end

Class Method Details

.cancel(inbound_transfer, params = {}, opts = {}) ⇒ Object

Cancels an InboundTransfer.



194
195
196
197
198
199
200
201
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 194

def self.cancel(inbound_transfer, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/treasury/inbound_transfers/%<inbound_transfer>s/cancel", { inbound_transfer: CGI.escape(inbound_transfer) }),
    params: params,
    opts: opts
  )
end

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

Creates an InboundTransfer.



204
205
206
207
208
209
210
211
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 204

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/treasury/inbound_transfers",
    params: params,
    opts: opts
  )
end

.field_remappingsObject



303
304
305
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 303

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



294
295
296
297
298
299
300
301
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 294

def self.inner_class_types
  @inner_class_types = {
    failure_details: FailureDetails,
    linked_flows: LinkedFlows,
    origin_payment_method_details: OriginPaymentMethodDetails,
    status_transitions: StatusTransitions,
  }
end

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

Returns a list of InboundTransfers sent from the specified FinancialAccount.



214
215
216
217
218
219
220
221
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 214

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

.object_nameObject



14
15
16
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 14

def self.object_name
  "treasury.inbound_transfer"
end

Instance Method Details

#cancel(params = {}, opts = {}) ⇒ Object

Cancels an InboundTransfer.



184
185
186
187
188
189
190
191
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 184

def cancel(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/treasury/inbound_transfers/%<inbound_transfer>s/cancel", { inbound_transfer: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#test_helpersObject



223
224
225
# File 'lib/stripe/resources/treasury/inbound_transfer.rb', line 223

def test_helpers
  TestHelpers.new(self)
end