processout 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/processout/customer.rb +13 -0
- data/lib/processout/invoice.rb +82 -0
- data/lib/processout/invoice_submerchant.rb +182 -0
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/submerchant_address.rb +136 -0
- data/lib/processout/submerchant_phone_number.rb +81 -0
- data/lib/processout/token.rb +12 -0
- data/lib/processout/transaction_operation.rb +22 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout.rb +24 -6
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75601257145ef1eb4375638b5ca39be8b73645409ab8a7cf25f1d8d6b65b58e1
|
4
|
+
data.tar.gz: e23c62e04974f47300b5904bf3e3eb5a4d331c236a8e14696baca24e6784ee75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d3bfc576fcbb6b4789d12a5be1e70e5d5f6b9878f29dd5a34e26a83e1c6312b1360846cfca14fc42630d847aa9d329744515201cdc03b1f80fea136737f724
|
7
|
+
data.tar.gz: f5d3980b0c3d7b859ece2d75f5c46af5a296582b08e38d81c53f36206a4251e76b6189e8f9869e46fba697c4694dc3d424b9b589b39f7f31978e5fbd813e2727
|
data/lib/processout/customer.rb
CHANGED
@@ -21,6 +21,7 @@ module ProcessOut
|
|
21
21
|
attr_reader :email
|
22
22
|
attr_reader :first_name
|
23
23
|
attr_reader :last_name
|
24
|
+
attr_reader :company_name
|
24
25
|
attr_reader :address1
|
25
26
|
attr_reader :address2
|
26
27
|
attr_reader :city
|
@@ -164,6 +165,10 @@ module ProcessOut
|
|
164
165
|
@last_name = val
|
165
166
|
end
|
166
167
|
|
168
|
+
def company_name=(val)
|
169
|
+
@company_name = val
|
170
|
+
end
|
171
|
+
|
167
172
|
def address1=(val)
|
168
173
|
@address1 = val
|
169
174
|
end
|
@@ -265,6 +270,7 @@ module ProcessOut
|
|
265
270
|
self.email = data.fetch(:email, nil)
|
266
271
|
self.first_name = data.fetch(:first_name, nil)
|
267
272
|
self.last_name = data.fetch(:last_name, nil)
|
273
|
+
self.company_name = data.fetch(:company_name, nil)
|
268
274
|
self.address1 = data.fetch(:address1, nil)
|
269
275
|
self.address2 = data.fetch(:address2, nil)
|
270
276
|
self.city = data.fetch(:city, nil)
|
@@ -306,6 +312,7 @@ module ProcessOut
|
|
306
312
|
"email": self.email,
|
307
313
|
"first_name": self.first_name,
|
308
314
|
"last_name": self.last_name,
|
315
|
+
"company_name": self.company_name,
|
309
316
|
"address1": self.address1,
|
310
317
|
"address2": self.address2,
|
311
318
|
"city": self.city,
|
@@ -372,6 +379,9 @@ module ProcessOut
|
|
372
379
|
if data.include? "last_name"
|
373
380
|
self.last_name = data["last_name"]
|
374
381
|
end
|
382
|
+
if data.include? "company_name"
|
383
|
+
self.company_name = data["company_name"]
|
384
|
+
end
|
375
385
|
if data.include? "address1"
|
376
386
|
self.address1 = data["address1"]
|
377
387
|
end
|
@@ -447,6 +457,7 @@ module ProcessOut
|
|
447
457
|
self.email = data.fetch(:email, self.email)
|
448
458
|
self.first_name = data.fetch(:first_name, self.first_name)
|
449
459
|
self.last_name = data.fetch(:last_name, self.last_name)
|
460
|
+
self.company_name = data.fetch(:company_name, self.company_name)
|
450
461
|
self.address1 = data.fetch(:address1, self.address1)
|
451
462
|
self.address2 = data.fetch(:address2, self.address2)
|
452
463
|
self.city = data.fetch(:city, self.city)
|
@@ -649,6 +660,7 @@ module ProcessOut
|
|
649
660
|
"email" => @email,
|
650
661
|
"first_name" => @first_name,
|
651
662
|
"last_name" => @last_name,
|
663
|
+
"company_name" => @company_name,
|
652
664
|
"address1" => @address1,
|
653
665
|
"address2" => @address2,
|
654
666
|
"city" => @city,
|
@@ -723,6 +735,7 @@ module ProcessOut
|
|
723
735
|
"email" => @email,
|
724
736
|
"first_name" => @first_name,
|
725
737
|
"last_name" => @last_name,
|
738
|
+
"company_name" => @company_name,
|
726
739
|
"address1" => @address1,
|
727
740
|
"address2" => @address2,
|
728
741
|
"city" => @city,
|
data/lib/processout/invoice.rb
CHANGED
@@ -20,6 +20,7 @@ module ProcessOut
|
|
20
20
|
attr_reader :token
|
21
21
|
attr_reader :token_id
|
22
22
|
attr_reader :details
|
23
|
+
attr_reader :submerchant
|
23
24
|
attr_reader :url
|
24
25
|
attr_reader :url_qrcode
|
25
26
|
attr_reader :name
|
@@ -184,6 +185,22 @@ module ProcessOut
|
|
184
185
|
|
185
186
|
end
|
186
187
|
|
188
|
+
def submerchant=(val)
|
189
|
+
if val.nil?
|
190
|
+
@submerchant = val
|
191
|
+
return
|
192
|
+
end
|
193
|
+
|
194
|
+
if val.instance_of? InvoiceSubmerchant
|
195
|
+
@submerchant = val
|
196
|
+
else
|
197
|
+
obj = InvoiceSubmerchant.new(@client)
|
198
|
+
obj.fill_with_data(val)
|
199
|
+
@submerchant = obj
|
200
|
+
end
|
201
|
+
|
202
|
+
end
|
203
|
+
|
187
204
|
def url=(val)
|
188
205
|
@url = val
|
189
206
|
end
|
@@ -452,6 +469,7 @@ module ProcessOut
|
|
452
469
|
self.token = data.fetch(:token, nil)
|
453
470
|
self.token_id = data.fetch(:token_id, nil)
|
454
471
|
self.details = data.fetch(:details, nil)
|
472
|
+
self.submerchant = data.fetch(:submerchant, nil)
|
455
473
|
self.url = data.fetch(:url, nil)
|
456
474
|
self.url_qrcode = data.fetch(:url_qrcode, nil)
|
457
475
|
self.name = data.fetch(:name, nil)
|
@@ -513,6 +531,7 @@ module ProcessOut
|
|
513
531
|
"token": self.token,
|
514
532
|
"token_id": self.token_id,
|
515
533
|
"details": self.details,
|
534
|
+
"submerchant": self.submerchant,
|
516
535
|
"url": self.url,
|
517
536
|
"url_qrcode": self.url_qrcode,
|
518
537
|
"name": self.name,
|
@@ -597,6 +616,9 @@ module ProcessOut
|
|
597
616
|
if data.include? "details"
|
598
617
|
self.details = data["details"]
|
599
618
|
end
|
619
|
+
if data.include? "submerchant"
|
620
|
+
self.submerchant = data["submerchant"]
|
621
|
+
end
|
600
622
|
if data.include? "url"
|
601
623
|
self.url = data["url"]
|
602
624
|
end
|
@@ -734,6 +756,7 @@ module ProcessOut
|
|
734
756
|
self.token = data.fetch(:token, self.token)
|
735
757
|
self.token_id = data.fetch(:token_id, self.token_id)
|
736
758
|
self.details = data.fetch(:details, self.details)
|
759
|
+
self.submerchant = data.fetch(:submerchant, self.submerchant)
|
737
760
|
self.url = data.fetch(:url, self.url)
|
738
761
|
self.url_qrcode = data.fetch(:url_qrcode, self.url_qrcode)
|
739
762
|
self.name = data.fetch(:name, self.name)
|
@@ -1139,6 +1162,7 @@ module ProcessOut
|
|
1139
1162
|
"currency" => @currency,
|
1140
1163
|
"metadata" => @metadata,
|
1141
1164
|
"details" => @details,
|
1165
|
+
"submerchant" => @submerchant,
|
1142
1166
|
"exemption_reason_3ds2" => @exemption_reason_3ds2,
|
1143
1167
|
"sca_exemption_reason" => @sca_exemption_reason,
|
1144
1168
|
"challenge_indicator" => @challenge_indicator,
|
@@ -1229,6 +1253,64 @@ module ProcessOut
|
|
1229
1253
|
return_values.push(response.success)
|
1230
1254
|
|
1231
1255
|
|
1256
|
+
return_values[0]
|
1257
|
+
end
|
1258
|
+
|
1259
|
+
# Refresh invoice by its ID with PSP.
|
1260
|
+
# Params:
|
1261
|
+
# +invoice_id+:: ID of the invoice
|
1262
|
+
# +options+:: +Hash+ of options
|
1263
|
+
def sync_with_psp(invoice_id, options = {})
|
1264
|
+
self.prefill(options)
|
1265
|
+
|
1266
|
+
request = Request.new(@client)
|
1267
|
+
path = "/invoices/" + CGI.escape(invoice_id) + "/sync-with-psp"
|
1268
|
+
data = {
|
1269
|
+
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
response = Response.new(request.put(path, data, options))
|
1273
|
+
return_values = Array.new
|
1274
|
+
|
1275
|
+
body = response.body
|
1276
|
+
body = body["invoice"]
|
1277
|
+
|
1278
|
+
|
1279
|
+
obj = Invoice.new(@client)
|
1280
|
+
return_values.push(obj.fill_with_data(body))
|
1281
|
+
|
1282
|
+
|
1283
|
+
|
1284
|
+
return_values[0]
|
1285
|
+
end
|
1286
|
+
|
1287
|
+
# Update invoice by its ID.
|
1288
|
+
# Params:
|
1289
|
+
# +invoice_id+:: ID of the invoice
|
1290
|
+
# +options+:: +Hash+ of options
|
1291
|
+
def update(invoice_id, options = {})
|
1292
|
+
self.prefill(options)
|
1293
|
+
|
1294
|
+
request = Request.new(@client)
|
1295
|
+
path = "/invoices/" + CGI.escape(invoice_id) + ""
|
1296
|
+
data = {
|
1297
|
+
"amount" => @amount,
|
1298
|
+
"tax" => @tax,
|
1299
|
+
"details" => @details,
|
1300
|
+
"shipping" => @shipping
|
1301
|
+
}
|
1302
|
+
|
1303
|
+
response = Response.new(request.put(path, data, options))
|
1304
|
+
return_values = Array.new
|
1305
|
+
|
1306
|
+
body = response.body
|
1307
|
+
body = body["invoice"]
|
1308
|
+
|
1309
|
+
|
1310
|
+
return_values.push(self.fill_with_data(body))
|
1311
|
+
|
1312
|
+
|
1313
|
+
|
1232
1314
|
return_values[0]
|
1233
1315
|
end
|
1234
1316
|
|
@@ -0,0 +1,182 @@
|
|
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 InvoiceSubmerchant
|
10
|
+
|
11
|
+
attr_reader :id
|
12
|
+
attr_reader :name
|
13
|
+
attr_reader :reference
|
14
|
+
attr_reader :mcc
|
15
|
+
attr_reader :phone_number
|
16
|
+
attr_reader :email
|
17
|
+
attr_reader :address
|
18
|
+
attr_reader :tax_reference
|
19
|
+
attr_reader :service_establishment_number
|
20
|
+
|
21
|
+
|
22
|
+
def id=(val)
|
23
|
+
@id = val
|
24
|
+
end
|
25
|
+
|
26
|
+
def name=(val)
|
27
|
+
@name = val
|
28
|
+
end
|
29
|
+
|
30
|
+
def reference=(val)
|
31
|
+
@reference = val
|
32
|
+
end
|
33
|
+
|
34
|
+
def mcc=(val)
|
35
|
+
@mcc = val
|
36
|
+
end
|
37
|
+
|
38
|
+
def phone_number=(val)
|
39
|
+
if val.nil?
|
40
|
+
@phone_number = val
|
41
|
+
return
|
42
|
+
end
|
43
|
+
|
44
|
+
if val.instance_of? SubmerchantPhoneNumber
|
45
|
+
@phone_number = val
|
46
|
+
else
|
47
|
+
obj = SubmerchantPhoneNumber.new(@client)
|
48
|
+
obj.fill_with_data(val)
|
49
|
+
@phone_number = obj
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
def email=(val)
|
55
|
+
@email = val
|
56
|
+
end
|
57
|
+
|
58
|
+
def address=(val)
|
59
|
+
if val.nil?
|
60
|
+
@address = val
|
61
|
+
return
|
62
|
+
end
|
63
|
+
|
64
|
+
if val.instance_of? SubmerchantAddress
|
65
|
+
@address = val
|
66
|
+
else
|
67
|
+
obj = SubmerchantAddress.new(@client)
|
68
|
+
obj.fill_with_data(val)
|
69
|
+
@address = obj
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
def tax_reference=(val)
|
75
|
+
@tax_reference = val
|
76
|
+
end
|
77
|
+
|
78
|
+
def service_establishment_number=(val)
|
79
|
+
@service_establishment_number = val
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
# Initializes the InvoiceSubmerchant object
|
84
|
+
# Params:
|
85
|
+
# +client+:: +ProcessOut+ client instance
|
86
|
+
# +data+:: data that can be used to fill the object
|
87
|
+
def initialize(client, data = {})
|
88
|
+
@client = client
|
89
|
+
|
90
|
+
self.id = data.fetch(:id, nil)
|
91
|
+
self.name = data.fetch(:name, nil)
|
92
|
+
self.reference = data.fetch(:reference, nil)
|
93
|
+
self.mcc = data.fetch(:mcc, nil)
|
94
|
+
self.phone_number = data.fetch(:phone_number, nil)
|
95
|
+
self.email = data.fetch(:email, nil)
|
96
|
+
self.address = data.fetch(:address, nil)
|
97
|
+
self.tax_reference = data.fetch(:tax_reference, nil)
|
98
|
+
self.service_establishment_number = data.fetch(:service_establishment_number, nil)
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
# Create a new InvoiceSubmerchant using the current client
|
103
|
+
def new(data = {})
|
104
|
+
InvoiceSubmerchant.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
|
+
"id": self.id,
|
111
|
+
"name": self.name,
|
112
|
+
"reference": self.reference,
|
113
|
+
"mcc": self.mcc,
|
114
|
+
"phone_number": self.phone_number,
|
115
|
+
"email": self.email,
|
116
|
+
"address": self.address,
|
117
|
+
"tax_reference": self.tax_reference,
|
118
|
+
"service_establishment_number": self.service_establishment_number,
|
119
|
+
}.to_json
|
120
|
+
end
|
121
|
+
|
122
|
+
# Fills the object with data coming from the API
|
123
|
+
# Params:
|
124
|
+
# +data+:: +Hash+ of data coming from the API
|
125
|
+
def fill_with_data(data)
|
126
|
+
if data.nil?
|
127
|
+
return self
|
128
|
+
end
|
129
|
+
if data.include? "id"
|
130
|
+
self.id = data["id"]
|
131
|
+
end
|
132
|
+
if data.include? "name"
|
133
|
+
self.name = data["name"]
|
134
|
+
end
|
135
|
+
if data.include? "reference"
|
136
|
+
self.reference = data["reference"]
|
137
|
+
end
|
138
|
+
if data.include? "mcc"
|
139
|
+
self.mcc = data["mcc"]
|
140
|
+
end
|
141
|
+
if data.include? "phone_number"
|
142
|
+
self.phone_number = data["phone_number"]
|
143
|
+
end
|
144
|
+
if data.include? "email"
|
145
|
+
self.email = data["email"]
|
146
|
+
end
|
147
|
+
if data.include? "address"
|
148
|
+
self.address = data["address"]
|
149
|
+
end
|
150
|
+
if data.include? "tax_reference"
|
151
|
+
self.tax_reference = data["tax_reference"]
|
152
|
+
end
|
153
|
+
if data.include? "service_establishment_number"
|
154
|
+
self.service_establishment_number = data["service_establishment_number"]
|
155
|
+
end
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
# Prefills the object with the data passed as parameters
|
161
|
+
# Params:
|
162
|
+
# +data+:: +Hash+ of data
|
163
|
+
def prefill(data)
|
164
|
+
if data.nil?
|
165
|
+
return self
|
166
|
+
end
|
167
|
+
self.id = data.fetch(:id, self.id)
|
168
|
+
self.name = data.fetch(:name, self.name)
|
169
|
+
self.reference = data.fetch(:reference, self.reference)
|
170
|
+
self.mcc = data.fetch(:mcc, self.mcc)
|
171
|
+
self.phone_number = data.fetch(:phone_number, self.phone_number)
|
172
|
+
self.email = data.fetch(:email, self.email)
|
173
|
+
self.address = data.fetch(:address, self.address)
|
174
|
+
self.tax_reference = data.fetch(:tax_reference, self.tax_reference)
|
175
|
+
self.service_establishment_number = data.fetch(:service_establishment_number, self.service_establishment_number)
|
176
|
+
|
177
|
+
self
|
178
|
+
end
|
179
|
+
|
180
|
+
|
181
|
+
end
|
182
|
+
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/3.
|
16
|
+
req["User-Agent"] = "ProcessOut Ruby-Bindings/3.3.0"
|
17
17
|
|
18
18
|
unless options.nil?
|
19
19
|
req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
|
@@ -0,0 +1,136 @@
|
|
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 SubmerchantAddress
|
10
|
+
|
11
|
+
attr_reader :line1
|
12
|
+
attr_reader :line2
|
13
|
+
attr_reader :city
|
14
|
+
attr_reader :state
|
15
|
+
attr_reader :country_code
|
16
|
+
attr_reader :zip
|
17
|
+
attr_reader :county
|
18
|
+
|
19
|
+
|
20
|
+
def line1=(val)
|
21
|
+
@line1 = val
|
22
|
+
end
|
23
|
+
|
24
|
+
def line2=(val)
|
25
|
+
@line2 = 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 county=(val)
|
45
|
+
@county = val
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
# Initializes the SubmerchantAddress object
|
50
|
+
# Params:
|
51
|
+
# +client+:: +ProcessOut+ client instance
|
52
|
+
# +data+:: data that can be used to fill the object
|
53
|
+
def initialize(client, data = {})
|
54
|
+
@client = client
|
55
|
+
|
56
|
+
self.line1 = data.fetch(:line1, nil)
|
57
|
+
self.line2 = data.fetch(:line2, nil)
|
58
|
+
self.city = data.fetch(:city, nil)
|
59
|
+
self.state = data.fetch(:state, nil)
|
60
|
+
self.country_code = data.fetch(:country_code, nil)
|
61
|
+
self.zip = data.fetch(:zip, nil)
|
62
|
+
self.county = data.fetch(:county, nil)
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
# Create a new SubmerchantAddress using the current client
|
67
|
+
def new(data = {})
|
68
|
+
SubmerchantAddress.new(@client, data)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Overrides the JSON marshaller to only send the fields we want
|
72
|
+
def to_json(options)
|
73
|
+
{
|
74
|
+
"line1": self.line1,
|
75
|
+
"line2": self.line2,
|
76
|
+
"city": self.city,
|
77
|
+
"state": self.state,
|
78
|
+
"country_code": self.country_code,
|
79
|
+
"zip": self.zip,
|
80
|
+
"county": self.county,
|
81
|
+
}.to_json
|
82
|
+
end
|
83
|
+
|
84
|
+
# Fills the object with data coming from the API
|
85
|
+
# Params:
|
86
|
+
# +data+:: +Hash+ of data coming from the API
|
87
|
+
def fill_with_data(data)
|
88
|
+
if data.nil?
|
89
|
+
return self
|
90
|
+
end
|
91
|
+
if data.include? "line1"
|
92
|
+
self.line1 = data["line1"]
|
93
|
+
end
|
94
|
+
if data.include? "line2"
|
95
|
+
self.line2 = data["line2"]
|
96
|
+
end
|
97
|
+
if data.include? "city"
|
98
|
+
self.city = data["city"]
|
99
|
+
end
|
100
|
+
if data.include? "state"
|
101
|
+
self.state = data["state"]
|
102
|
+
end
|
103
|
+
if data.include? "country_code"
|
104
|
+
self.country_code = data["country_code"]
|
105
|
+
end
|
106
|
+
if data.include? "zip"
|
107
|
+
self.zip = data["zip"]
|
108
|
+
end
|
109
|
+
if data.include? "county"
|
110
|
+
self.county = data["county"]
|
111
|
+
end
|
112
|
+
|
113
|
+
self
|
114
|
+
end
|
115
|
+
|
116
|
+
# Prefills the object with the data passed as parameters
|
117
|
+
# Params:
|
118
|
+
# +data+:: +Hash+ of data
|
119
|
+
def prefill(data)
|
120
|
+
if data.nil?
|
121
|
+
return self
|
122
|
+
end
|
123
|
+
self.line1 = data.fetch(:line1, self.line1)
|
124
|
+
self.line2 = data.fetch(:line2, self.line2)
|
125
|
+
self.city = data.fetch(:city, self.city)
|
126
|
+
self.state = data.fetch(:state, self.state)
|
127
|
+
self.country_code = data.fetch(:country_code, self.country_code)
|
128
|
+
self.zip = data.fetch(:zip, self.zip)
|
129
|
+
self.county = data.fetch(:county, self.county)
|
130
|
+
|
131
|
+
self
|
132
|
+
end
|
133
|
+
|
134
|
+
|
135
|
+
end
|
136
|
+
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 SubmerchantPhoneNumber
|
10
|
+
|
11
|
+
attr_reader :dialing_code
|
12
|
+
attr_reader :number
|
13
|
+
|
14
|
+
|
15
|
+
def dialing_code=(val)
|
16
|
+
@dialing_code = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def number=(val)
|
20
|
+
@number = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the SubmerchantPhoneNumber 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.dialing_code = data.fetch(:dialing_code, nil)
|
32
|
+
self.number = data.fetch(:number, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new SubmerchantPhoneNumber using the current client
|
37
|
+
def new(data = {})
|
38
|
+
SubmerchantPhoneNumber.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
|
+
"dialing_code": self.dialing_code,
|
45
|
+
"number": self.number,
|
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? "dialing_code"
|
57
|
+
self.dialing_code = data["dialing_code"]
|
58
|
+
end
|
59
|
+
if data.include? "number"
|
60
|
+
self.number = data["number"]
|
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.dialing_code = data.fetch(:dialing_code, self.dialing_code)
|
74
|
+
self.number = data.fetch(:number, self.number)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
data/lib/processout/token.rb
CHANGED
@@ -30,6 +30,7 @@ module ProcessOut
|
|
30
30
|
attr_reader :manual_invoice_cancellation
|
31
31
|
attr_reader :verification_status
|
32
32
|
attr_reader :can_get_balance
|
33
|
+
attr_reader :webhook_url
|
33
34
|
|
34
35
|
|
35
36
|
def id=(val)
|
@@ -168,6 +169,10 @@ module ProcessOut
|
|
168
169
|
@can_get_balance = val
|
169
170
|
end
|
170
171
|
|
172
|
+
def webhook_url=(val)
|
173
|
+
@webhook_url = val
|
174
|
+
end
|
175
|
+
|
171
176
|
|
172
177
|
# Initializes the Token object
|
173
178
|
# Params:
|
@@ -198,6 +203,7 @@ module ProcessOut
|
|
198
203
|
self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, nil)
|
199
204
|
self.verification_status = data.fetch(:verification_status, nil)
|
200
205
|
self.can_get_balance = data.fetch(:can_get_balance, nil)
|
206
|
+
self.webhook_url = data.fetch(:webhook_url, nil)
|
201
207
|
|
202
208
|
end
|
203
209
|
|
@@ -231,6 +237,7 @@ module ProcessOut
|
|
231
237
|
"manual_invoice_cancellation": self.manual_invoice_cancellation,
|
232
238
|
"verification_status": self.verification_status,
|
233
239
|
"can_get_balance": self.can_get_balance,
|
240
|
+
"webhook_url": self.webhook_url,
|
234
241
|
}.to_json
|
235
242
|
end
|
236
243
|
|
@@ -307,6 +314,9 @@ module ProcessOut
|
|
307
314
|
if data.include? "can_get_balance"
|
308
315
|
self.can_get_balance = data["can_get_balance"]
|
309
316
|
end
|
317
|
+
if data.include? "webhook_url"
|
318
|
+
self.webhook_url = data["webhook_url"]
|
319
|
+
end
|
310
320
|
|
311
321
|
self
|
312
322
|
end
|
@@ -340,6 +350,7 @@ module ProcessOut
|
|
340
350
|
self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, self.manual_invoice_cancellation)
|
341
351
|
self.verification_status = data.fetch(:verification_status, self.verification_status)
|
342
352
|
self.can_get_balance = data.fetch(:can_get_balance, self.can_get_balance)
|
353
|
+
self.webhook_url = data.fetch(:webhook_url, self.webhook_url)
|
343
354
|
|
344
355
|
self
|
345
356
|
end
|
@@ -419,6 +430,7 @@ module ProcessOut
|
|
419
430
|
"description" => @description,
|
420
431
|
"invoice_id" => @invoice_id,
|
421
432
|
"manual_invoice_cancellation" => @manual_invoice_cancellation,
|
433
|
+
"webhook_url" => @webhook_url,
|
422
434
|
"source" => options.fetch(:source, nil),
|
423
435
|
"settings" => options.fetch(:settings, nil),
|
424
436
|
"device" => options.fetch(:device, nil),
|
@@ -26,12 +26,14 @@ module ProcessOut
|
|
26
26
|
attr_reader :gateway_operation_id
|
27
27
|
attr_reader :arn
|
28
28
|
attr_reader :error_code
|
29
|
+
attr_reader :error_message
|
29
30
|
attr_reader :gateway_data
|
30
31
|
attr_reader :payment_data_three_d_s_request
|
31
32
|
attr_reader :payment_data_three_d_s_authentication
|
32
33
|
attr_reader :payment_data_network_authentication
|
33
34
|
attr_reader :initial_scheme_transaction_id
|
34
35
|
attr_reader :scheme_id
|
36
|
+
attr_reader :processed_with_network_token
|
35
37
|
attr_reader :payment_type
|
36
38
|
attr_reader :metadata
|
37
39
|
attr_reader :gateway_fee
|
@@ -158,6 +160,10 @@ module ProcessOut
|
|
158
160
|
@error_code = val
|
159
161
|
end
|
160
162
|
|
163
|
+
def error_message=(val)
|
164
|
+
@error_message = val
|
165
|
+
end
|
166
|
+
|
161
167
|
def gateway_data=(val)
|
162
168
|
@gateway_data = val
|
163
169
|
end
|
@@ -218,6 +224,10 @@ module ProcessOut
|
|
218
224
|
@scheme_id = val
|
219
225
|
end
|
220
226
|
|
227
|
+
def processed_with_network_token=(val)
|
228
|
+
@processed_with_network_token = val
|
229
|
+
end
|
230
|
+
|
221
231
|
def payment_type=(val)
|
222
232
|
@payment_type = val
|
223
233
|
end
|
@@ -260,12 +270,14 @@ module ProcessOut
|
|
260
270
|
self.gateway_operation_id = data.fetch(:gateway_operation_id, nil)
|
261
271
|
self.arn = data.fetch(:arn, nil)
|
262
272
|
self.error_code = data.fetch(:error_code, nil)
|
273
|
+
self.error_message = data.fetch(:error_message, nil)
|
263
274
|
self.gateway_data = data.fetch(:gateway_data, nil)
|
264
275
|
self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, nil)
|
265
276
|
self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, nil)
|
266
277
|
self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, nil)
|
267
278
|
self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, nil)
|
268
279
|
self.scheme_id = data.fetch(:scheme_id, nil)
|
280
|
+
self.processed_with_network_token = data.fetch(:processed_with_network_token, nil)
|
269
281
|
self.payment_type = data.fetch(:payment_type, nil)
|
270
282
|
self.metadata = data.fetch(:metadata, nil)
|
271
283
|
self.gateway_fee = data.fetch(:gateway_fee, nil)
|
@@ -299,12 +311,14 @@ module ProcessOut
|
|
299
311
|
"gateway_operation_id": self.gateway_operation_id,
|
300
312
|
"arn": self.arn,
|
301
313
|
"error_code": self.error_code,
|
314
|
+
"error_message": self.error_message,
|
302
315
|
"gateway_data": self.gateway_data,
|
303
316
|
"payment_data_three_d_s_request": self.payment_data_three_d_s_request,
|
304
317
|
"payment_data_three_d_s_authentication": self.payment_data_three_d_s_authentication,
|
305
318
|
"payment_data_network_authentication": self.payment_data_network_authentication,
|
306
319
|
"initial_scheme_transaction_id": self.initial_scheme_transaction_id,
|
307
320
|
"scheme_id": self.scheme_id,
|
321
|
+
"processed_with_network_token": self.processed_with_network_token,
|
308
322
|
"payment_type": self.payment_type,
|
309
323
|
"metadata": self.metadata,
|
310
324
|
"gateway_fee": self.gateway_fee,
|
@@ -373,6 +387,9 @@ module ProcessOut
|
|
373
387
|
if data.include? "error_code"
|
374
388
|
self.error_code = data["error_code"]
|
375
389
|
end
|
390
|
+
if data.include? "error_message"
|
391
|
+
self.error_message = data["error_message"]
|
392
|
+
end
|
376
393
|
if data.include? "gateway_data"
|
377
394
|
self.gateway_data = data["gateway_data"]
|
378
395
|
end
|
@@ -391,6 +408,9 @@ module ProcessOut
|
|
391
408
|
if data.include? "scheme_id"
|
392
409
|
self.scheme_id = data["scheme_id"]
|
393
410
|
end
|
411
|
+
if data.include? "processed_with_network_token"
|
412
|
+
self.processed_with_network_token = data["processed_with_network_token"]
|
413
|
+
end
|
394
414
|
if data.include? "payment_type"
|
395
415
|
self.payment_type = data["payment_type"]
|
396
416
|
end
|
@@ -432,12 +452,14 @@ module ProcessOut
|
|
432
452
|
self.gateway_operation_id = data.fetch(:gateway_operation_id, self.gateway_operation_id)
|
433
453
|
self.arn = data.fetch(:arn, self.arn)
|
434
454
|
self.error_code = data.fetch(:error_code, self.error_code)
|
455
|
+
self.error_message = data.fetch(:error_message, self.error_message)
|
435
456
|
self.gateway_data = data.fetch(:gateway_data, self.gateway_data)
|
436
457
|
self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, self.payment_data_three_d_s_request)
|
437
458
|
self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, self.payment_data_three_d_s_authentication)
|
438
459
|
self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, self.payment_data_network_authentication)
|
439
460
|
self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, self.initial_scheme_transaction_id)
|
440
461
|
self.scheme_id = data.fetch(:scheme_id, self.scheme_id)
|
462
|
+
self.processed_with_network_token = data.fetch(:processed_with_network_token, self.processed_with_network_token)
|
441
463
|
self.payment_type = data.fetch(:payment_type, self.payment_type)
|
442
464
|
self.metadata = data.fetch(:metadata, self.metadata)
|
443
465
|
self.gateway_fee = data.fetch(:gateway_fee, self.gateway_fee)
|
data/lib/processout/version.rb
CHANGED
data/lib/processout.rb
CHANGED
@@ -38,6 +38,9 @@ require "processout/invoice_shipping_phone"
|
|
38
38
|
require "processout/invoice_billing"
|
39
39
|
require "processout/unsupported_feature_bypass"
|
40
40
|
require "processout/invoice_detail"
|
41
|
+
require "processout/invoice_submerchant"
|
42
|
+
require "processout/submerchant_phone_number"
|
43
|
+
require "processout/submerchant_address"
|
41
44
|
require "processout/customer_action"
|
42
45
|
require "processout/dunning_action"
|
43
46
|
require "processout/payout"
|
@@ -69,9 +72,9 @@ require "processout/card_update_request"
|
|
69
72
|
require "processout/error_codes"
|
70
73
|
require "processout/category_error_codes"
|
71
74
|
require "processout/external_three_ds"
|
72
|
-
require "processout/native_apm_transaction_details"
|
73
75
|
require "processout/native_apm_transaction_details_gateway"
|
74
76
|
require "processout/native_apm_transaction_details_invoice"
|
77
|
+
require "processout/native_apm_transaction_details"
|
75
78
|
|
76
79
|
module ProcessOut
|
77
80
|
class Client
|
@@ -274,6 +277,21 @@ module ProcessOut
|
|
274
277
|
obj = InvoiceDetail.new(self, data)
|
275
278
|
end
|
276
279
|
|
280
|
+
# Create a new InvoiceSubmerchant instance
|
281
|
+
def invoice_submerchant(data = {})
|
282
|
+
obj = InvoiceSubmerchant.new(self, data)
|
283
|
+
end
|
284
|
+
|
285
|
+
# Create a new SubmerchantPhoneNumber instance
|
286
|
+
def submerchant_phone_number(data = {})
|
287
|
+
obj = SubmerchantPhoneNumber.new(self, data)
|
288
|
+
end
|
289
|
+
|
290
|
+
# Create a new SubmerchantAddress instance
|
291
|
+
def submerchant_address(data = {})
|
292
|
+
obj = SubmerchantAddress.new(self, data)
|
293
|
+
end
|
294
|
+
|
277
295
|
# Create a new CustomerAction instance
|
278
296
|
def customer_action(data = {})
|
279
297
|
obj = CustomerAction.new(self, data)
|
@@ -429,11 +447,6 @@ module ProcessOut
|
|
429
447
|
obj = ExternalThreeDS.new(self, data)
|
430
448
|
end
|
431
449
|
|
432
|
-
# Create a new NativeAPMTransactionDetails instance
|
433
|
-
def native_apm_transaction_details(data = {})
|
434
|
-
obj = NativeAPMTransactionDetails.new(self, data)
|
435
|
-
end
|
436
|
-
|
437
450
|
# Create a new NativeAPMTransactionDetailsGateway instance
|
438
451
|
def native_apm_transaction_details_gateway(data = {})
|
439
452
|
obj = NativeAPMTransactionDetailsGateway.new(self, data)
|
@@ -444,6 +457,11 @@ module ProcessOut
|
|
444
457
|
obj = NativeAPMTransactionDetailsInvoice.new(self, data)
|
445
458
|
end
|
446
459
|
|
460
|
+
# Create a new NativeAPMTransactionDetails instance
|
461
|
+
def native_apm_transaction_details(data = {})
|
462
|
+
obj = NativeAPMTransactionDetails.new(self, data)
|
463
|
+
end
|
464
|
+
|
447
465
|
|
448
466
|
end
|
449
467
|
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: 3.
|
4
|
+
version: 3.3.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:
|
11
|
+
date: 2025-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/processout/invoice_risk.rb
|
123
123
|
- lib/processout/invoice_shipping.rb
|
124
124
|
- lib/processout/invoice_shipping_phone.rb
|
125
|
+
- lib/processout/invoice_submerchant.rb
|
125
126
|
- lib/processout/invoice_tax.rb
|
126
127
|
- lib/processout/native_apm_parameter_definition.rb
|
127
128
|
- lib/processout/native_apm_parameter_value.rb
|
@@ -146,6 +147,8 @@ files:
|
|
146
147
|
- lib/processout/project_sftp_settings.rb
|
147
148
|
- lib/processout/project_sftp_settings_public.rb
|
148
149
|
- lib/processout/refund.rb
|
150
|
+
- lib/processout/submerchant_address.rb
|
151
|
+
- lib/processout/submerchant_phone_number.rb
|
149
152
|
- lib/processout/subscription.rb
|
150
153
|
- lib/processout/three_ds.rb
|
151
154
|
- lib/processout/token.rb
|