Class: OnlinePayments::SDK::Domain::CardWithoutCvv

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/card_without_cvv.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#card_numberString

Returns the current value of card_number.

Returns:

  • (String)

    the current value of card_number



12
13
14
# File 'lib/onlinepayments/sdk/domain/card_without_cvv.rb', line 12

def card_number
  @card_number
end

#cardholder_nameString

Returns the current value of cardholder_name.

Returns:

  • (String)

    the current value of cardholder_name



12
13
14
# File 'lib/onlinepayments/sdk/domain/card_without_cvv.rb', line 12

def cardholder_name
  @cardholder_name
end

#expiry_dateString

Returns the current value of expiry_date.

Returns:

  • (String)

    the current value of expiry_date



12
13
14
# File 'lib/onlinepayments/sdk/domain/card_without_cvv.rb', line 12

def expiry_date
  @expiry_date
end

Instance Method Details

#from_hash(hash) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/onlinepayments/sdk/domain/card_without_cvv.rb', line 29

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

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
27
# File 'lib/onlinepayments/sdk/domain/card_without_cvv.rb', line 21

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