processout 2.28.0 → 2.29.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c7f68dd1c2ad91a3abcc9c4ebad513d00d8022c78e861173c0b215dcad99f2c
4
- data.tar.gz: d6bcdb8de73326652f745663fffd0069bfda7276eadd914512bbbcbaf4d08d3b
3
+ metadata.gz: a4c1310f5b0805fdec37b79d6ca50503f9843bba0e81238fa1fc80187e3a6777
4
+ data.tar.gz: 5d17d3ec08d5f0b336ad53f7ce1575d21f9cffa37204e43f9d22ac5bade517f9
5
5
  SHA512:
6
- metadata.gz: a5f99c4c073dc9b293160993deae41cf14cc4a6c9312f8fd4aacd503c6bf3bb3d24fd83208736f2bb1cbf8b0eeba1bd8b60bf3132993508bdb1322c20ced8839
7
- data.tar.gz: c9ca949e957f07e84c76ff47e8a6e151cefbf66464a39ee5f8bd16474334bbbd837119609293a523b3307c7048214f0d4764a6dc63be3069ac1772271df70a4f
6
+ metadata.gz: 979c9c5e3d065a54013ef30b3a431a5ef854809b4c038ff3c98413a31e6a45e718593cc18fc1aefaaf1b9b9245eebf2db20a340fbd8171b07a971d3dd29249a2
7
+ data.tar.gz: 5c1095d0a955c15e3d01a9867b1470b2ad1fbd0cb0427cddb6a4e23a75986ae602e6dab0a42d146b7f87ce9caaa8f0ccca4290bc70a6c18078607b3dd7ea3018
@@ -0,0 +1,125 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class CardContact
10
+
11
+ attr_reader :address1
12
+ attr_reader :address2
13
+ attr_reader :city
14
+ attr_reader :state
15
+ attr_reader :country_code
16
+ attr_reader :zip
17
+
18
+
19
+ def address1=(val)
20
+ @address1 = val
21
+ end
22
+
23
+ def address2=(val)
24
+ @address2 = val
25
+ end
26
+
27
+ def city=(val)
28
+ @city = val
29
+ end
30
+
31
+ def state=(val)
32
+ @state = val
33
+ end
34
+
35
+ def country_code=(val)
36
+ @country_code = val
37
+ end
38
+
39
+ def zip=(val)
40
+ @zip = val
41
+ end
42
+
43
+
44
+ # Initializes the CardContact object
45
+ # Params:
46
+ # +client+:: +ProcessOut+ client instance
47
+ # +data+:: data that can be used to fill the object
48
+ def initialize(client, data = {})
49
+ @client = client
50
+
51
+ self.address1 = data.fetch(:address1, nil)
52
+ self.address2 = data.fetch(:address2, nil)
53
+ self.city = data.fetch(:city, nil)
54
+ self.state = data.fetch(:state, nil)
55
+ self.country_code = data.fetch(:country_code, nil)
56
+ self.zip = data.fetch(:zip, nil)
57
+
58
+ end
59
+
60
+ # Create a new CardContact using the current client
61
+ def new(data = {})
62
+ CardContact.new(@client, data)
63
+ end
64
+
65
+ # Overrides the JSON marshaller to only send the fields we want
66
+ def to_json(options)
67
+ {
68
+ "address1": self.address1,
69
+ "address2": self.address2,
70
+ "city": self.city,
71
+ "state": self.state,
72
+ "country_code": self.country_code,
73
+ "zip": self.zip,
74
+ }.to_json
75
+ end
76
+
77
+ # Fills the object with data coming from the API
78
+ # Params:
79
+ # +data+:: +Hash+ of data coming from the API
80
+ def fill_with_data(data)
81
+ if data.nil?
82
+ return self
83
+ end
84
+ if data.include? "address1"
85
+ self.address1 = data["address1"]
86
+ end
87
+ if data.include? "address2"
88
+ self.address2 = data["address2"]
89
+ end
90
+ if data.include? "city"
91
+ self.city = data["city"]
92
+ end
93
+ if data.include? "state"
94
+ self.state = data["state"]
95
+ end
96
+ if data.include? "country_code"
97
+ self.country_code = data["country_code"]
98
+ end
99
+ if data.include? "zip"
100
+ self.zip = data["zip"]
101
+ end
102
+
103
+ self
104
+ end
105
+
106
+ # Prefills the object with the data passed as parameters
107
+ # Params:
108
+ # +data+:: +Hash+ of data
109
+ def prefill(data)
110
+ if data.nil?
111
+ return self
112
+ end
113
+ self.address1 = data.fetch(:address1, self.address1)
114
+ self.address2 = data.fetch(:address2, self.address2)
115
+ self.city = data.fetch(:city, self.city)
116
+ self.state = data.fetch(:state, self.state)
117
+ self.country_code = data.fetch(:country_code, self.country_code)
118
+ self.zip = data.fetch(:zip, self.zip)
119
+
120
+ self
121
+ end
122
+
123
+
124
+ end
125
+ end
@@ -0,0 +1,309 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class CardCreateRequest
10
+
11
+ attr_reader :device
12
+ attr_reader :name
13
+ attr_reader :number
14
+ attr_reader :exp_day
15
+ attr_reader :exp_month
16
+ attr_reader :exp_year
17
+ attr_reader :cvc2
18
+ attr_reader :preferred_scheme
19
+ attr_reader :metadata
20
+ attr_reader :token_type
21
+ attr_reader :eci
22
+ attr_reader :cryptogram
23
+ attr_reader :applepay_response
24
+ attr_reader :applepay_mid
25
+ attr_reader :payment_token
26
+ attr_reader :contact
27
+ attr_reader :shipping
28
+
29
+
30
+ def device=(val)
31
+ if val.nil?
32
+ @device = val
33
+ return
34
+ end
35
+
36
+ if val.instance_of? Device
37
+ @device = val
38
+ else
39
+ obj = Device.new(@client)
40
+ obj.fill_with_data(val)
41
+ @device = obj
42
+ end
43
+
44
+ end
45
+
46
+ def name=(val)
47
+ @name = val
48
+ end
49
+
50
+ def number=(val)
51
+ @number = val
52
+ end
53
+
54
+ def exp_day=(val)
55
+ @exp_day = val
56
+ end
57
+
58
+ def exp_month=(val)
59
+ @exp_month = val
60
+ end
61
+
62
+ def exp_year=(val)
63
+ @exp_year = val
64
+ end
65
+
66
+ def cvc2=(val)
67
+ @cvc2 = val
68
+ end
69
+
70
+ def preferred_scheme=(val)
71
+ @preferred_scheme = val
72
+ end
73
+
74
+ def metadata=(val)
75
+ @metadata = val
76
+ end
77
+
78
+ def token_type=(val)
79
+ @token_type = val
80
+ end
81
+
82
+ def eci=(val)
83
+ @eci = val
84
+ end
85
+
86
+ def cryptogram=(val)
87
+ @cryptogram = val
88
+ end
89
+
90
+ def applepay_response=(val)
91
+ @applepay_response = val
92
+ end
93
+
94
+ def applepay_mid=(val)
95
+ @applepay_mid = val
96
+ end
97
+
98
+ def payment_token=(val)
99
+ @payment_token = val
100
+ end
101
+
102
+ def contact=(val)
103
+ if val.nil?
104
+ @contact = val
105
+ return
106
+ end
107
+
108
+ if val.instance_of? CardContact
109
+ @contact = val
110
+ else
111
+ obj = CardContact.new(@client)
112
+ obj.fill_with_data(val)
113
+ @contact = obj
114
+ end
115
+
116
+ end
117
+
118
+ def shipping=(val)
119
+ if val.nil?
120
+ @shipping = val
121
+ return
122
+ end
123
+
124
+ if val.instance_of? CardShipping
125
+ @shipping = val
126
+ else
127
+ obj = CardShipping.new(@client)
128
+ obj.fill_with_data(val)
129
+ @shipping = obj
130
+ end
131
+
132
+ end
133
+
134
+
135
+ # Initializes the CardCreateRequest object
136
+ # Params:
137
+ # +client+:: +ProcessOut+ client instance
138
+ # +data+:: data that can be used to fill the object
139
+ def initialize(client, data = {})
140
+ @client = client
141
+
142
+ self.device = data.fetch(:device, nil)
143
+ self.name = data.fetch(:name, nil)
144
+ self.number = data.fetch(:number, nil)
145
+ self.exp_day = data.fetch(:exp_day, nil)
146
+ self.exp_month = data.fetch(:exp_month, nil)
147
+ self.exp_year = data.fetch(:exp_year, nil)
148
+ self.cvc2 = data.fetch(:cvc2, nil)
149
+ self.preferred_scheme = data.fetch(:preferred_scheme, nil)
150
+ self.metadata = data.fetch(:metadata, nil)
151
+ self.token_type = data.fetch(:token_type, nil)
152
+ self.eci = data.fetch(:eci, nil)
153
+ self.cryptogram = data.fetch(:cryptogram, nil)
154
+ self.applepay_response = data.fetch(:applepay_response, nil)
155
+ self.applepay_mid = data.fetch(:applepay_mid, nil)
156
+ self.payment_token = data.fetch(:payment_token, nil)
157
+ self.contact = data.fetch(:contact, nil)
158
+ self.shipping = data.fetch(:shipping, nil)
159
+
160
+ end
161
+
162
+ # Create a new CardCreateRequest using the current client
163
+ def new(data = {})
164
+ CardCreateRequest.new(@client, data)
165
+ end
166
+
167
+ # Overrides the JSON marshaller to only send the fields we want
168
+ def to_json(options)
169
+ {
170
+ "device": self.device,
171
+ "name": self.name,
172
+ "number": self.number,
173
+ "exp_day": self.exp_day,
174
+ "exp_month": self.exp_month,
175
+ "exp_year": self.exp_year,
176
+ "cvc2": self.cvc2,
177
+ "preferred_scheme": self.preferred_scheme,
178
+ "metadata": self.metadata,
179
+ "token_type": self.token_type,
180
+ "eci": self.eci,
181
+ "cryptogram": self.cryptogram,
182
+ "applepay_response": self.applepay_response,
183
+ "applepay_mid": self.applepay_mid,
184
+ "payment_token": self.payment_token,
185
+ "contact": self.contact,
186
+ "shipping": self.shipping,
187
+ }.to_json
188
+ end
189
+
190
+ # Fills the object with data coming from the API
191
+ # Params:
192
+ # +data+:: +Hash+ of data coming from the API
193
+ def fill_with_data(data)
194
+ if data.nil?
195
+ return self
196
+ end
197
+ if data.include? "device"
198
+ self.device = data["device"]
199
+ end
200
+ if data.include? "name"
201
+ self.name = data["name"]
202
+ end
203
+ if data.include? "number"
204
+ self.number = data["number"]
205
+ end
206
+ if data.include? "exp_day"
207
+ self.exp_day = data["exp_day"]
208
+ end
209
+ if data.include? "exp_month"
210
+ self.exp_month = data["exp_month"]
211
+ end
212
+ if data.include? "exp_year"
213
+ self.exp_year = data["exp_year"]
214
+ end
215
+ if data.include? "cvc2"
216
+ self.cvc2 = data["cvc2"]
217
+ end
218
+ if data.include? "preferred_scheme"
219
+ self.preferred_scheme = data["preferred_scheme"]
220
+ end
221
+ if data.include? "metadata"
222
+ self.metadata = data["metadata"]
223
+ end
224
+ if data.include? "token_type"
225
+ self.token_type = data["token_type"]
226
+ end
227
+ if data.include? "eci"
228
+ self.eci = data["eci"]
229
+ end
230
+ if data.include? "cryptogram"
231
+ self.cryptogram = data["cryptogram"]
232
+ end
233
+ if data.include? "applepay_response"
234
+ self.applepay_response = data["applepay_response"]
235
+ end
236
+ if data.include? "applepay_mid"
237
+ self.applepay_mid = data["applepay_mid"]
238
+ end
239
+ if data.include? "payment_token"
240
+ self.payment_token = data["payment_token"]
241
+ end
242
+ if data.include? "contact"
243
+ self.contact = data["contact"]
244
+ end
245
+ if data.include? "shipping"
246
+ self.shipping = data["shipping"]
247
+ end
248
+
249
+ self
250
+ end
251
+
252
+ # Prefills the object with the data passed as parameters
253
+ # Params:
254
+ # +data+:: +Hash+ of data
255
+ def prefill(data)
256
+ if data.nil?
257
+ return self
258
+ end
259
+ self.device = data.fetch(:device, self.device)
260
+ self.name = data.fetch(:name, self.name)
261
+ self.number = data.fetch(:number, self.number)
262
+ self.exp_day = data.fetch(:exp_day, self.exp_day)
263
+ self.exp_month = data.fetch(:exp_month, self.exp_month)
264
+ self.exp_year = data.fetch(:exp_year, self.exp_year)
265
+ self.cvc2 = data.fetch(:cvc2, self.cvc2)
266
+ self.preferred_scheme = data.fetch(:preferred_scheme, self.preferred_scheme)
267
+ self.metadata = data.fetch(:metadata, self.metadata)
268
+ self.token_type = data.fetch(:token_type, self.token_type)
269
+ self.eci = data.fetch(:eci, self.eci)
270
+ self.cryptogram = data.fetch(:cryptogram, self.cryptogram)
271
+ self.applepay_response = data.fetch(:applepay_response, self.applepay_response)
272
+ self.applepay_mid = data.fetch(:applepay_mid, self.applepay_mid)
273
+ self.payment_token = data.fetch(:payment_token, self.payment_token)
274
+ self.contact = data.fetch(:contact, self.contact)
275
+ self.shipping = data.fetch(:shipping, self.shipping)
276
+
277
+ self
278
+ end
279
+
280
+ # Create a new card.
281
+ # Params:
282
+ # +options+:: +Hash+ of options
283
+ def create(options = {})
284
+ self.prefill(options)
285
+
286
+ request = Request.new(@client)
287
+ path = "/cards"
288
+ data = {
289
+
290
+ }
291
+
292
+ response = Response.new(request.post(path, data, options))
293
+ return_values = Array.new
294
+
295
+ body = response.body
296
+ body = body["card"]
297
+
298
+
299
+ obj = CardCreateRequest.new(@client)
300
+ return_values.push(obj.fill_with_data(body))
301
+
302
+
303
+
304
+ return_values[0]
305
+ end
306
+
307
+
308
+ end
309
+ end
@@ -0,0 +1,148 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class CardShipping
10
+
11
+ attr_reader :address1
12
+ attr_reader :address2
13
+ attr_reader :city
14
+ attr_reader :state
15
+ attr_reader :country_code
16
+ attr_reader :zip
17
+ attr_reader :phone
18
+
19
+
20
+ def address1=(val)
21
+ @address1 = val
22
+ end
23
+
24
+ def address2=(val)
25
+ @address2 = val
26
+ end
27
+
28
+ def city=(val)
29
+ @city = val
30
+ end
31
+
32
+ def state=(val)
33
+ @state = val
34
+ end
35
+
36
+ def country_code=(val)
37
+ @country_code = val
38
+ end
39
+
40
+ def zip=(val)
41
+ @zip = val
42
+ end
43
+
44
+ def phone=(val)
45
+ if val.nil?
46
+ @phone = val
47
+ return
48
+ end
49
+
50
+ if val.instance_of? Phone
51
+ @phone = val
52
+ else
53
+ obj = Phone.new(@client)
54
+ obj.fill_with_data(val)
55
+ @phone = obj
56
+ end
57
+
58
+ end
59
+
60
+
61
+ # Initializes the CardShipping 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.address1 = data.fetch(:address1, nil)
69
+ self.address2 = data.fetch(:address2, nil)
70
+ self.city = data.fetch(:city, nil)
71
+ self.state = data.fetch(:state, nil)
72
+ self.country_code = data.fetch(:country_code, nil)
73
+ self.zip = data.fetch(:zip, nil)
74
+ self.phone = data.fetch(:phone, nil)
75
+
76
+ end
77
+
78
+ # Create a new CardShipping using the current client
79
+ def new(data = {})
80
+ CardShipping.new(@client, data)
81
+ end
82
+
83
+ # Overrides the JSON marshaller to only send the fields we want
84
+ def to_json(options)
85
+ {
86
+ "address1": self.address1,
87
+ "address2": self.address2,
88
+ "city": self.city,
89
+ "state": self.state,
90
+ "country_code": self.country_code,
91
+ "zip": self.zip,
92
+ "phone": self.phone,
93
+ }.to_json
94
+ end
95
+
96
+ # Fills the object with data coming from the API
97
+ # Params:
98
+ # +data+:: +Hash+ of data coming from the API
99
+ def fill_with_data(data)
100
+ if data.nil?
101
+ return self
102
+ end
103
+ if data.include? "address1"
104
+ self.address1 = data["address1"]
105
+ end
106
+ if data.include? "address2"
107
+ self.address2 = data["address2"]
108
+ end
109
+ if data.include? "city"
110
+ self.city = data["city"]
111
+ end
112
+ if data.include? "state"
113
+ self.state = data["state"]
114
+ end
115
+ if data.include? "country_code"
116
+ self.country_code = data["country_code"]
117
+ end
118
+ if data.include? "zip"
119
+ self.zip = data["zip"]
120
+ end
121
+ if data.include? "phone"
122
+ self.phone = data["phone"]
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Prefills the object with the data passed as parameters
129
+ # Params:
130
+ # +data+:: +Hash+ of data
131
+ def prefill(data)
132
+ if data.nil?
133
+ return self
134
+ end
135
+ self.address1 = data.fetch(:address1, self.address1)
136
+ self.address2 = data.fetch(:address2, self.address2)
137
+ self.city = data.fetch(:city, self.city)
138
+ self.state = data.fetch(:state, self.state)
139
+ self.country_code = data.fetch(:country_code, self.country_code)
140
+ self.zip = data.fetch(:zip, self.zip)
141
+ self.phone = data.fetch(:phone, self.phone)
142
+
143
+ self
144
+ end
145
+
146
+
147
+ end
148
+ end
@@ -0,0 +1,120 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class CardUpdateRequest
10
+
11
+ attr_reader :update_type
12
+ attr_reader :update_reason
13
+ attr_reader :preferred_scheme
14
+
15
+
16
+ def update_type=(val)
17
+ @update_type = val
18
+ end
19
+
20
+ def update_reason=(val)
21
+ @update_reason = val
22
+ end
23
+
24
+ def preferred_scheme=(val)
25
+ @preferred_scheme = val
26
+ end
27
+
28
+
29
+ # Initializes the CardUpdateRequest object
30
+ # Params:
31
+ # +client+:: +ProcessOut+ client instance
32
+ # +data+:: data that can be used to fill the object
33
+ def initialize(client, data = {})
34
+ @client = client
35
+
36
+ self.update_type = data.fetch(:update_type, nil)
37
+ self.update_reason = data.fetch(:update_reason, nil)
38
+ self.preferred_scheme = data.fetch(:preferred_scheme, nil)
39
+
40
+ end
41
+
42
+ # Create a new CardUpdateRequest using the current client
43
+ def new(data = {})
44
+ CardUpdateRequest.new(@client, data)
45
+ end
46
+
47
+ # Overrides the JSON marshaller to only send the fields we want
48
+ def to_json(options)
49
+ {
50
+ "update_type": self.update_type,
51
+ "update_reason": self.update_reason,
52
+ "preferred_scheme": self.preferred_scheme,
53
+ }.to_json
54
+ end
55
+
56
+ # Fills the object with data coming from the API
57
+ # Params:
58
+ # +data+:: +Hash+ of data coming from the API
59
+ def fill_with_data(data)
60
+ if data.nil?
61
+ return self
62
+ end
63
+ if data.include? "update_type"
64
+ self.update_type = data["update_type"]
65
+ end
66
+ if data.include? "update_reason"
67
+ self.update_reason = data["update_reason"]
68
+ end
69
+ if data.include? "preferred_scheme"
70
+ self.preferred_scheme = data["preferred_scheme"]
71
+ end
72
+
73
+ self
74
+ end
75
+
76
+ # Prefills the object with the data passed as parameters
77
+ # Params:
78
+ # +data+:: +Hash+ of data
79
+ def prefill(data)
80
+ if data.nil?
81
+ return self
82
+ end
83
+ self.update_type = data.fetch(:update_type, self.update_type)
84
+ self.update_reason = data.fetch(:update_reason, self.update_reason)
85
+ self.preferred_scheme = data.fetch(:preferred_scheme, self.preferred_scheme)
86
+
87
+ self
88
+ end
89
+
90
+ # Update a card by its ID.
91
+ # Params:
92
+ # +card_id+:: ID of the card
93
+ # +options+:: +Hash+ of options
94
+ def update(card_id, options = {})
95
+ self.prefill(options)
96
+
97
+ request = Request.new(@client)
98
+ path = "/cards/" + CGI.escape(card_id) + ""
99
+ data = {
100
+
101
+ }
102
+
103
+ response = Response.new(request.put(path, data, options))
104
+ return_values = Array.new
105
+
106
+ body = response.body
107
+ body = body["card"]
108
+
109
+
110
+ obj = CardUpdateRequest.new(@client)
111
+ return_values.push(obj.fill_with_data(body))
112
+
113
+
114
+
115
+ return_values[0]
116
+ end
117
+
118
+
119
+ end
120
+ end
@@ -0,0 +1,202 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class Device
10
+
11
+ attr_reader :request_origin
12
+ attr_reader :id
13
+ attr_reader :channel
14
+ attr_reader :ip_address
15
+ attr_reader :user_agent
16
+ attr_reader :header_accept
17
+ attr_reader :header_referer
18
+ attr_reader :app_color_depth
19
+ attr_reader :app_java_enabled
20
+ attr_reader :app_language
21
+ attr_reader :app_screen_height
22
+ attr_reader :app_screen_width
23
+ attr_reader :app_timezone_offset
24
+
25
+
26
+ def request_origin=(val)
27
+ @request_origin = val
28
+ end
29
+
30
+ def id=(val)
31
+ @id = val
32
+ end
33
+
34
+ def channel=(val)
35
+ @channel = val
36
+ end
37
+
38
+ def ip_address=(val)
39
+ @ip_address = val
40
+ end
41
+
42
+ def user_agent=(val)
43
+ @user_agent = val
44
+ end
45
+
46
+ def header_accept=(val)
47
+ @header_accept = val
48
+ end
49
+
50
+ def header_referer=(val)
51
+ @header_referer = val
52
+ end
53
+
54
+ def app_color_depth=(val)
55
+ @app_color_depth = val
56
+ end
57
+
58
+ def app_java_enabled=(val)
59
+ @app_java_enabled = val
60
+ end
61
+
62
+ def app_language=(val)
63
+ @app_language = val
64
+ end
65
+
66
+ def app_screen_height=(val)
67
+ @app_screen_height = val
68
+ end
69
+
70
+ def app_screen_width=(val)
71
+ @app_screen_width = val
72
+ end
73
+
74
+ def app_timezone_offset=(val)
75
+ @app_timezone_offset = val
76
+ end
77
+
78
+
79
+ # Initializes the Device object
80
+ # Params:
81
+ # +client+:: +ProcessOut+ client instance
82
+ # +data+:: data that can be used to fill the object
83
+ def initialize(client, data = {})
84
+ @client = client
85
+
86
+ self.request_origin = data.fetch(:request_origin, nil)
87
+ self.id = data.fetch(:id, nil)
88
+ self.channel = data.fetch(:channel, nil)
89
+ self.ip_address = data.fetch(:ip_address, nil)
90
+ self.user_agent = data.fetch(:user_agent, nil)
91
+ self.header_accept = data.fetch(:header_accept, nil)
92
+ self.header_referer = data.fetch(:header_referer, nil)
93
+ self.app_color_depth = data.fetch(:app_color_depth, nil)
94
+ self.app_java_enabled = data.fetch(:app_java_enabled, nil)
95
+ self.app_language = data.fetch(:app_language, nil)
96
+ self.app_screen_height = data.fetch(:app_screen_height, nil)
97
+ self.app_screen_width = data.fetch(:app_screen_width, nil)
98
+ self.app_timezone_offset = data.fetch(:app_timezone_offset, nil)
99
+
100
+ end
101
+
102
+ # Create a new Device using the current client
103
+ def new(data = {})
104
+ Device.new(@client, data)
105
+ end
106
+
107
+ # Overrides the JSON marshaller to only send the fields we want
108
+ def to_json(options)
109
+ {
110
+ "request_origin": self.request_origin,
111
+ "id": self.id,
112
+ "channel": self.channel,
113
+ "ip_address": self.ip_address,
114
+ "user_agent": self.user_agent,
115
+ "header_accept": self.header_accept,
116
+ "header_referer": self.header_referer,
117
+ "app_color_depth": self.app_color_depth,
118
+ "app_java_enabled": self.app_java_enabled,
119
+ "app_language": self.app_language,
120
+ "app_screen_height": self.app_screen_height,
121
+ "app_screen_width": self.app_screen_width,
122
+ "app_timezone_offset": self.app_timezone_offset,
123
+ }.to_json
124
+ end
125
+
126
+ # Fills the object with data coming from the API
127
+ # Params:
128
+ # +data+:: +Hash+ of data coming from the API
129
+ def fill_with_data(data)
130
+ if data.nil?
131
+ return self
132
+ end
133
+ if data.include? "request_origin"
134
+ self.request_origin = data["request_origin"]
135
+ end
136
+ if data.include? "id"
137
+ self.id = data["id"]
138
+ end
139
+ if data.include? "channel"
140
+ self.channel = data["channel"]
141
+ end
142
+ if data.include? "ip_address"
143
+ self.ip_address = data["ip_address"]
144
+ end
145
+ if data.include? "user_agent"
146
+ self.user_agent = data["user_agent"]
147
+ end
148
+ if data.include? "header_accept"
149
+ self.header_accept = data["header_accept"]
150
+ end
151
+ if data.include? "header_referer"
152
+ self.header_referer = data["header_referer"]
153
+ end
154
+ if data.include? "app_color_depth"
155
+ self.app_color_depth = data["app_color_depth"]
156
+ end
157
+ if data.include? "app_java_enabled"
158
+ self.app_java_enabled = data["app_java_enabled"]
159
+ end
160
+ if data.include? "app_language"
161
+ self.app_language = data["app_language"]
162
+ end
163
+ if data.include? "app_screen_height"
164
+ self.app_screen_height = data["app_screen_height"]
165
+ end
166
+ if data.include? "app_screen_width"
167
+ self.app_screen_width = data["app_screen_width"]
168
+ end
169
+ if data.include? "app_timezone_offset"
170
+ self.app_timezone_offset = data["app_timezone_offset"]
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Prefills the object with the data passed as parameters
177
+ # Params:
178
+ # +data+:: +Hash+ of data
179
+ def prefill(data)
180
+ if data.nil?
181
+ return self
182
+ end
183
+ self.request_origin = data.fetch(:request_origin, self.request_origin)
184
+ self.id = data.fetch(:id, self.id)
185
+ self.channel = data.fetch(:channel, self.channel)
186
+ self.ip_address = data.fetch(:ip_address, self.ip_address)
187
+ self.user_agent = data.fetch(:user_agent, self.user_agent)
188
+ self.header_accept = data.fetch(:header_accept, self.header_accept)
189
+ self.header_referer = data.fetch(:header_referer, self.header_referer)
190
+ self.app_color_depth = data.fetch(:app_color_depth, self.app_color_depth)
191
+ self.app_java_enabled = data.fetch(:app_java_enabled, self.app_java_enabled)
192
+ self.app_language = data.fetch(:app_language, self.app_language)
193
+ self.app_screen_height = data.fetch(:app_screen_height, self.app_screen_height)
194
+ self.app_screen_width = data.fetch(:app_screen_width, self.app_screen_width)
195
+ self.app_timezone_offset = data.fetch(:app_timezone_offset, self.app_timezone_offset)
196
+
197
+ self
198
+ end
199
+
200
+
201
+ end
202
+ end
@@ -13,7 +13,7 @@ module ProcessOut
13
13
  req.basic_auth @client.project_id, @client.project_secret
