killbill 3.2.4 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -2
  3. data/.travis.yml +26 -5
  4. data/Gemfile +1 -1
  5. data/Gemfile.head +5 -0
  6. data/Gemfile.lock +125 -0
  7. data/Jarfile +9 -9
  8. data/Jarfile.lock +54 -0
  9. data/NEWS +3 -0
  10. data/README.md +13 -0
  11. data/VERSION +1 -1
  12. data/generators/active_merchant/templates/.gitignore.rb +2 -3
  13. data/generators/active_merchant/templates/.travis.yml.rb +22 -3
  14. data/generators/active_merchant/templates/Gemfile.head.rb +5 -0
  15. data/generators/active_merchant/templates/Gemfile.rb +1 -1
  16. data/generators/active_merchant/templates/Jarfile.rb +9 -8
  17. data/generators/active_merchant/templates/LICENSE.rb +2 -2
  18. data/generators/active_merchant/templates/config.yml.rb +16 -6
  19. data/generators/active_merchant/templates/lib/plugin.rb +0 -1
  20. data/generators/active_merchant/templates/plugin.gemspec.rb +17 -15
  21. data/generators/active_merchant/templates/pom.xml.rb +1 -1
  22. data/generators/active_merchant/templates/release.sh.rb +34 -14
  23. data/generators/active_merchant/templates/spec/base_plugin_spec.rb +5 -7
  24. data/generators/active_merchant/templates/spec/integration_spec.rb +7 -18
  25. data/killbill.gemspec +21 -15
  26. data/lib/killbill/ext/active_merchant/typhoeus_connection.rb +3 -4
  27. data/lib/killbill/gen/api/account.rb +1 -1
  28. data/lib/killbill/gen/api/account_data.rb +1 -1
  29. data/lib/killbill/gen/api/audit_log.rb +2 -2
  30. data/lib/killbill/gen/api/audit_user_api.rb +3 -3
  31. data/lib/killbill/gen/api/block.rb +1 -1
  32. data/lib/killbill/gen/api/blocking_state.rb +1 -1
  33. data/lib/killbill/gen/api/call_context.rb +2 -2
  34. data/lib/killbill/gen/api/control_tag.rb +2 -2
  35. data/lib/killbill/gen/api/currency_conversion.rb +1 -1
  36. data/lib/killbill/gen/api/currency_conversion_api.rb +2 -2
  37. data/lib/killbill/gen/api/custom_field.rb +1 -1
  38. data/lib/killbill/gen/api/custom_field_user_api.rb +2 -2
  39. data/lib/killbill/gen/api/dry_run_arguments.rb +22 -3
  40. data/lib/killbill/gen/api/duration.rb +1 -1
  41. data/lib/killbill/gen/api/entitlement.rb +3 -3
  42. data/lib/killbill/gen/api/entitlement_ao_status_dry_run.rb +3 -3
  43. data/lib/killbill/gen/api/entitlement_api.rb +25 -7
  44. data/lib/killbill/gen/api/fixed.rb +1 -1
  45. data/lib/killbill/gen/api/invoice.rb +1 -1
  46. data/lib/killbill/gen/api/invoice_formatter.rb +2 -2
  47. data/lib/killbill/gen/api/invoice_item.rb +2 -2
  48. data/lib/killbill/gen/api/invoice_item_formatter.rb +2 -2
  49. data/lib/killbill/gen/api/invoice_payment.rb +3 -3
  50. data/lib/killbill/gen/api/invoice_user_api.rb +2 -2
  51. data/lib/killbill/gen/api/migration_plan.rb +1 -1
  52. data/lib/killbill/gen/api/mutable_account_data.rb +1 -1
  53. data/lib/killbill/gen/api/payment.rb +1 -1
  54. data/lib/killbill/gen/api/payment_api.rb +11 -11
  55. data/lib/killbill/gen/api/payment_transaction.rb +4 -4
  56. data/lib/killbill/gen/api/plan.rb +1 -1
  57. data/lib/killbill/gen/api/plan_change_result.rb +2 -2
  58. data/lib/killbill/gen/api/plan_phase.rb +1 -1
  59. data/lib/killbill/gen/api/plan_phase_price_override.rb +93 -0
  60. data/lib/killbill/gen/api/plan_phase_price_overrides_with_call_context.rb +77 -0
  61. data/lib/killbill/gen/api/plan_phase_specifier.rb +3 -3
  62. data/lib/killbill/gen/api/plan_specifier.rb +2 -2
  63. data/lib/killbill/gen/api/price.rb +1 -1
  64. data/lib/killbill/gen/api/product.rb +1 -1
  65. data/lib/killbill/gen/api/rate.rb +2 -2
  66. data/lib/killbill/gen/api/record_id_api.rb +1 -1
  67. data/lib/killbill/gen/api/recurring.rb +1 -1
  68. data/lib/killbill/gen/api/refund.rb +2 -2
  69. data/lib/killbill/gen/api/require_gen.rb +2 -0
  70. data/lib/killbill/gen/api/static_catalog.rb +2 -2
  71. data/lib/killbill/gen/api/subscription.rb +3 -3
  72. data/lib/killbill/gen/api/subscription_event.rb +3 -3
  73. data/lib/killbill/gen/api/tag.rb +1 -1
  74. data/lib/killbill/gen/api/tag_definition.rb +1 -1
  75. data/lib/killbill/gen/api/tag_user_api.rb +6 -6
  76. data/lib/killbill/gen/api/tiered_block.rb +1 -1
  77. data/lib/killbill/gen/api/usage.rb +3 -3
  78. data/lib/killbill/gen/plugin-api/currency_plugin_api.rb +1 -1
  79. data/lib/killbill/gen/plugin-api/ext_bus_event.rb +2 -2
  80. data/lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb +3 -3
  81. data/lib/killbill/helpers/active_merchant.rb +2 -2
  82. data/lib/killbill/helpers/active_merchant/active_record.rb +1 -1
  83. data/lib/killbill/helpers/active_merchant/active_record/active_record_helper.rb +14 -0
  84. data/lib/killbill/helpers/active_merchant/active_record/models/helpers.rb +8 -0
  85. data/lib/killbill/helpers/active_merchant/active_record/models/payment_method.rb +10 -8
  86. data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +16 -3
  87. data/lib/killbill/helpers/active_merchant/active_record/models/streamy_result_set.rb +1 -3
  88. data/lib/killbill/helpers/active_merchant/active_record/models/transaction.rb +2 -0
  89. data/lib/killbill/helpers/active_merchant/configuration.rb +119 -27
  90. data/lib/killbill/helpers/active_merchant/gateway.rb +40 -27
  91. data/lib/killbill/helpers/active_merchant/killbill_spec_helper.rb +63 -45
  92. data/lib/killbill/helpers/active_merchant/payment_plugin.rb +121 -95
  93. data/lib/killbill/helpers/active_merchant/private_payment_plugin.rb +1 -1
  94. data/lib/killbill/helpers/active_merchant/properties.rb +9 -2
  95. data/lib/killbill/helpers/active_merchant/sinatra.rb +4 -8
  96. data/lib/killbill/helpers/active_merchant/utils.rb +44 -0
  97. data/lib/killbill/helpers/properties_helper.rb +41 -0
  98. data/lib/killbill/http_servlet.rb +11 -4
  99. data/lib/killbill/killbill_api.rb +6 -4
  100. data/lib/killbill/rake_task.rb +542 -102
  101. data/spec/killbill/helpers/configuration_spec.rb +117 -33
  102. data/spec/killbill/helpers/payment_method_spec.rb +20 -17
  103. data/spec/killbill/helpers/payment_plugin_spec.rb +401 -201
  104. data/spec/killbill/helpers/private_payment_plugin_spec.rb +3 -16
  105. data/spec/killbill/helpers/response_spec.rb +92 -22
  106. data/spec/killbill/helpers/streamy_result_set_spec.rb +3 -2
  107. data/spec/killbill/helpers/test_payment_method.rb +9 -0
  108. data/spec/killbill/helpers/test_response.rb +11 -0
  109. data/spec/killbill/helpers/test_schema.rb +6 -6
  110. data/spec/killbill/helpers/test_transaction.rb +11 -0
  111. data/spec/killbill/helpers/transaction_spec.rb +3 -13
  112. data/spec/killbill/helpers/utils_spec.rb +127 -69
  113. data/spec/spec_helper.rb +69 -18
  114. metadata +77 -71
  115. data/lib/killbill/ext/active_merchant/jdbc_connection.rb +0 -92
  116. data/lib/killbill/ext/active_merchant/proxy_support.rb +0 -58
  117. data/spec/killbill/helpers/gateway_spec.rb +0 -36
