Class: Stripe::Treasury::OutboundTransfer

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

Overview

Use [OutboundTransfers](docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user’s own external bank account.

Simulate OutboundTransfer state changes with the ‘/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.

Related guide: [Moving money with Treasury using OutboundTransfer objects](docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers)

Defined Under Namespace

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

Constant Summary collapse

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

#==, #[], #[]=, 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.



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

def amount
  @amount
end

#cancelableObject (readonly)

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



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

def cancelable
  @cancelable
end

#createdObject (readonly)

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



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

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



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

def currency
  @currency
end

#descriptionObject (readonly)

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



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

def description
  @description
end

#destination_payment_methodObject (readonly)

The PaymentMethod used as the payment instrument for an OutboundTransfer.



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

def destination_payment_method
  @destination_payment_method
end

#destination_payment_method_detailsObject (readonly)

Attribute for field destination_payment_method_details



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

def destination_payment_method_details
  @destination_payment_method_details
end

#expected_arrival_dateObject (readonly)

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



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

def expected_arrival_date
  @expected_arrival_date
end

#financial_accountObject (readonly)

The FinancialAccount that funds were pulled from.



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

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.



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

def hosted_regulatory_receipt_url
  @hosted_regulatory_receipt_url
end

#idObject (readonly)

Unique identifier for the object.



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

def id
  @id
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/treasury/outbound_transfer.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/treasury/outbound_transfer.rb', line 84

def 
  @metadata
end

#network_detailsObject (readonly)

Details about the network used for the OutboundTransfer.



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

def network_details
  @network_details
end

#objectObject (readonly)

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



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

def object
  @object
end

#returned_detailsObject (readonly)

Details about a returned OutboundTransfer. Only set when the status is ‘returned`.



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

def returned_details
  @returned_details
end

#statement_descriptorObject (readonly)

Information about the OutboundTransfer to be sent to the recipient account.



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

def statement_descriptor
  @statement_descriptor
end

#statusObject (readonly)

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



94
95
96
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 94

def status
  @status
end

#status_transitionsObject (readonly)

Attribute for field status_transitions



96
97
98
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 96

def status_transitions
  @status_transitions
end

#tracking_detailsObject (readonly)

Details about network-specific tracking information if available.



98
99
100
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 98

def tracking_details
  @tracking_details
end

#transactionObject (readonly)

The Transaction associated with this object.



100
101
102
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 100

def transaction
  @transaction
end

Class Method Details

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

An OutboundTransfer can be canceled if the funds have not yet been paid out.



113
114
115
116
117
118
119
120
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 113

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

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

Creates an OutboundTransfer.



123
124
125
126
127
128
129
130
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 123

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

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

Returns a list of OutboundTransfers sent from the specified FinancialAccount.



133
134
135
136
137
138
139
140
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 133

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

.object_nameObject



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

def self.object_name
  "treasury.outbound_transfer"
end

Instance Method Details

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

An OutboundTransfer can be canceled if the funds have not yet been paid out.



103
104
105
106
107
108
109
110
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 103

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

#test_helpersObject



142
143
144
# File 'lib/stripe/resources/treasury/outbound_transfer.rb', line 142

def test_helpers
  TestHelpers.new(self)
end