14
14
  req.content_type = "application/json"
15
15
  req["API-Version"] = "1.4.0.0"
16
- req["User-Agent"] = "ProcessOut Ruby-Bindings/2.28.0"
16
+ req["User-Agent"] = "ProcessOut Ruby-Bindings/2.29.0"
17
17
 
18
18
  unless options.nil?
19
19
  req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
@@ -21,6 +21,7 @@ module ProcessOut
21
21
  attr_reader :fees
22
22
  attr_reader :metadata
23
23
  attr_reader :created_at
24
+ attr_reader :breakdown
24
25
 
25
26
 
26
27
  def id=(val)
@@ -111,6 +112,22 @@ module ProcessOut
111
112
  @created_at = val
112
113
  end
113
114
 
115
+ def breakdown=(val)
116
+ if val.nil?
117
+ @breakdown = val
118
+ return
119
+ end
120
+
121
+ if val.instance_of? PayoutItemAmountBreakdowns
122
+ @breakdown = val
123
+ else
124
+ obj = PayoutItemAmountBreakdowns.new(@client)
125
+ obj.fill_with_data(val)
126
+ @breakdown = obj
127
+ end
128
+
129
+ end
130
+
114
131
 
115
132
  # Initializes the PayoutItem object
116
133
  # Params:
