Class: Worldline::Acquiring::SDK::V1::Domain::PlainCardData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#card_numberString

Returns the current value of card_number.

Returns:

  • (String)

    the current value of card_number



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

def card_number
  @card_number
end

#card_security_codeString

Returns the current value of card_security_code.

Returns:

  • (String)

    the current value of card_security_code



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

def card_security_code
  @card_security_code
end

#expiry_dateString

Returns the current value of expiry_date.

Returns:

  • (String)

    the current value of expiry_date



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

def expiry_date
  @expiry_date
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/plain_card_data.rb', line 31

def from_hash(hash)
  super
  if hash.has_key? 'cardNumber'
    @card_number = hash['cardNumber']
  end
  if hash.has_key? 'cardSecurityCode'
    @card_security_code = hash['cardSecurityCode']
  end
  if hash.has_key? 'expiryDate'
    @expiry_date = hash['expiryDate']
  end
end

#to_hHash

Returns:

  • (Hash)


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

def to_h
  hash = super
  hash['cardNumber'] = @card_number unless @card_number.nil?
  hash['cardSecurityCode'] = @card_security_code unless @card_security_code.nil?
  hash['expiryDate'] = @expiry_date unless @expiry_date.nil?
  hash
end