Class: Stripe::BalanceTransaction
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::BalanceTransaction
- Extended by:
- APIOperations::List
- Defined in:
- lib/stripe/resources/balance_transaction.rb
Overview
Balance transactions represent funds moving through your Stripe account. Stripe creates them for every type of transaction that enters or leaves your Stripe account balance.
Related guide: [Balance transaction types](stripe.com/docs/reports/balance-transaction-types)
Defined Under Namespace
Classes: FeeDetail
Constant Summary collapse
- OBJECT_NAME =
"balance_transaction"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Gross amount of this transaction (in cents (or local equivalent)).
-
#available_on ⇒ Object
readonly
The date that the transaction’s net funds become available in the Stripe balance.
-
#balance_type ⇒ Object
readonly
The balance that this transaction impacts.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#currency ⇒ Object
readonly
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#description ⇒ Object
readonly
An arbitrary string attached to the object.
-
#exchange_rate ⇒ Object
readonly
If applicable, this transaction uses an exchange rate.
-
#fee ⇒ Object
readonly
Fees (in cents (or local equivalent)) paid for this transaction.
-
#fee_details ⇒ Object
readonly
Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#net ⇒ Object
readonly
Net impact to a Stripe balance (in cents (or local equivalent)).
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#reporting_category ⇒ Object
readonly
Learn more about how [reporting categories](stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective.
-
#source ⇒ Object
readonly
This transaction relates to the Stripe object.
-
#status ⇒ Object
readonly
The transaction’s net funds status in the Stripe balance, which are either ‘available` or `pending`.
-
#type ⇒ Object
readonly
Transaction type: ‘adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth).
- .object_name ⇒ Object
Methods included from APIOperations::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
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
#amount ⇒ Object (readonly)
Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party.
38 39 40 |
# File 'lib/stripe/resources/balance_transaction.rb', line 38 def amount @amount end |
#available_on ⇒ Object (readonly)
The date that the transaction’s net funds become available in the Stripe balance.
40 41 42 |
# File 'lib/stripe/resources/balance_transaction.rb', line 40 def available_on @available_on end |
#balance_type ⇒ Object (readonly)
The balance that this transaction impacts.
42 43 44 |
# File 'lib/stripe/resources/balance_transaction.rb', line 42 def balance_type @balance_type end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
44 45 46 |
# File 'lib/stripe/resources/balance_transaction.rb', line 44 def created @created end |
#currency ⇒ Object (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).
46 47 48 |
# File 'lib/stripe/resources/balance_transaction.rb', line 46 def currency @currency end |
#description ⇒ Object (readonly)
An arbitrary string attached to the object. Often useful for displaying to users.
48 49 50 |
# File 'lib/stripe/resources/balance_transaction.rb', line 48 def description @description end |
#exchange_rate ⇒ Object (readonly)
If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the ‘amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent’s ‘amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction’s ‘amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`.
50 51 52 |
# File 'lib/stripe/resources/balance_transaction.rb', line 50 def exchange_rate @exchange_rate end |
#fee ⇒ Object (readonly)
Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed.
52 53 54 |
# File 'lib/stripe/resources/balance_transaction.rb', line 52 def fee @fee end |
#fee_details ⇒ Object (readonly)
Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
54 55 56 |
# File 'lib/stripe/resources/balance_transaction.rb', line 54 def fee_details @fee_details end |
#id ⇒ Object (readonly)
Unique identifier for the object.
56 57 58 |
# File 'lib/stripe/resources/balance_transaction.rb', line 56 def id @id end |
#net ⇒ Object (readonly)
Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by ‘amount` - `fee`
58 59 60 |
# File 'lib/stripe/resources/balance_transaction.rb', line 58 def net @net end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
60 61 62 |
# File 'lib/stripe/resources/balance_transaction.rb', line 60 def object @object end |
#reporting_category ⇒ Object (readonly)
Learn more about how [reporting categories](stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective.
62 63 64 |
# File 'lib/stripe/resources/balance_transaction.rb', line 62 def reporting_category @reporting_category end |
#source ⇒ Object (readonly)
This transaction relates to the Stripe object.
64 65 66 |
# File 'lib/stripe/resources/balance_transaction.rb', line 64 def source @source end |
#status ⇒ Object (readonly)
The transaction’s net funds status in the Stripe balance, which are either ‘available` or `pending`.
66 67 68 |
# File 'lib/stripe/resources/balance_transaction.rb', line 66 def status @status end |
#type ⇒ Object (readonly)
Transaction type: ‘adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
68 69 70 |
# File 'lib/stripe/resources/balance_transaction.rb', line 68 def type @type end |
Class Method Details
.field_remappings ⇒ Object
86 87 88 |
# File 'lib/stripe/resources/balance_transaction.rb', line 86 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
82 83 84 |
# File 'lib/stripe/resources/balance_transaction.rb', line 82 def self.inner_class_types @inner_class_types = { fee_details: FeeDetail } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
73 74 75 76 77 78 79 80 |
# File 'lib/stripe/resources/balance_transaction.rb', line 73 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/balance_transactions", params: params, opts: opts ) end |
.object_name ⇒ Object
13 14 15 |
# File 'lib/stripe/resources/balance_transaction.rb', line 13 def self.object_name "balance_transaction" end |