Class: PaysonAPI::Request::PaymentUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/payson_api/request/payment_update.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, action) ⇒ PaymentUpdate

Returns a new instance of PaymentUpdate.



6
7
8
9
10
11
12
# File 'lib/payson_api/request/payment_update.rb', line 6

def initialize(token, action)
  @token = token
  if !PAYMENT_ACTIONS.include?(action)
    raise "Unknown payment update action: #{action}"
  end
  @action = action
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



4
5
6
# File 'lib/payson_api/request/payment_update.rb', line 4

def action
  @action
end

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/payson_api/request/payment_update.rb', line 4

def token
  @token
end

Instance Method Details

#to_hashObject



14
15
16
17
18
19
# File 'lib/payson_api/request/payment_update.rb', line 14

def to_hash
  {}.tap do |hash|
    hash['token'] = @token
    hash['action'] = @action
  end
end