Class: OnlinePayments::SDK::Domain::CardPaymentMethodSpecificInputForHostedCheckout

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#click_to_paytrue/false

Returns the current value of click_to_pay.

Returns:

  • (true/false)

    the current value of click_to_pay



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

def click_to_pay
  @click_to_pay
end

#group_cardstrue/false

Returns the current value of group_cards.

Returns:

  • (true/false)

    the current value of group_cards



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

def group_cards
  @group_cards
end

#payment_product_preferred_orderArray<Integer>

Returns the current value of payment_product_preferred_order.

Returns:

  • (Array<Integer>)

    the current value of payment_product_preferred_order



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

def payment_product_preferred_order
  @payment_product_preferred_order
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  @click_to_pay = hash['clickToPay'] if hash.key? 'clickToPay'
  @group_cards = hash['groupCards'] if hash.key? 'groupCards'
  if hash.key? 'paymentProductPreferredOrder'
    raise TypeError, "value '%s' is not an Array" % [hash['paymentProductPreferredOrder']] unless hash['paymentProductPreferredOrder'].is_a? Array
    @payment_product_preferred_order = []
    hash['paymentProductPreferredOrder'].each do |e|
      @payment_product_preferred_order << e
    end
  end
end

#to_hHash

Returns:

  • (Hash)


18
19
20
21
22
23
24
# File 'lib/onlinepayments/sdk/domain/card_payment_method_specific_input_for_hosted_checkout.rb', line 18

def to_h
  hash = super
  hash['clickToPay'] = @click_to_pay unless @click_to_pay.nil?
  hash['groupCards'] = @group_cards unless @group_cards.nil?
  hash['paymentProductPreferredOrder'] = @payment_product_preferred_order unless @payment_product_preferred_order.nil?
  hash
end