Class: MasspayRubySdk::WalletService
- Inherits:
-
Object
- Object
- MasspayRubySdk::WalletService
- Defined in:
- lib/masspay_ruby_sdk/api/wallet_service.rb
Instance Method Summary collapse
-
#create_autopayout_rule(user_token, wallet_token, body) ⇒ Object
Add AutoPayout rule POST /payout/wallet/user_token/wallet_token/autopayout.
-
#delete_autopayout_rule(user_token, wallet_token, query_params = {}) ⇒ Object
Delete AutoPayout rule DELETE /payout/wallet/user_token/wallet_token/autopayout.
-
#get_autopayout_rules(user_token, wallet_token) ⇒ Object
Get all AutoPayout rules GET /payout/wallet/user_token/wallet_token/autopayout.
-
#get_wallet(user_token) ⇒ Object
Retrieve all available wallets for a user GET /payout/wallet/user_token.
-
#initialize(client) ⇒ WalletService
constructor
A new instance of WalletService.
Constructor Details
#initialize(client) ⇒ WalletService
Returns a new instance of WalletService.
15 16 17 |
# File 'lib/masspay_ruby_sdk/api/wallet_service.rb', line 15 def initialize(client) @client = client ||= Client.new end |
Instance Method Details
#create_autopayout_rule(user_token, wallet_token, body) ⇒ Object
Add AutoPayout rule POST /payout/wallet/user_token/wallet_token/autopayout
34 35 36 37 38 |
# File 'lib/masspay_ruby_sdk/api/wallet_service.rb', line 34 def create_autopayout_rule user_token, wallet_token, body @client.post("payout/wallet/#{user_token}/#{wallet_token}/autopayout") do |req| req.body = body end end |
#delete_autopayout_rule(user_token, wallet_token, query_params = {}) ⇒ Object
Delete AutoPayout rule DELETE /payout/wallet/user_token/wallet_token/autopayout
43 44 45 46 47 |
# File 'lib/masspay_ruby_sdk/api/wallet_service.rb', line 43 def delete_autopayout_rule user_token, wallet_token, query_params={} @client.delete("payout/wallet/#{user_token}/#{wallet_token}/autopayout") do |req| req.params = query_params end end |
#get_autopayout_rules(user_token, wallet_token) ⇒ Object
Get all AutoPayout rules GET /payout/wallet/user_token/wallet_token/autopayout
27 28 29 |
# File 'lib/masspay_ruby_sdk/api/wallet_service.rb', line 27 def get_autopayout_rules user_token, wallet_token @client.get("payout/wallet/#{user_token}/#{wallet_token}/autopayout") end |
#get_wallet(user_token) ⇒ Object
Retrieve all available wallets for a user GET /payout/wallet/user_token
21 22 23 |
# File 'lib/masspay_ruby_sdk/api/wallet_service.rb', line 21 def get_wallet user_token @client.get("payout/wallet/#{user_token}") end |