Class: Smartpay::Requests::Refund

Inherits:
Object
  • Object
show all
Includes:
Validator
Defined in:
lib/smartpay/requests/refund.rb

Overview

Refund

Constant Summary collapse

REQUIREMENT_KEY_NAME =
%i[payment amount currency].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_payload) ⇒ Refund

Returns a new instance of Refund.



13
14
15
# File 'lib/smartpay/requests/refund.rb', line 13

def initialize(raw_payload)
  @payload = raw_payload.transform_keys(&:to_sym)
end

Instance Attribute Details

#payloadObject

Returns the value of attribute payload.



9
10
11
# File 'lib/smartpay/requests/refund.rb', line 9

def payload
  @payload
end

Instance Method Details

#as_hashObject



17
18
19
20
# File 'lib/smartpay/requests/refund.rb', line 17

def as_hash
  check_requirement!(REQUIREMENT_KEY_NAME)
  normalize_payload
end