processout 2.10.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba44b37eeda481e648c0ce8e053cc1fffe01ef91
4
- data.tar.gz: c5a93b413cc6b8558e908b3d6c3e92f1a881c5d1
3
+ metadata.gz: 13f4ad30b2ad834076735be1d4cbeeb2906e1bc6
4
+ data.tar.gz: dbd93f0556a3d448d86160fce717ef5c1bb7a949
5
5
  SHA512:
6
- metadata.gz: 9c702ab254ba06529dfc467f1d55b2203491d809b9aa08e1aa5b204ca55fa3fbf746548caccb6bcbfa1cc7175af6d2b9d83bca8e6d53de053a4fea309a76c80c
7
- data.tar.gz: 3540d3899241a532f336e1241d5a5ae1715cc1e909402ea991873d4f92cb6b51d018c31b478b2fda403b14b583e509e94843527ab4343a999b0e17cc5f2568cf
6
+ metadata.gz: 6fc76ce22f5529b44be62c7caa0970452d8df105546915e857eae9dd8099ab1ba8b3d3858d1c396ed9ebcbd824d3951f8e072312fdd5b54088374e1e4648d626
7
+ data.tar.gz: c7346af3770313619191962ddab1fa768a87eda0b7757197999719fd9d9daeb4856f10b9abd638fc7afc0a1d6837c5c3add1d88f7d0c5208f3db67410021a048
@@ -0,0 +1,7 @@
1
+ FROM ruby:2
2
+
3
+ RUN gem install rspec
4
+
5
+ WORKDIR /ruby
6
+
7
+ COPY . .
data/Makefile CHANGED
@@ -1,2 +1,4 @@
1
+ .PHONY: test
1
2
  test:
2
- rspec
3
+ docker build -t fountain-ruby .
4
+ docker run -ti --rm fountain-ruby rspec
@@ -15,6 +15,9 @@ require "processout/event"
15
15
  require "processout/gateway"
16
16
  require "processout/gateway_configuration"
17
17
  require "processout/invoice"
18
+ require "processout/invoice_risk"
19
+ require "processout/invoice_device"
20
+ require "processout/invoice_shipping"
18
21
  require "processout/invoice_detail"
19
22
  require "processout/customer_action"
20
23
  require "processout/dunning_action"
@@ -119,6 +122,21 @@ module ProcessOut
119
122
  obj = Invoice.new(self, data)
120
123
  end
121
124
 
125
+ # Create a new InvoiceRisk instance
126
+ def invoice_risk(data = {})
127
+ obj = InvoiceRisk.new(self, data)
128
+ end
129
+
130
+ # Create a new InvoiceDevice instance
131
+ def invoice_device(data = {})
132
+ obj = InvoiceDevice.new(self, data)
133
+ end
134
+
135
+ # Create a new InvoiceShipping instance
136
+ def invoice_shipping(data = {})
137
+ obj = InvoiceShipping.new(self, data)
138
+ end
139
+
122
140
  # Create a new InvoiceDetail instance
123
141
  def invoice_detail(data = {})
124
142
  obj = InvoiceDetail.new(self, data)
@@ -12,6 +12,8 @@ module ProcessOut
12
12
  attr_reader :project_id
13
13
  attr_reader :token
14
14
  attr_reader :scheme
15
+ attr_reader :co_scheme
16
+ attr_reader :preferred_scheme
15
17
  attr_reader :type
16
18
  attr_reader :bank_name
17
19
  attr_reader :brand
@@ -80,6 +82,14 @@ module ProcessOut
80
82
  @scheme = val
81
83
  end
82
84
 
85
+ def co_scheme=(val)
86
+ @co_scheme = val
87
+ end
88
+
89
+ def preferred_scheme=(val)
90
+ @preferred_scheme = val
91
+ end
92
+
83
93
  def type=(val)
84
94
  @type = val
85
95
  end
@@ -181,6 +191,8 @@ module ProcessOut
181
191
  self.project_id = data.fetch(:project_id, nil)
182
192
  self.token = data.fetch(:token, nil)
183
193
  self.scheme = data.fetch(:scheme, nil)
194
+ self.co_scheme = data.fetch(:co_scheme, nil)
195
+ self.preferred_scheme = data.fetch(:preferred_scheme, nil)
184
196
  self.type = data.fetch(:type, nil)
185
197
  self.bank_name = data.fetch(:bank_name, nil)
186
198
  self.brand = data.fetch(:brand, nil)
@@ -233,6 +245,12 @@ module ProcessOut
233
245
  if data.include? "scheme"
234
246
  self.scheme = data["scheme"]
235
247
  end
248
+ if data.include? "co_scheme"
249
+ self.co_scheme = data["co_scheme"]
250
+ end
251
+ if data.include? "preferred_scheme"
252
+ self.preferred_scheme = data["preferred_scheme"]
253
+ end
236
254
  if data.include? "type"
237
255
  self.type = data["type"]
238
256
  end
@@ -315,6 +333,8 @@ module ProcessOut
315
333
  self.project_id = data.fetch(:project_id, self.project_id)
316
334
  self.token = data.fetch(:token, self.token)
317
335
  self.scheme = data.fetch(:scheme, self.scheme)
336
+ self.co_scheme = data.fetch(:co_scheme, self.co_scheme)
337
+ self.preferred_scheme = data.fetch(:preferred_scheme, self.preferred_scheme)
318
338
  self.type = data.fetch(:type, self.type)
319
339
  self.bank_name = data.fetch(:bank_name, self.bank_name)
320
340
  self.brand = data.fetch(:brand, self.brand)
@@ -29,6 +29,8 @@ module ProcessOut
29
29
  attr_reader :ip_address
