processout 2.5.0 → 2.6.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
  SHA1:
3
- metadata.gz: ce7980303bdbdb4f528fcb009f18608d285ccc40
4
- data.tar.gz: 480ab958ca4675c5887450cd0a4d39c95eddb229
3
+ metadata.gz: 240933d4f4a125a66e854a8987cd5da0503ab82d
4
+ data.tar.gz: e2ed43d77e6f691d5f569c0a7639c2fdb7f5a033
5
5
  SHA512:
6
- metadata.gz: 760c460b12ab5614338ff86f9e989eb1d78d125210992caf2be81e324ad1faee3dac0d5abab91b36e083a3d422471ce5024d5a9e18d03b126fed5a69520d327b
7
- data.tar.gz: 637b880ff587b2e0a0459ffe62db63d22ce9b799dc6c75be3a561f8fb4329088f375b6e462ccea2f7414e474745defd648981cdf526c701c2eda0ccd01a00cd4
6
+ metadata.gz: 74041d1c0ab4cbdf61bf2d2cceabde302da8e566e0a883e3a7344660cad129a635fa6bd2805f734f2eb50a16fcb55c83aaec532bb25b8cfd7835e8a608cd3616
7
+ data.tar.gz: d99ea61e24069f7431978116950af1cd6f3f7170da9a081d7e66c224cc06b8db34912a0b0f1ba882a56774a2cbb86b80a967b77ef5d993cd13dcd8fdda371d66
data/lib/processout.rb CHANGED
@@ -18,12 +18,17 @@ require "processout/invoice"
18
18
  require "processout/invoice_detail"
19
19
  require "processout/customer_action"
20
20
  require "processout/dunning_action"
21
+ require "processout/payout"
22
+ require "processout/payout_item"
21
23
  require "processout/plan"
22
24
  require "processout/product"
23
25
  require "processout/project"
24
26
  require "processout/refund"
25
27
  require "processout/subscription"
26
28
  require "processout/transaction"
29
+ require "processout/payment_data_three_ds_request"
30
+ require "processout/payment_data_network_authentication"
31
+ require "processout/payment_data_three_ds_authentication"
27
32
  require "processout/transaction_operation"
28
33
  require "processout/webhook"
29
34
  require "processout/webhook_endpoint"
@@ -129,6 +134,16 @@ module ProcessOut
129
134
  obj = DunningAction.new(self, data)
130
135
  end
131
136
 
137
+ # Create a new Payout instance
138
+ def payout(data = {})
139
+ obj = Payout.new(self, data)
140
+ end
141
+
142
+ # Create a new PayoutItem instance
143
+ def payout_item(data = {})
144
+ obj = PayoutItem.new(self, data)
145
+ end
146
+
132
147
  # Create a new Plan instance
133
148
  def plan(data = {})
134
149
  obj = Plan.new(self, data)
@@ -159,6 +174,21 @@ module ProcessOut
159
174
  obj = Transaction.new(self, data)
160
175
  end
161
176
 
177
+ # Create a new PaymentDataThreeDSRequest instance
178
+ def payment_data_three_ds_request(data = {})
179
+ obj = PaymentDataThreeDSRequest.new(self, data)
180
+ end
181
+
182
+ # Create a new PaymentDataNetworkAuthentication instance
183
+ def payment_data_network_authentication(data = {})
184
+ obj = PaymentDataNetworkAuthentication.new(self, data)
185
+ end
186
+
187
+ # Create a new PaymentDataThreeDSAuthentication instance
188
+ def payment_data_three_ds_authentication(data = {})
189
+ obj = PaymentDataThreeDSAuthentication.new(self, data)
190
+ end
191
+
162
192
  # Create a new TransactionOperation instance
163
193
  def transaction_operation(data = {})
164
194
  obj = TransactionOperation.new(self, data)
@@ -26,8 +26,9 @@ module ProcessOut
26
26
  attr_reader :address2
27
27
  attr_reader :city
28
28
  attr_reader :state
29
- attr_reader :country_code
30
29
  attr_reader :zip
30
+ attr_reader :country_code
31
+ attr_reader :ip_address
31
32
  attr_reader :metadata
32
33
  attr_reader :expires_soon
33
34
  attr_reader :sandbox
@@ -134,12 +135,16 @@ module ProcessOut
134
135
  @state = val
135
136
  end
136
137
 
138
+ def zip=(val)
139
+ @zip = val
140
+ end
141
+
137
142
  def country_code=(val)
138
143
  @country_code = val
139
144
  end
140
145
 
141
- def zip=(val)
142
- @zip = val
146
+ def ip_address=(val)
147
+ @ip_address = val
143
148
  end
144
149
 
145
150
  def metadata=(val)
@@ -185,8 +190,9 @@ module ProcessOut
185
190
  self.address2 = data.fetch(:address2, nil)
186
191
  self.city = data.fetch(:city, nil)
187
192
  self.state = data.fetch(:state, nil)
188
- self.country_code = data.fetch(:country_code, nil)
189
193
  self.zip = data.fetch(:zip, nil)
194
+ self.country_code = data.fetch(:country_code, nil)
195
+ self.ip_address = data.fetch(:ip_address, nil)
190
196
  self.metadata = data.fetch(:metadata, nil)
191
197
  self.expires_soon = data.fetch(:expires_soon, nil)
192
198
  self.sandbox = data.fetch(:sandbox, nil)
@@ -263,11 +269,14 @@ module ProcessOut
263
269
  if data.include? "state"
264
270
  self.state = data["state"]
265
271
  end
