Class: OnlinePayments::SDK::Domain::CreateHostedTokenizationRequest

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

Returns the current value of ask_consumer_consent.

Returns:

  • (true/false)

    the current value of ask_consumer_consent



19
20
21
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 19

def ask_consumer_consent
  @ask_consumer_consent
end

#credit_card_specific_inputOnlinePayments::SDK::Domain::CreditCardSpecificInputHostedTokenization

Returns the current value of credit_card_specific_input.

Returns:



19
20
21
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 19

def credit_card_specific_input
  @credit_card_specific_input
end

#localeString

Returns the current value of locale.

Returns:

  • (String)

    the current value of locale



19
20
21
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 19

def locale
  @locale
end

#page_customizationOnlinePayments::SDK::Domain::PageCustomization

Returns the current value of page_customization.

Returns:



19
20
21
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 19

def page_customization
  @page_customization
end

#payment_product_filtersOnlinePayments::SDK::Domain::PaymentProductFiltersHostedTokenization

Returns the current value of payment_product_filters.

Returns:



19
20
21
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 19

def payment_product_filters
  @payment_product_filters
end

#tokensString

Returns the current value of tokens.

Returns:

  • (String)

    the current value of tokens



19
20
21
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 19

def tokens
  @tokens
end

#variantString

Returns the current value of variant.

Returns:

  • (String)

    the current value of variant



19
20
21
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 19

def variant
  @variant
end

Instance Method Details

#from_hash(hash) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb', line 41

def from_hash(hash)
  super
  @ask_consumer_consent = hash['askConsumerConsent'] if hash.key? 'askConsumerConsent'
  if hash.key? 'creditCardSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['creditCardSpecificInput']] unless hash['creditCardSpecificInput'].is_a? Hash
    @credit_card_specific_input = OnlinePayments::SDK::Domain::CreditCardSpecificInputHostedTokenization.new_from_hash(hash['creditCardSpecificInput'])
  end
  @locale = hash['locale'] if hash.key? 'locale'
  if hash.key? 'pageCustomization'
    raise TypeError, "value '%s' is not a Hash" % [hash['pageCustomization']] unless hash['pageCustomization'].is_a? Hash
    @page_customization = OnlinePayments::SDK::Domain::PageCustomization.new_from_hash(hash['pageCustomization'])
  end
  if hash.key? 'paymentProductFilters'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductFilters']] unless hash['paymentProductFilters'].is_a? Hash
    @payment_product_filters = OnlinePayments::SDK::Domain::PaymentProductFiltersHostedTokenization.new_from_hash(hash['paymentProductFilters'])
  end
  @tokens = hash['tokens'] if hash.key? 'tokens'
  @variant = hash['variant'] if hash.key? 'variant'
end

#to_hHash

Returns:

  • (Hash)


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

def to_h
  hash = super
  hash['askConsumerConsent'] = @ask_consumer_consent unless @ask_consumer_consent.nil?
  hash['creditCardSpecificInput'] = @credit_card_specific_input.to_h if @credit_card_specific_input
  hash['locale'] = @locale unless @locale.nil?
  hash['pageCustomization'] = @page_customization.to_h if @page_customization
  hash['paymentProductFilters'] = @payment_product_filters.to_h if @payment_product_filters
  hash['tokens'] = @tokens unless @tokens.nil?
  hash['variant'] = @variant unless @variant.nil?
  hash
end