@@ -22,4 +22,3 @@ require '<%= identifier %>/private_api'
22
22
  require '<%= identifier %>/models/payment_method'
23
23
  require '<%= identifier %>/models/response'
24
24
  require '<%= identifier %>/models/transaction'
25
-
@@ -12,38 +12,40 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.author = 'Kill Bill core team'
14
14
  s.email = 'killbilling-users@googlegroups.com'
15
- s.homepage = 'http://kill-bill.org'
15
+ s.homepage = 'http://killbill.io'
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.bindir = 'bin'
20
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
21
21
  s.require_paths = ['lib']
22
22
 
23
23
  s.rdoc_options << '--exclude' << '.'
24
24
 
25
- s.add_dependency 'killbill', '~> 3.2.0'
26
- s.add_dependency 'activemerchant', '~> 1.44.1'
27
- s.add_dependency 'offsite_payments', '~> 2.0.1'
28
- s.add_dependency 'activerecord', '~> 4.1.0'
29
- s.add_dependency 'actionpack', '~> 4.1.0'
30
- s.add_dependency 'actionview', '~> 4.1.0'
31
- s.add_dependency 'activesupport', '~> 4.1.0'
32
- s.add_dependency 'money', '~> 6.1.1'
33
- s.add_dependency 'monetize', '~> 0.3.0'
25
+ s.add_dependency 'killbill', '~> 4.0.0'
26
+
34
27
  s.add_dependency 'sinatra', '~> 1.3.4'
