Class: Stripe::Treasury::OutboundPayment

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

Overview

Use OutboundPayments to send funds to another party's external bank account or FinancialAccount. To send money to an account belonging to the same user, use an OutboundTransfer.

Simulate OutboundPayment state changes with the /v1/test_helpers/treasury/outbound_payments endpoints. These methods can only be called on test mode objects.

Related guide: Moving money with Treasury using OutboundPayment objects

Defined Under Namespace

Classes: DestinationPaymentMethodDetails, EndUserDetails, ReturnedDetails, StatusTransitions, TestHelpers, TrackingDetails

Constant Summary collapse

OBJECT_NAME =
"treasury.outbound_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

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

Amount (in cents) transferred.



218
219
220
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 218

def amount
  @amount
end

#cancelableObject (readonly)

Returns true if the object can be canceled, and false otherwise.



220
221
222
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 220

def cancelable
  @cancelable
end

#createdObject (readonly)

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



222
223
224
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 222

def created
  @created
end

#currencyObject (readonly)

Three-letter ISO currency code, in lowercase. Must be a supported currency.



224
225
226
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 224

def currency
  @currency
end

#customerObject (readonly)

ID of the customer to whom an OutboundPayment is sent.



226
227
228
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 226

def customer
  @customer
end

#descriptionObject (readonly)

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



228
229
230
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 228

def description
  @description
end

#destination_payment_methodObject (readonly)

The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using destination_payment_method_data.



230
231
232
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 230

def destination_payment_method
  @destination_payment_method
end

#destination_payment_method_detailsObject (readonly)

Details about the PaymentMethod for an OutboundPayment.



232
233
234
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 232

def destination_payment_method_details
  @destination_payment_method_details
end

#end_user_detailsObject (readonly)

Details about the end user.



234
235
236
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 234

def end_user_details
  @end_user_details
end

#expected_arrival_dateObject (readonly)

The date when funds are expected to arrive in the destination account.



236
237
238
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 236

def expected_arrival_date
  @expected_arrival_date
end

#financial_accountObject (readonly)

The FinancialAccount that funds were pulled from.



238
239
240
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 238

def 
  @financial_account
end

#hosted_regulatory_receipt_urlObject (readonly)

A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.



240
241
242
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 240

def hosted_regulatory_receipt_url
  @hosted_regulatory_receipt_url
end

#idObject (readonly)

Unique identifier for the object.



242
243
244
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 242

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



244
245
246
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 244

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.



246
247
248
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 246

def 
  @metadata
end

#objectObject (readonly)

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



248
249
250
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 248

def object
  @object
end

#returned_detailsObject (readonly)

Details about a returned OutboundPayment. Only set when the status is returned.



250
251
252
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 250

def returned_details
  @returned_details
end

#statement_descriptorObject (readonly)

The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer).



252
253
254
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 252

def statement_descriptor
  @statement_descriptor
end

#statusObject (readonly)

Current status of the OutboundPayment: processing, failed, posted, returned, canceled. An OutboundPayment is processing if it has been created and is pending. The status changes to posted once the OutboundPayment has been "confirmed" and funds have left the account, or to failed or canceled. If an OutboundPayment fails to arrive at its destination, its status will change to returned.



254
255
256
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 254

def status
  @status
end

#status_transitionsObject (readonly)

Attribute for field status_transitions



256
257
258
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 256

def status_transitions
  @status_transitions
end

#tracking_detailsObject (readonly)

Details about network-specific tracking information if available.



258
259
260
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 258

def tracking_details
  @tracking_details
end

#transactionObject (readonly)

The Transaction associated with this object.



260
261
262
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 260

def transaction
  @transaction
end

Class Method Details

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

Cancel an OutboundPayment.



273
274
275
276
277
278
279
280
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 273

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

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

Creates an OutboundPayment.



283
284
285
286
287
288
289
290
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 283

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

.field_remappingsObject



403
404
405
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 403

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



393
394
395
396
397
398
399
400
401
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 393

def self.inner_class_types
  @inner_class_types = {
    destination_payment_method_details: DestinationPaymentMethodDetails,
    end_user_details: EndUserDetails,
    returned_details: ReturnedDetails,
    status_transitions: StatusTransitions,
    tracking_details: TrackingDetails,
  }
end

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

Returns a list of OutboundPayments sent from the specified FinancialAccount.



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

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

.object_nameObject



16
17
18
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 16

def self.object_name
  "treasury.outbound_payment"
end

Instance Method Details

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

Cancel an OutboundPayment.



263
264
265
266
267
268
269
270
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 263

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

#test_helpersObject



302
303
304
# File 'lib/stripe/resources/treasury/outbound_payment.rb', line 302

def test_helpers
  TestHelpers.new(self)
end