30
30
  attr_reader :phone_number
31
31
  attr_reader :legal_document
32
+ attr_reader :sex
33
+ attr_reader :is_business
32
34
  attr_reader :metadata
33
35
  attr_reader :sandbox
34
36
  attr_reader :created_at
@@ -194,6 +196,14 @@ module ProcessOut
194
196
  @legal_document = val
195
197
  end
196
198
 
199
+ def sex=(val)
200
+ @sex = val
201
+ end
202
+
203
+ def is_business=(val)
204
+ @is_business = val
205
+ end
206
+
197
207
  def metadata=(val)
198
208
  @metadata = val
199
209
  end
@@ -236,6 +246,8 @@ module ProcessOut
236
246
  self.ip_address = data.fetch(:ip_address, nil)
237
247
  self.phone_number = data.fetch(:phone_number, nil)
238
248
  self.legal_document = data.fetch(:legal_document, nil)
249
+ self.sex = data.fetch(:sex, nil)
250
+ self.is_business = data.fetch(:is_business, nil)
239
251
  self.metadata = data.fetch(:metadata, nil)
240
252
  self.sandbox = data.fetch(:sandbox, nil)
241
253
  self.created_at = data.fetch(:created_at, nil)
@@ -320,6 +332,12 @@ module ProcessOut
320
332
  if data.include? "legal_document"
321
333
  self.legal_document = data["legal_document"]
322
334
  end
335
+ if data.include? "sex"
336
+ self.sex = data["sex"]
337
+ end
338
+ if data.include? "is_business"
339
+ self.is_business = data["is_business"]
340
+ end
323
341
  if data.include? "metadata"
324
342
  self.metadata = data["metadata"]
325
343
  end
@@ -362,6 +380,8 @@ module ProcessOut
362
380
  self.ip_address = data.fetch(:ip_address, self.ip_address)
363
381
  self.phone_number = data.fetch(:phone_number, self.phone_number)
364
382
  self.legal_document = data.fetch(:legal_document, self.legal_document)
383
+ self.sex = data.fetch(:sex, self.sex)
384
+ self.is_business = data.fetch(:is_business, self.is_business)
365
385
  self.metadata = data.fetch(:metadata, self.metadata)
366
386
  self.sandbox = data.fetch(:sandbox, self.sandbox)
367
387
  self.created_at = data.fetch(:created_at, self.created_at)
@@ -581,6 +601,8 @@ module ProcessOut
581
601
  "ip_address" => @ip_address,
582
602
  "phone_number" => @phone_number,
583
603
  "legal_document" => @legal_document,
604
+ "is_business" => @is_business,
605
+ "sex" => @sex,
584
606
  "metadata" => @metadata,
585
607
  "id" => @id
586
608
  }
@@ -650,6 +672,8 @@ module ProcessOut
650
672
  "ip_address" => @ip_address,
651
673
  "phone_number" => @phone_number,
652
674
  "legal_document" => @legal_document,
675
+ "is_business" => @is_business,
676
+ "sex" => @sex,
653
677
  "metadata" => @metadata
654
678
  }
655
679
 
@@ -215,6 +215,37 @@ module ProcessOut
215
215
 
216
216
 
217
217
 
218
+ return_values[0]
219
+ end
220
+
221
+ # Find an event by the Resource ID that generated it.
222
+ # Params:
223
+ # +resource_id+:: Resource ID
224
+ # +options+:: +Hash+ of options
225
+ def find_by_resource_id(resource_id, options = {})
226
+ self.prefill(options)
227
+
228
+ request = Request.new(@client)
229
+ path = "/events/by_resource_id/" + CGI.escape(resource_id) + ""
230
+ data = {
231
+
232
+ }
233
+
234
+ response = Response.new(request.get(path, data, options))
235
+ return_values = Array.new
236
+
237
+ a = Array.new
238
+ body = response.body
239
+ for v in body['events']
240
+ tmp = Event.new(@client)
241
+ tmp.fill_with_data(v)
242
+ a.push(tmp)
243
+ end
244
+
245
+ return_values.push(a)
246
+
247
+
248
+
218
249
  return_values[0]
219
250
  end
220
251
 
@@ -13,8 +13,6 @@ module ProcessOut
13
13
  attr_reader :gateway
14
14
  attr_reader :gateway_id
15
15
  attr_reader :name
16
- attr_reader :fee_fixed
17
- attr_reader :fee_percentage
18
16
  attr_reader :default_currency
19
17
  attr_reader :enabled
20
18
  attr_reader :public_keys
@@ -70,14 +68,6 @@ module ProcessOut
70
68
  @name = val
71
69
  end
72
70
 
73
- def fee_fixed=(val)
74
- @fee_fixed = val
75
- end
76
-
77
- def fee_percentage=(val)
78
- @fee_percentage = val
79
- end
80
-
81
71
  def default_currency=(val)
82
72
  @default_currency = val
83
73
  end
@@ -112,8 +102,6 @@ module ProcessOut
112
102
  self.gateway = data.fetch(:gateway, nil)
113
103
  self.gateway_id = data.fetch(:gateway_id, nil)
114
104
  self.name = data.fetch(:name, nil)
115
- self.fee_fixed = data.fetch(:fee_fixed, nil)
116
- self.fee_percentage = data.fetch(:fee_percentage, nil)
117
105
  self.default_currency = data.fetch(:default_currency, nil)
118
106
  self.enabled = data.fetch(:enabled, nil)
119
107
  self.public_keys = data.fetch(:public_keys, nil)
@@ -152,12 +140,6 @@ module ProcessOut
152
140
  if data.include? "name"
153
141
  self.name = data["name"]