35
28
  s.add_dependency 'thread_safe', '~> 0.3.4'
29
+ s.add_dependency 'activerecord', '~> 4.1.0'
36
30
  if defined?(JRUBY_VERSION)
37
- s.add_dependency 'activerecord-jdbcmysql-adapter', '~> 1.3.7'
31
+ s.add_dependency 'activerecord-bogacs', '~> 0.3'
32
+ s.add_dependency 'activerecord-jdbc-adapter', '~> 1.3'
38
33
  # Required to avoid errors like java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DERBoolean
39
- s.add_dependency 'jruby-openssl', '~> 0.9.4'
34
+ s.add_dependency 'jruby-openssl', '~> 0.9.6'
40
35
  end
36
+ s.add_dependency 'actionpack', '~> 4.1.0'
37
+ s.add_dependency 'actionview', '~> 4.1.0'
38
+ s.add_dependency 'activemerchant', '~> 1.48.0'
39
+ s.add_dependency 'offsite_payments', '~> 2.1.0'
40
+ s.add_dependency 'monetize', '~> 1.1.0'
41
+ s.add_dependency 'money', '~> 6.5.1'
41
42
 
42
- s.add_development_dependency 'jbundler', '~> 0.4.1'
43
+ s.add_development_dependency 'jbundler', '~> 0.4.3'
43
44
  s.add_development_dependency 'rake', '>= 10.0.0'
44
45
  s.add_development_dependency 'rspec', '~> 2.12.0'
45
46
  if defined?(JRUBY_VERSION)
46
- s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', '~> 1.3.7'
47
+ s.add_development_dependency 'jdbc-sqlite3', '~> 3.7'
48
+ s.add_development_dependency 'jdbc-mariadb', '~> 1.1'
47
49
  else
48
50
  s.add_development_dependency 'sqlite3', '~> 1.3.7'
49
51
  end
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!--
3
- ~ Copyright 2014 The Billing Project, LLC
3
+ ~ Copyright 2015 The Billing Project, LLC
4
4
  ~
5
5
  ~ The Billing Project licenses this file to you under the Apache License, version 2.0
6
6
  ~ (the "License"); you may not use this file except in compliance with the
@@ -1,5 +1,8 @@
1
1
  set -e
2
2
 