@@ -132,6 +149,7 @@ module ProcessOut
132
149
  self.fees = data.fetch(:fees, nil)
133
150
  self.metadata = data.fetch(:metadata, nil)
134
151
  self.created_at = data.fetch(:created_at, nil)
152
+ self.breakdown = data.fetch(:breakdown, nil)
135
153
 
136
154
  end
137
155
 
@@ -156,6 +174,7 @@ module ProcessOut
156
174
  "fees": self.fees,
157
175
  "metadata": self.metadata,
158
176
  "created_at": self.created_at,
177
+ "breakdown": self.breakdown,
159
178
  }.to_json
160
179
  end
161
180
 
@@ -205,6 +224,9 @@ module ProcessOut
205
224
  if data.include? "created_at"
206
225
  self.created_at = data["created_at"]
207
226
  end
227
+ if data.include? "breakdown"
228
+ self.breakdown = data["breakdown"]
229
+ end
208
230
 
209
231
  self
210
232
  end
@@ -229,6 +251,7 @@ module ProcessOut
229
251
  self.fees = data.fetch(:fees, self.fees)
230
252
  self.metadata = data.fetch(:metadata, self.metadata)
231
253
  self.created_at = data.fetch(:created_at, self.created_at)
254
+ self.breakdown = data.fetch(:breakdown, self.breakdown)
232
255
 