272
+ if data.include? "zip"
273
+ self.zip = data["zip"]
274
+ end
266
275
  if data.include? "country_code"
267
276
  self.country_code = data["country_code"]
268
277
  end
269
- if data.include? "zip"
270
- self.zip = data["zip"]
278
+ if data.include? "ip_address"
279
+ self.ip_address = data["ip_address"]
271
280
  end
272
281
  if data.include? "metadata"
273
282
  self.metadata = data["metadata"]
@@ -311,8 +320,9 @@ module ProcessOut
311
320
  self.address2 = data.fetch(:address2, self.address2)
312
321
  self.city = data.fetch(:city, self.city)
313
322
  self.state = data.fetch(:state, self.state)
314
- self.country_code = data.fetch(:country_code, self.country_code)
315
323
  self.zip = data.fetch(:zip, self.zip)
324
+ self.country_code = data.fetch(:country_code, self.country_code)
325
+ self.ip_address = data.fetch(:ip_address, self.ip_address)
316
326
  self.metadata = data.fetch(:metadata, self.metadata)
317
327
  self.expires_soon = data.fetch(:expires_soon, self.expires_soon)
318
328
  self.sandbox = data.fetch(:sandbox, self.sandbox)
@@ -26,6 +26,7 @@ module ProcessOut
26
26
  attr_reader :state
27
27
  attr_reader :zip
28
28
  attr_reader :country_code
29
+ attr_reader :ip_address
29
30
  attr_reader :transactions_count
30
31
  attr_reader :subscriptions_count
31
32
  attr_reader :mrr_local
@@ -183,6 +184,10 @@ module ProcessOut
183
184
  @country_code = val
184
185
  end
185
186
 
187
+ def ip_address=(val)
188
+ @ip_address = val
189
+ end
190
+
186
191
  def transactions_count=(val)
187
192
  @transactions_count = val
188
193
  end
@@ -238,6 +243,7 @@ module ProcessOut
238
243
  self.state = data.fetch(:state, nil)
239
244
  self.zip = data.fetch(:zip, nil)
240
245
  self.country_code = data.fetch(:country_code, nil)
246
+ self.ip_address = data.fetch(:ip_address, nil)
241
247
  self.transactions_count = data.fetch(:transactions_count, nil)
242
248
  self.subscriptions_count = data.fetch(:subscriptions_count, nil)
243
249
  self.mrr_local = data.fetch(:mrr_local, nil)
@@ -317,6 +323,9 @@ module ProcessOut
317
323
  if data.include? "country_code"
318
324
  self.country_code = data["country_code"]
319
325
  end
326
+ if data.include? "ip_address"
327
+ self.ip_address = data["ip_address"]
328
+ end
320
329
  if data.include? "transactions_count"
321
330
  self.transactions_count = data["transactions_count"]
322
331
  end
@@ -368,6 +377,7 @@ module ProcessOut
368
377
  self.state = data.fetch(:state, self.state)
369
378
  self.zip = data.fetch(:zip, self.zip)
370
379
  self.country_code = data.fetch(:country_code, self.country_code)
380
+ self.ip_address = data.fetch(:ip_address, self.ip_address)
371
381
  self.transactions_count = data.fetch(:transactions_count, self.transactions_count)
372
382
  self.subscriptions_count = data.fetch(:subscriptions_count, self.subscriptions_count)
373
383
  self.mrr_local = data.fetch(:mrr_local, self.mrr_local)
@@ -566,6 +576,7 @@ module ProcessOut
566
576
  "state" => @state,
567
577
  "zip" => @zip,
568
578
  "country_code" => @country_code,
579
+ "ip_address" => @ip_address,
569
580
  "metadata" => @metadata
570
581
  }
571
582
 
@@ -631,6 +642,7 @@ module ProcessOut
631
642
  "state" => @state,
632
643
  "zip" => @zip,
633
644
  "country_code" => @country_code,
645
+ "ip_address" => @ip_address,
634
646
  "metadata" => @metadata
635
647
  }
636
648
 
@@ -394,7 +394,7 @@ module ProcessOut
394
394
  path = "/invoices/" + CGI.escape(@id) + "/authorize"
395
395
  data = {
396
396
  "synchronous" => options.fetch(:synchronous, nil),
397
- "prioritized_gateway_configuration_id" => options.fetch(:prioritized_gateway_configuration_id, nil),
397
+ "retry_drop_liability_shift" => options.fetch(:retry_drop_liability_shift, nil),
398
398
  "source" => source
399
399
  }
400
400
 
@@ -422,7 +422,7 @@ module ProcessOut
422
422
  data = {
423
423
  "authorize_only" => options.fetch(:authorize_only, nil),
424
424
  "synchronous" => options.fetch(:synchronous, nil),
425
- "prioritized_gateway_configuration_id" => options.fetch(:prioritized_gateway_configuration_id, nil),
425
+ "retry_drop_liability_shift" => options.fetch(:retry_drop_liability_shift, nil),
426
426
  "source" => source
427
427
  }
428
428
 
@@ -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"] = "utf-8"
16
+ req["User-Agent"] = "ProcessOut Ruby-Bindings/2.6.0"
17
17
 
18
18
  unless options.nil?
19
19
  req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
