Class: OnlinePayments::SDK::Domain::HostedCheckoutSpecificInput

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#allowed_number_of_payment_attemptsInteger

Returns the current value of allowed_number_of_payment_attempts.

Returns:

  • (Integer)

    the current value of allowed_number_of_payment_attempts



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def allowed_number_of_payment_attempts
  @allowed_number_of_payment_attempts
end

#card_payment_method_specific_inputOnlinePayments::SDK::Domain::CardPaymentMethodSpecificInputForHostedCheckout

Returns the current value of card_payment_method_specific_input.

Returns:



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#is_recurringtrue/false

Returns the current value of is_recurring.

Returns:

  • (true/false)

    the current value of is_recurring



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def is_recurring
  @is_recurring
end

#localeString

Returns the current value of locale.

Returns:

  • (String)

    the current value of locale



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def locale
  @locale
end

#payment_product_filtersOnlinePayments::SDK::Domain::PaymentProductFiltersHostedCheckout

Returns the current value of payment_product_filters.

Returns:



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def payment_product_filters
  @payment_product_filters
end

#return_urlString

Returns the current value of return_url.

Returns:

  • (String)

    the current value of return_url



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def return_url
  @return_url
end

#session_timeoutInteger

Returns the current value of session_timeout.

Returns:

  • (Integer)

    the current value of session_timeout



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def session_timeout
  @session_timeout
end

#show_result_pagetrue/false

Returns the current value of show_result_page.

Returns:

  • (true/false)

    the current value of show_result_page



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def show_result_page
  @show_result_page
end

#tokensString

Returns the current value of tokens.

Returns:

  • (String)

    the current value of tokens



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def tokens
  @tokens
end

#variantString

Returns the current value of variant.

Returns:

  • (String)

    the current value of variant



21
22
23
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 21

def variant
  @variant
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  @allowed_number_of_payment_attempts = hash['allowedNumberOfPaymentAttempts'] if hash.key? 'allowedNumberOfPaymentAttempts'
  if hash.key? 'cardPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']] unless hash['cardPaymentMethodSpecificInput'].is_a? Hash
    @card_payment_method_specific_input = OnlinePayments::SDK::Domain::CardPaymentMethodSpecificInputForHostedCheckout.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  end
  @is_recurring = hash['isRecurring'] if hash.key? 'isRecurring'
  @locale = hash['locale'] if hash.key? 'locale'
  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::PaymentProductFiltersHostedCheckout.new_from_hash(hash['paymentProductFilters'])
  end
  @return_url = hash['returnUrl'] if hash.key? 'returnUrl'
  @session_timeout = hash['sessionTimeout'] if hash.key? 'sessionTimeout'
  @show_result_page = hash['showResultPage'] if hash.key? 'showResultPage'
  @tokens = hash['tokens'] if hash.key? 'tokens'
  @variant = hash['variant'] if hash.key? 'variant'
end

#to_hHash

Returns:

  • (Hash)


34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb', line 34

def to_h
  hash = super
  hash['allowedNumberOfPaymentAttempts'] = @allowed_number_of_payment_attempts unless @allowed_number_of_payment_attempts.nil?
  hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h if @card_payment_method_specific_input
  hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
  hash['locale'] = @locale unless @locale.nil?
  hash['paymentProductFilters'] = @payment_product_filters.to_h if @payment_product_filters
  hash['returnUrl'] = @return_url unless @return_url.nil?
  hash['sessionTimeout'] = @session_timeout unless @session_timeout.nil?
  hash['showResultPage'] = @show_result_page unless @show_result_page.nil?
  hash['tokens'] = @tokens unless @tokens.nil?
  hash['variant'] = @variant unless @variant.nil?
  hash
end