233
256
  self
234
257
  end
@@ -0,0 +1,125 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class PayoutItemAmountBreakdowns
10
+
11
+ attr_reader :scheme_fee
12
+ attr_reader :interchange_fee
13
+ attr_reader :gateway_fee
14
+ attr_reader :markup_fee
15
+ attr_reader :acquirer_fee
16
+ attr_reader :other_fee
17
+
18
+
19
+ def scheme_fee=(val)
20
+ @scheme_fee = val
21
+ end
22
+
23
+ def interchange_fee=(val)
24
+ @interchange_fee = val
25
+ end
26
+
27
+ def gateway_fee=(val)
28
+ @gateway_fee = val
29
+ end
30
+
31
+ def markup_fee=(val)
32
+ @markup_fee = val
33
+ end
34
+
35
+ def acquirer_fee=(val)
36
+ @acquirer_fee = val
37
+ end
38
+
39
+ def other_fee=(val)
40
+ @other_fee = val
41
+ end
42
+
43
+
44
+ # Initializes the PayoutItemAmountBreakdowns object
45
+ # Params:
46
+ # +client+:: +ProcessOut+ client instance
47
+ # +data+:: data that can be used to fill the object
48
+ def initialize(client, data = {})
49
+ @client = client
50
+
51
+ self.scheme_fee = data.fetch(:scheme_fee, nil)
52
+ self.interchange_fee = data.fetch(:interchange_fee, nil)
53
+ self.gateway_fee = data.fetch(:gateway_fee, nil)
54
+ self.markup_fee = data.fetch(:markup_fee, nil)
55
+ self.acquirer_fee = data.fetch(:acquirer_fee, nil)
56
+ self.other_fee = data.fetch(:other_fee, nil)
57
+
58
+ end
59
+
60
+ # Create a new PayoutItemAmountBreakdowns using the current client
61
+ def new(data = {})
62
+ PayoutItemAmountBreakdowns.new(@client, data)
63
+ end
64
+
65
+ # Overrides the JSON marshaller to only send the fields we want
66
+ def to_json(options)
67
+ {
68
+ "scheme_fee": self.scheme_fee,
69
+ "interchange_fee": self.interchange_fee,
70
+ "gateway_fee": self.gateway_fee,
71
+ "markup_fee": self.markup_fee,
72
+ "acquirer_fee": self.acquirer_fee,
73
+ "other_fee": self.other_fee,
74
+ }.to_json
75
+ end
76
+
77
+ # Fills the object with data coming from the API
78
+ # Params:
79
+ # +data+:: +Hash+ of data coming from the API
80
+ def fill_with_data(data)
81
+ if data.nil?
82
+ return self
83
+ end
84
+ if data.include? "scheme_fee"
85
+ self.scheme_fee = data["scheme_fee"]
86
+ end
87
+ if data.include? "interchange_fee"
88
+ self.interchange_fee = data["interchange_fee"]
89
+ end
90
+ if data.include? "gateway_fee"
91
+ self.gateway_fee = data["gateway_fee"]
92
+ end
93
+ if data.include? "markup_fee"
94
+ self.markup_fee = data["markup_fee"]
95
+ end
96
+ if data.include? "acquirer_fee"
97
+ self.acquirer_fee = data["acquirer_fee"]
98
+ end
99
+ if data.include? "other_fee"
100
+ self.other_fee = data["other_fee"]
101
+ end
102
+
103
+ self
104
+ end
105
+
106
+ # Prefills the object with the data passed as parameters
107
+ # Params:
108
+ # +data+:: +Hash+ of data
109
+ def prefill(data)
110
+ if data.nil?
111
+ return self
112
+ end
113
+ self.scheme_fee = data.fetch(:scheme_fee, self.scheme_fee)
114
+ self.interchange_fee = data.fetch(:interchange_fee, self.interchange_fee)
115
+ self.gateway_fee = data.fetch(:gateway_fee, self.gateway_fee)
116
+ self.markup_fee = data.fetch(:markup_fee, self.markup_fee)
117
+ self.acquirer_fee = data.fetch(:acquirer_fee, self.acquirer_fee)
118
+ self.other_fee = data.fetch(:other_fee, self.other_fee)
119
+
120
+ self
121
+ end
122
+
123
+
124
+ end
125
+ end
@@ -0,0 +1,81 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class Phone
10
+
11
+ attr_reader :number
12
+ attr_reader :dialing_code
13
+
14
+
15
+ def number=(val)
16
+ @number = val
17
+ end
18
+
19
+ def dialing_code=(val)
20
+ @dialing_code = val
21
+ end
22
+
23
+
24
+ # Initializes the Phone object
25
+ # Params:
26
+ # +client+:: +ProcessOut+ client instance
27
+ # +data+:: data that can be used to fill the object
28
+ def initialize(client, data = {})
29
+ @client = client
30
+
31
+ self.number = data.fetch(:number, nil)
32
+ self.dialing_code = data.fetch(:dialing_code, nil)
33
+
34
+ end
35
+
36
+ # Create a new Phone using the current client
37
+ def new(data = {})
38
+ Phone.new(@client, data)
39
+ end
40
+
41
+ # Overrides the JSON marshaller to only send the fields we want
42
+ def to_json(options)
43
+ {
44
+ "number": self.number,
45
+ "dialing_code": self.dialing_code,
46
+ }.to_json
47
+ end
48
+
49
+ # Fills the object with data coming from the API
50
+ # Params:
51
+ # +data+:: +Hash+ of data coming from the API
52
+ def fill_with_data(data)
53
+ if data.nil?
54
+ return self
55
+ end
56
+ if data.include? "number"
57
+ self.number = data["number"]
58
+ end
59
+ if data.include? "dialing_code"
60
+ self.dialing_code = data["dialing_code"]
61
+ end
62
+
63
+ self
64
+ end
65
+
66
+ # Prefills the object with the data passed as parameters
67
+ # Params:
68
+ # +data+:: +Hash+ of data
69
+ def prefill(data)
70
+ if data.nil?
71
+ return self
72
+ end
73
+ self.number = data.fetch(:number, self.number)
74
+ self.dialing_code = data.fetch(:dialing_code, self.dialing_code)
75
+
76
+ self
77
+ end
78
+
79
+
80
+ end
81
+ end
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "2.28.0"
2
+ VERSION = "2.29.0"
3
3
  end
