Class: Ingenico::Direct::SDK::Domain::CustomerPaymentActivity

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/customer_payment_activity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#number_of_payment_attempts_last24_hoursInteger

Returns the current value of number_of_payment_attempts_last24_hours.

Returns:

  • (Integer)

    the current value of number_of_payment_attempts_last24_hours



13
14
15
# File 'lib/ingenico/direct/sdk/domain/customer_payment_activity.rb', line 13

def number_of_payment_attempts_last24_hours
  @number_of_payment_attempts_last24_hours
end

#number_of_payment_attempts_last_yearInteger

Returns the current value of number_of_payment_attempts_last_year.

Returns:

  • (Integer)

    the current value of number_of_payment_attempts_last_year



13
14
15
# File 'lib/ingenico/direct/sdk/domain/customer_payment_activity.rb', line 13

def number_of_payment_attempts_last_year
  @number_of_payment_attempts_last_year
end

#number_of_purchases_last6_monthsInteger

Returns the current value of number_of_purchases_last6_months.

Returns:

  • (Integer)

    the current value of number_of_purchases_last6_months



13
14
15
# File 'lib/ingenico/direct/sdk/domain/customer_payment_activity.rb', line 13

def number_of_purchases_last6_months
  @number_of_purchases_last6_months
end

Instance Method Details

#from_hash(hash) ⇒ Object



27
28
29
30
31
32
# File 'lib/ingenico/direct/sdk/domain/customer_payment_activity.rb', line 27

def from_hash(hash)
  super
  @number_of_payment_attempts_last24_hours = hash['numberOfPaymentAttemptsLast24Hours'] if hash.key? 'numberOfPaymentAttemptsLast24Hours'
  @number_of_payment_attempts_last_year = hash['numberOfPaymentAttemptsLastYear'] if hash.key? 'numberOfPaymentAttemptsLastYear'
  @number_of_purchases_last6_months = hash['numberOfPurchasesLast6Months'] if hash.key? 'numberOfPurchasesLast6Months'
end

#to_hHash

Returns:

  • (Hash)


19
20
21
22
23
24
25
# File 'lib/ingenico/direct/sdk/domain/customer_payment_activity.rb', line 19

def to_h
  hash = super
  hash['numberOfPaymentAttemptsLast24Hours'] = @number_of_payment_attempts_last24_hours unless @number_of_payment_attempts_last24_hours.nil?
  hash['numberOfPaymentAttemptsLastYear'] = @number_of_payment_attempts_last_year unless @number_of_payment_attempts_last_year.nil?
  hash['numberOfPurchasesLast6Months'] = @number_of_purchases_last6_months unless @number_of_purchases_last6_months.nil?
  hash
end