Class: SixSaferpay::SixTransaction::AuthorizeDirect
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::AuthorizeDirect
- Defined in:
- lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb
Instance Attribute Summary collapse
-
#authentication ⇒ Object
Returns the value of attribute authentication.
-
#order ⇒ Object
Returns the value of attribute order.
-
#payer ⇒ Object
Returns the value of attribute payer.
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#payment_means ⇒ Object
Returns the value of attribute payment_means.
-
#register_alias ⇒ Object
Returns the value of attribute register_alias.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
-
#risk_factors ⇒ Object
Returns the value of attribute risk_factors.
-
#terminal_id ⇒ Object
Returns the value of attribute terminal_id.
Instance Method Summary collapse
-
#initialize(request_header: nil, terminal_id: nil, payment:, payment_means:, authentication: nil, register_alias: nil, payer: nil, order: nil, risk_factors: nil) ⇒ AuthorizeDirect
constructor
A new instance of AuthorizeDirect.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(request_header: nil, terminal_id: nil, payment:, payment_means:, authentication: nil, register_alias: nil, payer: nil, order: nil, risk_factors: nil) ⇒ AuthorizeDirect
Returns a new instance of AuthorizeDirect.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 17 def initialize(request_header: nil, terminal_id: nil, payment:, payment_means:, authentication: nil, register_alias: nil, payer: nil, order: nil, risk_factors: nil ) @request_header = request_header || SixSaferpay::RequestHeader.new() @terminal_id = SixSaferpay.config.terminal_id || terminal_id @payment = SixSaferpay::Payment.new(**payment.to_h) if payment @payment_means = SixSaferpay::RequestPaymentMeans.new(**payment_means.to_h) if payment_means @authentication = SixSaferpay::Authentication.new(**authentication.to_h) if authentication @register_alias = SixSaferpay::RegisterAlias.new(**register_alias.to_h) if register_alias @payer = SixSaferpay::Payer.new(**payer.to_h) if payer @order = SixSaferpay::Order.new(**order.to_h) if order @risk_factors = SixSaferpay::RiskFactors.new(**risk_factors.to_h) if risk_factors end |
Instance Attribute Details
#authentication ⇒ Object
Returns the value of attribute authentication.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def authentication @authentication end |
#order ⇒ Object
Returns the value of attribute order.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def order @order end |
#payer ⇒ Object
Returns the value of attribute payer.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def payer @payer end |
#payment ⇒ Object
Returns the value of attribute payment.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def payment @payment end |
#payment_means ⇒ Object
Returns the value of attribute payment_means.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def payment_means @payment_means end |
#register_alias ⇒ Object
Returns the value of attribute register_alias.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def register_alias @register_alias end |
#request_header ⇒ Object
Returns the value of attribute request_header.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def request_header @request_header end |
#risk_factors ⇒ Object
Returns the value of attribute risk_factors.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def risk_factors @risk_factors end |
#terminal_id ⇒ Object
Returns the value of attribute terminal_id.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 5 def terminal_id @terminal_id end |
Instance Method Details
#response_class ⇒ Object
61 62 63 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 61 def response_class SixSaferpay::SixTransaction::AuthorizeDirectResponse end |
#to_hash ⇒ Object Also known as: to_h
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 38 def to_hash hash = Hash.new hash.merge!(request_header: @request_header.to_h) if @register_alias hash.merge!(terminal_id: @terminal_id) if @terminal_id hash.merge!(payment: @payment.to_h) if @payment hash.merge!(payment_means: @payment_means.to_h) if @payment_means hash.merge!(authentication: @authentication.to_h) if @authentication hash.merge!(register_alias: @register_alias.to_h) if @register_alias hash.merge!(payer: @payer.to_h) if @payer hash.merge!(order: @order.to_h) if @order hash.merge!(risk_factors: @risk_factors.to_h) if @risk_factors hash end |
#to_json ⇒ Object
53 54 55 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 53 def to_json to_hash.to_json end |
#url ⇒ Object
57 58 59 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb', line 57 def url '/Payment/v1/Transaction/AuthorizeDirect' end |