processout 3.4.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +1 -1
- data/lib/processout/alternative_merchant_certificate.rb +5 -3
- data/lib/processout/apm_payment_processing_configuration.rb +81 -0
- data/lib/processout/apple_pay_alternative_merchant_certificates.rb +5 -3
- data/lib/processout/balances.rb +5 -3
- data/lib/processout/card.rb +45 -1
- data/lib/processout/card_contact.rb +11 -0
- data/lib/processout/card_create_request.rb +38 -2
- data/lib/processout/card_information.rb +1 -1
- data/lib/processout/card_scheme_details.rb +81 -0
- data/lib/processout/card_update_request.rb +37 -2
- data/lib/processout/customer.rb +8 -63
- data/lib/processout/device.rb +22 -0
- data/lib/processout/event.rb +1 -1
- data/lib/processout/export_layout.rb +4 -4
- data/lib/processout/export_layout_configuration_options.rb +1 -1
- data/lib/processout/gateway_configuration.rb +3 -3
- data/lib/processout/invoice.rb +163 -80
- data/lib/processout/invoice_device.rb +11 -0
- data/lib/processout/invoice_external_fraud_tools.rb +12 -0
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/payment_processing_configuration.rb +93 -0
- data/lib/processout/payout.rb +1 -1
- data/lib/processout/product.rb +8 -6
- data/lib/processout/project.rb +2 -63
- data/lib/processout/project_sftp_settings_public.rb +1 -1
- data/lib/processout/refund.rb +1 -1
- data/lib/processout/submerchant.rb +92 -0
- data/lib/processout/submerchant_mapping.rb +103 -0
- data/lib/processout/token.rb +22 -7
- data/lib/processout/transaction.rb +17 -38
- data/lib/processout/transaction_operation.rb +11 -0
- data/lib/processout/unsupported_feature_bypass.rb +11 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout.rb +40 -46
- metadata +12 -13
- data/lib/processout/activity.rb +0 -206
- data/lib/processout/addon.rb +0 -401
- data/lib/processout/coupon.rb +0 -352
- data/lib/processout/discount.rb +0 -360
- data/lib/processout/plan.rb +0 -368
- data/lib/processout/subscription.rb +0 -910
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 634d1a974e5b93afce89e8757121ef97ee37270170eb5daa5382818636dcdbd7
|
|
4
|
+
data.tar.gz: 162b32cb236f72b47b647f00738a8f18cdd7b28f4c09a1e77db2d2b51b20ce1c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e4947a4f455f0335b89ef7bdaaef2d035f42a3ce01c9005af6dcd4f77f1c8aa915b5680d4c0074a085cc3c4573c5098452bfbde97bf91d44bc60f543caff0f4
|
|
7
|
+
data.tar.gz: 82e742271a73b264e5fb1d99a0f965ee6070b85d5d2856ddec8206f69dfb7f3c81c29a8ed29822ba25ef1261b774f39e3da2ab27a7ed633fd6d48cd6438221f5
|
data/.github/workflows/ci.yaml
CHANGED
|
@@ -81,9 +81,11 @@ module ProcessOut
|
|
|
81
81
|
return_values = Array.new
|
|
82
82
|
|
|
83
83
|
body = response.body
|
|
84
|
-
body = body["alternative_merchant_certificate"]
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
body = body.key?("alternative_merchant_certificate") ? body["alternative_merchant_certificate"] : nil
|
|
85
|
+
if !body.nil?
|
|
86
|
+
alternative_merchant_certificate = AlternativeMerchantCertificate.new(@client)
|
|
87
|
+
return_values.push(alternative_merchant_certificate.fill_with_data(body))
|
|
88
|
+
end
|
|
87
89
|
|
|
88
90
|
|
|
89
91
|
return_values[0]
|
|
@@ -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 APMPaymentProcessingConfiguration
|
|
10
|
+
|
|
11
|
+
attr_reader :return_redirect_type
|
|
12
|
+
attr_reader :preferred_finalization_mode
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def return_redirect_type=(val)
|
|
16
|
+
@return_redirect_type = val
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def preferred_finalization_mode=(val)
|
|
20
|
+
@preferred_finalization_mode = val
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Initializes the APMPaymentProcessingConfiguration 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.return_redirect_type = data.fetch(:return_redirect_type, nil)
|
|
32
|
+
self.preferred_finalization_mode = data.fetch(:preferred_finalization_mode, nil)
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Create a new APMPaymentProcessingConfiguration using the current client
|
|
37
|
+
def new(data = {})
|
|
38
|
+
APMPaymentProcessingConfiguration.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
|
+
"return_redirect_type": self.return_redirect_type,
|
|
45
|
+
"preferred_finalization_mode": self.preferred_finalization_mode,
|
|
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? "return_redirect_type"
|
|
57
|
+
self.return_redirect_type = data["return_redirect_type"]
|
|
58
|
+
end
|
|
59
|
+
if data.include? "preferred_finalization_mode"
|
|
60
|
+
self.preferred_finalization_mode = data["preferred_finalization_mode"]
|
|
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.return_redirect_type = data.fetch(:return_redirect_type, self.return_redirect_type)
|
|
74
|
+
self.preferred_finalization_mode = data.fetch(:preferred_finalization_mode, self.preferred_finalization_mode)
|
|
75
|
+
|
|
76
|
+
self
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -108,9 +108,11 @@ module ProcessOut
|
|
|
108
108
|
return_values = Array.new
|
|
109
109
|
|
|
110
110
|
body = response.body
|
|
111
|
-
body = body["applepay_certificates"]
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
body = body.key?("applepay_certificates") ? body["applepay_certificates"] : nil
|
|
112
|
+
if !body.nil?
|
|
113
|
+
apple_pay_alternative_merchant_certificates = ApplePayAlternativeMerchantCertificates.new(@client)
|
|
114
|
+
return_values.push(apple_pay_alternative_merchant_certificates.fill_with_data(body))
|
|
115
|
+
end
|
|
114
116
|
|
|
115
117
|
|
|
116
118
|
return_values[0]
|
data/lib/processout/balances.rb
CHANGED
|
@@ -144,9 +144,11 @@ module ProcessOut
|
|
|
144
144
|
return_values = Array.new
|
|
145
145
|
|
|
146
146
|
body = response.body
|
|
147
|
-
body = body["balances"]
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
body = body.key?("balances") ? body["balances"] : nil
|
|
148
|
+
if !body.nil?
|
|
149
|
+
balances = Balances.new(@client)
|
|
150
|
+
return_values.push(balances.fill_with_data(body))
|
|
151
|
+
end
|
|
150
152
|
|
|
151
153
|
|
|
152
154
|
return_values[0]
|
data/lib/processout/card.rb
CHANGED
|
@@ -32,6 +32,7 @@ module ProcessOut
|
|
|
32
32
|
attr_reader :state
|
|
33
33
|
attr_reader :zip
|
|
34
34
|
attr_reader :country_code
|
|
35
|
+
attr_reader :billing_country_code
|
|
35
36
|
attr_reader :ip_address
|
|
36
37
|
attr_reader :fingerprint
|
|
37
38
|
attr_reader :token_type
|
|
@@ -41,6 +42,9 @@ module ProcessOut
|
|
|
41
42
|
attr_reader :expires_soon
|
|
42
43
|
attr_reader :sandbox
|
|
43
44
|
attr_reader :created_at
|
|
45
|
+
attr_reader :preferred_card_type
|
|
46
|
+
attr_reader :initial_scheme_transaction_id
|
|
47
|
+
attr_reader :payment_account_reference
|
|
44
48
|
|
|
45
49
|
|
|
46
50
|
def id=(val)
|
|
@@ -163,6 +167,10 @@ module ProcessOut
|
|
|
163
167
|
@country_code = val
|
|
164
168
|
end
|
|
165
169
|
|
|
170
|
+
def billing_country_code=(val)
|
|
171
|
+
@billing_country_code = val
|
|
172
|
+
end
|
|
173
|
+
|
|
166
174
|
def ip_address=(val)
|
|
167
175
|
@ip_address = val
|
|
168
176
|
end
|
|
@@ -199,6 +207,18 @@ module ProcessOut
|
|
|
199
207
|
@created_at = val
|
|
200
208
|
end
|
|
201
209
|
|
|
210
|
+
def preferred_card_type=(val)
|
|
211
|
+
@preferred_card_type = val
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
def initial_scheme_transaction_id=(val)
|
|
215
|
+
@initial_scheme_transaction_id = val
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def payment_account_reference=(val)
|
|
219
|
+
@payment_account_reference = val
|
|
220
|
+
end
|
|
221
|
+
|
|
202
222
|
|
|
203
223
|
# Initializes the Card object
|
|
204
224
|
# Params:
|
|
@@ -231,6 +251,7 @@ module ProcessOut
|
|
|
231
251
|
self.state = data.fetch(:state, nil)
|
|
232
252
|
self.zip = data.fetch(:zip, nil)
|
|
233
253
|
self.country_code = data.fetch(:country_code, nil)
|
|
254
|
+
self.billing_country_code = data.fetch(:billing_country_code, nil)
|
|
234
255
|
self.ip_address = data.fetch(:ip_address, nil)
|
|
235
256
|
self.fingerprint = data.fetch(:fingerprint, nil)
|
|
236
257
|
self.token_type = data.fetch(:token_type, nil)
|
|
@@ -240,6 +261,9 @@ module ProcessOut
|
|
|
240
261
|
self.expires_soon = data.fetch(:expires_soon, nil)
|
|
241
262
|
self.sandbox = data.fetch(:sandbox, nil)
|
|
242
263
|
self.created_at = data.fetch(:created_at, nil)
|
|
264
|
+
self.preferred_card_type = data.fetch(:preferred_card_type, nil)
|
|
265
|
+
self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, nil)
|
|
266
|
+
self.payment_account_reference = data.fetch(:payment_account_reference, nil)
|
|
243
267
|
|
|
244
268
|
end
|
|
245
269
|
|
|
@@ -275,6 +299,7 @@ module ProcessOut
|
|
|
275
299
|
"state": self.state,
|
|
276
300
|
"zip": self.zip,
|
|
277
301
|
"country_code": self.country_code,
|
|
302
|
+
"billing_country_code": self.billing_country_code,
|
|
278
303
|
"ip_address": self.ip_address,
|
|
279
304
|
"fingerprint": self.fingerprint,
|
|
280
305
|
"token_type": self.token_type,
|
|
@@ -284,6 +309,9 @@ module ProcessOut
|
|
|
284
309
|
"expires_soon": self.expires_soon,
|
|
285
310
|
"sandbox": self.sandbox,
|
|
286
311
|
"created_at": self.created_at,
|
|
312
|
+
"preferred_card_type": self.preferred_card_type,
|
|
313
|
+
"initial_scheme_transaction_id": self.initial_scheme_transaction_id,
|
|
314
|
+
"payment_account_reference": self.payment_account_reference,
|
|
287
315
|
}.to_json
|
|
288
316
|
end
|
|
289
317
|
|
|
@@ -366,6 +394,9 @@ module ProcessOut
|
|
|
366
394
|
if data.include? "country_code"
|
|
367
395
|
self.country_code = data["country_code"]
|
|
368
396
|
end
|
|
397
|
+
if data.include? "billing_country_code"
|
|
398
|
+
self.billing_country_code = data["billing_country_code"]
|
|
399
|
+
end
|
|
369
400
|
if data.include? "ip_address"
|
|
370
401
|
self.ip_address = data["ip_address"]
|
|
371
402
|
end
|
|
@@ -393,6 +424,15 @@ module ProcessOut
|
|
|
393
424
|
if data.include? "created_at"
|
|
394
425
|
self.created_at = data["created_at"]
|
|
395
426
|
end
|
|
427
|
+
if data.include? "preferred_card_type"
|
|
428
|
+
self.preferred_card_type = data["preferred_card_type"]
|
|
429
|
+
end
|
|
430
|
+
if data.include? "initial_scheme_transaction_id"
|
|
431
|
+
self.initial_scheme_transaction_id = data["initial_scheme_transaction_id"]
|
|
432
|
+
end
|
|
433
|
+
if data.include? "payment_account_reference"
|
|
434
|
+
self.payment_account_reference = data["payment_account_reference"]
|
|
435
|
+
end
|
|
396
436
|
|
|
397
437
|
self
|
|
398
438
|
end
|
|
@@ -428,6 +468,7 @@ module ProcessOut
|
|
|
428
468
|
self.state = data.fetch(:state, self.state)
|
|
429
469
|
self.zip = data.fetch(:zip, self.zip)
|
|
430
470
|
self.country_code = data.fetch(:country_code, self.country_code)
|
|
471
|
+
self.billing_country_code = data.fetch(:billing_country_code, self.billing_country_code)
|
|
431
472
|
self.ip_address = data.fetch(:ip_address, self.ip_address)
|
|
432
473
|
self.fingerprint = data.fetch(:fingerprint, self.fingerprint)
|
|
433
474
|
self.token_type = data.fetch(:token_type, self.token_type)
|
|
@@ -437,6 +478,9 @@ module ProcessOut
|
|
|
437
478
|
self.expires_soon = data.fetch(:expires_soon, self.expires_soon)
|
|
438
479
|
self.sandbox = data.fetch(:sandbox, self.sandbox)
|
|
439
480
|
self.created_at = data.fetch(:created_at, self.created_at)
|
|
481
|
+
self.preferred_card_type = data.fetch(:preferred_card_type, self.preferred_card_type)
|
|
482
|
+
self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, self.initial_scheme_transaction_id)
|
|
483
|
+
self.payment_account_reference = data.fetch(:payment_account_reference, self.payment_account_reference)
|
|
440
484
|
|
|
441
485
|
self
|
|
442
486
|
end
|
|
@@ -488,7 +532,7 @@ module ProcessOut
|
|
|
488
532
|
return_values = Array.new
|
|
489
533
|
|
|
490
534
|
body = response.body
|
|
491
|
-
body = body["card"]
|
|
535
|
+
body = body.key?("card") ? body["card"] : nil
|
|
492
536
|
|
|
493
537
|
|
|
494
538
|
obj = Card.new(@client)
|
|
@@ -13,6 +13,7 @@ module ProcessOut
|
|
|
13
13
|
attr_reader :city
|
|
14
14
|
attr_reader :state
|
|
15
15
|
attr_reader :country_code
|
|
16
|
+
attr_reader :billing_country_code
|
|
16
17
|
attr_reader :zip
|
|
17
18
|
|
|
18
19
|
|
|
@@ -36,6 +37,10 @@ module ProcessOut
|
|
|
36
37
|
@country_code = val
|
|
37
38
|
end
|
|
38
39
|
|
|
40
|
+
def billing_country_code=(val)
|
|
41
|
+
@billing_country_code = val
|
|
42
|
+
end
|
|
43
|
+
|
|
39
44
|
def zip=(val)
|
|
40
45
|
@zip = val
|
|
41
46
|
end
|
|
@@ -53,6 +58,7 @@ module ProcessOut
|
|
|
53
58
|
self.city = data.fetch(:city, nil)
|
|
54
59
|
self.state = data.fetch(:state, nil)
|
|
55
60
|
self.country_code = data.fetch(:country_code, nil)
|
|
61
|
+
self.billing_country_code = data.fetch(:billing_country_code, nil)
|
|
56
62
|
self.zip = data.fetch(:zip, nil)
|
|
57
63
|
|
|
58
64
|
end
|
|
@@ -70,6 +76,7 @@ module ProcessOut
|
|
|
70
76
|
"city": self.city,
|
|
71
77
|
"state": self.state,
|
|
72
78
|
"country_code": self.country_code,
|
|
79
|
+
"billing_country_code": self.billing_country_code,
|
|
73
80
|
"zip": self.zip,
|
|
74
81
|
}.to_json
|
|
75
82
|
end
|
|
@@ -96,6 +103,9 @@ module ProcessOut
|
|
|
96
103
|
if data.include? "country_code"
|
|
97
104
|
self.country_code = data["country_code"]
|
|
98
105
|
end
|
|
106
|
+
if data.include? "billing_country_code"
|
|
107
|
+
self.billing_country_code = data["billing_country_code"]
|
|
108
|
+
end
|
|
99
109
|
if data.include? "zip"
|
|
100
110
|
self.zip = data["zip"]
|
|
101
111
|
end
|
|
@@ -115,6 +125,7 @@ module ProcessOut
|
|
|
115
125
|
self.city = data.fetch(:city, self.city)
|
|
116
126
|
self.state = data.fetch(:state, self.state)
|
|
117
127
|
self.country_code = data.fetch(:country_code, self.country_code)
|
|
128
|
+
self.billing_country_code = data.fetch(:billing_country_code, self.billing_country_code)
|
|
118
129
|
self.zip = data.fetch(:zip, self.zip)
|
|
119
130
|
|
|
120
131
|
self
|
|
@@ -16,6 +16,7 @@ module ProcessOut
|
|
|
16
16
|
attr_reader :exp_year
|
|
17
17
|
attr_reader :cvc2
|
|
18
18
|
attr_reader :preferred_scheme
|
|
19
|
+
attr_reader :preferred_card_type
|
|
19
20
|
attr_reader :metadata
|
|
20
21
|
attr_reader :token_type
|
|
21
22
|
attr_reader :eci
|
|
@@ -25,6 +26,7 @@ module ProcessOut
|
|
|
25
26
|
attr_reader :payment_token
|
|
26
27
|
attr_reader :contact
|
|
27
28
|
attr_reader :shipping
|
|
29
|
+
attr_reader :scheme_details
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
def device=(val)
|
|
@@ -71,6 +73,10 @@ module ProcessOut
|
|
|
71
73
|
@preferred_scheme = val
|
|
72
74
|
end
|
|
73
75
|
|
|
76
|
+
def preferred_card_type=(val)
|
|
77
|
+
@preferred_card_type = val
|
|
78
|
+
end
|
|
79
|
+
|
|
74
80
|
def metadata=(val)
|
|
75
81
|
@metadata = val
|
|
76
82
|
end
|
|
@@ -131,6 +137,22 @@ module ProcessOut
|
|
|
131
137
|
|
|
132
138
|
end
|
|
133
139
|
|
|
140
|
+
def scheme_details=(val)
|
|
141
|
+
if val.nil?
|
|
142
|
+
@scheme_details = val
|
|
143
|
+
return
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if val.instance_of? CardSchemeDetails
|
|
147
|
+
@scheme_details = val
|
|
148
|
+
else
|
|
149
|
+
obj = CardSchemeDetails.new(@client)
|
|
150
|
+
obj.fill_with_data(val)
|
|
151
|
+
@scheme_details = obj
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
134
156
|
|
|
135
157
|
# Initializes the CardCreateRequest object
|
|
136
158
|
# Params:
|
|
@@ -147,6 +169,7 @@ module ProcessOut
|
|
|
147
169
|
self.exp_year = data.fetch(:exp_year, nil)
|
|
148
170
|
self.cvc2 = data.fetch(:cvc2, nil)
|
|
149
171
|
self.preferred_scheme = data.fetch(:preferred_scheme, nil)
|
|
172
|
+
self.preferred_card_type = data.fetch(:preferred_card_type, nil)
|
|
150
173
|
self.metadata = data.fetch(:metadata, nil)
|
|
151
174
|
self.token_type = data.fetch(:token_type, nil)
|
|
152
175
|
self.eci = data.fetch(:eci, nil)
|
|
@@ -156,6 +179,7 @@ module ProcessOut
|
|
|
156
179
|
self.payment_token = data.fetch(:payment_token, nil)
|
|
157
180
|
self.contact = data.fetch(:contact, nil)
|
|
158
181
|
self.shipping = data.fetch(:shipping, nil)
|
|
182
|
+
self.scheme_details = data.fetch(:scheme_details, nil)
|
|
159
183
|
|
|
160
184
|
end
|
|
161
185
|
|
|
@@ -175,6 +199,7 @@ module ProcessOut
|
|
|
175
199
|
"exp_year": self.exp_year,
|
|
176
200
|
"cvc2": self.cvc2,
|
|
177
201
|
"preferred_scheme": self.preferred_scheme,
|
|
202
|
+
"preferred_card_type": self.preferred_card_type,
|
|
178
203
|
"metadata": self.metadata,
|
|
179
204
|
"token_type": self.token_type,
|
|
180
205
|
"eci": self.eci,
|
|
@@ -184,6 +209,7 @@ module ProcessOut
|
|
|
184
209
|
"payment_token": self.payment_token,
|
|
185
210
|
"contact": self.contact,
|
|
186
211
|
"shipping": self.shipping,
|
|
212
|
+
"scheme_details": self.scheme_details,
|
|
187
213
|
}.to_json
|
|
188
214
|
end
|
|
189
215
|
|
|
@@ -218,6 +244,9 @@ module ProcessOut
|
|
|
218
244
|
if data.include? "preferred_scheme"
|
|
219
245
|
self.preferred_scheme = data["preferred_scheme"]
|
|
220
246
|
end
|
|
247
|
+
if data.include? "preferred_card_type"
|
|
248
|
+
self.preferred_card_type = data["preferred_card_type"]
|
|
249
|
+
end
|
|
221
250
|
if data.include? "metadata"
|
|
222
251
|
self.metadata = data["metadata"]
|
|
223
252
|
end
|
|
@@ -245,6 +274,9 @@ module ProcessOut
|
|
|
245
274
|
if data.include? "shipping"
|
|
246
275
|
self.shipping = data["shipping"]
|
|
247
276
|
end
|
|
277
|
+
if data.include? "scheme_details"
|
|
278
|
+
self.scheme_details = data["scheme_details"]
|
|
279
|
+
end
|
|
248
280
|
|
|
249
281
|
self
|
|
250
282
|
end
|
|
@@ -264,6 +296,7 @@ module ProcessOut
|
|
|
264
296
|
self.exp_year = data.fetch(:exp_year, self.exp_year)
|
|
265
297
|
self.cvc2 = data.fetch(:cvc2, self.cvc2)
|
|
266
298
|
self.preferred_scheme = data.fetch(:preferred_scheme, self.preferred_scheme)
|
|
299
|
+
self.preferred_card_type = data.fetch(:preferred_card_type, self.preferred_card_type)
|
|
267
300
|
self.metadata = data.fetch(:metadata, self.metadata)
|
|
268
301
|
self.token_type = data.fetch(:token_type, self.token_type)
|
|
269
302
|
self.eci = data.fetch(:eci, self.eci)
|
|
@@ -273,6 +306,7 @@ module ProcessOut
|
|
|
273
306
|
self.payment_token = data.fetch(:payment_token, self.payment_token)
|
|
274
307
|
self.contact = data.fetch(:contact, self.contact)
|
|
275
308
|
self.shipping = data.fetch(:shipping, self.shipping)
|
|
309
|
+
self.scheme_details = data.fetch(:scheme_details, self.scheme_details)
|
|
276
310
|
|
|
277
311
|
self
|
|
278
312
|
end
|
|
@@ -294,6 +328,7 @@ module ProcessOut
|
|
|
294
328
|
"exp_year" => @exp_year,
|
|
295
329
|
"cvc2" => @cvc2,
|
|
296
330
|
"preferred_scheme" => @preferred_scheme,
|
|
331
|
+
"preferred_card_type" => @preferred_card_type,
|
|
297
332
|
"metadata" => @metadata,
|
|
298
333
|
"token_type" => @token_type,
|
|
299
334
|
"eci" => @eci,
|
|
@@ -302,14 +337,15 @@ module ProcessOut
|
|
|
302
337
|
"applepay_mid" => @applepay_mid,
|
|
303
338
|
"payment_token" => @payment_token,
|
|
304
339
|
"contact" => @contact,
|
|
305
|
-
"shipping" => @shipping
|
|
340
|
+
"shipping" => @shipping,
|
|
341
|
+
"scheme_details" => @scheme_details
|
|
306
342
|
}
|
|
307
343
|
|
|
308
344
|
response = Response.new(request.post(path, data, options))
|
|
309
345
|
return_values = Array.new
|
|
310
346
|
|
|
311
347
|
body = response.body
|
|
312
|
-
body = body["card"]
|
|
348
|
+
body = body.key?("card") ? body["card"] : nil
|
|
313
349
|
|
|
314
350
|
|
|
315
351
|
return_values.push(self.fill_with_data(body))
|
|
@@ -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 CardSchemeDetails
|
|
10
|
+
|
|
11
|
+
attr_reader :transaction_id
|
|
12
|
+
attr_reader :transaction_link_id
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def transaction_id=(val)
|
|
16
|
+
@transaction_id = val
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def transaction_link_id=(val)
|
|
20
|
+
@transaction_link_id = val
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Initializes the CardSchemeDetails 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.transaction_id = data.fetch(:transaction_id, nil)
|
|
32
|
+
self.transaction_link_id = data.fetch(:transaction_link_id, nil)
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Create a new CardSchemeDetails using the current client
|
|
37
|
+
def new(data = {})
|
|
38
|
+
CardSchemeDetails.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
|
+
"transaction_id": self.transaction_id,
|
|
45
|
+
"transaction_link_id": self.transaction_link_id,
|
|
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? "transaction_id"
|
|
57
|
+
self.transaction_id = data["transaction_id"]
|
|
58
|
+
end
|
|
59
|
+
if data.include? "transaction_link_id"
|
|
60
|
+
self.transaction_link_id = data["transaction_link_id"]
|
|
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.transaction_id = data.fetch(:transaction_id, self.transaction_id)
|
|
74
|
+
self.transaction_link_id = data.fetch(:transaction_link_id, self.transaction_link_id)
|
|
75
|
+
|
|
76
|
+
self
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -9,12 +9,34 @@ module ProcessOut
|
|
|
9
9
|
class CardUpdateRequest
|
|
10
10
|
|
|
11
11
|
attr_reader :preferred_scheme
|
|
12
|
+
attr_reader :preferred_card_type
|
|
13
|
+
attr_reader :scheme_details
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def preferred_scheme=(val)
|
|
15
17
|
@preferred_scheme = val
|
|
16
18
|
end
|
|
17
19
|
|
|
20
|
+
def preferred_card_type=(val)
|
|
21
|
+
@preferred_card_type = val
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def scheme_details=(val)
|
|
25
|
+
if val.nil?
|
|
26
|
+
@scheme_details = val
|
|
27
|
+
return
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
if val.instance_of? CardSchemeDetails
|
|
31
|
+
@scheme_details = val
|
|
32
|
+
else
|
|
33
|
+
obj = CardSchemeDetails.new(@client)
|
|
34
|
+
obj.fill_with_data(val)
|
|
35
|
+
@scheme_details = obj
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
|
|
18
40
|
|
|
19
41
|
# Initializes the CardUpdateRequest object
|
|
20
42
|
# Params:
|
|
@@ -24,6 +46,8 @@ module ProcessOut
|
|
|
24
46
|
@client = client
|
|
25
47
|
|
|
26
48
|
self.preferred_scheme = data.fetch(:preferred_scheme, nil)
|
|
49
|
+
self.preferred_card_type = data.fetch(:preferred_card_type, nil)
|
|
50
|
+
self.scheme_details = data.fetch(:scheme_details, nil)
|
|
27
51
|
|
|
28
52
|
end
|
|
29
53
|
|
|
@@ -36,6 +60,8 @@ module ProcessOut
|
|
|
36
60
|
def to_json(options)
|
|
37
61
|
{
|
|
38
62
|
"preferred_scheme": self.preferred_scheme,
|
|
63
|
+
"preferred_card_type": self.preferred_card_type,
|
|
64
|
+
"scheme_details": self.scheme_details,
|
|
39
65
|
}.to_json
|
|
40
66
|
end
|
|
41
67
|
|
|
@@ -49,6 +75,12 @@ module ProcessOut
|
|
|
49
75
|
if data.include? "preferred_scheme"
|
|
50
76
|
self.preferred_scheme = data["preferred_scheme"]
|
|
51
77
|
end
|
|
78
|
+
if data.include? "preferred_card_type"
|
|
79
|
+
self.preferred_card_type = data["preferred_card_type"]
|
|
80
|
+
end
|
|
81
|
+
if data.include? "scheme_details"
|
|
82
|
+
self.scheme_details = data["scheme_details"]
|
|
83
|
+
end
|
|
52
84
|
|
|
53
85
|
self
|
|
54
86
|
end
|
|
@@ -61,6 +93,8 @@ module ProcessOut
|
|
|
61
93
|
return self
|
|
62
94
|
end
|
|
63
95
|
self.preferred_scheme = data.fetch(:preferred_scheme, self.preferred_scheme)
|
|
96
|
+
self.preferred_card_type = data.fetch(:preferred_card_type, self.preferred_card_type)
|
|
97
|
+
self.scheme_details = data.fetch(:scheme_details, self.scheme_details)
|
|
64
98
|
|
|
65
99
|
self
|
|
66
100
|
end
|
|
@@ -75,14 +109,15 @@ module ProcessOut
|
|
|
75
109
|
request = Request.new(@client)
|
|
76
110
|
path = "/cards/" + CGI.escape(card_id) + ""
|
|
77
111
|
data = {
|
|
78
|
-
"preferred_scheme" => @preferred_scheme
|
|
112
|
+
"preferred_scheme" => @preferred_scheme,
|
|
113
|
+
"scheme_details" => @scheme_details
|
|
79
114
|
}
|
|
80
115
|
|
|
81
116
|
response = Response.new(request.put(path, data, options))
|
|
82
117
|
return_values = Array.new
|
|
83
118
|
|
|
84
119
|
body = response.body
|
|
85
|
-
body = body["card"]
|
|
120
|
+
body = body.key?("card") ? body["card"] : nil
|
|
86
121
|
|
|
87
122
|
|
|
88
123
|
return_values.push(self.fill_with_data(body))
|