154
142
  end
155
- if data.include? "fee_fixed"
156
- self.fee_fixed = data["fee_fixed"]
157
- end
158
- if data.include? "fee_percentage"
159
- self.fee_percentage = data["fee_percentage"]
160
- end
161
143
  if data.include? "default_currency"
162
144
  self.default_currency = data["default_currency"]
163
145
  end
@@ -190,8 +172,6 @@ module ProcessOut
190
172
  self.gateway = data.fetch(:gateway, self.gateway)
191
173
  self.gateway_id = data.fetch(:gateway_id, self.gateway_id)
192
174
  self.name = data.fetch(:name, self.name)
193
- self.fee_fixed = data.fetch(:fee_fixed, self.fee_fixed)
194
- self.fee_percentage = data.fetch(:fee_percentage, self.fee_percentage)
195
175
  self.default_currency = data.fetch(:default_currency, self.default_currency)
196
176
  self.enabled = data.fetch(:enabled, self.enabled)
197
177
  self.public_keys = data.fetch(:public_keys, self.public_keys)
@@ -271,10 +251,9 @@ module ProcessOut
271
251
  "id" => @id,
272
252
  "name" => @name,
273
253
  "enabled" => @enabled,
274
- "fee_fixed" => @fee_fixed,
275
- "fee_percentage" => @fee_percentage,
276
254
  "default_currency" => @default_currency,
277
- "settings" => options.fetch(:settings, nil)
255
+ "settings" => options.fetch(:settings, nil),
256
+ "sub_accounts_enabled" => options.fetch(:sub_accounts_enabled, nil)
278
257
  }
279
258
 
280
259
  response = Response.new(request.put(path, data, options))
@@ -325,10 +304,9 @@ module ProcessOut
325
304
  "id" => @id,
326
305
  "name" => @name,
327
306
  "enabled" => @enabled,
328
- "fee_fixed" => @fee_fixed,
329
- "fee_percentage" => @fee_percentage,
330
307
  "default_currency" => @default_currency,
331
- "settings" => options.fetch(:settings, nil)
308
+ "settings" => options.fetch(:settings, nil),
309
+ "sub_accounts_enabled" => options.fetch(:sub_accounts_enabled, nil)
332
310
  }
333
311
 
334
312
  response = Response.new(request.post(path, data, options))
@@ -34,6 +34,9 @@ module ProcessOut
34
34
  attr_reader :webhook_url
35
35
  attr_reader :sandbox
36
36
  attr_reader :created_at
37
+ attr_reader :risk
38
+ attr_reader :shipping
39
+ attr_reader :device
37
40
 
38
41
 
39
42
  def id=(val)
@@ -220,6 +223,54 @@ module ProcessOut
220
223
  @created_at = val
221
224
  end
222
225
 
226
+ def risk=(val)
227
+ if val.nil?
228
+ @risk = val
229
+ return
230
+ end
231
+
232
+ if val.instance_of? InvoiceRisk
233
+ @risk = val
234
+ else
235
+ obj = InvoiceRisk.new(@client)
236
+ obj.fill_with_data(val)
237
+ @risk = obj
238
+ end
239
+
240
+ end
241
+
242
+ def shipping=(val)
243
+ if val.nil?
244
+ @shipping = val
245
+ return
246
+ end
247
+
248
+ if val.instance_of? InvoiceShipping
249
+ @shipping = val
250
+ else
251
+ obj = InvoiceShipping.new(@client)
252
+ obj.fill_with_data(val)
253
+ @shipping = obj
254
+ end
255
+
256
+ end
257
+
258
+ def device=(val)
259
+ if val.nil?
260
+ @device = val
261
+ return
262
+ end
263
+
264
+ if val.instance_of? InvoiceDevice
265
+ @device = val
266
+ else
267
+ obj = InvoiceDevice.new(@client)
268
+ obj.fill_with_data(val)
269
+ @device = obj
270
+ end
271
+
272
+ end
273
+
223
274
 
224
275
  # Initializes the Invoice object
225
276
  # Params:
@@ -255,6 +306,9 @@ module ProcessOut
255
306
  self.webhook_url = data.fetch(:webhook_url, nil)
256
307
  self.sandbox = data.fetch(:sandbox, nil)
257
308
  self.created_at = data.fetch(:created_at, nil)
309
+ self.risk = data.fetch(:risk, nil)
310
+ self.shipping = data.fetch(:shipping, nil)
311
+ self.device = data.fetch(:device, nil)
258
312
 
259
313
  end
260
314
 
@@ -351,6 +405,15 @@ module ProcessOut
351
405
  if data.include? "created_at"
352
406
  self.created_at = data["created_at"]
353
407
  end
408
+ if data.include? "risk"
409
+ self.risk = data["risk"]
410
+ end
411
+ if data.include? "shipping"
412
+ self.shipping = data["shipping"]
413
+ end
414
+ if data.include? "device"
415
+ self.device = data["device"]
416
+ end
354
417
 
355
418
  self
356
419
  end
@@ -389,6 +452,9 @@ module ProcessOut
389
452
  self.webhook_url = data.fetch(:webhook_url, self.webhook_url)
390
453
  self.sandbox = data.fetch(:sandbox, self.sandbox)
391
454
  self.created_at = data.fetch(:created_at, self.created_at)
455
+ self.risk = data.fetch(:risk, self.risk)
456
+ self.shipping = data.fetch(:shipping, self.shipping)
457
+ self.device = data.fetch(:device, self.device)
392
458
 
393
459
  self
394
460
  end
@@ -406,6 +472,8 @@ module ProcessOut
406
472
  "synchronous" => options.fetch(:synchronous, nil),
