Class: EasyLabs::Resources::Transfers
- Inherits:
-
Base
- Object
- Base
- EasyLabs::Resources::Transfers
show all
- Defined in:
- lib/easylabs/resources/transfers.rb
Overview
/transfer plus the /transfer/:id/reversals refund helper.
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#create(amount:, currency:, source:, tags: nil) ⇒ Object
9
10
11
12
|
# File 'lib/easylabs/resources/transfers.rb', line 9
def create(amount:, currency:, source:, tags: nil)
body = { amount: amount, currency: currency, source: source, tags: tags }.compact
request(:post, "/transfer", body: body)
end
|
#create_refund(transfer_id, refund_amount:, tags: nil) ⇒ Object
POST /transfer/:id/reversals — refund the original transfer.
27
28
29
30
|
# File 'lib/easylabs/resources/transfers.rb', line 27
def create_refund(transfer_id, refund_amount:, tags: nil)
body = { refund_amount: refund_amount, tags: tags }.compact
request(:post, "/transfer/#{transfer_id}/reversals", body: body)
end
|
#list(limit: nil, offset: nil, ids: nil) ⇒ Object
22
23
24
|
# File 'lib/easylabs/resources/transfers.rb', line 22
def list(limit: nil, offset: nil, ids: nil)
request(:get, "/transfer", query: (limit: limit, offset: offset, ids: ids))
end
|
#retrieve(id) ⇒ Object
18
19
20
|
# File 'lib/easylabs/resources/transfers.rb', line 18
def retrieve(id)
request(:get, "/transfer/#{id}")
end
|
#update(id, **body) ⇒ Object
14
15
16
|
# File 'lib/easylabs/resources/transfers.rb', line 14
def update(id, **body)
request(:patch, "/transfer/#{id}", body: body)
end
|