Class: MasspayRubySdk::SpendBackService

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SpendBackService

Returns a new instance of SpendBackService.



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

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

Instance Method Details

#get_user_spendbacks_by_token(user_token) ⇒ Object

Get history of spend backs by user token GET /payout/spendback/user_token



21
22
23
# File 'lib/masspay_ruby_sdk/api/spend_back_service.rb', line 21

def get_user_spendbacks_by_token user_token
  @client.get("payout/spendback/#{user_token}") 
end

#initiate_spendback(user_token, body) ⇒ Object

Initiate a spend back transaction POST /payout/spendback/user_token

Parameters:

  • body

    The body of the request



28
29
30
31
32
# File 'lib/masspay_ruby_sdk/api/spend_back_service.rb', line 28

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