Class: OnlinePayments::SDK::Domain::ApplePayLineItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#amountString

Returns the current value of amount.

Returns:

  • (String)

    the current value of amount



16
17
18
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 16

def amount
  @amount
end

#labelString

Returns the current value of label.

Returns:

  • (String)

    the current value of label



16
17
18
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 16

def label
  @label
end

#payment_timingString

Returns the current value of payment_timing.

Returns:

  • (String)

    the current value of payment_timing



16
17
18
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 16

def payment_timing
  @payment_timing
end

#recurring_payment_end_dateString

Returns the current value of recurring_payment_end_date.

Returns:

  • (String)

    the current value of recurring_payment_end_date



16
17
18
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 16

def recurring_payment_end_date
  @recurring_payment_end_date
end

#recurring_payment_interval_countInteger

Returns the current value of recurring_payment_interval_count.

Returns:

  • (Integer)

    the current value of recurring_payment_interval_count



16
17
18
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 16

def recurring_payment_interval_count
  @recurring_payment_interval_count
end

#recurring_payment_interval_unitString

Returns the current value of recurring_payment_interval_unit.

Returns:

  • (String)

    the current value of recurring_payment_interval_unit



16
17
18
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 16

def recurring_payment_interval_unit
  @recurring_payment_interval_unit
end

#recurring_payment_start_dateString

Returns the current value of recurring_payment_start_date.

Returns:

  • (String)

    the current value of recurring_payment_start_date



16
17
18
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 16

def recurring_payment_start_date
  @recurring_payment_start_date
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  if hash.has_key? 'amount'
    @amount = hash['amount']
  end
  if hash.has_key? 'label'
    @label = hash['label']
  end
  if hash.has_key? 'paymentTiming'
    @payment_timing = hash['paymentTiming']
  end
  if hash.has_key? 'recurringPaymentEndDate'
    @recurring_payment_end_date = hash['recurringPaymentEndDate']
  end
  if hash.has_key? 'recurringPaymentIntervalCount'
    @recurring_payment_interval_count = hash['recurringPaymentIntervalCount']
  end
  if hash.has_key? 'recurringPaymentIntervalUnit'
    @recurring_payment_interval_unit = hash['recurringPaymentIntervalUnit']
  end
  if hash.has_key? 'recurringPaymentStartDate'
    @recurring_payment_start_date = hash['recurringPaymentStartDate']
  end
end

#to_hHash

Returns:

  • (Hash)


33
34
35
36
37
38
39
40
41
42
43
# File 'lib/onlinepayments/sdk/domain/apple_pay_line_item.rb', line 33

def to_h
  hash = super
  hash['amount'] = @amount unless @amount.nil?
  hash['label'] = @label unless @label.nil?
  hash['paymentTiming'] = @payment_timing unless @payment_timing.nil?
  hash['recurringPaymentEndDate'] = @recurring_payment_end_date unless @recurring_payment_end_date.nil?
  hash['recurringPaymentIntervalCount'] = @recurring_payment_interval_count unless @recurring_payment_interval_count.nil?
  hash['recurringPaymentIntervalUnit'] = @recurring_payment_interval_unit unless @recurring_payment_interval_unit.nil?
  hash['recurringPaymentStartDate'] = @recurring_payment_start_date unless @recurring_payment_start_date.nil?
  hash
end