3
+ BUNDLE=${BUNDLE-"bundle exec"}
4
+ MVN=${MVN-"mvn"}
5
+
3
6
  if [ 'GNU' != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
4
7
  echo 'Unable to release: make sure to use GNU tar'
5
8
  exit 1
@@ -14,28 +17,45 @@ else
14
17
  fi
15
18
 
16
19
  VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
17
- if [ "$VERSION" != "$(cat $PWD/VERSION)" ]; then
20
+ if [[ -z "$NO_RELEASE" && "$VERSION" != "$(cat $PWD/VERSION)" ]]; then
18
21
  echo 'Unable to release: make sure the versions in pom.xml and VERSION match'
19
22
  exit 1
20
23
  fi
21
24
 
22
25
  echo 'Cleaning up'
23
- rake killbill:clean ; rake build
26
+ $BUNDLE rake killbill:clean
27
+
28
+ echo 'Building gem'
29
+ $BUNDLE rake build
24
30
 
25
- echo 'Pushing the gem to Rubygems'
26
- rake release
31
+ if [[ -z "$NO_RELEASE" ]]; then
32
+ echo 'Pushing the gem to Rubygems'
33
+ $BUNDLE rake release
34
+ fi
27
35
 
28
36
  echo 'Building artifact'
29
- rake killbill:package
37
+ $BUNDLE rake killbill:package
30
38
 
31
39
  ARTIFACT="$PWD/pkg/killbill-<%= identifier %>-$VERSION.tar.gz"
32
40
  echo "Pushing $ARTIFACT to Maven Central"
33
- mvn gpg:sign-and-deploy-file \
34
- -DgroupId=org.kill-bill.billing.plugin.ruby \
35
- -DartifactId=<%= identifier %>-plugin \
36
- -Dversion=$VERSION \
37
- -Dpackaging=tar.gz \
38
- -DrepositoryId=ossrh-releases \
39
- -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
40
- -Dfile=$ARTIFACT \
41
- -DpomFile=pom.xml
41
+
42
+ if [[ -z "$NO_RELEASE" ]]; then
43
+ GOAL=gpg:sign-and-deploy-file
44
+ REPOSITORY_ID=ossrh-releases
45
+ URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
46
+ else
47
+ GOAL=deploy:deploy-file
48
+ REPOSITORY_ID=sonatype-nexus-snapshots
49
+ URL=https://oss.sonatype.org/content/repositories/snapshots/
50
+ VERSION="$VERSION-SNAPSHOT"
51
+ fi
52
+
53
+ $MVN $GOAL \
54
+ -DgroupId=org.kill-bill.billing.plugin.ruby \
55
+ -DartifactId=<%= identifier %>-plugin \
56
+ -Dversion=$VERSION \
57
+ -Dpackaging=tar.gz \
58
+ -DrepositoryId=$REPOSITORY_ID \
59
+ -Durl=$URL \
60
+ -Dfile=$ARTIFACT \
61
+ -DpomFile=pom.xml
@@ -1,9 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Killbill::<%= class_name %>::PaymentPlugin do
4
+
5
+ include ::Killbill::Plugin::ActiveMerchant::RSpec
6
+
4
7
  before(:each) do
5
8
  Dir.mktmpdir do |dir|
6
- file = File.new(File.join(dir, '<%= identifier %>.yml'), "w+")
9
+ file = File.new(File.join(dir, '<%= identifier %>.yml'), 'w+')
7
10
  file.write(<<-eos)
8
11
  :<%= identifier %>:
9
12
  :test: true
@@ -14,12 +17,7 @@ describe Killbill::<%= class_name %>::PaymentPlugin do
14
17
  eos
15
18
  file.close
16
19
 
17
- @plugin = Killbill::<%= class_name %>::PaymentPlugin.new
18
- @plugin.logger = Logger.new(STDOUT)
19
- @plugin.logger.level = Logger::INFO
20
- @plugin.conf_dir = File.dirname(file)
21
- @plugin.kb_apis = Killbill::Plugin::KillbillApi.new('<%= identifier %>', {})
22
- @plugin.root = '/foo/killbill-<%= identifier %>/0.0.1'
20
+ @plugin = build_plugin(::Killbill::<%= class_name %>::PaymentPlugin, '<%= identifier %>', File.dirname(file))
23
21
 
24
22
  # Start the plugin here - since the config file will be deleted
25
23
  @plugin.start_plugin
@@ -7,26 +7,15 @@ describe Killbill::<%= class_name %>::PaymentPlugin do
7
7
  include ::Killbill::Plugin::ActiveMerchant::RSpec
8
8
 
9
9
  before(:each) do
10
- @plugin = Killbill::<%= class_name %>::PaymentPlugin.new
11
-
12
- @account_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaUserAccountApi.new
13
- @payment_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaPaymentApi.new
14
- @tenant_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaTenantUserApi.new({})
15
-
16
- svcs = {:account_user_api => @account_api, :payment_api => @payment_api, :tenant_user_api => @tenant_api}
17
- @plugin.kb_apis = Killbill::Plugin::KillbillApi.new('<%= identifier %>', svcs)
18
-
19
- @call_context = ::Killbill::Plugin::Model::CallContext.new
20
- @call_context.tenant_id = '00000011-0022-0033-0044-000000000055'
21
- @call_context = @call_context.to_ruby(@call_context)
22
-
23
- @plugin.logger = Logger.new(STDOUT)
24
- @plugin.logger.level = Logger::INFO
25
- @plugin.conf_dir = File.expand_path(File.dirname(__FILE__) + '../../../../')
26
- @plugin.root = '/foo/killbill-<%= identifier %>/0.0.1'
10
+ ::Killbill::<%= class_name %>::<%= class_name %>PaymentMethod.delete_all
11
+ ::Killbill::<%= class_name %>::<%= class_name %>Response.delete_all
12
+ ::Killbill::<%= class_name %>::<%= class_name %>Transaction.delete_all
27
13
 
14
+ @plugin = build_plugin(::Killbill::<%= class_name %>::PaymentPlugin, '<%= identifier %>')
28
15
  @plugin.start_plugin
29
16
 
17
+ @call_context = build_call_context
18
+
30
19
  @properties = []
31
20
  @pm = create_payment_method(::Killbill::<%= class_name %>::<%= class_name %>PaymentMethod, nil, @call_context.tenant_id, @properties)
32
21
  @amount = BigDecimal.new('100')
@@ -34,7 +23,7 @@ describe Killbill::<%= class_name %>::PaymentPlugin do
34
23
 
35
24
  kb_payment_id = SecureRandom.uuid
36
25
  1.upto(6) do
37
- @kb_payment = @payment_api.add_payment(kb_payment_id)
26
+ @kb_payment = @plugin.kb_apis.proxied_services[:payment_api].add_payment(kb_payment_id)
38
27
  end
39
28
  end
40
29
 
data/killbill.gemspec CHANGED
@@ -12,39 +12,45 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.author = 'Kill Bill core team'
14
14
  s.email = 'killbilling-users@googlegroups.com'
15
- s.homepage = 'http://kill-bill.org'
15
+ s.homepage = 'http://killbill.io'
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.bindir = 'bin'
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
21
- s.require_paths = ["lib"]
21
+ s.require_paths = ['lib']
22
22
 
23
23
  s.rdoc_options << '--exclude' << '.'
24
24
 
25
25
  s.add_dependency 'sinatra', '~> 1.3.4'
26
+ s.add_dependency 'rack', '>= 1.5.2'
26
27
  s.add_dependency 'typhoeus', '~> 0.6.9'
27
- s.add_dependency 'tzinfo', '~> 1.1.0'
28
-
29
- s.add_development_dependency 'activerecord', '~> 4.1.0'
28
+ s.add_dependency 'tzinfo', '~> 1.2.0'
29
+ # semi-optional:
30
30
  s.add_development_dependency 'thread_safe', '~> 0.3.4'
31
+ s.add_development_dependency 'activerecord', '~> 4.1.0'
31
32
  if defined?(JRUBY_VERSION)
32
- s.add_development_dependency 'activerecord-jdbcmysql-adapter', '~> 1.3.7'
33
- s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', '~> 1.3.7'
34
- else
35
- s.add_development_dependency 'sqlite3', '~> 1.3.7'
33
+ s.add_development_dependency 'activerecord-bogacs', '~> 0.3'
34
+ # See https://github.com/killbill/killbill-plugin-framework-ruby/issues/33
35
+ s.add_development_dependency 'activerecord-jdbc-adapter', '~> 1.3'
36
+ s.add_development_dependency 'jdbc-mariadb', '~> 1.1.8'
36
37
  end
37
38
  s.add_development_dependency 'actionpack', '~> 4.1.0'
38
39
  s.add_development_dependency 'actionview', '~> 4.1.0'
39
- s.add_development_dependency 'activemerchant', '~> 1.44.1'
40
- s.add_development_dependency 'offsite_payments', '~> 2.0.1'
41
- s.add_development_dependency 'monetize', '~> 0.3.0'
42
- s.add_development_dependency 'money', '~> 6.1.1'
40
+ s.add_development_dependency 'activemerchant', '~> 1.48.0'
41
+ s.add_development_dependency 'offsite_payments', '~> 2.1.0'
42
+ s.add_development_dependency 'monetize', '~> 1.1.0'
43
+ s.add_development_dependency 'money', '~> 6.5.1'
44
+ # testing/development :
43
45
  s.add_development_dependency 'jbundler', '~> 0.4.3'
44
- s.add_development_dependency 'rack', '>= 1.5.2'
45
- s.add_development_dependency 'rake', '>= 0.8.7'
46
+ s.add_development_dependency 'rake', '>= 10.0.0'
46
47
  s.add_development_dependency 'rspec', '~> 2.12.0'
47
48
  s.add_development_dependency 'thor', '~> 0.19.1'
49
+ if defined?(JRUBY_VERSION)
50
+ s.add_development_dependency 'jdbc-sqlite3', '~> 3.7'
51
+ else
52
+ s.add_development_dependency 'sqlite3', '~> 1.3.7'
53
+ end
48
54
 
49
55
  s.requirements << "jar 'org.kill-bill.billing:killbill-api'"
50
56
  # For testing only
@@ -1,11 +1,10 @@
1
1
  require 'benchmark'
2
- require 'active_utils/common/error'
3
- require 'active_utils/common/network_connection_retries'
4
- require 'active_utils/common/connection'
2
+ require 'openssl' # active_utils internals assume OpenSSL loaded
3
+ require 'active_merchant'
5
4
  require 'typhoeus'
6
5
 
7
6
  module ActiveMerchant
8
- class Connection
7
+ Connection.class_eval do # force auto-load (loads network_connection_retries)
9
8
 
10
9
  def request(method, body, headers = {})
11
10
  request_start = Time.now.to_f
@@ -71,7 +71,7 @@ module Killbill
71
71
  @bill_cycle_day_local = @bill_cycle_day_local
72
72
 
73
73
  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
74
- @currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{@currency.to_s}") unless @currency.nil?
74
+ @currency = Java::org.killbill.billing.catalog.api.Currency.value_of( @currency.to_s ) unless @currency.nil?
75
75
 
76
76
  # conversion for payment_method_id [type = java.util.UUID]
77
77
  @payment_method_id = java.util.UUID.fromString(@payment_method_id.to_s) unless @payment_method_id.nil?
@@ -56,7 +56,7 @@ module Killbill
56
56
  @bill_cycle_day_local = @bill_cycle_day_local
57
57
 
58
58
  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
59
- @currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{@currency.to_s}") unless @currency.nil?
59
+ @currency = Java::org.killbill.billing.catalog.api.Currency.value_of( @currency.to_s ) unless @currency.nil?
60
60
 
61
61
  # conversion for payment_method_id [type = java.util.UUID]
62
62
  @payment_method_id = java.util.UUID.fromString(@payment_method_id.to_s) unless @payment_method_id.nil?
@@ -59,10 +59,10 @@ module Killbill
59
59
  @audited_entity_id = java.util.UUID.fromString(@audited_entity_id.to_s) unless @audited_entity_id.nil?
60
60
 
61
61
  # conversion for audited_object_type [type = org.killbill.billing.ObjectType]
62
- @audited_object_type = Java::org.killbill.billing.ObjectType.value_of("#{@audited_object_type.to_s}") unless @audited_object_type.nil?
62
+ @audited_object_type = Java::org.killbill.billing.ObjectType.value_of( @audited_object_type.to_s ) unless @audited_object_type.nil?
63
63
 
64
64
  # conversion for change_type [type = org.killbill.billing.util.audit.ChangeType]
65
- @change_type = Java::org.killbill.billing.util.audit.ChangeType.value_of("#{@change_type.to_s}") unless @change_type.nil?
65
+ @change_type = Java::org.killbill.billing.util.audit.ChangeType.value_of( @change_type.to_s ) unless @change_type.nil?
66
66
 
67
67
  # conversion for user_name [type = java.lang.String]
68
68
  @user_name = @user_name.to_s unless @user_name.nil?
@@ -46,7 +46,7 @@ module Killbill
46
46
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
47
47
 
48
48
  # conversion for auditLevel [type = org.killbill.billing.util.api.AuditLevel]
49
- auditLevel = Java::org.killbill.billing.util.api.AuditLevel.value_of("#{auditLevel.to_s}") unless auditLevel.nil?
49
+ auditLevel = Java::org.killbill.billing.util.api.AuditLevel.value_of( auditLevel.to_s ) unless auditLevel.nil?
50
50
 
51
51
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
52
52
  context = context.to_java unless context.nil?
@@ -63,10 +63,10 @@ module Killbill
63
63
  objectId = java.util.UUID.fromString(objectId.to_s) unless objectId.nil?
64
64
 
65
65
  # conversion for objectType [type = org.killbill.billing.ObjectType]
66
- objectType = Java::org.killbill.billing.ObjectType.value_of("#{objectType.to_s}") unless objectType.nil?
66
+ objectType = Java::org.killbill.billing.ObjectType.value_of( objectType.to_s ) unless objectType.nil?
67
67
 
68
68
  # conversion for auditLevel [type = org.killbill.billing.util.api.AuditLevel]
69
- auditLevel = Java::org.killbill.billing.util.api.AuditLevel.value_of("#{auditLevel.to_s}") unless auditLevel.nil?
69
+ auditLevel = Java::org.killbill.billing.util.api.AuditLevel.value_of( auditLevel.to_s ) unless auditLevel.nil?
70
70
 
71
71
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
72
72
  context = context.to_java unless context.nil?
@@ -41,7 +41,7 @@ module Killbill
41
41
 
42
42
  def to_java()
43
43
  # conversion for type [type = org.killbill.billing.catalog.api.BlockType]
44
- @type = Java::org.killbill.billing.catalog.api.BlockType.value_of("#{@type.to_s}") unless @type.nil?
44
+ @type = Java::org.killbill.billing.catalog.api.BlockType.value_of( @type.to_s ) unless @type.nil?
45
45
 
46
46
  # conversion for unit [type = org.killbill.billing.catalog.api.Unit]
47
47
  @unit = @unit.to_java unless @unit.nil?
@@ -62,7 +62,7 @@ module Killbill
62
62
  @state_name = @state_name.to_s unless @state_name.nil?
63
63
 
64
64
  # conversion for type [type = org.killbill.billing.entitlement.api.BlockingStateType]
65
- @type = Java::org.killbill.billing.entitlement.api.BlockingStateType.value_of("#{@type.to_s}") unless @type.nil?
65
+ @type = Java::org.killbill.billing.entitlement.api.BlockingStateType.value_of( @type.to_s ) unless @type.nil?
66
66
 
67
67
  # conversion for effective_date [type = org.joda.time.DateTime]
68
68
  if !@effective_date.nil?
@@ -50,10 +50,10 @@ module Killbill
50
50
  @user_name = @user_name.to_s unless @user_name.nil?
51
51
 
52
52
  # conversion for call_origin [type = org.killbill.billing.util.callcontext.CallOrigin]
53
- @call_origin = Java::org.killbill.billing.util.callcontext.CallOrigin.value_of("#{@call_origin.to_s}") unless @call_origin.nil?
53
+ @call_origin = Java::org.killbill.billing.util.callcontext.CallOrigin.value_of( @call_origin.to_s ) unless @call_origin.nil?
54
54
 
55
55
  # conversion for user_type [type = org.killbill.billing.util.callcontext.UserType]
56
- @user_type = Java::org.killbill.billing.util.callcontext.UserType.value_of("#{@user_type.to_s}") unless @user_type.nil?
56
+ @user_type = Java::org.killbill.billing.util.callcontext.UserType.value_of( @user_type.to_s ) unless @user_type.nil?
57
57
 
58
58
  # conversion for reason_code [type = java.lang.String]
59
59
  @reason_code = @reason_code.to_s unless @reason_code.nil?
@@ -44,7 +44,7 @@ module Killbill
44
44
  @tag_definition_id = java.util.UUID.fromString(@tag_definition_id.to_s) unless @tag_definition_id.nil?
45
45
 
46
46
  # conversion for object_type [type = org.killbill.billing.ObjectType]
47
- @object_type = Java::org.killbill.billing.ObjectType.value_of("#{@object_type.to_s}") unless @object_type.nil?
47
+ @object_type = Java::org.killbill.billing.ObjectType.value_of( @object_type.to_s ) unless @object_type.nil?
48
48
 
49
49
  # conversion for object_id [type = java.util.UUID]
50
50
  @object_id = java.util.UUID.fromString(@object_id.to_s) unless @object_id.nil?
@@ -65,7 +65,7 @@ module Killbill
65
65
  end
66
66
 
67
67
  # conversion for control_tag_type [type = org.killbill.billing.util.tag.ControlTagType]
68
- @control_tag_type = Java::org.killbill.billing.util.tag.ControlTagType.value_of("#{@control_tag_type.to_s}") unless @control_tag_type.nil?
68
+ @control_tag_type = Java::org.killbill.billing.util.tag.ControlTagType.value_of( @control_tag_type.to_s ) unless @control_tag_type.nil?
69
69
  self
70
70
  end
71
71
 
@@ -41,7 +41,7 @@ module Killbill
41
41
 
42
42
  def to_java()
43
43
  # conversion for base_currency [type = org.killbill.billing.catalog.api.Currency]
44
- @base_currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{@base_currency.to_s}") unless @base_currency.nil?
44
+ @base_currency = Java::org.killbill.billing.catalog.api.Currency.value_of( @base_currency.to_s ) unless @base_currency.nil?
45
45
 
46
46
  # conversion for rates [type = java.util.Set]
47
47
  tmp = java.util.TreeSet.new
@@ -61,7 +61,7 @@ module Killbill
61
61
  def get_current_currency_conversion(baseCurrency)
62
62
 
63
63
  # conversion for baseCurrency [type = org.killbill.billing.catalog.api.Currency]
64
- baseCurrency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{baseCurrency.to_s}") unless baseCurrency.nil?
64
+ baseCurrency = Java::org.killbill.billing.catalog.api.Currency.value_of( baseCurrency.to_s ) unless baseCurrency.nil?
65
65
  begin
66
66
  res = @real_java_api.get_current_currency_conversion(baseCurrency)
67
67
  # conversion for res [type = org.killbill.billing.currency.api.CurrencyConversion]
@@ -76,7 +76,7 @@ module Killbill
76
76
  def get_currency_conversion(baseCurrency, dateConversion)
77
77
 
78
78
  # conversion for baseCurrency [type = org.killbill.billing.catalog.api.Currency]
79
- baseCurrency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{baseCurrency.to_s}") unless baseCurrency.nil?
79
+ baseCurrency = Java::org.killbill.billing.catalog.api.Currency.value_of( baseCurrency.to_s ) unless baseCurrency.nil?
80
80
 
81
81
  # conversion for dateConversion [type = org.joda.time.DateTime]
82
82
  if !dateConversion.nil?
@@ -59,7 +59,7 @@ module Killbill
59
59
  @object_id = java.util.UUID.fromString(@object_id.to_s) unless @object_id.nil?
60
60
 
61
61
  # conversion for object_type [type = org.killbill.billing.ObjectType]
62
- @object_type = Java::org.killbill.billing.ObjectType.value_of("#{@object_type.to_s}") unless @object_type.nil?
62
+ @object_type = Java::org.killbill.billing.ObjectType.value_of( @object_type.to_s ) unless @object_type.nil?
63
63
 
64
64
  # conversion for field_name [type = java.lang.String]
65
65
  @field_name = @field_name.to_s unless @field_name.nil?
@@ -117,7 +117,7 @@ module Killbill
117
117
  objectId = java.util.UUID.fromString(objectId.to_s) unless objectId.nil?
118
118
 
119
119
  # conversion for objectType [type = org.killbill.billing.ObjectType]
120
- objectType = Java::org.killbill.billing.ObjectType.value_of("#{objectType.to_s}") unless objectType.nil?
120
+ objectType = Java::org.killbill.billing.ObjectType.value_of( objectType.to_s ) unless objectType.nil?
121
121
 
122
122
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
123
123
  context = context.to_java unless context.nil?
@@ -140,7 +140,7 @@ module Killbill
140
140
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
141
141
 
142
142
  # conversion for objectType [type = org.killbill.billing.ObjectType]
143
- objectType = Java::org.killbill.billing.ObjectType.value_of("#{objectType.to_s}") unless objectType.nil?
143
+ objectType = Java::org.killbill.billing.ObjectType.value_of( objectType.to_s ) unless objectType.nil?
144
144
 
145
145
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
146
146
  context = context.to_java unless context.nil?