Class: Killbill::Plugin::Model::PaymentTransaction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePaymentTransaction

Returns a new instance of PaymentTransaction.



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

def initialize()
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



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

def amount
  @amount
end

#created_dateObject

Returns the value of attribute created_date.



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

def created_date
  @created_date
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#effective_dateObject

Returns the value of attribute effective_date.



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

def effective_date
  @effective_date
end

#external_keyObject

Returns the value of attribute external_key.



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

def external_key
  @external_key
end

#gateway_error_codeObject

Returns the value of attribute gateway_error_code.



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

def gateway_error_code
  @gateway_error_code
end

#gateway_error_msgObject

Returns the value of attribute gateway_error_msg.



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

def gateway_error_msg
  @gateway_error_msg
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#payment_idObject

Returns the value of attribute payment_id.



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

def payment_id
  @payment_id
end

#payment_info_pluginObject

Returns the value of attribute payment_info_plugin.



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

def payment_info_plugin
  @payment_info_plugin
end

#processed_amountObject

Returns the value of attribute processed_amount.



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

def processed_amount
  @processed_amount
end

#processed_currencyObject

Returns the value of attribute processed_currency.



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

def processed_currency
  @processed_currency
end

#transaction_statusObject

Returns the value of attribute transaction_status.



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

def transaction_status
  @transaction_status
end

#transaction_typeObject

Returns the value of attribute transaction_type.



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

def transaction_type
  @transaction_type
end

#updated_dateObject

Returns the value of attribute updated_date.



37
38
39
# File 'lib/killbill/gen/api/payment_transaction.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
96
97
98
99
100
101
102
103
104
105
# File 'lib/killbill/gen/api/payment_transaction.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 external_key [type = java.lang.String]
  @external_key = @external_key.to_s unless @external_key.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

  # 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 processed_amount [type = java.math.BigDecimal]
  if @processed_amount.nil?
    @processed_amount = java.math.BigDecimal::ZERO
  else
    @processed_amount = java.math.BigDecimal.new(@processed_amount.to_s)
  end

  # 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 gateway_error_code [type = java.lang.String]
  @gateway_error_code = @gateway_error_code.to_s unless @gateway_error_code.nil?

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

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

  # conversion for payment_info_plugin [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
  @payment_info_plugin = @payment_info_plugin.to_java unless @payment_info_plugin.nil?
  self
end

#to_ruby(j_obj) ⇒ Object



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
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/killbill/gen/api/payment_transaction.rb', line 107

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 external_key [type = java.lang.String]
  @external_key = j_obj.external_key

  # 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

  # 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 processed_amount [type = java.math.BigDecimal]
  @processed_amount = j_obj.processed_amount
  @processed_amount = @processed_amount.nil? ? 0 : BigDecimal.new(@processed_amount.to_s)

  # 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 gateway_error_code [type = java.lang.String]
  @gateway_error_code = j_obj.gateway_error_code

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

  # conversion for transaction_status [type = org.killbill.billing.payment.api.TransactionStatus]
  @transaction_status = j_obj.transaction_status
  @transaction_status = @transaction_status.to_s.to_sym unless @transaction_status.nil?

  # conversion for payment_info_plugin [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
  @payment_info_plugin = j_obj.payment_info_plugin
  @payment_info_plugin = Killbill::Plugin::Model::PaymentTransactionInfoPlugin.new.to_ruby(@payment_info_plugin) unless @payment_info_plugin.nil?
  self
end