Class: Worldline::Acquiring::SDK::V1::Domain::ApiPaymentResponse
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Acquiring::SDK::V1::Domain::ApiPaymentResponse
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb
Instance Attribute Summary collapse
-
#card_payment_data ⇒ Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse
The current value of card_payment_data.
-
#initial_authorization_code ⇒ String
The current value of initial_authorization_code.
-
#operation_id ⇒ String
The current value of operation_id.
-
#payment_id ⇒ String
The current value of payment_id.
-
#references ⇒ Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses
The current value of references.
-
#responder ⇒ String
The current value of responder.
-
#response_code ⇒ String
The current value of response_code.
-
#response_code_category ⇒ String
The current value of response_code_category.
-
#response_code_description ⇒ String
The current value of response_code_description.
-
#retry_after ⇒ String
The current value of retry_after.
-
#status ⇒ String
The current value of status.
-
#status_timestamp ⇒ DateTime
The current value of status_timestamp.
-
#total_authorized_amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
The current value of total_authorized_amount.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#card_payment_data ⇒ Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse
Returns the current value of card_payment_data.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def card_payment_data @card_payment_data end |
#initial_authorization_code ⇒ String
Returns the current value of initial_authorization_code.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def @initial_authorization_code end |
#operation_id ⇒ String
Returns the current value of operation_id.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def operation_id @operation_id end |
#payment_id ⇒ String
Returns the current value of payment_id.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def payment_id @payment_id end |
#references ⇒ Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses
Returns the current value of references.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def references @references end |
#responder ⇒ String
Returns the current value of responder.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def responder @responder end |
#response_code ⇒ String
Returns the current value of response_code.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def response_code @response_code end |
#response_code_category ⇒ String
Returns the current value of response_code_category.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def response_code_category @response_code_category end |
#response_code_description ⇒ String
Returns the current value of response_code_description.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def response_code_description @response_code_description end |
#retry_after ⇒ String
Returns the current value of retry_after.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def retry_after @retry_after end |
#status ⇒ String
Returns the current value of status.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def status @status end |
#status_timestamp ⇒ DateTime
Returns the current value of status_timestamp.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def @status_timestamp end |
#total_authorized_amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
Returns the current value of total_authorized_amount.
29 30 31 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 29 def @total_authorized_amount end |
Instance Method Details
#from_hash(hash) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 76 def from_hash(hash) super if hash.has_key? 'cardPaymentData' raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash @card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse.new_from_hash(hash['cardPaymentData']) end if hash.has_key? 'initialAuthorizationCode' @initial_authorization_code = hash['initialAuthorizationCode'] end if hash.has_key? 'operationId' @operation_id = hash['operationId'] end if hash.has_key? 'paymentId' @payment_id = hash['paymentId'] end if hash.has_key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses.new_from_hash(hash['references']) end if hash.has_key? 'responder' @responder = hash['responder'] end if hash.has_key? 'responseCode' @response_code = hash['responseCode'] end if hash.has_key? 'responseCodeCategory' @response_code_category = hash['responseCodeCategory'] end if hash.has_key? 'responseCodeDescription' @response_code_description = hash['responseCodeDescription'] end if hash.has_key? 'retryAfter' @retry_after = hash['retryAfter'] end if hash.has_key? 'status' @status = hash['status'] end if hash.has_key? 'statusTimestamp' @status_timestamp = DateTime.parse(hash['statusTimestamp']) end if hash.has_key? 'totalAuthorizedAmount' raise TypeError, "value '%s' is not a Hash" % [hash['totalAuthorizedAmount']] unless hash['totalAuthorizedAmount'].is_a? Hash @total_authorized_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['totalAuthorizedAmount']) end end |
#to_h ⇒ Hash
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb', line 58 def to_h hash = super hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil? hash['initialAuthorizationCode'] = @initial_authorization_code unless @initial_authorization_code.nil? hash['operationId'] = @operation_id unless @operation_id.nil? hash['paymentId'] = @payment_id unless @payment_id.nil? hash['references'] = @references.to_h unless @references.nil? hash['responder'] = @responder unless @responder.nil? hash['responseCode'] = @response_code unless @response_code.nil? hash['responseCodeCategory'] = @response_code_category unless @response_code_category.nil? hash['responseCodeDescription'] = @response_code_description unless @response_code_description.nil? hash['retryAfter'] = @retry_after unless @retry_after.nil? hash['status'] = @status unless @status.nil? hash['statusTimestamp'] = @status_timestamp.iso8601(3) unless @status_timestamp.nil? hash['totalAuthorizedAmount'] = @total_authorized_amount.to_h unless @total_authorized_amount.nil? hash end |