Class: OnlinePayments::SDK::Domain::ImportCofSeriesRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#cardOnlinePayments::SDK::Domain::CardDataWithoutCvv

Returns the current value of card.

Returns:



15
16
17
# File 'lib/onlinepayments/sdk/domain/import_cof_series_request.rb', line 15

def card
  @card
end

#currency_codeString

Returns the current value of currency_code.

Returns:

  • (String)

    the current value of currency_code



15
16
17
# File 'lib/onlinepayments/sdk/domain/import_cof_series_request.rb', line 15

def currency_code
  @currency_code
end

#payment_product_idInteger

Returns the current value of payment_product_id.

Returns:

  • (Integer)

    the current value of payment_product_id



15
16
17
# File 'lib/onlinepayments/sdk/domain/import_cof_series_request.rb', line 15

def payment_product_id
  @payment_product_id
end

#scheme_reference_dataString

Returns the current value of scheme_reference_data.

Returns:

  • (String)

    the current value of scheme_reference_data



15
16
17
# File 'lib/onlinepayments/sdk/domain/import_cof_series_request.rb', line 15

def scheme_reference_data
  @scheme_reference_data
end

#token_idString

Returns the current value of token_id.

Returns:

  • (String)

    the current value of token_id



15
16
17
# File 'lib/onlinepayments/sdk/domain/import_cof_series_request.rb', line 15

def token_id
  @token_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/onlinepayments/sdk/domain/import_cof_series_request.rb', line 38

def from_hash(hash)
  super
  if hash.has_key? 'card'
    raise TypeError, "value '%s' is not a Hash" % [hash['card']] unless hash['card'].is_a? Hash
    @card = OnlinePayments::SDK::Domain::CardDataWithoutCvv.new_from_hash(hash['card'])
  end
  if hash.has_key? 'currencyCode'
    @currency_code = hash['currencyCode']
  end
  if hash.has_key? 'paymentProductId'
    @payment_product_id = hash['paymentProductId']
  end
  if hash.has_key? 'schemeReferenceData'
    @scheme_reference_data = hash['schemeReferenceData']
  end
  if hash.has_key? 'tokenId'
    @token_id = hash['tokenId']
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
36
# File 'lib/onlinepayments/sdk/domain/import_cof_series_request.rb', line 28

def to_h
  hash = super
  hash['card'] = @card.to_h unless @card.nil?
  hash['currencyCode'] = @currency_code unless @currency_code.nil?
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash['schemeReferenceData'] = @scheme_reference_data unless @scheme_reference_data.nil?
  hash['tokenId'] = @token_id unless @token_id.nil?
  hash
end