data/lib/processout.rb CHANGED
@@ -9,6 +9,7 @@ require "processout/balances"
9
9
  require "processout/balance"
10
10
  require "processout/card"
11
11
  require "processout/card_information"
12
+ require "processout/phone"
12
13
  require "processout/coupon"
13
14
  require "processout/customer"
14
15
  require "processout/customer_phone"
@@ -33,6 +34,7 @@ require "processout/customer_action"
33
34
  require "processout/dunning_action"
34
35
  require "processout/payout"
35
36
  require "processout/payout_item"
37
+ require "processout/payout_item_amount_breakdowns"
36
38
  require "processout/plan"
37
39
  require "processout/product"
38
40
  require "processout/project"
@@ -50,6 +52,11 @@ require "processout/payment_data_three_ds_authentication"
50
52
  require "processout/transaction_operation"
51
53
  require "processout/webhook"
52
54
  require "processout/webhook_endpoint"
55
+ require "processout/card_create_request"
56
+ require "processout/device"
57
+ require "processout/card_contact"
58
+ require "processout/card_shipping"
59
+ require "processout/card_update_request"
53
60
  require "processout/error_codes"
54
61
  require "processout/category_error_codes"
55
62
  require "processout/native_apm_transaction_details_gateway"
@@ -113,6 +120,11 @@ module ProcessOut
113
120
  obj = CardInformation.new(self, data)