407
473
  "retry_drop_liability_shift" => options.fetch(:retry_drop_liability_shift, nil),
408
474
  "capture_amount" => options.fetch(:capture_amount, nil),
475
+ "enable_three_d_s_2" => options.fetch(:enable_three_d_s_2, nil),
476
+ "auto_capture_at" => options.fetch(:auto_capture_at, nil),
409
477
  "source" => source
410
478
  }
411
479
 
@@ -435,6 +503,8 @@ module ProcessOut
435
503
  "synchronous" => options.fetch(:synchronous, nil),
436
504
  "retry_drop_liability_shift" => options.fetch(:retry_drop_liability_shift, nil),
437
505
  "capture_amount" => options.fetch(:capture_amount, nil),
506
+ "auto_capture_at" => options.fetch(:auto_capture_at, nil),
507
+ "enable_three_d_s_2" => options.fetch(:enable_three_d_s_2, nil),
438
508
  "source" => source
439
509
  }
440
510
 
@@ -509,6 +579,7 @@ module ProcessOut
509
579
  request = Request.new(@client)
510
580
  path = "/invoices/" + CGI.escape(@id) + "/three-d-s"
511
581
  data = {
582
+ "enable_three_d_s_2" => options.fetch(:enable_three_d_s_2, nil),
512
583
  "source" => source
513
584
  }
514
585
 
@@ -624,7 +695,10 @@ module ProcessOut
624
695
  "statement_descriptor_url" => @statement_descriptor_url,
625
696
  "return_url" => @return_url,
626
697
  "cancel_url" => @cancel_url,
627
- "webhook_url" => @webhook_url
698
+ "webhook_url" => @webhook_url,
699
+ "risk" => @risk,
700
+ "shipping" => @shipping,
701
+ "device" => @device
628
702
  }
629
703
 
630
704
  response = Response.new(request.post(path, data, options))
@@ -12,6 +12,16 @@ module ProcessOut
12
12
  attr_reader :amount
13
13
  attr_reader :quantity
14
14
  attr_reader :metadata
15
+ attr_reader :reference
16
+ attr_reader :description
17
+ attr_reader :brand
18
+ attr_reader :model
19
+ attr_reader :discount_amount
20
+ attr_reader :condition
21
+ attr_reader :marketplace_merchant
22
+ attr_reader :marketplace_merchant_is_business
23
+ attr_reader :marketplace_merchant_created_at
24
+ attr_reader :category
15
25
 
16
26
 
17
27
  def name=(val)
@@ -34,6 +44,46 @@ module ProcessOut
34
44
  @metadata = val
35
45
  end
36
46
 
47
+ def reference=(val)
48
+ @reference = val
49
+ end
50
+
51
+ def description=(val)
52
+ @description = val
53
+ end
54
+
55
+ def brand=(val)
56
+ @brand = val
57
+ end
58
+
59
+ def model=(val)
60
+ @model = val
61
+ end
62
+
63
+ def discount_amount=(val)
64
+ @discount_amount = val
65
+ end
66
+
67
+ def condition=(val)
68
+ @condition = val
69
+ end
70
+
71
+ def marketplace_merchant=(val)
72
+ @marketplace_merchant = val
73
+ end
74
+
75
+ def marketplace_merchant_is_business=(val)
76
+ @marketplace_merchant_is_business = val
77
+ end
78
+
79
+ def marketplace_merchant_created_at=(val)
80
+ @marketplace_merchant_created_at = val
81
+ end
82
+
83
+ def category=(val)
84
+ @category = val
85
+ end
86
+
37
87
 
38
88
  # Initializes the InvoiceDetail object
39
89
  # Params:
@@ -47,6 +97,16 @@ module ProcessOut
47
97
  self.amount = data.fetch(:amount, nil)
48
98
  self.quantity = data.fetch(:quantity, nil)
49
99
  self.metadata = data.fetch(:metadata, nil)
100
+ self.reference = data.fetch(:reference, nil)
101
+ self.description = data.fetch(:description, nil)
102
+ self.brand = data.fetch(:brand, nil)
103
+ self.model = data.fetch(:model, nil)
104
+ self.discount_amount = data.fetch(:discount_amount, nil)
105
+ self.condition = data.fetch(:condition, nil)
106
+ self.marketplace_merchant = data.fetch(:marketplace_merchant, nil)
107
+ self.marketplace_merchant_is_business = data.fetch(:marketplace_merchant_is_business, nil)
108
+ self.marketplace_merchant_created_at = data.fetch(:marketplace_merchant_created_at, nil)
109
+ self.category = data.fetch(:category, nil)
50
110
 
51
111
  end
52
112
 
@@ -77,6 +137,36 @@ module ProcessOut
77
137
  if data.include? "metadata"
78
138
  self.metadata = data["metadata"]
79
139
  end
140
+ if data.include? "reference"
141
+ self.reference = data["reference"]
142
+ end
143
+ if data.include? "description"
144
+ self.description = data["description"]
145
+ end
146
+ if data.include? "brand"
147
+ self.brand = data["brand"]
148
+ end
149
+ if data.include? "model"
150
+ self.model = data["model"]
151
+ end
152
+ if data.include? "discount_amount"
153
+ self.discount_amount = data["discount_amount"]
154
+ end
155
+ if data.include? "condition"
156
+ self.condition = data["condition"]
157
+ end
158
+ if data.include? "marketplace_merchant"
159
+ self.marketplace_merchant = data["marketplace_merchant"]
160
+ end
161
+ if data.include? "marketplace_merchant_is_business"
162
+ self.marketplace_merchant_is_business = data["marketplace_merchant_is_business"]
163
+ end
164
+ if data.include? "marketplace_merchant_created_at"
165
+ self.marketplace_merchant_created_at = data["marketplace_merchant_created_at"]
166
+ end
167
+ if data.include? "category"
168
+ self.category = data["category"]
169
+ end
80
170
 
