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.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.travis.yml +11 -0
- data/CONTRIBUTORS +1 -0
- data/Gemfile +2 -0
- data/History.txt +0 -0
- data/LICENSE +21 -0
- data/README.rdoc +43 -0
- data/Rakefile +16 -0
- data/VERSION +1 -0
- data/bin/peakium-console +7 -0
- data/gemfiles/default-with-activesupport.gemfile +3 -0
- data/gemfiles/json.gemfile +4 -0
- data/gemfiles/yajl.gemfile +4 -0
- data/lib/data/ca-certificates.crt +3828 -0
- data/lib/peakium/api_operations/create.rb +16 -0
- data/lib/peakium/api_operations/delete.rb +11 -0
- data/lib/peakium/api_operations/list.rb +21 -0
- data/lib/peakium/api_operations/update.rb +17 -0
- data/lib/peakium/api_resource.rb +33 -0
- data/lib/peakium/api_resources/customer.rb +25 -0
- data/lib/peakium/api_resources/event.rb +28 -0
- data/lib/peakium/api_resources/event_webhook.rb +5 -0
- data/lib/peakium/api_resources/gateway.rb +19 -0
- data/lib/peakium/api_resources/invoice.rb +26 -0
- data/lib/peakium/api_resources/payment_session.rb +5 -0
- data/lib/peakium/api_resources/submission_form.rb +12 -0
- data/lib/peakium/api_resources/subscription.rb +26 -0
- data/lib/peakium/api_resources/webhook.rb +21 -0
- data/lib/peakium/errors/api_connection_error.rb +4 -0
- data/lib/peakium/errors/api_error.rb +4 -0
- data/lib/peakium/errors/authentication_error.rb +4 -0
- data/lib/peakium/errors/invalid_request_error.rb +10 -0
- data/lib/peakium/errors/peakium_error.rb +20 -0
- data/lib/peakium/list_object.rb +31 -0
- data/lib/peakium/peakium_object.rb +167 -0
- data/lib/peakium/util.rb +115 -0
- data/lib/peakium/version.rb +3 -0
- data/lib/peakium.rb +265 -0
- data/peakium.gemspec +27 -0
- data/test/peakium/api_resource_test.rb +315 -0
- data/test/peakium/customer_test.rb +21 -0
- data/test/peakium/event_test.rb +30 -0
- data/test/peakium/event_webhook_test.rb +13 -0
- data/test/peakium/gateway_test.rb +35 -0
- data/test/peakium/invoice_test.rb +21 -0
- data/test/peakium/list_object_test.rb +16 -0
- data/test/peakium/payment_session_test.rb +13 -0
- data/test/peakium/submission_form_test.rb +12 -0
- data/test/peakium/subscription_test.rb +13 -0
- data/test/peakium/util_test.rb +29 -0
- data/test/peakium/webhook_test.rb +20 -0
- data/test/test_helper.rb +337 -0
- 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
data/.travis.yml
ADDED
data/CONTRIBUTORS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Dan Schultzer <dan@dreamconception.com>
|
data/Gemfile
ADDED
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
|
data/bin/peakium-console
ADDED