114
121
  end
115
122
 
123
+ # Create a new Phone instance
124
+ def phone(data = {})
125
+ obj = Phone.new(self, data)
126
+ end
127
+
116
128
  # Create a new Coupon instance
117
129
  def coupon(data = {})
118
130
  obj = Coupon.new(self, data)
@@ -233,6 +245,11 @@ module ProcessOut
233
245
  obj = PayoutItem.new(self, data)
234
246
  end
235
247
 
248
+ # Create a new PayoutItemAmountBreakdowns instance
249
+ def payout_item_amount_breakdowns(data = {})
250
+ obj = PayoutItemAmountBreakdowns.new(self, data)
251
+ end
252
+
236
253
  # Create a new Plan instance
237
254
  def plan(data = {})
238
255
  obj = Plan.new(self, data)
@@ -318,6 +335,31 @@ module ProcessOut
318
335
  obj = WebhookEndpoint.new(self, data)
319
336
  end
320
337
 
338
+ # Create a new CardCreateRequest instance
339
+ def card_create_request(data = {})
340
+ obj = CardCreateRequest.new(self, data)
341
+ end
342
+
343
+ # Create a new Device instance
344
+ def device(data = {})
345
+ obj = Device.new(self, data)
346
+ end
347
+
348
+ # Create a new CardContact instance
349
+ def card_contact(data = {})
350
+ obj = CardContact.new(self, data)
351
+ end
352
+
353
+ # Create a new CardShipping instance
354
+ def card_shipping(data = {})
355
+ obj = CardShipping.new(self, data)
356
+ end
357
+
358
+ # Create a new CardUpdateRequest instance
359
+ def card_update_request(data = {})
360
+ obj = CardUpdateRequest.new(self, data)
361
+ end
362
+
321
363
  # Create a new ErrorCodes instance
