processout 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +10 -0
  8. data/Rakefile +6 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/deploy.sh +25 -0
  12. data/lib/processout.rb +130 -0
  13. data/lib/processout/activity.rb +147 -0
  14. data/lib/processout/authorization_request.rb +248 -0
  15. data/lib/processout/card.rb +156 -0
  16. data/lib/processout/coupon.rb +284 -0
  17. data/lib/processout/customer.rb +418 -0
  18. data/lib/processout/customer_action.rb +50 -0
  19. data/lib/processout/discount.rb +217 -0
  20. data/lib/processout/errors/authentication_error.rb +7 -0
  21. data/lib/processout/errors/generic_error.rb +7 -0
  22. data/lib/processout/errors/internal_error.rb +7 -0
  23. data/lib/processout/errors/notfound_error.rb +7 -0
  24. data/lib/processout/errors/validation_error.rb +7 -0
  25. data/lib/processout/event.rb +176 -0
  26. data/lib/processout/gateway.rb +104 -0
  27. data/lib/processout/gateway_configuration.rb +91 -0
  28. data/lib/processout/invoice.rb +457 -0
  29. data/lib/processout/networking/request.rb +95 -0
  30. data/lib/processout/networking/response.rb +61 -0
  31. data/lib/processout/plan.rb +280 -0
  32. data/lib/processout/product.rb +313 -0
  33. data/lib/processout/project.rb +105 -0
  34. data/lib/processout/refund.rb +161 -0
  35. data/lib/processout/subscription.rb +633 -0
  36. data/lib/processout/token.rb +167 -0
  37. data/lib/processout/transaction.rb +302 -0
  38. data/lib/processout/version.rb +3 -0
  39. data/lib/processout/webhook.rb +154 -0
  40. data/processout.gemspec +26 -0
  41. metadata +125 -0
