bill_forward 1.2014.296 → 1.2015.183

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +29 -27
  3. data/.idea/compiler.xml +23 -23
  4. data/.idea/copyright/profiles_settings.xml +2 -2
  5. data/.idea/encodings.xml +5 -5
  6. data/.idea/inspectionProfiles/Project_Default.xml +10 -10
  7. data/.idea/inspectionProfiles/profiles_settings.xml +6 -6
  8. data/.idea/misc.xml +23 -23
  9. data/.idea/modules.xml +9 -9
  10. data/.idea/scopes/scope_settings.xml +4 -4
  11. data/.idea/vcs.xml +7 -7
  12. data/.rspec +1 -1
  13. data/Gemfile +13 -9
  14. data/LICENSE.md +22 -22
  15. data/README.md +285 -227
  16. data/Rakefile +73 -73
  17. data/bill_forward.gemspec +28 -29
  18. data/bill_forward.iml +28 -28
  19. data/lib/bill_forward/billing_entity.rb +295 -262
  20. data/lib/bill_forward/client.rb +350 -355
  21. data/lib/bill_forward/entities/account.rb +18 -18
  22. data/lib/bill_forward/entities/amendments/issue_invoice_amendment.rb +10 -0
  23. data/lib/bill_forward/entities/amendments/product_rate_plan_migration_amendment.rb +18 -0
  24. data/lib/bill_forward/entities/api_configuration.rb +12 -0
  25. data/lib/bill_forward/entities/invoice.rb +29 -3
  26. data/lib/bill_forward/entities/invoice_parts/taxation_link.rb +5 -5
  27. data/lib/bill_forward/entities/organisation.rb +36 -36
  28. data/lib/bill_forward/entities/payment_method.rb +4 -4
  29. data/lib/bill_forward/entities/payment_method_subscription_link.rb +5 -5
  30. data/lib/bill_forward/entities/pricing_component.rb +21 -21
  31. data/lib/bill_forward/entities/pricing_component_tier.rb +5 -5
  32. data/lib/bill_forward/entities/pricing_component_value.rb +5 -5
  33. data/lib/bill_forward/entities/pricing_component_value_migration_amendment_mapping.rb +31 -0
  34. data/lib/bill_forward/entities/product.rb +5 -5
  35. data/lib/bill_forward/entities/product_rate_plan.rb +43 -19
  36. data/lib/bill_forward/entities/profile.rb +14 -14
  37. data/lib/bill_forward/entities/refund.rb +5 -0
  38. data/lib/bill_forward/entities/role.rb +3 -3
  39. data/lib/bill_forward/entities/stripe_ach_token.rb +9 -0
  40. data/lib/bill_forward/entities/subscription.rb +83 -53
  41. data/lib/bill_forward/entities/subscription_charge.rb +14 -0
  42. data/lib/bill_forward/insertable_entity.rb +21 -31
  43. data/lib/bill_forward/mutable_entity.rb +26 -46
  44. data/lib/bill_forward/resource_path.rb +10 -10
  45. data/lib/bill_forward/type_check.rb +20 -20
  46. data/lib/bill_forward/version.rb +4 -4
  47. data/lib/bill_forward.rb +17 -17
  48. data/scratch/Gemfile +9 -0
  49. data/scratch/scratch.example.rb +8 -0
  50. data/spec/component/account_spec.rb +199 -199
  51. data/spec/component/billing_entity_spec.rb +152 -152
  52. data/spec/functional/account_spec.rb +24 -24
  53. data/spec/functional/bad_citizen/account_spec.rb +102 -102
  54. data/spec/functional/bad_citizen/credit_note_spec.rb +14 -13
  55. data/spec/functional/bad_citizen/payment_method_spec.rb +1 -1
  56. data/spec/functional/bad_citizen/product_rate_plan_migration_amendment_spec.rb +379 -0
  57. data/spec/functional/bad_citizen/product_rate_plan_spec.rb +103 -47
  58. data/spec/functional/bad_citizen/product_spec.rb +16 -9
  59. data/spec/functional/bad_citizen/situational/authorize_net_token_spec.rb +4 -0
  60. data/spec/functional/bad_citizen/situational/malordered_entity_spec.rb +1 -1
  61. data/spec/functional/bad_citizen/situational/payment_method_spec.rb +6 -1
  62. data/spec/functional/bad_citizen/situational/subscription_chargeable_spec.rb +96 -65
  63. data/spec/functional/bad_citizen/subscription_spec.rb +99 -60
  64. data/spec/functional/bad_citizen/subscription_with_credit_spec.rb +121 -91
  65. data/spec/functional/bad_citizen/unit_of_measure_spec.rb +14 -7
  66. data/spec/functional/client_spec.rb +23 -23
  67. data/spec/functional/organisation_spec.rb +27 -27
  68. data/spec/setup_test_constants.rb +72 -72
  69. data/spec/spec_helper.rb +10 -10
  70. data/spec/syntax/account_spec.rb +23 -23
  71. data/spec/syntax/billing_entity_spec.rb +92 -92
  72. data/tools/RSpec hardcoded.sublime-build +16 -0
  73. data/tools/RSpec.sublime-build +13 -0
  74. data/tools/Ruby legacy.sublime-build +7 -0
  75. data/tools/local_bundle_build.sh +8 -0
  76. data/tools/local_bundle_install.sh +9 -0
  77. metadata +30 -85
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 03950eb3b76ab947d2c992800c770876757a078c
4
+ data.tar.gz: c748b8b839b282579d191d3d3357db11bba5969e
5
+ SHA512:
6
+ metadata.gz: 808f09b81b2df249b603a3fdac37d21106cb4ddcc385e4c13f4f83d0b17b5eea4d5a9e7b198ae29307aaf85291712f99e5958879d965312d451b0219089129eb
7
+ data.tar.gz: aa4d65a5d5cd60fff4bc4d598e652d6dcb8db01d114504e0f9e96d642507e773d7bc2f074d4d5fb904fbea0e2631a9ed971f4bd7c53c4805e6d44904b7bbce29
data/.gitignore CHANGED
@@ -1,27 +1,29 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- mkmf.log
23
- .idea/dictionaries
24
- .rakeTasks
25
- onelinechange.bat
26
- twolinechange.bat
27
- spec/test_constants.rb
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .idea/dictionaries
24
+ .rakeTasks
25
+ onelinechange.bat
26
+ twolinechange.bat
27
+ spec/test_constants.rb
28
+ scratch/scratch.rb
29
+ *.scratch.rb
data/.idea/compiler.xml CHANGED
@@ -1,23 +1,23 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="CompilerConfiguration">
4
- <option name="DEFAULT_COMPILER" value="Javac" />
5
- <resourceExtensions />
6
- <wildcardResourcePatterns>
7
- <entry name="!?*.java" />
8
- <entry name="!?*.form" />
9
- <entry name="!?*.class" />
10
- <entry name="!?*.groovy" />
11
- <entry name="!?*.scala" />
12
- <entry name="!?*.flex" />
13
- <entry name="!?*.kt" />
14
- <entry name="!?*.clj" />
15
- </wildcardResourcePatterns>
16
- <annotationProcessing>
17
- <profile default="true" name="Default" enabled="false">
18
- <processorPath useClasspath="true" />
19
- </profile>
20
- </annotationProcessing>
21
- </component>
22
- </project>
23
-
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="CompilerConfiguration">
4
+ <option name="DEFAULT_COMPILER" value="Javac" />
5
+ <resourceExtensions />
6
+ <wildcardResourcePatterns>
7
+ <entry name="!?*.java" />
8
+ <entry name="!?*.form" />
9
+ <entry name="!?*.class" />
10
+ <entry name="!?*.groovy" />
11
+ <entry name="!?*.scala" />
12
+ <entry name="!?*.flex" />
13
+ <entry name="!?*.kt" />
14
+ <entry name="!?*.clj" />
15
+ </wildcardResourcePatterns>
16
+ <annotationProcessing>
17
+ <profile default="true" name="Default" enabled="false">
18
+ <processorPath useClasspath="true" />
19
+ </profile>
20
+ </annotationProcessing>
21
+ </component>
22
+ </project>
23
+
@@ -1,3 +1,3 @@
1
- <component name="CopyrightManager">
2
- <settings default="" />
1
+ <component name="CopyrightManager">
2
+ <settings default="" />
3
3
  </component>