322
364
  def error_codes(data = {})
323
365
  obj = ErrorCodes.new(self, data)
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: 2.28.0
4
+ version: 2.29.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: 2024-02-16 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,12 +82,17 @@ files:
82
82
  - lib/processout/balance.rb
83
83
  - lib/processout/balances.rb
84
84
  - lib/processout/card.rb
85
+ - lib/processout/card_contact.rb
86
+ - lib/processout/card_create_request.rb
85
87
  - lib/processout/card_information.rb
88
+ - lib/processout/card_shipping.rb
89
+ - lib/processout/card_update_request.rb
86
90
  - lib/processout/category_error_codes.rb
87
91
  - lib/processout/coupon.rb
88
92
  - lib/processout/customer.rb
89
93
  - lib/processout/customer_action.rb
90
94
  - lib/processout/customer_phone.rb
95
+ - lib/processout/device.rb
91
96
  - lib/processout/discount.rb
92
97
  - lib/processout/dunning_action.rb
93
98
  - lib/processout/error_codes.rb
@@ -125,6 +130,8 @@ files:
125
130
  - lib/processout/payment_data_three_ds_request.rb
126
131
  - lib/processout/payout.rb
127
132
  - lib/processout/payout_item.rb
133
+ - lib/processout/payout_item_amount_breakdowns.rb
134
+ - lib/processout/phone.rb
128
135
  - lib/processout/plan.rb
129
136
  - lib/processout/product.rb
130
137
  - lib/processout/project.rb