processout 1.2.2 → 2.0.0
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 +4 -4
- data/lib/processout.rb +37 -0
- data/lib/processout/activity.rb +15 -0
- data/lib/processout/addon.rb +352 -0
- data/lib/processout/api_request.rb +274 -0
- data/lib/processout/api_version.rb +82 -0
- data/lib/processout/authorization_request.rb +62 -17
- data/lib/processout/card.rb +137 -10
- data/lib/processout/coupon.rb +22 -17
- data/lib/processout/customer.rb +180 -14
- data/lib/processout/discount.rb +69 -19
- data/lib/processout/dunning_action.rb +72 -0
- data/lib/processout/event.rb +15 -0
- data/lib/processout/gateway.rb +30 -0
- data/lib/processout/gateway_configuration.rb +90 -0
- data/lib/processout/gateway_request.rb +26 -0
- data/lib/processout/invoice.rb +119 -62
- data/lib/processout/invoice_detail.rb +20 -0
- data/lib/processout/networking/request.rb +1 -2
- data/lib/processout/plan.rb +15 -0
- data/lib/processout/product.rb +15 -0
- data/lib/processout/project.rb +100 -0
- data/lib/processout/refund.rb +32 -7
- data/lib/processout/subscription.rb +267 -117
- data/lib/processout/token.rb +62 -2
- data/lib/processout/transaction.rb +159 -0
- data/lib/processout/transaction_operation.rb +248 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout/webhook.rb +30 -0
- data/lib/processout/webhook_endpoint.rb +135 -0
- metadata +9 -2
data/lib/processout/version.rb
CHANGED
data/lib/processout/webhook.rb
CHANGED
@@ -9,7 +9,9 @@ module ProcessOut
|
|
9
9
|
|
10
10
|
attr_reader :id
|
11
11
|
attr_reader :project
|
12
|
+
attr_reader :project_id
|
12
13
|
attr_reader :event
|
14
|
+
attr_reader :event_id
|
13
15
|
attr_reader :request_url
|
14
16
|
attr_reader :request_method
|
15
17
|
attr_reader :response_body
|
@@ -26,6 +28,11 @@ module ProcessOut
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def project=(val)
|
31
|
+
if val.nil?
|
32
|
+
@project = val
|
33
|
+
return
|
34
|
+
end
|
35
|
+
|
29
36
|
if val.instance_of? Project
|
30
37
|
@project = val
|
31
38
|
else
|
@@ -36,7 +43,16 @@ module ProcessOut
|
|
36
43
|
|
37
44
|
end
|
38
45
|
|
46
|
+
def project_id=(val)
|
47
|
+
@project_id = val
|
48
|
+
end
|
49
|
+
|
39
50
|
def event=(val)
|
51
|
+
if val.nil?
|
52
|
+
@event = val
|
53
|
+
return
|
54
|
+
end
|
55
|
+
|
40
56
|
if val.instance_of? Event
|
41
57
|
@event = val
|
42
58
|
else
|
@@ -47,6 +63,10 @@ module ProcessOut
|
|
47
63
|
|
48
64
|
end
|
49
65
|
|
66
|
+
def event_id=(val)
|
67
|
+
@event_id = val
|
68
|
+
end
|
69
|
+
|
50
70
|
def request_url=(val)
|
51
71
|
@request_url = val
|
52
72
|
end
|
@@ -93,7 +113,9 @@ module ProcessOut
|
|
93
113
|
|
94
114
|
self.id = data.fetch(:id, nil)
|
95
115
|
self.project = data.fetch(:project, nil)
|
116
|
+
self.project_id = data.fetch(:project_id, nil)
|
96
117
|
self.event = data.fetch(:event, nil)
|
118
|
+
self.event_id = data.fetch(:event_id, nil)
|
97
119
|
self.request_url = data.fetch(:request_url, nil)
|
98
120
|
self.request_method = data.fetch(:request_method, nil)
|
99
121
|
self.response_body = data.fetch(:response_body, nil)
|
@@ -124,9 +146,15 @@ module ProcessOut
|
|
124
146
|
if data.include? "project"
|
125
147
|
self.project = data["project"]
|
126
148
|
end
|
149
|
+
if data.include? "project_id"
|
150
|
+
self.project_id = data["project_id"]
|
151
|
+
end
|
127
152
|
if data.include? "event"
|
128
153
|
self.event = data["event"]
|
129
154
|
end
|
155
|
+
if data.include? "event_id"
|
156
|
+
self.event_id = data["event_id"]
|
157
|
+
end
|
130
158
|
if data.include? "request_url"
|
131
159
|
self.request_url = data["request_url"]
|
132
160
|
end
|
@@ -167,7 +195,9 @@ module ProcessOut
|
|
167
195
|
end
|
168
196
|
self.id = data.fetch(:id, self.id)
|
169
197
|
self.project = data.fetch(:project, self.project)
|
198
|
+
self.project_id = data.fetch(:project_id, self.project_id)
|
170
199
|
self.event = data.fetch(:event, self.event)
|
200
|
+
self.event_id = data.fetch(:event_id, self.event_id)
|
171
201
|
self.request_url = data.fetch(:request_url, self.request_url)
|
172
202
|
self.request_method = data.fetch(:request_method, self.request_method)
|
173
203
|
self.response_body = data.fetch(:response_body, self.response_body)
|
@@ -0,0 +1,135 @@
|
|
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 WebhookEndpoint
|
9
|
+
|
10
|
+
attr_reader :id
|
11
|
+
attr_reader :project
|
12
|
+
attr_reader :project_id
|
13
|
+
attr_reader :url
|
14
|
+
attr_reader :events_whitelist
|
15
|
+
attr_reader :sandbox
|
16
|
+
attr_reader :created_at
|
17
|
+
|
18
|
+
|
19
|
+
def id=(val)
|
20
|
+
@id = val
|
21
|
+
end
|
22
|
+
|
23
|
+
def project=(val)
|
24
|
+
if val.nil?
|
25
|
+
@project = val
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
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 project_id=(val)
|
40
|
+
@project_id = val
|
41
|
+
end
|
42
|
+
|
43
|
+
def url=(val)
|
44
|
+
@url = val
|
45
|
+
end
|
46
|
+
|
47
|
+
def events_whitelist=(val)
|
48
|
+
@events_whitelist = val
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
def sandbox=(val)
|
53
|
+
@sandbox = val
|
54
|
+
end
|
55
|
+
|
56
|
+
def created_at=(val)
|
57
|
+
@created_at = val
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
# Initializes the WebhookEndpoint object
|
62
|
+
# Params:
|
63
|
+
# +client+:: +ProcessOut+ client instance
|
64
|
+
# +data+:: data that can be used to fill the object
|
65
|
+
def initialize(client, data = {})
|
66
|
+
@client = client
|
67
|
+
|
68
|
+
self.id = data.fetch(:id, nil)
|
69
|
+
self.project = data.fetch(:project, nil)
|
70
|
+
self.project_id = data.fetch(:project_id, nil)
|
71
|
+
self.url = data.fetch(:url, nil)
|
72
|
+
self.events_whitelist = data.fetch(:events_whitelist, nil)
|
73
|
+
self.sandbox = data.fetch(:sandbox, nil)
|
74
|
+
self.created_at = data.fetch(:created_at, nil)
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
# Create a new WebhookEndpoint using the current client
|
79
|
+
def new(data = {})
|
80
|
+
WebhookEndpoint.new(@client, data)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Fills the object with data coming from the API
|
84
|
+
# Params:
|
85
|
+
# +data+:: +Hash+ of data coming from the API
|
86
|
+
def fill_with_data(data)
|
87
|
+
if data.nil?
|
88
|
+
return self
|
89
|
+
end
|
90
|
+
if data.include? "id"
|
91
|
+
self.id = data["id"]
|
92
|
+
end
|
93
|
+
if data.include? "project"
|
94
|
+
self.project = data["project"]
|
95
|
+
end
|
96
|
+
if data.include? "project_id"
|
97
|
+
self.project_id = data["project_id"]
|
98
|
+
end
|
99
|
+
if data.include? "url"
|
100
|
+
self.url = data["url"]
|
101
|
+
end
|
102
|
+
if data.include? "events_whitelist"
|
103
|
+
self.events_whitelist = data["events_whitelist"]
|
104
|
+
end
|
105
|
+
if data.include? "sandbox"
|
106
|
+
self.sandbox = data["sandbox"]
|
107
|
+
end
|
108
|
+
if data.include? "created_at"
|
109
|
+
self.created_at = data["created_at"]
|
110
|
+
end
|
111
|
+
|
112
|
+
self
|
113
|
+
end
|
114
|
+
|
115
|
+
# Prefills the object with the data passed as parameters
|
116
|
+
# Params:
|
117
|
+
# +data+:: +Hash+ of data
|
118
|
+
def prefill(data)
|
119
|
+
if data.nil?
|
120
|
+
return self
|
121
|
+
end
|
122
|
+
self.id = data.fetch(:id, self.id)
|
123
|
+
self.project = data.fetch(:project, self.project)
|
124
|
+
self.project_id = data.fetch(:project_id, self.project_id)
|
125
|
+
self.url = data.fetch(:url, self.url)
|
126
|
+
self.events_whitelist = data.fetch(:events_whitelist, self.events_whitelist)
|
127
|
+
self.sandbox = data.fetch(:sandbox, self.sandbox)
|
128
|
+
self.created_at = data.fetch(:created_at, self.created_at)
|
129
|
+
|
130
|
+
self
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
end
|
135
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: processout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel HUEZ
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,6 +70,9 @@ files:
|
|
70
70
|
- bin/setup
|
71
71
|
- lib/processout.rb
|
72
72
|
- lib/processout/activity.rb
|
73
|
+
- lib/processout/addon.rb
|
74
|
+
- lib/processout/api_request.rb
|
75
|
+
- lib/processout/api_version.rb
|
73
76
|
- lib/processout/authorization_request.rb
|
74
77
|
- lib/processout/card.rb
|
75
78
|
- lib/processout/card_information.rb
|
@@ -77,6 +80,7 @@ files:
|
|
77
80
|
- lib/processout/customer.rb
|
78
81
|
- lib/processout/customer_action.rb
|
79
82
|
- lib/processout/discount.rb
|
83
|
+
- lib/processout/dunning_action.rb
|
80
84
|
- lib/processout/errors/authentication_error.rb
|
81
85
|
- lib/processout/errors/generic_error.rb
|
82
86
|
- lib/processout/errors/internal_error.rb
|
@@ -85,6 +89,7 @@ files:
|
|
85
89
|
- lib/processout/event.rb
|
86
90
|
- lib/processout/gateway.rb
|
87
91
|
- lib/processout/gateway_configuration.rb
|
92
|
+
- lib/processout/gateway_request.rb
|
88
93
|
- lib/processout/invoice.rb
|
89
94
|
- lib/processout/invoice_detail.rb
|
90
95
|
- lib/processout/networking/request.rb
|
@@ -96,8 +101,10 @@ files:
|
|
96
101
|
- lib/processout/subscription.rb
|
97
102
|
- lib/processout/token.rb
|
98
103
|
- lib/processout/transaction.rb
|
104
|
+
- lib/processout/transaction_operation.rb
|
99
105
|
- lib/processout/version.rb
|
100
106
|
- lib/processout/webhook.rb
|
107
|
+
- lib/processout/webhook_endpoint.rb
|
101
108
|
- processout.gemspec
|
102
109
|
homepage: https://docs.processout.com
|
103
110
|
licenses:
|