@@ -0,0 +1,62 @@
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 PaymentDataNetworkAuthentication
9
+
10
+ attr_reader :cavv
11
+
12
+
13
+ def cavv=(val)
14
+ @cavv = val
15
+ end
16
+
17
+
18
+ # Initializes the PaymentDataNetworkAuthentication object
19
+ # Params:
20
+ # +client+:: +ProcessOut+ client instance
21
+ # +data+:: data that can be used to fill the object
22
+ def initialize(client, data = {})
23
+ @client = client
24
+
25
+ self.cavv = data.fetch(:cavv, nil)
26
+
27
+ end
28
+
29
+ # Create a new PaymentDataNetworkAuthentication using the current client
30
+ def new(data = {})
31
+ PaymentDataNetworkAuthentication.new(@client, data)
32
+ end
33
+
34
+ # Fills the object with data coming from the API
35
+ # Params:
36
+ # +data+:: +Hash+ of data coming from the API
37
+ def fill_with_data(data)
38
+ if data.nil?
39
+ return self
40
+ end
41
+ if data.include? "cavv"
42
+ self.cavv = data["cavv"]
43
+ end
44
+
45
+ self
46
+ end
47
+
48
+ # Prefills the object with the data passed as parameters
49
+ # Params:
50
+ # +data+:: +Hash+ of data
51
+ def prefill(data)
52
+ if data.nil?
53
+ return self
54
+ end
55
+ self.cavv = data.fetch(:cavv, self.cavv)
56
+
57
+ self
58
+ end
59
+
60
+
61
+ end
62
+ end
@@ -0,0 +1,62 @@
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 PaymentDataThreeDSAuthentication
9
+
10
+ attr_reader :xid
11
+
12
+
13
+ def xid=(val)
14
+ @xid = val
15
+ end
16
+
17
+
18
+ # Initializes the PaymentDataThreeDSAuthentication object
19
+ # Params:
20
+ # +client+:: +ProcessOut+ client instance
21
+ # +data+:: data that can be used to fill the object
22
+ def initialize(client, data = {})
23
+ @client = client
24
+
25
+ self.xid = data.fetch(:xid, nil)
26
+
27
+ end
28
+
29
+ # Create a new PaymentDataThreeDSAuthentication using the current client
30
+ def new(data = {})
31
+ PaymentDataThreeDSAuthentication.new(@client, data)
32
+ end
33
+
34
+ # Fills the object with data coming from the API
35
+ # Params:
36
+ # +data+:: +Hash+ of data coming from the API
37
+ def fill_with_data(data)
38
+ if data.nil?
39
+ return self
40
+ end
41
+ if data.include? "XID"
42
+ self.xid = data["XID"]
43
+ end
44
+
45
+ self
46
+ end
47
+
48
+ # Prefills the object with the data passed as parameters
49
+ # Params:
50
+ # +data+:: +Hash+ of data
51
+ def prefill(data)
52
+ if data.nil?
53
+ return self
54
+ end
55
+ self.xid = data.fetch(:xid, self.xid)
56
+
57
+ self
58
+ end
59
+
60
+
61
+ end
62
+ end
@@ -0,0 +1,92 @@
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 PaymentDataThreeDSRequest
9
+
10
+ attr_reader :acs_url
11
+ attr_reader :pareq
12
+ attr_reader :md
13
+ attr_reader :term_url
14
+
15
+
16
+ def acs_url=(val)
17
+ @acs_url = val
18
+ end
19
+
20
+ def pareq=(val)
21
+ @pareq = val
22
+ end
23
+
24
+ def md=(val)
25
+ @md = val
26
+ end
27
+
28
+ def term_url=(val)
29
+ @term_url = val
30
+ end
31
+
32
+
33
+ # Initializes the PaymentDataThreeDSRequest object
34
+ # Params:
35
+ # +client+:: +ProcessOut+ client instance
36
+ # +data+:: data that can be used to fill the object
37
+ def initialize(client, data = {})
38
+ @client = client
39
+
40
+ self.acs_url = data.fetch(:acs_url, nil)
41
+ self.pareq = data.fetch(:pareq, nil)
42
+ self.md = data.fetch(:md, nil)
43
+ self.term_url = data.fetch(:term_url, nil)
44
+
45
+ end
46
+
47
+ # Create a new PaymentDataThreeDSRequest using the current client
48
+ def new(data = {})
49
+ PaymentDataThreeDSRequest.new(@client, data)
50
+ end
51
+
52
+ # Fills the object with data coming from the API
53
+ # Params:
54
+ # +data+:: +Hash+ of data coming from the API
55
+ def fill_with_data(data)
56
+ if data.nil?
57
+ return self
58
+ end
59
+ if data.include? "acs_url"
60
+ self.acs_url = data["acs_url"]
61
+ end
62
+ if data.include? "pareq"
63
+ self.pareq = data["pareq"]
64
+ end
65
+ if data.include? "md"
66
+ self.md = data["md"]
67
+ end
68
+ if data.include? "term_url"
69
+ self.term_url = data["term_url"]
70
+ end
71
+
72
+ self
73
+ end
74
+
75
+ # Prefills the object with the data passed as parameters
76
+ # Params:
77
+ # +data+:: +Hash+ of data
78
+ def prefill(data)
79
+ if data.nil?
80
+ return self
81
+ end
82
+ self.acs_url = data.fetch(:acs_url, self.acs_url)
83
+ self.pareq = data.fetch(:pareq, self.pareq)
84
+ self.md = data.fetch(:md, self.md)
85
+ self.term_url = data.fetch(:term_url, self.term_url)
86
+
87
+ self
88
+ end
89
+
90
+
91
+ end
92
+ end
@@ -0,0 +1,342 @@
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 Payout
9
+
10
+ attr_reader :id
11
+ attr_reader :project
12
+ attr_reader :project_id
13
+ attr_reader :status
14
+ attr_reader :amount
15
+ attr_reader :currency
16
+ attr_reader :metadata
17
+ attr_reader :bank_name
18
+ attr_reader :bank_summary
19
+ attr_reader :sales_transactions
20
+ attr_reader :sales_volume
21
+ attr_reader :refunds_transactions
22
+ attr_reader :refunds_volume
23
+ attr_reader :chargebacks_transactions
24
+ attr_reader :chargebacks_volume
25
+ attr_reader :fees
26
+ attr_reader :adjustments
27
+ attr_reader :reserve
28
+ attr_reader :created_at
29
+
30
+
31
+ def id=(val)
32
+ @id = val
33
+ end
34
+
35
+ def project=(val)
36
+ if val.nil?
37
+ @project = val
38
+ return
39
+ end
40
+
41
+ if val.instance_of? Project
42
+ @project = val
43
+ else
44
+ obj = Project.new(@client)
45
+ obj.fill_with_data(val)
46
+ @project = obj
47
+ end
48
+
49
+ end
50
+
51
+ def project_id=(val)
52
+ @project_id = val
53
+ end
54
+
55
+ def status=(val)
56
+ @status = val
57
+ end
58
+
59
+ def amount=(val)
60
+ @amount = val
61
+ end
62
+
63
+ def currency=(val)
64
+ @currency = val
65
+ end
66
+
67
+ def metadata=(val)
68
+ @metadata = val
69
+ end
70
+
71
+ def bank_name=(val)
72
+ @bank_name = val
73
+ end
74
+
75
+ def bank_summary=(val)
76
+ @bank_summary = val
77
+ end
78
+
79
+ def sales_transactions=(val)
80
+ @sales_transactions = val
81
+ end
82
+
83
+ def sales_volume=(val)
84
+ @sales_volume = val
85
+ end
86
+
87
+ def refunds_transactions=(val)
88
+ @refunds_transactions = val
89
+ end
90
+
91
+ def refunds_volume=(val)
92
+ @refunds_volume = val
93
+ end
94
+
95
+ def chargebacks_transactions=(val)
96
+ @chargebacks_transactions = val
97
+ end
98
+
99
+ def chargebacks_volume=(val)
100
+ @chargebacks_volume = val
101
+ end
102
+
103
+ def fees=(val)
104
+ @fees = val
105
+ end
106
+
107
+ def adjustments=(val)
108
+ @adjustments = val
109
+ end
110
+
111
+ def reserve=(val)
112
+ @reserve = val
113
+ end
114
+
115
+ def created_at=(val)
116
+ @created_at = val
117
+ end
118
+
119
+
120
+ # Initializes the Payout object
121
+ # Params:
122
+ # +client+:: +ProcessOut+ client instance
123
+ # +data+:: data that can be used to fill the object
124
+ def initialize(client, data = {})
125
+ @client = client
126
+
127
+ self.id = data.fetch(:id, nil)
128
+ self.project = data.fetch(:project, nil)
129
+ self.project_id = data.fetch(:project_id, nil)
130
+ self.status = data.fetch(:status, nil)
131
+ self.amount = data.fetch(:amount, nil)
132
+ self.currency = data.fetch(:currency, nil)
133
+ self.metadata = data.fetch(:metadata, nil)
134
+ self.bank_name = data.fetch(:bank_name, nil)
135
+ self.bank_summary = data.fetch(:bank_summary, nil)
136
+ self.sales_transactions = data.fetch(:sales_transactions, nil)
137
+ self.sales_volume = data.fetch(:sales_volume, nil)
138
+ self.refunds_transactions = data.fetch(:refunds_transactions, nil)
139
+ self.refunds_volume = data.fetch(:refunds_volume, nil)
140
+ self.chargebacks_transactions = data.fetch(:chargebacks_transactions, nil)
141
+ self.chargebacks_volume = data.fetch(:chargebacks_volume, nil)
142
+ self.fees = data.fetch(:fees, nil)
143
+ self.adjustments = data.fetch(:adjustments, nil)
144
+ self.reserve = data.fetch(:reserve, nil)
145
+ self.created_at = data.fetch(:created_at, nil)
146
+
147
+ end
148
+
149
+ # Create a new Payout using the current client
150
+ def new(data = {})
151
+ Payout.new(@client, data)
152
+ end
153
+
154
+ # Fills the object with data coming from the API
155
+ # Params:
156
+ # +data+:: +Hash+ of data coming from the API
157
+ def fill_with_data(data)
158
+ if data.nil?
159
+ return self
160
+ end
161
+ if data.include? "id"
162
+ self.id = data["id"]
163
+ end
164
+ if data.include? "project"
165
+ self.project = data["project"]
166
+ end
167
+ if data.include? "project_id"
168
+ self.project_id = data["project_id"]
169
+ end
170
+ if data.include? "status"
171
+ self.status = data["status"]
172
+ end
173
+ if data.include? "amount"
174
+ self.amount = data["amount"]
175
+ end
176
+ if data.include? "currency"
177
+ self.currency = data["currency"]
178
+ end
179
+ if data.include? "metadata"
180
+ self.metadata = data["metadata"]
181
+ end
182
+ if data.include? "bank_name"
183
+ self.bank_name = data["bank_name"]
184
+ end
185
+ if data.include? "bank_summary"
186
+ self.bank_summary = data["bank_summary"]
187
+ end
188
+ if data.include? "sales_transactions"
189
+ self.sales_transactions = data["sales_transactions"]
190
+ end
191
+ if data.include? "sales_volume"
192
+ self.sales_volume = data["sales_volume"]
193
+ end
194
+ if data.include? "refunds_transactions"
195
+ self.refunds_transactions = data["refunds_transactions"]
196
+ end
197
+ if data.include? "refunds_volume"
198
+ self.refunds_volume = data["refunds_volume"]
199
+ end
200
+ if data.include? "chargebacks_transactions"
201
+ self.chargebacks_transactions = data["chargebacks_transactions"]
202
+ end
203
+ if data.include? "chargebacks_volume"
204
+ self.chargebacks_volume = data["chargebacks_volume"]
205
+ end
206
+ if data.include? "fees"
207
+ self.fees = data["fees"]
208
+ end
209
+ if data.include? "adjustments"
210
+ self.adjustments = data["adjustments"]
211
+ end
212
+ if data.include? "reserve"
213
+ self.reserve = data["reserve"]
214
+ end
215
+ if data.include? "created_at"
216
+ self.created_at = data["created_at"]
217
+ end
218
+
219
+ self
220
+ end
221
+
222
+ # Prefills the object with the data passed as parameters
223
+ # Params:
224
+ # +data+:: +Hash+ of data
225
+ def prefill(data)
226
+ if data.nil?
227
+ return self
228
+ end
229
+ self.id = data.fetch(:id, self.id)
230
+ self.project = data.fetch(:project, self.project)
231
+ self.project_id = data.fetch(:project_id, self.project_id)
232
+ self.status = data.fetch(:status, self.status)
233
+ self.amount = data.fetch(:amount, self.amount)
234
+ self.currency = data.fetch(:currency, self.currency)
235
+ self.metadata = data.fetch(:metadata, self.metadata)
236
+ self.bank_name = data.fetch(:bank_name, self.bank_name)
237
+ self.bank_summary = data.fetch(:bank_summary, self.bank_summary)
238
+ self.sales_transactions = data.fetch(:sales_transactions, self.sales_transactions)
239
+ self.sales_volume = data.fetch(:sales_volume, self.sales_volume)
240
+ self.refunds_transactions = data.fetch(:refunds_transactions, self.refunds_transactions)
241
+ self.refunds_volume = data.fetch(:refunds_volume, self.refunds_volume)
242
+ self.chargebacks_transactions = data.fetch(:chargebacks_transactions, self.chargebacks_transactions)
243
+ self.chargebacks_volume = data.fetch(:chargebacks_volume, self.chargebacks_volume)
244
+ self.fees = data.fetch(:fees, self.fees)
245
+ self.adjustments = data.fetch(:adjustments, self.adjustments)
246
+ self.reserve = data.fetch(:reserve, self.reserve)
247
+ self.created_at = data.fetch(:created_at, self.created_at)
248
+
249
+ self
250
+ end
251
+
252
+ # Get all the items linked to the payout.
253
+ # Params:
254
+ # +options+:: +Hash+ of options
255
+ def fetch_items(options = {})
256
+ self.prefill(options)
257
+
258
+ request = Request.new(@client)
259
+ path = "/payouts/" + CGI.escape(@id) + "/items"
260
+ data = {
261
+
262
+ }
263
+
264
+ response = Response.new(request.get(path, data, options))
265
+ return_values = Array.new
266
+
267
+ a = Array.new
268
+ body = response.body
269
+ for v in body['items']
270
+ tmp = PayoutItem.new(@client)
271
+ tmp.fill_with_data(v)
272
+ a.push(tmp)
273
+ end
274
+
275
+ return_values.push(a)
276
+
277
+
278
+
279
+ return_values[0]
280
+ end
281
+
282
+ # Get all the payouts.
283
+ # Params:
284
+ # +options+:: +Hash+ of options
285
+ def all(options = {})
286
+ self.prefill(options)
287
+
288
+ request = Request.new(@client)
289
+ path = "/payouts"
290
+ data = {
291
+
292
+ }
293
+
294
+ response = Response.new(request.get(path, data, options))
295
+ return_values = Array.new
296
+
297
+ a = Array.new
298
+ body = response.body
299
+ for v in body['payouts']
300
+ tmp = Payout.new(@client)
301
+ tmp.fill_with_data(v)
302
+ a.push(tmp)
303
+ end
304
+
305
+ return_values.push(a)
306
+
307
+
308
+
309
+ return_values[0]
310
+ end
311
+
312
+ # Find a payout by its ID.
313
+ # Params:
314
+ # +payout_id+:: ID of the payout
315
+ # +options+:: +Hash+ of options
316
+ def find(payout_id, options = {})
317
+ self.prefill(options)
318
+
319
+ request = Request.new(@client)
320
+ path = "/payouts/" + CGI.escape(payout_id) + ""
321
+ data = {
322
+
323
+ }
324
+
325
+ response = Response.new(request.get(path, data, options))
326
+ return_values = Array.new
327
+
328
+ body = response.body
329
+ body = body["payout"]
330
+
331
+
332
+ obj = Payout.new(@client)
333
+ return_values.push(obj.fill_with_data(body))
334
+
335
+
336
+
337
+ return_values[0]
338
+ end
339
+
340
+
341
+ end
342
+ end
@@ -0,0 +1,208 @@
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 PayoutItem
9
+
10
+ attr_reader :id
11
+ attr_reader :project
12
+ attr_reader :project_id
13
+ attr_reader :payout
14
+ attr_reader :payout_id
15
+ attr_reader :transaction
16
+ attr_reader :transaction_id
17
+ attr_reader :type
18
+ attr_reader :gateway_id
19
+ attr_reader :fee
20
+ attr_reader :metadata
21
+ attr_reader :created_at
22
+
23
+
24
+ def id=(val)
25
+ @id = val
26
+ end
27
+
28
+ def project=(val)
29
+ if val.nil?
30
+ @project = val
31
+ return
32
+ end
33
+
34
+ if val.instance_of? Project
35
+ @project = val
36
+ else
37
+ obj = Project.new(@client)
38
+ obj.fill_with_data(val)
39
+ @project = obj
40
+ end
41
+
42
+ end
43
+
44
+ def project_id=(val)
45
+ @project_id = val
46
+ end
47
+
48
+ def payout=(val)
49
+ if val.nil?
50
+ @payout = val
51
+ return
52
+ end
53
+
54
+ if val.instance_of? Payout
55
+ @payout = val
56
+ else
57
+ obj = Payout.new(@client)
58
+ obj.fill_with_data(val)
59
+ @payout = obj
60
+ end
61
+
62
+ end
63
+
64
+ def payout_id=(val)
65
+ @payout_id = val
66
+ end
67
+
68
+ def transaction=(val)
69
+ if val.nil?
70
+ @transaction = val
71
+ return
72
+ end
73
+
74
+ if val.instance_of? Transaction
75
+ @transaction = val
76
+ else
77
+ obj = Transaction.new(@client)
78
+ obj.fill_with_data(val)
79
+ @transaction = obj
80
+ end
81
+
82
+ end
83
+
84
+ def transaction_id=(val)
85
+ @transaction_id = val
86
+ end
87
+
88
+ def type=(val)
89
+ @type = val
90
+ end
91
+
92
+ def gateway_id=(val)
93
+ @gateway_id = val
94
+ end
95
+
96
+ def fee=(val)
97
+ @fee = val
98
+ end
99
+
100
+ def metadata=(val)
101
+ @metadata = val
102
+ end
103
+
104
+ def created_at=(val)
105
+ @created_at = val
106
+ end
107
+
108
+
109
+ # Initializes the PayoutItem object
110
+ # Params:
111
+ # +client+:: +ProcessOut+ client instance
112
+ # +data+:: data that can be used to fill the object
113
+ def initialize(client, data = {})
114
+ @client = client
115
+
116
+ self.id = data.fetch(:id, nil)
117
+ self.project = data.fetch(:project, nil)
118
+ self.project_id = data.fetch(:project_id, nil)
119
+ self.payout = data.fetch(:payout, nil)
120
+ self.payout_id = data.fetch(:payout_id, nil)
121
+ self.transaction = data.fetch(:transaction, nil)
122
+ self.transaction_id = data.fetch(:transaction_id, nil)
123
+ self.type = data.fetch(:type, nil)
124
+ self.gateway_id = data.fetch(:gateway_id, nil)
125
+ self.fee = data.fetch(:fee, nil)
126
+ self.metadata = data.fetch(:metadata, nil)
127
+ self.created_at = data.fetch(:created_at, nil)
128
+
129
+ end
130
+
131
+ # Create a new PayoutItem using the current client
132
+ def new(data = {})
133
+ PayoutItem.new(@client, data)
134
+ end
135
+
136
+ # Fills the object with data coming from the API
137
+ # Params:
138
+ # +data+:: +Hash+ of data coming from the API
139
+ def fill_with_data(data)
140
+ if data.nil?
141
+ return self
142
+ end
143
+ if data.include? "id"
144
+ self.id = data["id"]
145
+ end
146
+ if data.include? "project"
147
+ self.project = data["project"]
148
+ end
149
+ if data.include? "project_id"
150
+ self.project_id = data["project_id"]
151
+ end
152
+ if data.include? "payout"
153
+ self.payout = data["payout"]
154
+ end
155
+ if data.include? "payout_id"
156
+ self.payout_id = data["payout_id"]
157
+ end
158
+ if data.include? "transaction"
159
+ self.transaction = data["transaction"]
160
+ end
161
+ if data.include? "transaction_id"
162
+ self.transaction_id = data["transaction_id"]
163
+ end
164
+ if data.include? "type"
165
+ self.type = data["type"]
166
+ end
167
+ if data.include? "gateway_id"
168
+ self.gateway_id = data["gateway_id"]
169
+ end
170
+ if data.include? "fee"
171
+ self.fee = data["fee"]
172
+ end
173
+ if data.include? "metadata"
174
+ self.metadata = data["metadata"]
175
+ end
176
+ if data.include? "created_at"
177
+ self.created_at = data["created_at"]
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Prefills the object with the data passed as parameters
184
+ # Params:
185
+ # +data+:: +Hash+ of data
186
+ def prefill(data)
187
+ if data.nil?
188
+ return self
189
+ end
190
+ self.id = data.fetch(:id, self.id)
191
+ self.project = data.fetch(:project, self.project)
192
+ self.project_id = data.fetch(:project_id, self.project_id)
193
+ self.payout = data.fetch(:payout, self.payout)
194
+ self.payout_id = data.fetch(:payout_id, self.payout_id)
195
+ self.transaction = data.fetch(:transaction, self.transaction)
196
+ self.transaction_id = data.fetch(:transaction_id, self.transaction_id)
197
+ self.type = data.fetch(:type, self.type)
198
+ self.gateway_id = data.fetch(:gateway_id, self.gateway_id)
199
+ self.fee = data.fetch(:fee, self.fee)
200
+ self.metadata = data.fetch(:metadata, self.metadata)
201
+ self.created_at = data.fetch(:created_at, self.created_at)
202
+
203
+ self
204
+ end
205
+
206
+
207
+ end
208
+ end
@@ -204,7 +204,7 @@ module ProcessOut
204
204
  self.prefill(options)
