Class: SixSaferpay::SixTransaction::AuthorizeReferenced
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::AuthorizeReferenced
- Defined in:
- lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb
Instance Attribute Summary collapse
-
#authentication ⇒ Object
Returns the value of attribute authentication.
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
-
#suppress_dcc ⇒ Object
Returns the value of attribute suppress_dcc.
-
#terminal_id ⇒ Object
Returns the value of attribute terminal_id.
-
#transaction_reference ⇒ Object
Returns the value of attribute transaction_reference.
Instance Method Summary collapse
-
#initialize(request_header: nil, terminal_id: nil, payment:, transaction_reference:, authentication: nil, suppress_dcc:) ⇒ AuthorizeReferenced
constructor
A new instance of AuthorizeReferenced.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
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
#authentication ⇒ Object
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 |
#payment ⇒ Object
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_header ⇒ Object
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_dcc ⇒ Object
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_id ⇒ Object
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_reference ⇒ Object
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_class ⇒ Object
49 50 51 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 49 def response_class SixSaferpay::SixTransaction::AuthorizeReferencedResponse end |
#to_hash ⇒ Object 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_json ⇒ Object
41 42 43 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 41 def to_json to_hash.to_json end |
#url ⇒ Object
45 46 47 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb', line 45 def url '/Payment/v1/Transaction/AuthorizeReferenced' end |