Class: SixSaferpay::SixTransaction::AuthorizeResponse
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::AuthorizeResponse
- Defined in:
- lib/six_saferpay/api/six_transaction/responses/authorize_response.rb
Instance Attribute Summary collapse
-
#dcc ⇒ Object
Returns the value of attribute dcc.
-
#liability ⇒ Object
Returns the value of attribute liability.
-
#mastercard_issuer_installments ⇒ Object
Returns the value of attribute mastercard_issuer_installments.
-
#payer ⇒ Object
Returns the value of attribute payer.
-
#payment_means ⇒ Object
Returns the value of attribute payment_means.
-
#registration_result ⇒ Object
Returns the value of attribute registration_result.
-
#response_header ⇒ Object
Returns the value of attribute response_header.
-
#transaction ⇒ Object
Returns the value of attribute transaction.
Instance Method Summary collapse
-
#initialize(response_header:, transaction:, payment_means:, payer: nil, registration_result: nil, liability: nil, dcc: nil, mastercard_issuer_installments: nil, fraud_prevention: nil) ⇒ AuthorizeResponse
constructor
A new instance of AuthorizeResponse.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(response_header:, transaction:, payment_means:, payer: nil, registration_result: nil, liability: nil, dcc: nil, mastercard_issuer_installments: nil, fraud_prevention: nil) ⇒ AuthorizeResponse
Returns a new instance of AuthorizeResponse.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 17 def initialize(response_header:, transaction:, payment_means:, payer: nil, registration_result: nil, liability: nil, dcc: nil, mastercard_issuer_installments: nil, fraud_prevention: nil ) @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header @transaction = SixSaferpay::Transaction.new(**transaction.to_h) if transaction @payment_means = SixSaferpay::ResponsePaymentMeans.new(**payment_means.to_h) if payment_means @payer = SixSaferpay::Payer.new(**payer.to_h) if payer @registration_result = SixSaferpay::RegistrationResult.new(**registration_result.to_h) if registration_result @liability = SixSaferpay::Liability.new(**liability.to_h) if liability @dcc = SixSaferpay::Dcc.new(**dcc.to_h) if dcc if mastercard_issuer_installments @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments .new(**mastercard_issuer_installments.to_h) end @fraud_prevention = SixSaferpay::FraudPrevention.new(**fraud_prevention.to_h) if fraud_prevention end |
Instance Attribute Details
#dcc ⇒ Object
Returns the value of attribute dcc.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def dcc @dcc end |
#liability ⇒ Object
Returns the value of attribute liability.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def liability @liability end |
#mastercard_issuer_installments ⇒ Object
Returns the value of attribute mastercard_issuer_installments.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def mastercard_issuer_installments @mastercard_issuer_installments end |
#payer ⇒ Object
Returns the value of attribute payer.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def payer @payer end |
#payment_means ⇒ Object
Returns the value of attribute payment_means.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def payment_means @payment_means end |
#registration_result ⇒ Object
Returns the value of attribute registration_result.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def registration_result @registration_result end |
#response_header ⇒ Object
Returns the value of attribute response_header.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def response_header @response_header end |
#transaction ⇒ Object
Returns the value of attribute transaction.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 5 def transaction @transaction end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/six_saferpay/api/six_transaction/responses/authorize_response.rb', line 41 def to_hash hash = Hash.new hash.merge!(response_header: @response_header.to_h) if @response_header hash.merge!(transaction: @transaction.to_h) if @transaction hash.merge!(payment_means: @payment_means.to_h) if @payment_means hash.merge!(payer: @payer.to_h) if @payer hash.merge!(registration_result: @registration_result.to_h) if @registration_result hash.merge!(liability: @liability.to_h) if @liability hash.merge!(dcc: @dcc.to_h) if @dcc if @mastercard_issuer_installments hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h) end if @fraud_prevention hash.merge!(fraud_prevention: fraud_prevention.to_h) end hash end |