205
205
 
206
206
  request = Request.new(@client)
207
- path = "/projects/{project_id}/private-key"
207
+ path = "/private-keys"
208
208
  data = {
209
209
 
210
210
  }
@@ -221,13 +221,86 @@ module ProcessOut
221
221
 
222
222
 
223
223
 
224
+ return_values[0]
225
+ end
226
+
227
+ # Fetch the current project information.
228
+ # Params:
229
+ # +options+:: +Hash+ of options
230
+ def fetch(options = {})
231
+ self.prefill(options)
232
+
233
+ request = Request.new(@client)
234
+ path = "/projects/" + CGI.escape(@id) + ""
235
+ data = {
236
+
237
+ }
238
+
239
+ response = Response.new(request.get(path, data, options))
240
+ return_values = Array.new
241
+
242
+ body = response.body
243
+ body = body["project"]
244
+
245
+
246
+ return_values.push(self.fill_with_data(body))
247
+
248
+
249
+
250
+ return_values[0]
251
+ end
252
+
253
+ # Save the updated project's attributes.
254
+ # Params:
255
+ # +options+:: +Hash+ of options
256
+ def save(options = {})
257
+ self.prefill(options)
258
+
259
+ request = Request.new(@client)
260
+ path = "/projects/" + CGI.escape(@id) + ""
261
+ data = {
262
+
263
+ }
264
+
265
+ response = Response.new(request.put(path, data, options))
266
+ return_values = Array.new
267
+
268
+ body = response.body
269
+ body = body["project"]
270
+
271
+
272
+ return_values.push(self.fill_with_data(body))
273
+
274
+
275
+
276
+ return_values[0]
277
+ end
278
+
279
+ # Delete the project. Be careful! Executing this request will prevent any further interaction with the API that uses this project.
280
+ # Params:
281
+ # +options+:: +Hash+ of options
282
+ def delete(options = {})
283
+ self.prefill(options)
284
+
285
+ request = Request.new(@client)
286
+ path = "/projects/{project_id}"
287
+ data = {
288
+
289
+ }
290
+
291
+ response = Response.new(request.delete(path, data, options))
292
+ return_values = Array.new
293
+
294
+ return_values.push(response.success)
295
+
296
+
224
297
  return_values[0]
