Class: MasspayRubySdk::LoadService

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ LoadService

Returns a new instance of LoadService.



15
16
17
# File 'lib/masspay_ruby_sdk/api/load_service.rb', line 15

def initialize(client)
  @client = client ||= Client.new
end

Instance Method Details

#cancel_user_load(user_token, query_params = {}) ⇒ Object

Reverse a user load DELETE /payout/load/user_token

Parameters:

  • query_params (defaults to: {})

    The query parameters



55
56
57
58
59
# File 'lib/masspay_ruby_sdk/api/load_service.rb', line 55

def cancel_user_load user_token, query_params={}
  @client.delete("payout/load/#{user_token}") do |req|
    req.params = query_params
  end
end

#get_user_loads_by_token(user_token) ⇒ Object

Get history of loads by user token GET /payout/load/user_token



39
40
41
# File 'lib/masspay_ruby_sdk/api/load_service.rb', line 39

def get_user_loads_by_token user_token
  @client.get("payout/load/#{user_token}") 
end

#load_user(user_token, body) ⇒ Object

Initiate a load transaction POST /payout/load/user_token

Parameters:

  • body

    The body of the request



31
32
33
34
35
# File 'lib/masspay_ruby_sdk/api/load_service.rb', line 31

def load_user user_token, body
  @client.post("payout/load/#{user_token}") do |req|
    req.body = body
  end
end

#resend_balance_notification(user_token, query_params = {}) ⇒ Object

Resend balance notification PUT /payout/wallet/user_token

Parameters:

  • query_params (defaults to: {})

    The query parameters



22
23
24
25
26
# File 'lib/masspay_ruby_sdk/api/load_service.rb', line 22

def resend_balance_notification user_token, query_params={}
  @client.put("payout/wallet/#{user_token}") do |req|
    req.params = query_params
  end
end

#resend_load_notification(user_token, query_params = {}) ⇒ Object

Resend load notification PUT /payout/load/user_token

Parameters:

  • query_params (defaults to: {})

    The query parameters



46
47
48
49
50
# File 'lib/masspay_ruby_sdk/api/load_service.rb', line 46

def resend_load_notification user_token, query_params={}
  @client.put("payout/load/#{user_token}") do |req|
    req.params = query_params
  end
end