data/.idea/encodings.xml CHANGED
@@ -1,5 +1,5 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
- </project>
5
-
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
@@ -1,11 +1,11 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0" is_locked="false">
3
- <option name="myName" value="Project Default" />
4
- <option name="myLocal" value="false" />
5
- <inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
6
- <option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
7
- <option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
8
- </inspection_tool>
9
- <inspection_tool class="RubyQuotedStringsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
10
- </profile>
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0" is_locked="false">
3
+ <option name="myName" value="Project Default" />
4
+ <option name="myLocal" value="false" />
5
+ <inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
6
+ <option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
7
+ <option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
8
+ </inspection_tool>
9
+ <inspection_tool class="RubyQuotedStringsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
10
+ </profile>
11
11
  </component>
@@ -1,7 +1,7 @@
1
- <component name="InspectionProjectProfileManager">
2
- <settings>
3
- <option name="PROJECT_PROFILE" value="Project Default" />
4
- <option name="USE_PROJECT_PROFILE" value="true" />
5
- <version value="1.0" />
6
- </settings>
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="PROJECT_PROFILE" value="Project Default" />
4
+ <option name="USE_PROJECT_PROFILE" value="true" />
5
+ <version value="1.0" />
6
+ </settings>
7
7
  </component>
data/.idea/misc.xml CHANGED
@@ -1,23 +1,23 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="ruby-2.0.0-p451" project-jdk-type="RUBY_SDK">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- <component name="masterDetails">
7
- <states>
8
- <state key="ProjectJDKs.UI">
9
- <settings>
10
- <last-edited>1.7</last-edited>
11
- <splitter-proportions>
12
- <option name="proportions">
13
- <list>
14
- <option value="0.2" />
15
- </list>
16
- </option>
17
- </splitter-proportions>
18
- </settings>
19
- </state>
20
- </states>
21
- </component>
22
- </project>
23
-
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="ruby-2.0.0-p451" project-jdk-type="RUBY_SDK">
4
+ <output url="file://$PROJECT_DIR$/out" />
5
+ </component>
6
+ <component name="masterDetails">
7
+ <states>
8
+ <state key="ProjectJDKs.UI">
9
+ <settings>
10
+ <last-edited>1.7</last-edited>
11
+ <splitter-proportions>
12
+ <option name="proportions">
13
+ <list>
14
+ <option value="0.2" />
15
+ </list>
16
+ </option>
17
+ </splitter-proportions>
18
+ </settings>
19
+ </state>
20
+ </states>
21
+ </component>
22
+ </project>
23
+
data/.idea/modules.xml CHANGED
@@ -1,9 +1,9 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/bill_forward_api_client.iml" filepath="$PROJECT_DIR$/bill_forward_api_client.iml" />
6
- </modules>
7
- </component>
8
- </project>
9
-
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/bill_forward_api_client.iml" filepath="$PROJECT_DIR$/bill_forward_api_client.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
@@ -1,5 +1,5 @@
1
- <component name="DependencyValidationManager">
2
- <state>
3
- <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
- </state>
1
+ <component name="DependencyValidationManager">
2
+ <state>
3
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
+ </state>
5
5
  </component>
data/.idea/vcs.xml CHANGED
@@ -1,7 +1,7 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
7
-
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
7
+
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --color
1
+ --color
2
2
  --format documentation
data/Gemfile CHANGED
@@ -1,9 +1,13 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in bill_forward.gemspec
4
- gemspec
5
-
6
- gem 'rest-client', '~> 1.6.8'
7
- gem 'json', '~> 1.8.1'
8
- gem 'require_all'
9
- gem 'activesupport', '>= 3.1.0', '< 4'
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bill_forward.gemspec
4
+ gemspec
5
+
6
+ gem 'json', '~> 1.8.1'
7
+ gem 'require_all'
8
+
9
+ if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('1.9.3')
10
+ gem 'i18n', '< 0.7'
11
+ gem 'rest-client', '~> 1.6.8'
12
+ gem 'activesupport', '~> 3.2'
13
+ end
data/LICENSE.md CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2014 BillForward, Inc
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2014 BillForward, Inc
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.