225
298
  end
226
299
 
227
300
  # Get all the supervised projects.
228
301
  # Params:
229
302
  # +options+:: +Hash+ of options
230
- def all_supervised(options = {})
303
+ def fetch_supervised(options = {})
231
304
  self.prefill(options)
232
305
 
233
306
  request = Request.new(@client)
@@ -28,6 +28,8 @@ module ProcessOut
28
28
  attr_reader :amount
29
29
  attr_reader :authorized_amount
30
30
  attr_reader :captured_amount
31
+ attr_reader :refunded_amount
32
+ attr_reader :available_amount
31
33
  attr_reader :currency
32
34
  attr_reader :error_code
33
35
  attr_reader :three_d_s_status
@@ -242,6 +244,14 @@ module ProcessOut
242
244
  @captured_amount = val
243
245
  end
244
246
 
247
+ def refunded_amount=(val)
248
+ @refunded_amount = val
249
+ end
250
+
251
+ def available_amount=(val)
252
+ @available_amount = val
253
+ end
254
+
245
255
  def currency=(val)
246
256
  @currency = val
247
257
  end
@@ -319,6 +329,8 @@ module ProcessOut
319
329
  self.amount = data.fetch(:amount, nil)
320
330
  self.authorized_amount = data.fetch(:authorized_amount, nil)