81
171
  self
82
172
  end
@@ -93,6 +183,16 @@ module ProcessOut
93
183
  self.amount = data.fetch(:amount, self.amount)
94
184
  self.quantity = data.fetch(:quantity, self.quantity)
95
185
  self.metadata = data.fetch(:metadata, self.metadata)
186
+ self.reference = data.fetch(:reference, self.reference)
187
+ self.description = data.fetch(:description, self.description)
188
+ self.brand = data.fetch(:brand, self.brand)
189
+ self.model = data.fetch(:model, self.model)
190
+ self.discount_amount = data.fetch(:discount_amount, self.discount_amount)
191
+ self.condition = data.fetch(:condition, self.condition)
192
+ self.marketplace_merchant = data.fetch(:marketplace_merchant, self.marketplace_merchant)
193
+ self.marketplace_merchant_is_business = data.fetch(:marketplace_merchant_is_business, self.marketplace_merchant_is_business)
194
+ self.marketplace_merchant_created_at = data.fetch(:marketplace_merchant_created_at, self.marketplace_merchant_created_at)
195
+ self.category = data.fetch(:category, self.category)
96
196
 
97
197
  self
98
198
  end
@@ -0,0 +1,72 @@
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 InvoiceDevice
9
+
10
+ attr_reader :channel
11
+ attr_reader :ip_address
12
+
13
+
14
+ def channel=(val)
15
+ @channel = val
16
+ end
17
+
18
+ def ip_address=(val)
19
+ @ip_address = val
20
+ end
21
+
22
+
23
+ # Initializes the InvoiceDevice object
24
+ # Params:
25
+ # +client+:: +ProcessOut+ client instance
26
+ # +data+:: data that can be used to fill the object
27
+ def initialize(client, data = {})
28
+ @client = client
29
+
30
+ self.channel = data.fetch(:channel, nil)
31
+ self.ip_address = data.fetch(:ip_address, nil)
32
+
33
+ end
34
+
35
+ # Create a new InvoiceDevice using the current client
36
+ def new(data = {})
37
+ InvoiceDevice.new(@client, data)
38
+ end
39
+
40
+ # Fills the object with data coming from the API
41
+ # Params:
42
+ # +data+:: +Hash+ of data coming from the API
43
+ def fill_with_data(data)
44
+ if data.nil?
45
+ return self
46
+ end
47
+ if data.include? "channel"
48
+ self.channel = data["channel"]
49
+ end
50
+ if data.include? "ip_address"
51
+ self.ip_address = data["ip_address"]
52
+ end
53
+
54
+ self
55
+ end
56
+
57
+ # Prefills the object with the data passed as parameters
58
+ # Params:
59
+ # +data+:: +Hash+ of data
60
+ def prefill(data)
61
+ if data.nil?
62
+ return self
63
+ end
64
+ self.channel = data.fetch(:channel, self.channel)
65
+ self.ip_address = data.fetch(:ip_address, self.ip_address)
66
+
67
+ self
68
+ end
69
+
70
+
71
+ end
72
+ end
@@ -0,0 +1,72 @@
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 InvoiceRisk
9
+
10
+ attr_reader :score
11
+ attr_reader :is_legit
12
+
13
+
14
+ def score=(val)
15
+ @score = val
16
+ end
17
+
18
+ def is_legit=(val)
19
+ @is_legit = val
20
+ end
21
+
22
+
23
+ # Initializes the InvoiceRisk object
24
+ # Params:
25
+ # +client+:: +ProcessOut+ client instance
26
+ # +data+:: data that can be used to fill the object
27
+ def initialize(client, data = {})
28
+ @client = client
29
+
30
+ self.score = data.fetch(:score, nil)
31
+ self.is_legit = data.fetch(:is_legit, nil)
32
+
33
+ end
34
+
35
+ # Create a new InvoiceRisk using the current client
36
+ def new(data = {})
37
+ InvoiceRisk.new(@client, data)
38
+ end
39
+
40
+ # Fills the object with data coming from the API
41
+ # Params:
42
+ # +data+:: +Hash+ of data coming from the API
43
+ def fill_with_data(data)
44
+ if data.nil?
45
+ return self
46
+ end
47
+ if data.include? "score"
48
+ self.score = data["score"]
49
+ end
50
+ if data.include? "is_legit"
51
+ self.is_legit = data["is_legit"]
52
+ end
53
+
54
+ self
55
+ end
56
+
57
+ # Prefills the object with the data passed as parameters
58
+ # Params:
59
+ # +data+:: +Hash+ of data
60
+ def prefill(data)
61
+ if data.nil?
62
+ return self
63
+ end
64
+ self.score = data.fetch(:score, self.score)
65
+ self.is_legit = data.fetch(:is_legit, self.is_legit)
66
+
67
+ self
68
+ end
69
+
70
+
71
+ end
72
+ end
@@ -0,0 +1,172 @@
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 InvoiceShipping
9
+
10
+ attr_reader :amount
11
+ attr_reader :method
12
+ attr_reader :provider
13
+ attr_reader :delay
14
+ attr_reader :address1
15
+ attr_reader :address2
16
+ attr_reader :city
17
+ attr_reader :state
18
+ attr_reader :country_code
19
+ attr_reader :zip
20
+ attr_reader :phone_number
21
+ attr_reader :expects_shipping_at
22
+
23
+
24
+ def amount=(val)
25
+ @amount = val
26
+ end
27
+
28
+ def method=(val)
29
+ @method = val
30
+ end
31
+
32
+ def provider=(val)
33
+ @provider = val
34
+ end
35
+
36
+ def delay=(val)
37
+ @delay = val
38
+ end
39
+
40
+ def address1=(val)
41
+ @address1 = val
42
+ end
43
+
44
+ def address2=(val)
45
+ @address2 = val
46
+ end
47
+
48
+ def city=(val)
49
+ @city = val
50
+ end
51
+
52
+ def state=(val)
53
+ @state = val
54
+ end
55
+
56
+ def country_code=(val)
57
+ @country_code = val
58
+ end
59
+
60
+ def zip=(val)
61
+ @zip = val
62
+ end
63
+
64
+ def phone_number=(val)
65
+ @phone_number = val
66
+ end
67
+
68
+ def expects_shipping_at=(val)
69
+ @expects_shipping_at = val
70
+ end
71
+
72
+
73
+ # Initializes the InvoiceShipping object
74
+ # Params:
75
+ # +client+:: +ProcessOut+ client instance
76
+ # +data+:: data that can be used to fill the object
77
+ def initialize(client, data = {})
78
+ @client = client
79
+
80
+ self.amount = data.fetch(:amount, nil)
81
+ self.method = data.fetch(:method, nil)
82
+ self.provider = data.fetch(:provider, nil)
83
+ self.delay = data.fetch(:delay, nil)
84
+ self.address1 = data.fetch(:address1, nil)
85
+ self.address2 = data.fetch(:address2, nil)
86
+ self.city = data.fetch(:city, nil)
87
+ self.state = data.fetch(:state, nil)
88
+ self.country_code = data.fetch(:country_code, nil)
89
+ self.zip = data.fetch(:zip, nil)
90
+ self.phone_number = data.fetch(:phone_number, nil)
91
+ self.expects_shipping_at = data.fetch(:expects_shipping_at, nil)
92
+
93
+ end
94
+
95
+ # Create a new InvoiceShipping using the current client
96
+ def new(data = {})
97
+ InvoiceShipping.new(@client, data)
98
+ end
99
+
100
+ # Fills the object with data coming from the API
101
+ # Params:
102
+ # +data+:: +Hash+ of data coming from the API
103
+ def fill_with_data(data)
104
+ if data.nil?
105
+ return self
106
+ end
107
+ if data.include? "amount"
108
+ self.amount = data["amount"]
109
+ end
110
+ if data.include? "method"
111
+ self.method = data["method"]
112
+ end
113
+ if data.include? "provider"
114
+ self.provider = data["provider"]
115
+ end
116
+ if data.include? "delay"
117
+ self.delay = data["delay"]
118
+ end
119
+ if data.include? "address1"
120
+ self.address1 = data["address1"]
121
+ end
122
+ if data.include? "address2"
123
+ self.address2 = data["address2"]
124
+ end
125
+ if data.include? "city"
126
+ self.city = data["city"]
127
+ end
128
+ if data.include? "state"
129
+ self.state = data["state"]
130
+ end
131
+ if data.include? "country_code"
132
+ self.country_code = data["country_code"]
133
+ end
134
+ if data.include? "zip"
135
+ self.zip = data["zip"]
136
+ end
137
+ if data.include? "phone_number"
138
+ self.phone_number = data["phone_number"]
139
+ end
140
+ if data.include? "expects_shipping_at"
141
+ self.expects_shipping_at = data["expects_shipping_at"]
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Prefills the object with the data passed as parameters
148
+ # Params:
149
+ # +data+:: +Hash+ of data
150
+ def prefill(data)
151
+ if data.nil?
152
+ return self
153
+ end
154
+ self.amount = data.fetch(:amount, self.amount)
155
+ self.method = data.fetch(:method, self.method)
156
+ self.provider = data.fetch(:provider, self.provider)
157
+ self.delay = data.fetch(:delay, self.delay)
158
+ self.address1 = data.fetch(:address1, self.address1)
159
+ self.address2 = data.fetch(:address2, self.address2)
160
+ self.city = data.fetch(:city, self.city)
161
+ self.state = data.fetch(:state, self.state)
162
+ self.country_code = data.fetch(:country_code, self.country_code)
163
+ self.zip = data.fetch(:zip, self.zip)
164
+ self.phone_number = data.fetch(:phone_number, self.phone_number)
165
+ self.expects_shipping_at = data.fetch(:expects_shipping_at, self.expects_shipping_at)
166
+
167
+ self
168
+ end
169
+
170
+
171
+ end
172
+ 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.10.0"
16
+ req["User-Agent"] = "ProcessOut Ruby-Bindings/2.11.0"
17
17
 
