Class: SixSaferpay::SixTransaction::Authorize
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::Authorize
- Defined in:
- lib/six_saferpay/api/six_transaction/requests/authorize.rb
Instance Attribute Summary collapse
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#register_alias ⇒ Object
Returns the value of attribute register_alias.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
-
#token ⇒ Object
Returns the value of attribute token.
-
#verification_code ⇒ Object
Returns the value of attribute verification_code.
Instance Method Summary collapse
-
#initialize(request_header: nil, token:, condition: nil, verification_code: nil, register_alias: nil) ⇒ Authorize
constructor
A new instance of Authorize.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(request_header: nil, token:, condition: nil, verification_code: nil, register_alias: nil) ⇒ Authorize
Returns a new instance of Authorize.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 13 def initialize(request_header: nil, token:, condition: nil, verification_code: nil, register_alias: nil ) @request_header = request_header || SixSaferpay::RequestHeader.new() @token = token @condition = condition @verification_code = verification_code @register_alias = SixSaferpay::RegisterAlias.new(**register_alias.to_h) if register_alias end |
Instance Attribute Details
#condition ⇒ Object
Returns the value of attribute condition.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 5 def condition @condition end |
#register_alias ⇒ Object
Returns the value of attribute register_alias.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.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.rb', line 5 def request_header @request_header end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 5 def token @token end |
#verification_code ⇒ Object
Returns the value of attribute verification_code.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 5 def verification_code @verification_code end |
Instance Method Details
#response_class ⇒ Object
45 46 47 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 45 def response_class SixSaferpay::SixTransaction::AuthorizeResponse end |
#to_hash ⇒ Object Also known as: to_h
26 27 28 29 30 31 32 33 34 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 26 def to_hash hash = Hash.new hash.merge!(request_header: @request_header.to_h) if @request_header hash.merge!(token: @token) if @token hash.merge!(condition: @condition) if @condition hash.merge!(verification_code: @verification_code) if @verification_code hash.merge!(register_alias: @register_alias.to_h) if @register_alias hash end |
#to_json ⇒ Object
37 38 39 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 37 def to_json to_hash.to_json end |
#url ⇒ Object
41 42 43 |
# File 'lib/six_saferpay/api/six_transaction/requests/authorize.rb', line 41 def url '/Payment/v1/Transaction/Authorize' end |