321
331
  self.captured_amount = data.fetch(:captured_amount, nil)
332
+ self.refunded_amount = data.fetch(:refunded_amount, nil)
333
+ self.available_amount = data.fetch(:available_amount, nil)
322
334
  self.currency = data.fetch(:currency, nil)
323
335
  self.error_code = data.fetch(:error_code, nil)
324
336
  self.three_d_s_status = data.fetch(:three_d_s_status, nil)
@@ -409,6 +421,12 @@ module ProcessOut
409
421
  if data.include? "captured_amount"
410
422
  self.captured_amount = data["captured_amount"]
411
423
  end
424
+ if data.include? "refunded_amount"
425
+ self.refunded_amount = data["refunded_amount"]
426
+ end
427
+ if data.include? "available_amount"
428
+ self.available_amount = data["available_amount"]
429
+ end
412
430
  if data.include? "currency"
413
431
  self.currency = data["currency"]
414
432
  end
@@ -477,6 +495,8 @@ module ProcessOut
477
495
  self.amount = data.fetch(:amount, self.amount)
478
496
  self.authorized_amount = data.fetch(:authorized_amount, self.authorized_amount)
479
497
  self.captured_amount = data.fetch(:captured_amount, self.captured_amount)
498
+ self.refunded_amount = data.fetch(:refunded_amount, self.refunded_amount)
499
+ self.available_amount = data.fetch(:available_amount, self.available_amount)
480
500
  self.currency = data.fetch(:currency, self.currency)