18
18
  unless options.nil?
19
19
  req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
@@ -43,6 +43,8 @@ module ProcessOut
43
43
  self.apply_headers(req, options)
44
44
 
45
45
  Net::HTTP.start(uri.hostname, uri.port,
46
+ :open_timeout => 5,
47
+ :read_timeout => 65,
46
48
  :use_ssl => true) do |http|
47
49
 
48
50
  http.request(req)
@@ -57,6 +59,8 @@ module ProcessOut
57
59
  self.apply_headers(req, options)
58
60
 
59
61
  Net::HTTP.start(uri.hostname, uri.port,
62
+ :open_timeout => 5,
63
+ :read_timeout => 65,
60
64
  :use_ssl => true) do |http|
61
65
 
62
66
  http.request(req)
@@ -71,6 +75,8 @@ module ProcessOut
71
75
  self.apply_headers(req, options)
72
76
 
73
77
  Net::HTTP.start(uri.hostname, uri.port,
78
+ :open_timeout => 5,
79
+ :read_timeout => 65,
74
80
  :use_ssl => true) do |http|
75
81
 
76
82
  http.request(req)
@@ -85,10 +91,12 @@ module ProcessOut
85
91
  self.apply_headers(req, options)
86
92
 
87
93
  Net::HTTP.start(uri.hostname, uri.port,
94
+ :open_timeout => 5,
95
+ :read_timeout => 65,
88
96
  :use_ssl => true) do |http|
