Class: OnlinePayments::SDK::Domain::MobilePaymentProduct302SpecificInput

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#apple_pay_recurring_payment_requestOnlinePayments::SDK::Domain::ApplePayRecurringPaymentRequest

Returns the current value of apple_pay_recurring_payment_request.

Returns:



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

def apple_pay_recurring_payment_request
  @apple_pay_recurring_payment_request
end

#is_recurringtrue/false

Returns the current value of is_recurring.

Returns:

  • (true/false)

    the current value of is_recurring



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

def is_recurring
  @is_recurring
end

#recurringOnlinePayments::SDK::Domain::Product302Recurring

Returns the current value of recurring.

Returns:



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

def recurring
  @recurring
end

#tokenizetrue/false

Returns the current value of tokenize.

Returns:

  • (true/false)

    the current value of tokenize



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

def tokenize
  @tokenize
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/onlinepayments/sdk/domain/mobile_payment_product302_specific_input.rb', line 35

def from_hash(hash)
  super
  if hash.has_key? 'applePayRecurringPaymentRequest'
    raise TypeError, "value '%s' is not a Hash" % [hash['applePayRecurringPaymentRequest']] unless hash['applePayRecurringPaymentRequest'].is_a? Hash
    @apple_pay_recurring_payment_request = OnlinePayments::SDK::Domain::ApplePayRecurringPaymentRequest.new_from_hash(hash['applePayRecurringPaymentRequest'])
  end
  if hash.has_key? 'isRecurring'
    @is_recurring = hash['isRecurring']
  end
  if hash.has_key? 'recurring'
    raise TypeError, "value '%s' is not a Hash" % [hash['recurring']] unless hash['recurring'].is_a? Hash
    @recurring = OnlinePayments::SDK::Domain::Product302Recurring.new_from_hash(hash['recurring'])
  end
  if hash.has_key? 'tokenize'
    @tokenize = hash['tokenize']
  end
end

#to_hHash

Returns:

  • (Hash)


26
27
28
29
30
31
32
33
# File 'lib/onlinepayments/sdk/domain/mobile_payment_product302_specific_input.rb', line 26

def to_h
  hash = super
  hash['applePayRecurringPaymentRequest'] = @apple_pay_recurring_payment_request.to_h unless @apple_pay_recurring_payment_request.nil?
  hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
  hash['recurring'] = @recurring.to_h unless @recurring.nil?
  hash['tokenize'] = @tokenize unless @tokenize.nil?
  hash
end