Class: Worldline::Acquiring::SDK::V1::Domain::TransactionReferencesBase

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

Direct Known Subclasses

TransactionReferencesDispute

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#acquirer_reference_number ⇒ String

Returns the current value of acquirer_reference_number.

Returns:

  • (String) —

    the current value of acquirer_reference_number



14
15
16
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_references_base.rb', line 14

def acquirer_reference_number
  @acquirer_reference_number
end

#merchant_reference ⇒ String

Returns the current value of merchant_reference.

Returns:

  • (String) —

    the current value of merchant_reference



14
15
16
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_references_base.rb', line 14

def merchant_reference
  @merchant_reference
end

#payment_id ⇒ String

Returns the current value of payment_id.

Returns:

  • (String) —

    the current value of payment_id



14
15
16
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_references_base.rb', line 14

def payment_id
  @payment_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_references_base.rb', line 31

def from_hash(hash)
  super
  if hash.has_key? 'acquirerReferenceNumber'
    @acquirer_reference_number = hash['acquirerReferenceNumber']
  end
  if hash.has_key? 'merchantReference'
    @merchant_reference = hash['merchantReference']
  end
  if hash.has_key? 'paymentId'
    @payment_id = hash['paymentId']
  end
end

#to_h ⇒ Hash

Returns:

  • (Hash)


23
24
25
26
27
28
29
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_references_base.rb', line 23

def to_h
  hash = super
  hash['acquirerReferenceNumber'] = @acquirer_reference_number unless @acquirer_reference_number.nil?
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
  hash['paymentId'] = @payment_id unless @payment_id.nil?
  hash
end