89
97
 
90
98
  http.request(req)
91
99
  end
92
100
  end
93
101
  end
94
- end
102
+ end
@@ -25,6 +25,7 @@ module ProcessOut
25
25
  attr_reader :fees
26
26
  attr_reader :adjustments
27
27
  attr_reader :reserve
28
+ attr_reader :settled_at
28
29
  attr_reader :created_at
29
30
 
30
31
 
@@ -112,6 +113,10 @@ module ProcessOut
112
113
  @reserve = val
113
114
  end
114
115
 
116
+ def settled_at=(val)
117
+ @settled_at = val
118
+ end
119
+
115
120
  def created_at=(val)
116
121
  @created_at = val
117
122
  end
@@ -142,6 +147,7 @@ module ProcessOut
142
147
  self.fees = data.fetch(:fees, nil)
143
148
  self.adjustments = data.fetch(:adjustments, nil)
144
149
  self.reserve = data.fetch(:reserve, nil)
150
+ self.settled_at = data.fetch(:settled_at, nil)
145
151
  self.created_at = data.fetch(:created_at, nil)
146
152
 
147
153
  end
@@ -212,6 +218,9 @@ module ProcessOut
212
218
  if data.include? "reserve"
213
219
  self.reserve = data["reserve"]
214
220
  end
221
+ if data.include? "settled_at"
222
+ self.settled_at = data["settled_at"]
223
+ end
215
224
  if data.include? "created_at"
216
225
  self.created_at = data["created_at"]
217
226
  end
@@ -244,6 +253,7 @@ module ProcessOut
244
253
  self.fees = data.fetch(:fees, self.fees)
245
254
  self.adjustments = data.fetch(:adjustments, self.adjustments)
246
255
  self.reserve = data.fetch(:reserve, self.reserve)
256
+ self.settled_at = data.fetch(:settled_at, self.settled_at)
247
257
  self.created_at = data.fetch(:created_at, self.created_at)
248
258
 
249
259
  self
@@ -37,10 +37,16 @@ module ProcessOut
37
37
  attr_reader :available_amount_local
38
38
  attr_reader :currency
39
39
  attr_reader :error_code
40
+ attr_reader :gateway_name
40
41
  attr_reader :three_d_s_status
41
42
  attr_reader :status
42
43
  attr_reader :authorized
43
44
  attr_reader :captured
45
+ attr_reader :voided
46
+ attr_reader :refunded
47
+ attr_reader :chargedback
48
+ attr_reader :received_fraud_notification
49
+ attr_reader :received_retrieval_request
44
50
  attr_reader :processout_fee
45
51
  attr_reader :estimated_fee
46
52
  attr_reader :gateway_fee
@@ -49,6 +55,8 @@ module ProcessOut
49
55
  attr_reader :metadata
50
56
  attr_reader :sandbox
51
57
  attr_reader :created_at
58
+ attr_reader :chargedback_at
59
+ attr_reader :refunded_at
52
60
 
53
61
 
54
62
  def id=(val)
@@ -81,10 +89,10 @@ module ProcessOut
81
89
  return
82
90
  end
83
91
 
84
- if val.instance_of? Customer
92
+ if val.instance_of? Invoice
85
93
  @invoice = val
86
94
  else
87
- obj = Customer.new(@client)
95
+ obj = Invoice.new(@client)
88
96
  obj.fill_with_data(val)
89
97
  @invoice = obj
90
98
  end
@@ -287,6 +295,10 @@ module ProcessOut
287
295
  @error_code = val
288
296
  end
289
297
 
298
+ def gateway_name=(val)
299
+ @gateway_name = val
300
+ end
301
+
290
302
  def three_d_s_status=(val)
291
303
  @three_d_s_status = val
292
304
  end
@@ -303,6 +315,26 @@ module ProcessOut
303
315
  @captured = val
304
316
  end
305
317
 
318
+ def voided=(val)
319
+ @voided = val
320
+ end
321
+
322
+ def refunded=(val)
323
+ @refunded = val
324
+ end
325
+
326
+ def chargedback=(val)
327
+ @chargedback = val
328
+ end
329
+
330
+ def received_fraud_notification=(val)
331
+ @received_fraud_notification = val
332
+ end
333
+
334
+ def received_retrieval_request=(val)
335
+ @received_retrieval_request = val
336
+ end
337
+
306
338
  def processout_fee=(val)
307
339
  @processout_fee = val
308
340
  end
@@ -335,6 +367,14 @@ module ProcessOut
335
367
  @created_at = val
336
368
  end
337
369
 
370
+ def chargedback_at=(val)
371
+ @chargedback_at = val
372
+ end
373
+
374
+ def refunded_at=(val)
375
+ @refunded_at = val
376
+ end
377
+
338
378
 
339
379
  # Initializes the Transaction object
340
380
  # Params:
@@ -373,10 +413,16 @@ module ProcessOut
373
413
  self.available_amount_local = data.fetch(:available_amount_local, nil)
374
414
  self.currency = data.fetch(:currency, nil)
375
415
  self.error_code = data.fetch(:error_code, nil)
416
+ self.gateway_name = data.fetch(:gateway_name, nil)
376
417
  self.three_d_s_status = data.fetch(:three_d_s_status, nil)
