peakium 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.travis.yml +11 -0
  4. data/CONTRIBUTORS +1 -0
  5. data/Gemfile +2 -0
  6. data/History.txt +0 -0
  7. data/LICENSE +21 -0
  8. data/README.rdoc +43 -0
  9. data/Rakefile +16 -0
  10. data/VERSION +1 -0
  11. data/bin/peakium-console +7 -0
  12. data/gemfiles/default-with-activesupport.gemfile +3 -0
  13. data/gemfiles/json.gemfile +4 -0
  14. data/gemfiles/yajl.gemfile +4 -0
  15. data/lib/data/ca-certificates.crt +3828 -0
  16. data/lib/peakium/api_operations/create.rb +16 -0
  17. data/lib/peakium/api_operations/delete.rb +11 -0
  18. data/lib/peakium/api_operations/list.rb +21 -0
  19. data/lib/peakium/api_operations/update.rb +17 -0
  20. data/lib/peakium/api_resource.rb +33 -0
  21. data/lib/peakium/api_resources/customer.rb +25 -0
  22. data/lib/peakium/api_resources/event.rb +28 -0
  23. data/lib/peakium/api_resources/event_webhook.rb +5 -0
  24. data/lib/peakium/api_resources/gateway.rb +19 -0
  25. data/lib/peakium/api_resources/invoice.rb +26 -0
  26. data/lib/peakium/api_resources/payment_session.rb +5 -0
  27. data/lib/peakium/api_resources/submission_form.rb +12 -0
  28. data/lib/peakium/api_resources/subscription.rb +26 -0
  29. data/lib/peakium/api_resources/webhook.rb +21 -0
  30. data/lib/peakium/errors/api_connection_error.rb +4 -0
  31. data/lib/peakium/errors/api_error.rb +4 -0
  32. data/lib/peakium/errors/authentication_error.rb +4 -0
  33. data/lib/peakium/errors/invalid_request_error.rb +10 -0
  34. data/lib/peakium/errors/peakium_error.rb +20 -0
  35. data/lib/peakium/list_object.rb +31 -0
  36. data/lib/peakium/peakium_object.rb +167 -0
  37. data/lib/peakium/util.rb +115 -0
  38. data/lib/peakium/version.rb +3 -0
  39. data/lib/peakium.rb +265 -0
  40. data/peakium.gemspec +27 -0
  41. data/test/peakium/api_resource_test.rb +315 -0
  42. data/test/peakium/customer_test.rb +21 -0
  43. data/test/peakium/event_test.rb +30 -0
  44. data/test/peakium/event_webhook_test.rb +13 -0
  45. data/test/peakium/gateway_test.rb +35 -0
  46. data/test/peakium/invoice_test.rb +21 -0
  47. data/test/peakium/list_object_test.rb +16 -0
  48. data/test/peakium/payment_session_test.rb +13 -0
  49. data/test/peakium/submission_form_test.rb +12 -0
  50. data/test/peakium/subscription_test.rb +13 -0
  51. data/test/peakium/util_test.rb +29 -0
  52. data/test/peakium/webhook_test.rb +20 -0
  53. data/test/test_helper.rb +337 -0
  54. metadata +99 -52
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1dbe842cd5be59f035860999cf71310f6cb70e17
4
+ data.tar.gz: 990e7f839fe417b03c96747c28f0222c9b94b1b8
5
+ SHA512:
6
+ metadata.gz: 2e6eea49c4f6aad01511ebdbd64826469e125a2c9f60804773ec7d50777986036b0331908c66a9c89b42049a0dff59694bc1327a971b11d5c052b036c8c00d8d
7
+ data.tar.gz: 87fd020da8823b92ed56a95264a79c6a3443bc9910d141554e785393f5cd739cfa6f309024dae289006d7c3ff0380a396584e927fd2000dcdff62396186d00ac
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ /peakium-*.gem
3
+ Gemfile.lock
4
+ .rvmrc
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - 2.1.0
8
+ gemfile:
9
+ - gemfiles/default-with-activesupport.gemfile
10
+ - gemfiles/json.gemfile
11
+ - gemfiles/yajl.gemfile
data/CONTRIBUTORS ADDED
@@ -0,0 +1 @@
1
+ Dan Schultzer <dan@dreamconception.com>
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/History.txt ADDED
File without changes
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2011- Dream Conception L.L.C. (https://dreamconception.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,43 @@
1
+ = Peakium Ruby API Bindings
2
+
3
+ == About
4
+
5
+ This is an experimental release heavily inspired by (and stolen from) the {Stripe
6
+ Ruby bindings}[https://github.com/stripe/stripe-ruby].
7
+
8
+ == Installation
9
+
10
+ gem build peakium.gemspec
11
+ gem install
12
+
13
+ == Example usage
14
+
15
+ Set API key:
16
+
17
+ Peakium.api_key = "you_secret_api_key"
18
+
19
+ Retrieve a customer:
20
+
21
+ customer = Peakium::Customer.retrieve("test_customer")
22
+
23
+ Create a submission form:
24
+
25
+ submission_form = Peakium::SubmissionForm.build('create-subscription', args)
26
+
27
+ Cancel a subscription:
28
+
29
+ customer.cancel_subscription("test_subscription")
30
+
31
+ == Errors
32
+
33
+ The library will raise exceptions when errors are encountered, e.g. if a resource doesn't exist.
34
+
35
+ == Requirements
36
+
37
+ * Ruby 1.8.7 or above. (Ruby 1.8.6 may work if you load
38
+ ActiveSupport.)
39
+ * rest-client, multi_json
40
+
41
+ == Development
42
+
43
+ Test cases can be run with: `bundle exec rake test`
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ task :default => [:all]
2
+
3
+ task :test do
4
+ ret = true
5
+ Dir["test/**/*_test.rb"].each do |f|
6
+ ret = ret && ruby(f, '')
7
+ end
8
+ exit(ret)
9
+ end
10
+
11
+ task :all do
12
+ Rake::Task["test"].invoke
13
+ require 'active_support/all'
14
+ Rake::Task["test"].reenable
15
+ Rake::Task["test"].invoke
16
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
3
+
4
+ libs = " -r irb/completion"
5
+ libs << " -r '#{File.dirname(__FILE__) + '/../lib/peakium'}'"
6
+ puts "Loading peakium gem"
7
+ exec "#{irb} #{libs} --simple-prompt"
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => File.join(File.dirname(__FILE__), "..")
3
+ gem "activesupport", "~> 3.0"
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => File.join(File.dirname(__FILE__), "..")
3
+ gem "json"
4
+ gem "activesupport", "~> 3.0"
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => File.join(File.dirname(__FILE__), "..")
3
+ gem "yajl-ruby"
4
+ gem "activesupport", "~> 3.0"