Class: Zaala::API::RequestIdentifier

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/zaala/api/types.rb

Overview

The class RequestIdentifier contains data to determine the origin of a web service call.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_message(h) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/zaala/api/types.rb', line 42

def self.from_message(h)
  RequestIdentifier.new({
    web_shop_id: h[:webShopId],
    authorization_type: h[:authorizationType],
    authorization_id: h[:authorizationId],
    pos_id: h[:posId],
  })
end

Instance Method Details

#to_messageObject



51
52
53
54
55
56
57
58
59
# File 'lib/zaala/api/types.rb', line 51

def to_message
  m = {
    webShopId: web_shop_id,
    authorizationType: authorization_type
  }
  m[:authorizationId] = authorization_id unless authorization_id.nil?
  m[:posId] = pos_id unless pos_id.nil?
  m
end