Class: Stripe::TransferService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::TransferService
- Defined in:
- lib/stripe/services/transfer_service.rb
Defined Under Namespace
Classes: CreateParams, ListParams, RetrieveParams, UpdateParams
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 @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.
133 134 135 |
# File 'lib/stripe/services/transfer_service.rb', line 133 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.
138 139 140 |
# File 'lib/stripe/services/transfer_service.rb', line 138 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.
143 144 145 146 147 148 149 150 151 |
# File 'lib/stripe/services/transfer_service.rb', line 143 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.
156 157 158 159 160 161 162 163 164 |
# File 'lib/stripe/services/transfer_service.rb', line 156 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 |