Class: Stripe::Transfer

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List, APIOperations::NestedResource
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/transfer.rb

Overview

A ‘Transfer` object is created when you move funds between Stripe accounts as part of Connect.

Before April 6, 2017, transfers also represented movement of funds from a Stripe account to a card or bank account. This behavior has since been split out into a [Payout](stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. For more information, read about the [transfer/payout split](stripe.com/docs/transfer-payout-split).

Related guide: [Creating separate charges and transfers](stripe.com/docs/connect/separate-charges-and-transfers)

Constant Summary collapse

OBJECT_NAME =
"transfer"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::NestedResource

nested_resource_class_methods

Methods included from APIOperations::Save

included, #save

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

Class Method Details

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

To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](stripe.com/docs/api#balance) must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.

[View source]

29
30
31
# File 'lib/stripe/resources/transfer.rb', line 29

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

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

Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first.

[View source]

34
35
36
# File 'lib/stripe/resources/transfer.rb', line 34

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

.object_nameObject

[View source]

22
23
24
# File 'lib/stripe/resources/transfer.rb', line 22

def self.object_name
  "transfer"
end

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

Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

This request accepts only metadata as an argument.

[View source]

41
42
43
44
45
46
47
48
# File 'lib/stripe/resources/transfer.rb', line 41

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