@@ -0,0 +1,3 @@
1
+ module ProcessOut
2
+ VERSION = "0.2.0"
3
+ end
@@ -0,0 +1,154 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "processout/networking/request"
5
+ require "processout/networking/response"
6
+
7
+ module ProcessOut
8
+ class Webhook
9
+
10
+ attr_reader :id
11
+ attr_reader :project
12
+ attr_reader :event
13
+ attr_reader :request_url
14
+ attr_reader :request_method
15
+ attr_reader :response_body
16
+ attr_reader :response_code
17
+ attr_reader :response_headers
18
+ attr_reader :response_time_ms
19
+ attr_reader :status
20
+ attr_reader :created_at
21
+ attr_reader :release_at
22
+
23
+
24
+ def id=(val)
25
+ @id = val
26
+ end
27
+
28
+ def project=(val)
29
+ if val.instance_of? Project
30
+ @project = val
31
+ else
32
+ obj = Project.new(@client)
33
+ obj.fill_with_data(val)
34
+ @project = obj
35
+ end
36
+
37
+ end
38
+
39
+ def event=(val)
40
+ if val.instance_of? Event
41
+ @event = val
42
+ else
43
+ obj = Event.new(@client)
44
+ obj.fill_with_data(val)
45
+ @event = obj
46
+ end
47
+
48
+ end
49
+
50
+ def request_url=(val)
51
+ @request_url = val
52
+ end
53
+
54
+ def request_method=(val)
55
+ @request_method = val
56
+ end
57
+
58
+ def response_body=(val)
59
+ @response_body = val
60
+ end
61
+
62
+ def response_code=(val)
63
+ @response_code = val
64
+ end
65
+
66
+ def response_headers=(val)
67
+ @response_headers = val
68
+ end
69
+
70
+ def response_time_ms=(val)
71
+ @response_time_ms = val
72
+ end
73
+
74
+ def status=(val)
75
+ @status = val
76
+ end
77
+
78
+ def created_at=(val)
79
+ @created_at = val
80
+ end
81
+
82
+ def release_at=(val)
83
+ @release_at = val
84
+ end
85
+
86
+
87
+ # Initializes the Webhook object
88
+ # Params:
89
+ # +client+:: +ProcessOut+ client instance
90
+ def initialize(client)
91
+ @client = client
92
+
93
+ @id = ""
94
+ @project = nil
95
+ @event = nil
96
+ @request_url = ""
97
+ @request_method = ""
98
+ @response_body = ""
99
+ @response_code = ""
100
+ @response_headers = ""
101
+ @response_time_ms = 0
102
+ @status = 0
103
+ @created_at = ""
104
+ @release_at = ""
105
+
106
+ end
107
+
108
+ # Fills the object with data coming from the API
109
+ # Params:
110
+ # +data+:: +Hash+ of data coming from the API
111
+ def fill_with_data(data)
112
+ if data.include? "id"
113
+ @id = data["id"]
114
+ end
115
+ if data.include? "project"
116
+ @project = data["project"]
117
+ end
118
+ if data.include? "event"
119
+ @event = data["event"]
120
+ end
121
+ if data.include? "request_url"
122
+ @request_url = data["request_url"]
123
+ end
124
+ if data.include? "request_method"
125
+ @request_method = data["request_method"]
126
+ end
127
+ if data.include? "response_body"
128
+ @response_body = data["response_body"]
129
+ end
130
+ if data.include? "response_code"
131
+ @response_code = data["response_code"]
132
+ end
133
+ if data.include? "response_headers"
134
+ @response_headers = data["response_headers"]
135
+ end
136
+ if data.include? "response_time_ms"
137
+ @response_time_ms = data["response_time_ms"]
138
+ end
139
+ if data.include? "status"
140
+ @status = data["status"]
141
+ end
142
+ if data.include? "created_at"
143
+ @created_at = data["created_at"]
144
+ end
145
+ if data.include? "release_at"
146
+ @release_at = data["release_at"]
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+
153
+ end
154
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'processout/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "processout"
8
+ spec.version = ProcessOut::VERSION
9
+ spec.authors = ["Manuel HUEZ"]
10
+ spec.email = ["manuel@processout.com"]
11
+
12
+ spec.summary = "Ruby bindings for the ProcessOut API"
13
+ spec.homepage = "https://docs.processout.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.13"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: processout
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Manuel HUEZ
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-11-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description:
56
+ email:
57
+ - manuel@processout.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/console
70
+ - bin/setup
71
+ - deploy.sh
72
+ - lib/processout.rb
73
+ - lib/processout/activity.rb
74
+ - lib/processout/authorization_request.rb
75
+ - lib/processout/card.rb
76
+ - lib/processout/coupon.rb
77
+ - lib/processout/customer.rb
78
+ - lib/processout/customer_action.rb
79
+ - lib/processout/discount.rb
80
+ - lib/processout/errors/authentication_error.rb
81
+ - lib/processout/errors/generic_error.rb
82
+ - lib/processout/errors/internal_error.rb
83
+ - lib/processout/errors/notfound_error.rb
84
+ - lib/processout/errors/validation_error.rb
85
+ - lib/processout/event.rb
86
+ - lib/processout/gateway.rb
87
+ - lib/processout/gateway_configuration.rb
88
+ - lib/processout/invoice.rb
89
+ - lib/processout/networking/request.rb
90
+ - lib/processout/networking/response.rb
91
+ - lib/processout/plan.rb
92
+ - lib/processout/product.rb
93
+ - lib/processout/project.rb
94
+ - lib/processout/refund.rb
95
+ - lib/processout/subscription.rb
96
+ - lib/processout/token.rb
97
+ - lib/processout/transaction.rb
98
+ - lib/processout/version.rb
99
+ - lib/processout/webhook.rb
100
+ - processout.gemspec
101
+ homepage: https://docs.processout.com
102
+ licenses:
103
+ - MIT
104
+ metadata: {}
105
+ post_install_message:
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubyforge_project:
121
+ rubygems_version: 2.6.8
122
+ signing_key:
123
+ specification_version: 4
124
+ summary: Ruby bindings for the ProcessOut API
125
+ test_files: []