377
418
  self.status = data.fetch(:status, nil)
378
419
  self.authorized = data.fetch(:authorized, nil)
379
420
  self.captured = data.fetch(:captured, nil)
421
+ self.voided = data.fetch(:voided, nil)
422
+ self.refunded = data.fetch(:refunded, nil)
423
+ self.chargedback = data.fetch(:chargedback, nil)
424
+ self.received_fraud_notification = data.fetch(:received_fraud_notification, nil)
425
+ self.received_retrieval_request = data.fetch(:received_retrieval_request, nil)
380
426
  self.processout_fee = data.fetch(:processout_fee, nil)
381
427
  self.estimated_fee = data.fetch(:estimated_fee, nil)
382
428
  self.gateway_fee = data.fetch(:gateway_fee, nil)
@@ -385,6 +431,8 @@ module ProcessOut
385
431
  self.metadata = data.fetch(:metadata, nil)
386
432
  self.sandbox = data.fetch(:sandbox, nil)
387
433
  self.created_at = data.fetch(:created_at, nil)
434
+ self.chargedback_at = data.fetch(:chargedback_at, nil)
435
+ self.refunded_at = data.fetch(:refunded_at, nil)
388
436
 
389
437
  end
390
438
 
@@ -490,6 +538,9 @@ module ProcessOut
490
538
  if data.include? "error_code"
491
539
  self.error_code = data["error_code"]
492
540
  end
541
+ if data.include? "gateway_name"
542
+ self.gateway_name = data["gateway_name"]
543
+ end
493
544
  if data.include? "three_d_s_status"
494
545
  self.three_d_s_status = data["three_d_s_status"]
495
546
  end
@@ -502,6 +553,21 @@ module ProcessOut
502
553
  if data.include? "captured"
503
554
  self.captured = data["captured"]
504
555
  end
556
+ if data.include? "voided"
557
+ self.voided = data["voided"]
558
+ end
559
+ if data.include? "refunded"
560
+ self.refunded = data["refunded"]
561
+ end
562
+ if data.include? "chargedback"
563
+ self.chargedback = data["chargedback"]
564
+ end
565
+ if data.include? "received_fraud_notification"
566
+ self.received_fraud_notification = data["received_fraud_notification"]
567
+ end
568
+ if data.include? "received_retrieval_request"
569
+ self.received_retrieval_request = data["received_retrieval_request"]
570
+ end
505
571
  if data.include? "processout_fee"
506
572
  self.processout_fee = data["processout_fee"]
507
573
  end
@@ -526,6 +592,12 @@ module ProcessOut
526
592
  if data.include? "created_at"
527
593
  self.created_at = data["created_at"]
528
594
  end
595
+ if data.include? "chargedback_at"
596
+ self.chargedback_at = data["chargedback_at"]
597
+ end
598
+ if data.include? "refunded_at"
599
+ self.refunded_at = data["refunded_at"]
600
+ end
529
601
 
530
602
  self
531
603
  end
@@ -567,10 +639,16 @@ module ProcessOut
567
639
  self.available_amount_local = data.fetch(:available_amount_local, self.available_amount_local)
568
640
  self.currency = data.fetch(:currency, self.currency)
569
641
  self.error_code = data.fetch(:error_code, self.error_code)
642
+ self.gateway_name = data.fetch(:gateway_name, self.gateway_name)
570
643
  self.three_d_s_status = data.fetch(:three_d_s_status, self.three_d_s_status)
571
644
  self.status = data.fetch(:status, self.status)
572
645
  self.authorized = data.fetch(:authorized, self.authorized)
573
646
  self.captured = data.fetch(:captured, self.captured)
647
+ self.voided = data.fetch(:voided, self.voided)
648
+ self.refunded = data.fetch(:refunded, self.refunded)
649
+ self.chargedback = data.fetch(:chargedback, self.chargedback)
650
+ self.received_fraud_notification = data.fetch(:received_fraud_notification, self.received_fraud_notification)
651
+ self.received_retrieval_request = data.fetch(:received_retrieval_request, self.received_retrieval_request)
574
652
  self.processout_fee = data.fetch(:processout_fee, self.processout_fee)
575
653
  self.estimated_fee = data.fetch(:estimated_fee, self.estimated_fee)
576
654
  self.gateway_fee = data.fetch(:gateway_fee, self.gateway_fee)
@@ -579,6 +657,8 @@ module ProcessOut
579
657
  self.metadata = data.fetch(:metadata, self.metadata)
580
658
  self.sandbox = data.fetch(:sandbox, self.sandbox)
581
659
  self.created_at = data.fetch(:created_at, self.created_at)
660
+ self.chargedback_at = data.fetch(:chargedback_at, self.chargedback_at)
661
+ self.refunded_at = data.fetch(:refunded_at, self.refunded_at)
582
662
 
583
663
  self
584
664
  end
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "2.10.0"
2
+ VERSION = "2.11.0"
3
3
  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: 2.10.0
4
+ version: 2.11.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: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
64
  - ".travis.yml"
65
+ - Dockerfile
65
66
  - Gemfile
66
67
  - LICENSE.txt
67
68
  - Makefile
@@ -93,6 +94,9 @@ files:
93
94
  - lib/processout/gateway_request.rb
94
95
  - lib/processout/invoice.rb
95
96
  - lib/processout/invoice_detail.rb
97
+ - lib/processout/invoice_device.rb
98
+ - lib/processout/invoice_risk.rb
99
+ - lib/processout/invoice_shipping.rb
96
100
  - lib/processout/networking/request.rb
97
101
  - lib/processout/networking/response.rb
98
102
  - lib/processout/payment_data_network_authentication.rb