Class: Worldline::Acquiring::SDK::V1::Domain::ApiPaymentRefundRequest

Inherits:
Domain::DataObject
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#amountWorldline::Acquiring::SDK::V1::Domain::AmountData

Returns the current value of amount.

Returns:



22
23
24
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 22

def amount
  @amount
end

#capture_immediatelytrue/false

Returns the current value of capture_immediately.

Returns:

  • (true/false)

    the current value of capture_immediately



22
23
24
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 22

def capture_immediately
  @capture_immediately
end

#dynamic_currency_conversionWorldline::Acquiring::SDK::V1::Domain::DccData

Returns the current value of dynamic_currency_conversion.

Returns:



22
23
24
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 22

def dynamic_currency_conversion
  @dynamic_currency_conversion
end

#operation_idString

Returns the current value of operation_id.

Returns:

  • (String)

    the current value of operation_id



22
23
24
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 22

def operation_id
  @operation_id
end

#referencesWorldline::Acquiring::SDK::V1::Domain::PaymentReferences

Returns the current value of references.

Returns:



22
23
24
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 22

def references
  @references
end

#transaction_timestampDateTime

Returns the current value of transaction_timestamp.

Returns:

  • (DateTime)

    the current value of transaction_timestamp



22
23
24
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 22

def transaction_timestamp
  @transaction_timestamp
end

Instance Method Details

#from_hash(hash) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 48

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? 'captureImmediately'
    @capture_immediately = hash['captureImmediately']
  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? '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? 'transactionTimestamp'
    @transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
  end
end

#to_hHash

Returns:

  • (Hash)


37
38
39
40
41
42
43
44
45
46
# File 'lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb', line 37

def to_h
  hash = super
  hash['amount'] = @amount.to_h unless @amount.nil?
  hash['captureImmediately'] = @capture_immediately unless @capture_immediately.nil?
  hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
  hash['operationId'] = @operation_id unless @operation_id.nil?
  hash['references'] = @references.to_h unless @references.nil?
  hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
  hash
end