Class: Zaala::API::AuthorizationRequest

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

Overview

The AuthorizationRequest class represents the request parameter of the PreAuthorize and the Authorize service call. It contains all information needed to make a preauthorization/authorization.

Instance Method Summary collapse

Instance Method Details

#to_messageObject



638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'lib/zaala/api/types.rb', line 638

def to_message
  m = {
    identifier: identifier.to_message,
    personalData: personal_data.to_message,
    invoiceAddress: invoice_address.to_message,
    additionalData: additional_data.to_message,
  }
  m[:requestedAmount] = requested_amount unless requested_amount.nil?
  m[:deliveryAddress] = delivery_address unless delivery_address.nil?
  m[:basket] = basket unless basket.nil?
  m[:token] = token unless token.nil?
  m[:attachments] = attachments.map(&:to_message) unless attachments.nil?
  m
end