Class: SixSaferpay::SixTransaction::AuthorizeReferenced

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_header: nil, terminal_id: nil, payment:, transaction_reference:, authentication: nil, suppress_dcc:) ⇒ AuthorizeReferenced

Returns a new instance of AuthorizeReferenced.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 14

def initialize(request_header: nil,
               terminal_id: nil,
               payment:,
               transaction_reference:,
               authentication: nil,
               suppress_dcc:
              )
  @request_header = request_header || SixSaferpay::RequestHeader.new()
  @terminal_id = terminal_id || SixSaferpay.config.terminal_id
  @payment = SixSaferpay::Payment.new(**payment.to_h) if payment
  @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
  @authentication = SixSaferpay::Authentication.new(**authentication.to_h) if authentication
  @suppress_dcc = suppress_dcc
end

Instance Attribute Details

#authenticationObject

Returns the value of attribute authentication.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 5

def authentication
  @authentication
end

#paymentObject

Returns the value of attribute payment.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 5

def payment
  @payment
end

#request_headerObject

Returns the value of attribute request_header.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 5

def request_header
  @request_header
end

#suppress_dccObject

Returns the value of attribute suppress_dcc.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 5

def suppress_dcc
  @suppress_dcc
end

#terminal_idObject

Returns the value of attribute terminal_id.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 5

def terminal_id
  @terminal_id
end

#transaction_referenceObject

Returns the value of attribute transaction_reference.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 5

def transaction_reference
  @transaction_reference
end

Instance Method Details

#response_classObject



49
50
51
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 49

def response_class
  SixSaferpay::SixTransaction::AuthorizeReferencedResponse
end

#to_hashObject Also known as: to_h



29
30
31
32
33
34
35
36
37
38
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 29

def to_hash
  hash = Hash.new
  hash.merge!(request_header: @request_header.to_h) if @request_header
  hash.merge!(terminal_id: @terminal_id) if @terminal_id
  hash.merge!(payment: @payment.to_h) if @payment
  hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
  hash.merge!(authentication: @authentication.to_h) if @authentication
  hash.merge!(suppress_dcc: @suppress_dcc) if !@suppress_dcc.nil?
  hash
end

#to_jsonObject



41
42
43
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 41

def to_json
  to_hash.to_json
end

#urlObject



45
46
47
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 45

def url
  '/Payment/v1/Transaction/AuthorizeReferenced'
end