Class: PaysonAPI::V1::Requests::PaymentUpdate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, action) ⇒ PaymentUpdate

Returns a new instance of PaymentUpdate.



9
10
11
12
13
14
15
16
# File 'lib/payson_api/v1/requests/payment_update.rb', line 9

def initialize(token, action)
  unless PaysonAPI::V1::PAYMENT_ACTIONS.include?(action)
    raise PaysonAPI::V1::Errors::UnknownPaymentActionError(action)
  end

  @token = token
  @action = action
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



7
8
9
# File 'lib/payson_api/v1/requests/payment_update.rb', line 7

def action
  @action
end

#tokenObject

Returns the value of attribute token.



7
8
9
# File 'lib/payson_api/v1/requests/payment_update.rb', line 7

def token
  @token
end

Instance Method Details

#to_hashObject



18
19
20
21
22
23
# File 'lib/payson_api/v1/requests/payment_update.rb', line 18

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