Class: Stripe::TransferService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::TransferService
- Defined in:
- lib/stripe/services/transfer_service.rb
Instance Attribute Summary collapse
-
#reversals ⇒ Object
readonly
Returns the value of attribute reversals.
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
To send funds from your Stripe account to a connected account, you create a new transfer object.
-
#initialize(requestor) ⇒ TransferService
constructor
A new instance of TransferService.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of existing transfers sent to connected accounts.
-
#retrieve(transfer, params = {}, opts = {}) ⇒ Object
Retrieves the details of an existing transfer.
-
#update(transfer, params = {}, opts = {}) ⇒ Object
Updates the specified transfer by setting the values of the parameters passed.
Methods inherited from StripeService
Constructor Details
#initialize(requestor) ⇒ TransferService
Returns a new instance of TransferService.
8 9 10 11 |
# File 'lib/stripe/services/transfer_service.rb', line 8 def initialize(requestor) super(requestor) @reversals = Stripe::TransferReversalService.new(@requestor) end |
Instance Attribute Details
#reversals ⇒ Object (readonly)
Returns the value of attribute reversals.
6 7 8 |
# File 'lib/stripe/services/transfer_service.rb', line 6 def reversals @reversals end |
Instance 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.
14 15 16 |
# File 'lib/stripe/services/transfer_service.rb', line 14 def create(params = {}, opts = {}) request(method: :post, path: "/v1/transfers", params: params, opts: opts, base_address: :api) end |
#list(params = {}, 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.
19 20 21 |
# File 'lib/stripe/services/transfer_service.rb', line 19 def list(params = {}, opts = {}) request(method: :get, path: "/v1/transfers", params: params, opts: opts, base_address: :api) end |
#retrieve(transfer, params = {}, opts = {}) ⇒ Object
Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information.
24 25 26 27 28 29 30 31 32 |
# File 'lib/stripe/services/transfer_service.rb', line 24 def retrieve(transfer, params = {}, opts = {}) request( method: :get, path: format("/v1/transfers/%<transfer>s", { transfer: CGI.escape(transfer) }), params: params, opts: opts, base_address: :api ) end |
#update(transfer, 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.
37 38 39 40 41 42 43 44 45 |
# File 'lib/stripe/services/transfer_service.rb', line 37 def update(transfer, params = {}, opts = {}) request( method: :post, path: format("/v1/transfers/%<transfer>s", { transfer: CGI.escape(transfer) }), params: params, opts: opts, base_address: :api ) end |