Class: Killbill::Plugin::Model::InvoicePaymentMetadata
- Defined in:
- lib/killbill/gen/plugin-api/invoice_payment_metadata.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#invoice_payment_type ⇒ Object
Returns the value of attribute invoice_payment_type.
-
#linked_invoice_payment_id ⇒ Object
Returns the value of attribute linked_invoice_payment_id.
-
#payment_cookie_id ⇒ Object
Returns the value of attribute payment_cookie_id.
-
#payment_date ⇒ Object
Returns the value of attribute payment_date.
-
#payment_id ⇒ Object
Returns the value of attribute payment_id.
-
#processed_currency ⇒ Object
Returns the value of attribute processed_currency.
Instance Method Summary collapse
-
#initialize ⇒ InvoicePaymentMetadata
constructor
A new instance of InvoicePaymentMetadata.
- #to_java ⇒ Object
- #to_ruby(j_obj) ⇒ Object
Constructor Details
#initialize ⇒ InvoicePaymentMetadata
Returns a new instance of InvoicePaymentMetadata.
37 38 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 37 def initialize() end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def amount @amount end |
#currency ⇒ Object
Returns the value of attribute currency.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def currency @currency end |
#invoice_payment_type ⇒ Object
Returns the value of attribute invoice_payment_type.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def invoice_payment_type @invoice_payment_type end |
#linked_invoice_payment_id ⇒ Object
Returns the value of attribute linked_invoice_payment_id.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def linked_invoice_payment_id @linked_invoice_payment_id end |
#payment_cookie_id ⇒ Object
Returns the value of attribute payment_cookie_id.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def @payment_cookie_id end |
#payment_date ⇒ Object
Returns the value of attribute payment_date.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def payment_date @payment_date end |
#payment_id ⇒ Object
Returns the value of attribute payment_id.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def payment_id @payment_id end |
#processed_currency ⇒ Object
Returns the value of attribute processed_currency.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 35 def processed_currency @processed_currency end |
Instance Method Details
#to_java ⇒ Object
40 41 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 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 40 def to_java() # conversion for payment_id [type = java.util.UUID] @payment_id = java.util.UUID.fromString(@payment_id.to_s) unless @payment_id.nil? # conversion for invoice_payment_type [type = org.killbill.billing.invoice.api.InvoicePaymentType] @invoice_payment_type = Java::org.killbill.billing.invoice.api.InvoicePaymentType.value_of( @invoice_payment_type.to_s ) unless @invoice_payment_type.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? Java::org.killbill.billing.notification.plugin.api.InvoicePaymentMetadata.new(@payment_id, @invoice_payment_type, @payment_date, @amount, @currency, @linked_invoice_payment_id, @payment_cookie_id, @processed_currency) end |
#to_ruby(j_obj) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/killbill/gen/plugin-api/invoice_payment_metadata.rb', line 74 def to_ruby(j_obj) # 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 invoice_payment_type [type = org.killbill.billing.invoice.api.InvoicePaymentType] @invoice_payment_type = j_obj.invoice_payment_type @invoice_payment_type = @invoice_payment_type.to_s.to_sym unless @invoice_payment_type.nil? # 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. # 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? self end |