Class: Worldline::Acquiring::SDK::V1::Domain::ApiPaymentRequest
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Acquiring::SDK::V1::Domain::ApiPaymentRequest
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb
Instance Attribute Summary collapse
-
#amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
The current value of amount.
-
#amount_breakdown_data ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountBreakdownData
The current value of amount_breakdown_data.
-
#authorization_type ⇒ String
The current value of authorization_type.
-
#card_payment_data ⇒ Worldline::Acquiring::SDK::V1::Domain::CardPaymentData
The current value of card_payment_data.
-
#dynamic_currency_conversion ⇒ Worldline::Acquiring::SDK::V1::Domain::DccData
The current value of dynamic_currency_conversion.
-
#merchant ⇒ Worldline::Acquiring::SDK::V1::Domain::MerchantData
The current value of merchant.
-
#operation_id ⇒ String
The current value of operation_id.
-
#references ⇒ Worldline::Acquiring::SDK::V1::Domain::PaymentReferences
The current value of references.
-
#terminal_data ⇒ Worldline::Acquiring::SDK::V1::Domain::TerminalData
The current value of terminal_data.
-
#transaction_timestamp ⇒ DateTime
The current value of transaction_timestamp.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
Returns the current value of amount.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def amount @amount end |
#amount_breakdown_data ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountBreakdownData
Returns the current value of amount_breakdown_data.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def amount_breakdown_data @amount_breakdown_data end |
#authorization_type ⇒ String
Returns the current value of authorization_type.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def @authorization_type end |
#card_payment_data ⇒ Worldline::Acquiring::SDK::V1::Domain::CardPaymentData
Returns the current value of card_payment_data.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def card_payment_data @card_payment_data end |
#dynamic_currency_conversion ⇒ Worldline::Acquiring::SDK::V1::Domain::DccData
Returns the current value of dynamic_currency_conversion.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def dynamic_currency_conversion @dynamic_currency_conversion end |
#merchant ⇒ Worldline::Acquiring::SDK::V1::Domain::MerchantData
Returns the current value of merchant.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def merchant @merchant end |
#operation_id ⇒ String
Returns the current value of operation_id.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def operation_id @operation_id end |
#references ⇒ Worldline::Acquiring::SDK::V1::Domain::PaymentReferences
Returns the current value of references.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def references @references end |
#terminal_data ⇒ Worldline::Acquiring::SDK::V1::Domain::TerminalData
Returns the current value of terminal_data.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def terminal_data @terminal_data end |
#transaction_timestamp ⇒ DateTime
Returns the current value of transaction_timestamp.
30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 30 def @transaction_timestamp end |
Instance Method Details
#from_hash(hash) ⇒ Object
68 69 70 71 72 73 74 75 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 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 68 def from_hash(hash) super if hash.has_key? 'amount' raise TypeError, "value '%s' is not a Hash" % [hash['amount']] unless hash['amount'].is_a? Hash @amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['amount']) end if hash.has_key? 'amountBreakdownData' raise TypeError, "value '%s' is not a Hash" % [hash['amountBreakdownData']] unless hash['amountBreakdownData'].is_a? Hash @amount_breakdown_data = Worldline::Acquiring::SDK::V1::Domain::AmountBreakdownData.new_from_hash(hash['amountBreakdownData']) end if hash.has_key? 'authorizationType' @authorization_type = hash['authorizationType'] end 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::CardPaymentData.new_from_hash(hash['cardPaymentData']) end if hash.has_key? 'dynamicCurrencyConversion' raise TypeError, "value '%s' is not a Hash" % [hash['dynamicCurrencyConversion']] unless hash['dynamicCurrencyConversion'].is_a? Hash @dynamic_currency_conversion = Worldline::Acquiring::SDK::V1::Domain::DccData.new_from_hash(hash['dynamicCurrencyConversion']) end if hash.has_key? 'merchant' raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash @merchant = Worldline::Acquiring::SDK::V1::Domain::MerchantData.new_from_hash(hash['merchant']) end if hash.has_key? 'operationId' @operation_id = hash['operationId'] 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::PaymentReferences.new_from_hash(hash['references']) end if hash.has_key? 'terminalData' raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash @terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData']) end if hash.has_key? 'transactionTimestamp' @transaction_timestamp = DateTime.parse(hash['transactionTimestamp']) end end |
#to_h ⇒ Hash
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb', line 53 def to_h hash = super hash['amount'] = @amount.to_h unless @amount.nil? hash['amountBreakdownData'] = @amount_breakdown_data.to_h unless @amount_breakdown_data.nil? hash['authorizationType'] = @authorization_type unless @authorization_type.nil? hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil? hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil? hash['merchant'] = @merchant.to_h unless @merchant.nil? hash['operationId'] = @operation_id unless @operation_id.nil? hash['references'] = @references.to_h unless @references.nil? hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil? hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil? hash end |