481
501
  self.error_code = data.fetch(:error_code, self.error_code)
482
502
  self.three_d_s_status = data.fetch(:three_d_s_status, self.three_d_s_status)
@@ -19,7 +19,11 @@ module ProcessOut
19
19
  attr_reader :has_failed
20
20
  attr_reader :is_accountable
21
21
  attr_reader :type
22
+ attr_reader :gateway_operation_id
22
23
  attr_reader :error_code
24
+ attr_reader :payment_data_three_d_s_request
25
+ attr_reader :payment_data_three_d_s_authentication
26
+ attr_reader :payment_data_network_authentication
23
27
  attr_reader :metadata
24
28
  attr_reader :gateway_fee
25
29
  attr_reader :created_at
@@ -109,10 +113,62 @@ module ProcessOut
109
113
  @type = val
110
114
  end
111
115
 
116
+ def gateway_operation_id=(val)
117
+ @gateway_operation_id = val
118
+ end
119
+
112
120
  def error_code=(val)
113
121
  @error_code = val
114
122
  end
115
123
 
124
+ def payment_data_three_d_s_request=(val)
125
+ if val.nil?
126
+ @payment_data_three_d_s_request = val
127
+ return
128
+ end
129
+
130
+ if val.instance_of? PaymentDataThreeDSRequest
131
+ @payment_data_three_d_s_request = val
132
+ else
133
+ obj = PaymentDataThreeDSRequest.new(@client)
134
+ obj.fill_with_data(val)
135
+ @payment_data_three_d_s_request = obj
136
+ end
137
+
138
+ end
139
+
140
+ def payment_data_three_d_s_authentication=(val)
141
+ if val.nil?
142
+ @payment_data_three_d_s_authentication = val
143
+ return
144
+ end
145
+
146
+ if val.instance_of? PaymentDataThreeDSAuthentication
147
+ @payment_data_three_d_s_authentication = val
148
+ else
149
+ obj = PaymentDataThreeDSAuthentication.new(@client)
150
+ obj.fill_with_data(val)
151
+ @payment_data_three_d_s_authentication = obj
152
+ end
153
+
154
+ end
155
+
156
+ def payment_data_network_authentication=(val)
157
+ if val.nil?
158
+ @payment_data_network_authentication = val
159
+ return
160
+ end
161
+
162
+ if val.instance_of? PaymentDataNetworkAuthentication
163
+ @payment_data_network_authentication = val
164
+ else
165
+ obj = PaymentDataNetworkAuthentication.new(@client)
166
+ obj.fill_with_data(val)
167
+ @payment_data_network_authentication = obj
168
+ end
169
+
170
+ end
171
+
116
172
  def metadata=(val)
