Class: Stripe::BalanceTransfer

Inherits:
APIResource show all
Extended by:
APIOperations::Create
Defined in:
lib/stripe/resources/balance_transfer.rb

Overview

Balance transfers represent funds moving between balance types on your Stripe account. They currently support moving funds between your Stripe balance and your [Issuing](docs.stripe.com/issuing) balance and between your [Allocated Funds](docs.stripe.com/connect/funds-segregation) balance and your Stripe balance.

Defined Under Namespace

Classes: DestinationBalance, SourceBalance

Constant Summary collapse

OBJECT_NAME =
"balance_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

Methods included from APIOperations::Create

create

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)

A positive integer representing how much was transferred in the smallest currency unit.



101
102
103
# File 'lib/stripe/resources/balance_transfer.rb', line 101

def amount
  @amount
end

#createdObject (readonly)

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



103
104
105
# File 'lib/stripe/resources/balance_transfer.rb', line 103

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



105
106
107
# File 'lib/stripe/resources/balance_transfer.rb', line 105

def currency
  @currency
end

#destination_balanceObject (readonly)

The balance that funds were transferred to.



107
108
109
# File 'lib/stripe/resources/balance_transfer.rb', line 107

def destination_balance
  @destination_balance
end

#hosted_regulatory_receipt_urlObject (readonly)

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



109
110
111
# File 'lib/stripe/resources/balance_transfer.rb', line 109

def hosted_regulatory_receipt_url
  @hosted_regulatory_receipt_url
end

#idObject (readonly)

Unique identifier for the object.



111
112
113
# File 'lib/stripe/resources/balance_transfer.rb', line 111

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



113
114
115
# File 'lib/stripe/resources/balance_transfer.rb', line 113

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.



115
116
117
# File 'lib/stripe/resources/balance_transfer.rb', line 115

def 
  @metadata
end

#objectObject (readonly)

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



117
118
119
# File 'lib/stripe/resources/balance_transfer.rb', line 117

def object
  @object
end

#source_balanceObject (readonly)

The balance that funds were transferred from. One of ‘card`, `fpx`, or `bank_account`.



119
120
121
# File 'lib/stripe/resources/balance_transfer.rb', line 119

def source_balance
  @source_balance
end

Class Method Details

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

Creates a balance transfer. For Issuing use cases, funds will be debited immediately from the source balance and credited to the destination balance immediately (if your account is based in the US) or next-business-day (if your account is based in the EU). For Segregated Separate Charges and Transfers use cases, funds will be debited immediately from the source balance and credited immediately to the destination balance.



122
123
124
125
126
127
128
129
# File 'lib/stripe/resources/balance_transfer.rb', line 122

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

.field_remappingsObject



135
136
137
# File 'lib/stripe/resources/balance_transfer.rb', line 135

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



131
132
133
# File 'lib/stripe/resources/balance_transfer.rb', line 131

def self.inner_class_types
  @inner_class_types = { destination_balance: DestinationBalance, source_balance: SourceBalance }
end

.object_nameObject



11
12
13
# File 'lib/stripe/resources/balance_transfer.rb', line 11

def self.object_name
  "balance_transfer"
end