Class: OnlinePayments::SDK::Domain::CardToken

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#cardholder_nameString

Returns the current value of cardholder_name.

Returns:

  • (String)

    the current value of cardholder_name



16
17
18
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 16

def cardholder_name
  @cardholder_name
end

#expiry_dateString

Returns the current value of expiry_date.

Returns:

  • (String)

    the current value of expiry_date



16
17
18
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 16

def expiry_date
  @expiry_date
end

#logo_urlString

Returns the current value of logo_url.

Returns:

  • (String)

    the current value of logo_url



16
17
18
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 16

def logo_url
  @logo_url
end

#masked_panString

Returns the current value of masked_pan.

Returns:

  • (String)

    the current value of masked_pan



16
17
18
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 16

def masked_pan
  @masked_pan
end

#payment_product_idInteger

Returns the current value of payment_product_id.

Returns:

  • (Integer)

    the current value of payment_product_id



16
17
18
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 16

def payment_product_id
  @payment_product_id
end

#product_nameString

Returns the current value of product_name.

Returns:

  • (String)

    the current value of product_name



16
17
18
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 16

def product_name
  @product_name
end

#tokenString

Returns the current value of token.

Returns:

  • (String)

    the current value of token



16
17
18
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 16

def token
  @token
end

Instance Method Details

#from_hash(hash) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 45

def from_hash(hash)
  super
  if hash.has_key? 'cardholderName'
    @cardholder_name = hash['cardholderName']
  end
  if hash.has_key? 'expiryDate'
    @expiry_date = hash['expiryDate']
  end
  if hash.has_key? 'logoUrl'
    @logo_url = hash['logoUrl']
  end
  if hash.has_key? 'maskedPan'
    @masked_pan = hash['maskedPan']
  end
  if hash.has_key? 'paymentProductId'
    @payment_product_id = hash['paymentProductId']
  end
  if hash.has_key? 'productName'
    @product_name = hash['productName']
  end
  if hash.has_key? 'token'
    @token = hash['token']
  end
end

#to_hHash

Returns:

  • (Hash)


33
34
35
36
37
38
39
40
41
42
43
# File 'lib/onlinepayments/sdk/domain/card_token.rb', line 33

def to_h
  hash = super
  hash['cardholderName'] = @cardholder_name unless @cardholder_name.nil?
  hash['expiryDate'] = @expiry_date unless @expiry_date.nil?
  hash['logoUrl'] = @logo_url unless @logo_url.nil?
  hash['maskedPan'] = @masked_pan unless @masked_pan.nil?
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash['productName'] = @product_name unless @product_name.nil?
  hash['token'] = @token unless @token.nil?
  hash
end