Class: Killbill::Plugin::Model::InvoicePayment

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/gen/api/invoice_payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInvoicePayment

Returns a new instance of InvoicePayment.



39
40
# File 'lib/killbill/gen/api/invoice_payment.rb', line 39

def initialize()
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def amount
  @amount
end

#created_dateObject

Returns the value of attribute created_date.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def created_date
  @created_date
end

#currencyObject

Returns the value of attribute currency.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def currency
  @currency
end

#idObject

Returns the value of attribute id.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def id
  @id
end

#invoice_idObject

Returns the value of attribute invoice_id.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def invoice_id
  @invoice_id
end

#is_successObject

Returns the value of attribute is_success.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def is_success
  @is_success
end

#linked_invoice_payment_idObject

Returns the value of attribute linked_invoice_payment_id.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def linked_invoice_payment_id
  @linked_invoice_payment_id
end

Returns the value of attribute payment_cookie_id.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def payment_cookie_id
  @payment_cookie_id
end

#payment_dateObject

Returns the value of attribute payment_date.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def payment_date
  @payment_date
end

#payment_idObject

Returns the value of attribute payment_id.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def payment_id
  @payment_id
end

#processed_currencyObject

Returns the value of attribute processed_currency.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def processed_currency
  @processed_currency
end

#typeObject

Returns the value of attribute type.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def type
  @type
end

#updated_dateObject

Returns the value of attribute updated_date.



37
38
39
# File 'lib/killbill/gen/api/invoice_payment.rb', line 37

def updated_date
  @updated_date
end

Instance Method Details

#to_javaObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/killbill/gen/api/invoice_payment.rb', line 42

def to_java()
  # conversion for id [type = java.util.UUID]
  @id = java.util.UUID.fromString(@id.to_s) unless @id.nil?

  # conversion for created_date [type = org.joda.time.DateTime]
  if !@created_date.nil?
    @created_date =  (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
    @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
  end

  # conversion for updated_date [type = org.joda.time.DateTime]
  if !@updated_date.nil?
    @updated_date =  (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
    @updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
  end

  # conversion for payment_id [type = java.util.UUID]
  @payment_id = java.util.UUID.fromString(@payment_id.to_s) unless @payment_id.nil?

  # conversion for type [type = org.killbill.billing.invoice.api.InvoicePaymentType]
  @type = Java::org.killbill.billing.invoice.api.InvoicePaymentType.value_of( @type.to_s ) unless @type.nil?

  # conversion for invoice_id [type = java.util.UUID]
  @invoice_id = java.util.UUID.fromString(@invoice_id.to_s) unless @invoice_id.nil?

  # conversion for payment_date [type = org.joda.time.DateTime]
  if !@payment_date.nil?
    @payment_date =  (@payment_date.kind_of? Time) ? DateTime.parse(@payment_date.to_s) : @payment_date
    @payment_date = Java::org.joda.time.DateTime.new(@payment_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
  end

  # conversion for amount [type = java.math.BigDecimal]
  if @amount.nil?
    @amount = java.math.BigDecimal::ZERO
  else
    @amount = java.math.BigDecimal.new(@amount.to_s)
  end

  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
  @currency = Java::org.killbill.billing.catalog.api.Currency.value_of( @currency.to_s ) unless @currency.nil?

  # conversion for linked_invoice_payment_id [type = java.util.UUID]
  @linked_invoice_payment_id = java.util.UUID.fromString(@linked_invoice_payment_id.to_s) unless @linked_invoice_payment_id.nil?

  # conversion for payment_cookie_id [type = java.lang.String]
  @payment_cookie_id = @payment_cookie_id.to_s unless @payment_cookie_id.nil?

  # conversion for processed_currency [type = org.killbill.billing.catalog.api.Currency]
  @processed_currency = Java::org.killbill.billing.catalog.api.Currency.value_of( @processed_currency.to_s ) unless @processed_currency.nil?

  # conversion for is_success [type = java.lang.Boolean]
  @is_success = @is_success.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_success)
  self
end

#to_ruby(j_obj) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/killbill/gen/api/invoice_payment.rb', line 97

def to_ruby(j_obj)
  # conversion for id [type = java.util.UUID]
  @id = j_obj.id
  @id = @id.nil? ? nil : @id.to_s

  # conversion for created_date [type = org.joda.time.DateTime]
  @created_date = j_obj.created_date
  if !@created_date.nil?
    fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
    str = fmt.print(@created_date)
    @created_date = DateTime.iso8601(str)
  end

  # conversion for updated_date [type = org.joda.time.DateTime]
  @updated_date = j_obj.updated_date
  if !@updated_date.nil?
    fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
    str = fmt.print(@updated_date)
    @updated_date = DateTime.iso8601(str)
  end

  # conversion for payment_id [type = java.util.UUID]
  @payment_id = j_obj.payment_id
  @payment_id = @payment_id.nil? ? nil : @payment_id.to_s

  # conversion for type [type = org.killbill.billing.invoice.api.InvoicePaymentType]
  @type = j_obj.type
  @type = @type.to_s.to_sym unless @type.nil?

  # conversion for invoice_id [type = java.util.UUID]
  @invoice_id = j_obj.invoice_id
  @invoice_id = @invoice_id.nil? ? nil : @invoice_id.to_s

  # conversion for payment_date [type = org.joda.time.DateTime]
  @payment_date = j_obj.payment_date
  if !@payment_date.nil?
    fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
    str = fmt.print(@payment_date)
    @payment_date = DateTime.iso8601(str)
  end

  # conversion for amount [type = java.math.BigDecimal]
  @amount = j_obj.amount
  @amount = @amount.nil? ? 0 : BigDecimal.new(@amount.to_s)

  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
  @currency = j_obj.currency
  @currency = @currency.to_s.to_sym unless @currency.nil?

  # conversion for linked_invoice_payment_id [type = java.util.UUID]
  @linked_invoice_payment_id = j_obj.linked_invoice_payment_id
  @linked_invoice_payment_id = @linked_invoice_payment_id.nil? ? nil : @linked_invoice_payment_id.to_s

  # conversion for payment_cookie_id [type = java.lang.String]
  @payment_cookie_id = j_obj.payment_cookie_id

  # conversion for processed_currency [type = org.killbill.billing.catalog.api.Currency]
  @processed_currency = j_obj.processed_currency
  @processed_currency = @processed_currency.to_s.to_sym unless @processed_currency.nil?

  # conversion for is_success [type = java.lang.Boolean]
  @is_success = j_obj.is_success
  if @is_success.nil?
    @is_success = false
  else
    tmp_bool = (@is_success.java_kind_of? java.lang.Boolean) ? @is_success.boolean_value : @is_success
    @is_success = tmp_bool ? true : false
  end
  self
end