117
173
  @metadata = val
118
174
  end
@@ -145,7 +201,11 @@ module ProcessOut
145
201
  self.has_failed = data.fetch(:has_failed, nil)
146
202
  self.is_accountable = data.fetch(:is_accountable, nil)
147
203
  self.type = data.fetch(:type, nil)
204
+ self.gateway_operation_id = data.fetch(:gateway_operation_id, nil)
148
205
  self.error_code = data.fetch(:error_code, nil)
206
+ self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, nil)
207
+ self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, nil)
208
+ self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, nil)
149
209
  self.metadata = data.fetch(:metadata, nil)
150
210
  self.gateway_fee = data.fetch(:gateway_fee, nil)
151
211
  self.created_at = data.fetch(:created_at, nil)
@@ -200,9 +260,21 @@ module ProcessOut
200
260
  if data.include? "type"
201
261
  self.type = data["type"]
202
262
  end
263
+ if data.include? "gateway_operation_id"
264
+ self.gateway_operation_id = data["gateway_operation_id"]
265
+ end
203
266
  if data.include? "error_code"
204
267
  self.error_code = data["error_code"]
205
268
  end
269
+ if data.include? "payment_data_three_d_s_request"
270
+ self.payment_data_three_d_s_request = data["payment_data_three_d_s_request"]
271
+ end
272
+ if data.include? "payment_data_three_d_s_authentication"
273
+ self.payment_data_three_d_s_authentication = data["payment_data_three_d_s_authentication"]
274
+ end
275
+ if data.include? "payment_data_network_authentication"
276
+ self.payment_data_network_authentication = data["payment_data_network_authentication"]
277
+ end
206
278
  if data.include? "metadata"
207
279
  self.metadata = data["metadata"]
208
280
  end
@@ -235,7 +307,11 @@ module ProcessOut
235
307
  self.has_failed = data.fetch(:has_failed, self.has_failed)
236
308
  self.is_accountable = data.fetch(:is_accountable, self.is_accountable)
237
309
  self.type = data.fetch(:type, self.type)
310
+ self.gateway_operation_id = data.fetch(:gateway_operation_id, self.gateway_operation_id)
238
311
  self.error_code = data.fetch(:error_code, self.error_code)
312
+ self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, self.payment_data_three_d_s_request)
313
+ self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, self.payment_data_three_d_s_authentication)
314
+ self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, self.payment_data_network_authentication)
239
315
  self.metadata = data.fetch(:metadata, self.metadata)
240
316
  self.gateway_fee = data.fetch(:gateway_fee, self.gateway_fee)
241
317
  self.created_at = data.fetch(:created_at, self.created_at)
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "2.5.0"
2
+ VERSION = "2.6.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.5.0
4
+ version: 2.6.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: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,6 +95,11 @@ files:
95
95
  - lib/processout/invoice_detail.rb
96
96
  - lib/processout/networking/request.rb
97
97
  - lib/processout/networking/response.rb
98
+ - lib/processout/payment_data_network_authentication.rb
99
+ - lib/processout/payment_data_three_ds_authentication.rb
100
+ - lib/processout/payment_data_three_ds_request.rb
101
+ - lib/processout/payout.rb
102
+ - lib/processout/payout_item.rb
98
103
  - lib/processout/plan.rb
99
104
  - lib/processout/product.rb
100
105
  - lib/processout/project.rb
@@ -127,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
132
  version: '0'
128
133
  requirements: []
129
134
  rubyforge_project:
130
- rubygems_version: 2.5.2
135
+ rubygems_version: 2.5.2.3
131
136
  signing_key:
132
137
  specification_version: 4
133
138
  summary: Ruby bindings for the ProcessOut API