Class: Killbill::Plugin::Model::PaymentMetadata
- Defined in:
- lib/killbill/gen/plugin-api/payment_metadata.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#effective_date ⇒ Object
Returns the value of attribute effective_date.
-
#payment_transaction_id ⇒ Object
Returns the value of attribute payment_transaction_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
Instance Method Summary collapse
-
#initialize ⇒ PaymentMetadata
constructor
A new instance of PaymentMetadata.
- #to_java ⇒ Object
- #to_ruby(j_obj) ⇒ Object
Constructor Details
#initialize ⇒ PaymentMetadata
Returns a new instance of PaymentMetadata.
37 38 |
# File 'lib/killbill/gen/plugin-api/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/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/payment_metadata.rb', line 35 def currency @currency end |
#effective_date ⇒ Object
Returns the value of attribute effective_date.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/payment_metadata.rb', line 35 def effective_date @effective_date end |
#payment_transaction_id ⇒ Object
Returns the value of attribute payment_transaction_id.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/payment_metadata.rb', line 35 def payment_transaction_id @payment_transaction_id end |
#status ⇒ Object
Returns the value of attribute status.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/payment_metadata.rb', line 35 def status @status end |
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
35 36 37 |
# File 'lib/killbill/gen/plugin-api/payment_metadata.rb', line 35 def transaction_type @transaction_type 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 |
# File 'lib/killbill/gen/plugin-api/payment_metadata.rb', line 40 def to_java() # conversion for payment_transaction_id [type = java.util.UUID] @payment_transaction_id = java.util.UUID.fromString(@payment_transaction_id.to_s) unless @payment_transaction_id.nil? # 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 status [type = org.killbill.billing.payment.api.TransactionStatus] @status = Java::org.killbill.billing.payment.api.TransactionStatus.value_of( @status.to_s ) unless @status.nil? # conversion for transaction_type [type = org.killbill.billing.payment.api.TransactionType] @transaction_type = Java::org.killbill.billing.payment.api.TransactionType.value_of( @transaction_type.to_s ) unless @transaction_type.nil? # conversion for effective_date [type = org.joda.time.DateTime] if !@effective_date.nil? @effective_date = (@effective_date.kind_of? Time) ? DateTime.parse(@effective_date.to_s) : @effective_date @effective_date = Java::org.joda.time.DateTime.new(@effective_date.to_s, Java::org.joda.time.DateTimeZone::UTC) end Java::org.killbill.billing.notification.plugin.api.PaymentMetadata.new(@payment_transaction_id, @amount, @currency, @status, @transaction_type, @effective_date) end |
#to_ruby(j_obj) ⇒ Object
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 96 97 |
# File 'lib/killbill/gen/plugin-api/payment_metadata.rb', line 68 def to_ruby(j_obj) # conversion for payment_transaction_id [type = java.util.UUID] @payment_transaction_id = j_obj.payment_transaction_id @payment_transaction_id = @payment_transaction_id.nil? ? nil : @payment_transaction_id.to_s # 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 status [type = org.killbill.billing.payment.api.TransactionStatus] @status = j_obj.status @status = @status.to_s.to_sym unless @status.nil? # conversion for transaction_type [type = org.killbill.billing.payment.api.TransactionType] @transaction_type = j_obj.transaction_type @transaction_type = @transaction_type.to_s.to_sym unless @transaction_type.nil? # conversion for effective_date [type = org.joda.time.DateTime] @effective_date = j_obj.effective_date if !@effective_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(@effective_date) @effective_date = DateTime.iso8601(str) end self end |