Class: Killbill::Plugin::Model::PaymentTransactionInfoPlugin

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePaymentTransactionInfoPlugin

Returns a new instance of PaymentTransactionInfoPlugin.



39
40
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 39

def initialize()
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def amount
  @amount
end

#created_dateObject

Returns the value of attribute created_date.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def created_date
  @created_date
end

#currencyObject

Returns the value of attribute currency.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def currency
  @currency
end

#effective_dateObject

Returns the value of attribute effective_date.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def effective_date
  @effective_date
end

#first_payment_reference_idObject

Returns the value of attribute first_payment_reference_id.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def first_payment_reference_id
  @first_payment_reference_id
end

#gateway_errorObject

Returns the value of attribute gateway_error.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def gateway_error
  @gateway_error
end

#gateway_error_codeObject

Returns the value of attribute gateway_error_code.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def gateway_error_code
  @gateway_error_code
end

#kb_payment_idObject

Returns the value of attribute kb_payment_id.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def kb_payment_id
  @kb_payment_id
end

#kb_transaction_payment_idObject

Returns the value of attribute kb_transaction_payment_id.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def kb_transaction_payment_id
  @kb_transaction_payment_id
end

#propertiesObject

Returns the value of attribute properties.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def properties
  @properties
end

#second_payment_reference_idObject

Returns the value of attribute second_payment_reference_id.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def second_payment_reference_id
  @second_payment_reference_id
end

#statusObject

Returns the value of attribute status.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def status
  @status
end

#transaction_typeObject

Returns the value of attribute transaction_type.



37
38
39
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 37

def transaction_type
  @transaction_type
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
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 42

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

  # conversion for kb_transaction_payment_id [type = java.util.UUID]
  @kb_transaction_payment_id = java.util.UUID.fromString(@kb_transaction_payment_id.to_s) unless @kb_transaction_payment_id.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 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 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 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 status [type = org.killbill.billing.payment.plugin.api.PaymentPluginStatus]
  @status = Java::org.killbill.billing.payment.plugin.api.PaymentPluginStatus.value_of( @status.to_s ) unless @status.nil?

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

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

  # conversion for properties [type = java.util.List]
  tmp = java.util.ArrayList.new
  (@properties || []).each do |m|
    # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  @properties = tmp
  self
end

#to_ruby(j_obj) ⇒ Object



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
# File 'lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb', line 100

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

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

  # 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 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 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 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 status [type = org.killbill.billing.payment.plugin.api.PaymentPluginStatus]
  @status = j_obj.status
  @status = @status.to_s.to_sym unless @status.nil?

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

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

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

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

  # conversion for properties [type = java.util.List]
  @properties = j_obj.properties
  tmp = []
  (@properties || []).each do |m|
    # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
    m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @properties = tmp
  self
end