Class: MasspayRubySdk::WalletService

Inherits:
Object
  • Object
show all
Defined in:
lib/masspay_ruby_sdk/api/wallet_service.rb

Instance Method Summary collapse

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

Parameters:

  • body

    The body of the request



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

Parameters:

  • query_params (defaults to: {})

    The query parameters



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