processout 2.27.1 → 2.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/processout/card_contact.rb +125 -0
- data/lib/processout/card_create_request.rb +309 -0
- data/lib/processout/card_shipping.rb +148 -0
- data/lib/processout/card_update_request.rb +120 -0
- data/lib/processout/device.rb +202 -0
- data/lib/processout/invoice.rb +25 -1
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/payout.rb +22 -0
- data/lib/processout/payout_item.rb +23 -0
- data/lib/processout/payout_item_amount_breakdowns.rb +125 -0
- data/lib/processout/phone.rb +81 -0
- data/lib/processout/transaction.rb +33 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout.rb +42 -6
- metadata +9 -4
- data/.DS_Store +0 -0
- data/lib/processout/api_request.rb +0 -295
@@ -0,0 +1,202 @@
|
|
1
|
+
# The content of this file was automatically generated
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
require "json"
|
5
|
+
require "processout/networking/request"
|
6
|
+
require "processout/networking/response"
|
7
|
+
|
8
|
+
module ProcessOut
|
9
|
+
class Device
|
10
|
+
|
11
|
+
attr_reader :request_origin
|
12
|
+
attr_reader :id
|
13
|
+
attr_reader :channel
|
14
|
+
attr_reader :ip_address
|
15
|
+
attr_reader :user_agent
|
16
|
+
attr_reader :header_accept
|
17
|
+
attr_reader :header_referer
|
18
|
+
attr_reader :app_color_depth
|
19
|
+
attr_reader :app_java_enabled
|
20
|
+
attr_reader :app_language
|
21
|
+
attr_reader :app_screen_height
|
22
|
+
attr_reader :app_screen_width
|
23
|
+
attr_reader :app_timezone_offset
|
24
|
+
|
25
|
+
|
26
|
+
def request_origin=(val)
|
27
|
+
@request_origin = val
|
28
|
+
end
|
29
|
+
|
30
|
+
def id=(val)
|
31
|
+
@id = val
|
32
|
+
end
|
33
|
+
|
34
|
+
def channel=(val)
|
35
|
+
@channel = val
|
36
|
+
end
|
37
|
+
|
38
|
+
def ip_address=(val)
|
39
|
+
@ip_address = val
|
40
|
+
end
|
41
|
+
|
42
|
+
def user_agent=(val)
|
43
|
+
@user_agent = val
|
44
|
+
end
|
45
|
+
|
46
|
+
def header_accept=(val)
|
47
|
+
@header_accept = val
|
48
|
+
end
|
49
|
+
|
50
|
+
def header_referer=(val)
|
51
|
+
@header_referer = val
|
52
|
+
end
|
53
|
+
|
54
|
+
def app_color_depth=(val)
|
55
|
+
@app_color_depth = val
|
56
|
+
end
|
57
|
+
|
58
|
+
def app_java_enabled=(val)
|
59
|
+
@app_java_enabled = val
|
60
|
+
end
|
61
|
+
|
62
|
+
def app_language=(val)
|
63
|
+
@app_language = val
|
64
|
+
end
|
65
|
+
|
66
|
+
def app_screen_height=(val)
|
67
|
+
@app_screen_height = val
|
68
|
+
end
|
69
|
+
|
70
|
+
def app_screen_width=(val)
|
71
|
+
@app_screen_width = val
|
72
|
+
end
|
73
|
+
|
74
|
+
def app_timezone_offset=(val)
|
75
|
+
@app_timezone_offset = val
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
# Initializes the Device object
|
80
|
+
# Params:
|
81
|
+
# +client+:: +ProcessOut+ client instance
|
82
|
+
# +data+:: data that can be used to fill the object
|
83
|
+
def initialize(client, data = {})
|
84
|
+
@client = client
|
85
|
+
|
86
|
+
self.request_origin = data.fetch(:request_origin, nil)
|
87
|
+
self.id = data.fetch(:id, nil)
|
88
|
+
self.channel = data.fetch(:channel, nil)
|
89
|
+
self.ip_address = data.fetch(:ip_address, nil)
|
90
|
+
self.user_agent = data.fetch(:user_agent, nil)
|
91
|
+
self.header_accept = data.fetch(:header_accept, nil)
|
92
|
+
self.header_referer = data.fetch(:header_referer, nil)
|
93
|
+
self.app_color_depth = data.fetch(:app_color_depth, nil)
|
94
|
+
self.app_java_enabled = data.fetch(:app_java_enabled, nil)
|
95
|
+
self.app_language = data.fetch(:app_language, nil)
|
96
|
+
self.app_screen_height = data.fetch(:app_screen_height, nil)
|
97
|
+
self.app_screen_width = data.fetch(:app_screen_width, nil)
|
98
|
+
self.app_timezone_offset = data.fetch(:app_timezone_offset, nil)
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
# Create a new Device using the current client
|
103
|
+
def new(data = {})
|
104
|
+
Device.new(@client, data)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Overrides the JSON marshaller to only send the fields we want
|
108
|
+
def to_json(options)
|
109
|
+
{
|
110
|
+
"request_origin": self.request_origin,
|
111
|
+
"id": self.id,
|
112
|
+
"channel": self.channel,
|
113
|
+
"ip_address": self.ip_address,
|
114
|
+
"user_agent": self.user_agent,
|
115
|
+
"header_accept": self.header_accept,
|
116
|
+
"header_referer": self.header_referer,
|
117
|
+
"app_color_depth": self.app_color_depth,
|
118
|
+
"app_java_enabled": self.app_java_enabled,
|
119
|
+
"app_language": self.app_language,
|
120
|
+
"app_screen_height": self.app_screen_height,
|
121
|
+
"app_screen_width": self.app_screen_width,
|
122
|
+
"app_timezone_offset": self.app_timezone_offset,
|
123
|
+
}.to_json
|
124
|
+
end
|
125
|
+
|
126
|
+
# Fills the object with data coming from the API
|
127
|
+
# Params:
|
128
|
+
# +data+:: +Hash+ of data coming from the API
|
129
|
+
def fill_with_data(data)
|
130
|
+
if data.nil?
|
131
|
+
return self
|
132
|
+
end
|
133
|
+
if data.include? "request_origin"
|
134
|
+
self.request_origin = data["request_origin"]
|
135
|
+
end
|
136
|
+
if data.include? "id"
|
137
|
+
self.id = data["id"]
|
138
|
+
end
|
139
|
+
if data.include? "channel"
|
140
|
+
self.channel = data["channel"]
|
141
|
+
end
|
142
|
+
if data.include? "ip_address"
|
143
|
+
self.ip_address = data["ip_address"]
|
144
|
+
end
|
145
|
+
if data.include? "user_agent"
|
146
|
+
self.user_agent = data["user_agent"]
|
147
|
+
end
|
148
|
+
if data.include? "header_accept"
|
149
|
+
self.header_accept = data["header_accept"]
|
150
|
+
end
|
151
|
+
if data.include? "header_referer"
|
152
|
+
self.header_referer = data["header_referer"]
|
153
|
+
end
|
154
|
+
if data.include? "app_color_depth"
|
155
|
+
self.app_color_depth = data["app_color_depth"]
|
156
|
+
end
|
157
|
+
if data.include? "app_java_enabled"
|
158
|
+
self.app_java_enabled = data["app_java_enabled"]
|
159
|
+
end
|
160
|
+
if data.include? "app_language"
|
161
|
+
self.app_language = data["app_language"]
|
162
|
+
end
|
163
|
+
if data.include? "app_screen_height"
|
164
|
+
self.app_screen_height = data["app_screen_height"]
|
165
|
+
end
|
166
|
+
if data.include? "app_screen_width"
|
167
|
+
self.app_screen_width = data["app_screen_width"]
|
168
|
+
end
|
169
|
+
if data.include? "app_timezone_offset"
|
170
|
+
self.app_timezone_offset = data["app_timezone_offset"]
|
171
|
+
end
|
172
|
+
|
173
|
+
self
|
174
|
+
end
|
175
|
+
|
176
|
+
# Prefills the object with the data passed as parameters
|
177
|
+
# Params:
|
178
|
+
# +data+:: +Hash+ of data
|
179
|
+
def prefill(data)
|
180
|
+
if data.nil?
|
181
|
+
return self
|
182
|
+
end
|
183
|
+
self.request_origin = data.fetch(:request_origin, self.request_origin)
|
184
|
+
self.id = data.fetch(:id, self.id)
|
185
|
+
self.channel = data.fetch(:channel, self.channel)
|
186
|
+
self.ip_address = data.fetch(:ip_address, self.ip_address)
|
187
|
+
self.user_agent = data.fetch(:user_agent, self.user_agent)
|
188
|
+
self.header_accept = data.fetch(:header_accept, self.header_accept)
|
189
|
+
self.header_referer = data.fetch(:header_referer, self.header_referer)
|
190
|
+
self.app_color_depth = data.fetch(:app_color_depth, self.app_color_depth)
|
191
|
+
self.app_java_enabled = data.fetch(:app_java_enabled, self.app_java_enabled)
|
192
|
+
self.app_language = data.fetch(:app_language, self.app_language)
|
193
|
+
self.app_screen_height = data.fetch(:app_screen_height, self.app_screen_height)
|
194
|
+
self.app_screen_width = data.fetch(:app_screen_width, self.app_screen_width)
|
195
|
+
self.app_timezone_offset = data.fetch(:app_timezone_offset, self.app_timezone_offset)
|
196
|
+
|
197
|
+
self
|
198
|
+
end
|
199
|
+
|
200
|
+
|
201
|
+
end
|
202
|
+
end
|
data/lib/processout/invoice.rb
CHANGED
@@ -22,6 +22,7 @@ module ProcessOut
|
|
22
22
|
attr_reader :details
|
23
23
|
attr_reader :url
|
24
24
|
attr_reader :name
|
25
|
+
attr_reader :order_id
|
25
26
|
attr_reader :amount
|
26
27
|
attr_reader :currency
|
27
28
|
attr_reader :merchant_initiator_type
|
@@ -53,6 +54,7 @@ module ProcessOut
|
|
53
54
|
attr_reader :payment_intent
|
54
55
|
attr_reader :billing
|
55
56
|
attr_reader :unsupported_feature_bypass
|
57
|
+
attr_reader :verification
|
56
58
|
|
57
59
|
|
58
60
|
def id=(val)
|
@@ -187,6 +189,10 @@ module ProcessOut
|
|
187
189
|
@name = val
|
188
190
|
end
|
189
191
|
|
192
|
+
def order_id=(val)
|
193
|
+
@order_id = val
|
194
|
+
end
|
195
|
+
|
190
196
|
def amount=(val)
|
191
197
|
@amount = val
|
192
198
|
end
|
@@ -407,6 +413,10 @@ module ProcessOut
|
|
407
413
|
|
408
414
|
end
|
409
415
|
|
416
|
+
def verification=(val)
|
417
|
+
@verification = val
|
418
|
+
end
|
419
|
+
|
410
420
|
|
411
421
|
# Initializes the Invoice object
|
412
422
|
# Params:
|
@@ -429,6 +439,7 @@ module ProcessOut
|
|
429
439
|
self.details = data.fetch(:details, nil)
|
430
440
|
self.url = data.fetch(:url, nil)
|
431
441
|
self.name = data.fetch(:name, nil)
|
442
|
+
self.order_id = data.fetch(:order_id, nil)
|
432
443
|
self.amount = data.fetch(:amount, nil)
|
433
444
|
self.currency = data.fetch(:currency, nil)
|
434
445
|
self.merchant_initiator_type = data.fetch(:merchant_initiator_type, nil)
|
@@ -460,6 +471,7 @@ module ProcessOut
|
|
460
471
|
self.payment_intent = data.fetch(:payment_intent, nil)
|
461
472
|
self.billing = data.fetch(:billing, nil)
|
462
473
|
self.unsupported_feature_bypass = data.fetch(:unsupported_feature_bypass, nil)
|
474
|
+
self.verification = data.fetch(:verification, nil)
|
463
475
|
|
464
476
|
end
|
465
477
|
|
@@ -485,6 +497,7 @@ module ProcessOut
|
|
485
497
|
"details": self.details,
|
486
498
|
"url": self.url,
|
487
499
|
"name": self.name,
|
500
|
+
"order_id": self.order_id,
|
488
501
|
"amount": self.amount,
|
489
502
|
"currency": self.currency,
|
490
503
|
"merchant_initiator_type": self.merchant_initiator_type,
|
@@ -516,6 +529,7 @@ module ProcessOut
|
|
516
529
|
"payment_intent": self.payment_intent,
|
517
530
|
"billing": self.billing,
|
518
531
|
"unsupported_feature_bypass": self.unsupported_feature_bypass,
|
532
|
+
"verification": self.verification,
|
519
533
|
}.to_json
|
520
534
|
end
|
521
535
|
|
@@ -568,6 +582,9 @@ module ProcessOut
|
|
568
582
|
if data.include? "name"
|
569
583
|
self.name = data["name"]
|
570
584
|
end
|
585
|
+
if data.include? "order_id"
|
586
|
+
self.order_id = data["order_id"]
|
587
|
+
end
|
571
588
|
if data.include? "amount"
|
572
589
|
self.amount = data["amount"]
|
573
590
|
end
|
@@ -661,6 +678,9 @@ module ProcessOut
|
|
661
678
|
if data.include? "unsupported_feature_bypass"
|
662
679
|
self.unsupported_feature_bypass = data["unsupported_feature_bypass"]
|
663
680
|
end
|
681
|
+
if data.include? "verification"
|
682
|
+
self.verification = data["verification"]
|
683
|
+
end
|
664
684
|
|
665
685
|
self
|
666
686
|
end
|
@@ -686,6 +706,7 @@ module ProcessOut
|
|
686
706
|
self.details = data.fetch(:details, self.details)
|
687
707
|
self.url = data.fetch(:url, self.url)
|
688
708
|
self.name = data.fetch(:name, self.name)
|
709
|
+
self.order_id = data.fetch(:order_id, self.order_id)
|
689
710
|
self.amount = data.fetch(:amount, self.amount)
|
690
711
|
self.currency = data.fetch(:currency, self.currency)
|
691
712
|
self.merchant_initiator_type = data.fetch(:merchant_initiator_type, self.merchant_initiator_type)
|
@@ -717,6 +738,7 @@ module ProcessOut
|
|
717
738
|
self.payment_intent = data.fetch(:payment_intent, self.payment_intent)
|
718
739
|
self.billing = data.fetch(:billing, self.billing)
|
719
740
|
self.unsupported_feature_bypass = data.fetch(:unsupported_feature_bypass, self.unsupported_feature_bypass)
|
741
|
+
self.verification = data.fetch(:verification, self.verification)
|
720
742
|
|
721
743
|
self
|
722
744
|
end
|
@@ -1062,6 +1084,7 @@ module ProcessOut
|
|
1062
1084
|
data = {
|
1063
1085
|
"customer_id" => @customer_id,
|
1064
1086
|
"name" => @name,
|
1087
|
+
"order_id" => @order_id,
|
1065
1088
|
"amount" => @amount,
|
1066
1089
|
"currency" => @currency,
|
1067
1090
|
"metadata" => @metadata,
|
@@ -1089,7 +1112,8 @@ module ProcessOut
|
|
1089
1112
|
"tax" => @tax,
|
1090
1113
|
"payment_type" => @payment_type,
|
1091
1114
|
"billing" => @billing,
|
1092
|
-
"unsupported_feature_bypass" => @unsupported_feature_bypass
|
1115
|
+
"unsupported_feature_bypass" => @unsupported_feature_bypass,
|
1116
|
+
"verification" => @verification
|
1093
1117
|
}
|
1094
1118
|
|
1095
1119
|
response = Response.new(request.post(path, data, options))
|
@@ -13,7 +13,7 @@ module ProcessOut
|
|
13
13
|
req.basic_auth @client.project_id, @client.project_secret
|
14
14
|
req.content_type = "application/json"
|
15
15
|
req["API-Version"] = "1.4.0.0"
|
16
|
-
req["User-Agent"] = "ProcessOut Ruby-Bindings/2.
|
16
|
+
req["User-Agent"] = "ProcessOut Ruby-Bindings/2.29.0"
|
17
17
|
|
18
18
|
unless options.nil?
|
19
19
|
req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
|
data/lib/processout/payout.rb
CHANGED
@@ -371,6 +371,28 @@ module ProcessOut
|
|
371
371
|
|
372
372
|
|
373
373
|
|
374
|
+
return_values[0]
|
375
|
+
end
|
376
|
+
|
377
|
+
# Delete the payout along with its payout items
|
378
|
+
# Params:
|
379
|
+
# +payout_id+:: ID of the payout
|
380
|
+
# +options+:: +Hash+ of options
|
381
|
+
def delete(payout_id, options = {})
|
382
|
+
self.prefill(options)
|
383
|
+
|
384
|
+
request = Request.new(@client)
|
385
|
+
path = "/payouts/" + CGI.escape(payout_id) + ""
|
386
|
+
data = {
|
387
|
+
|
388
|
+
}
|
389
|
+
|
390
|
+
response = Response.new(request.delete(path, data, options))
|
391
|
+
return_values = Array.new
|
392
|
+
|
393
|
+
return_values.push(response.success)
|
394
|
+
|
395
|
+
|
374
396
|
return_values[0]
|
375
397
|
end
|
376
398
|
|
@@ -21,6 +21,7 @@ module ProcessOut
|
|
21
21
|
attr_reader :fees
|
22
22
|
attr_reader :metadata
|
23
23
|
attr_reader :created_at
|
24
|
+
attr_reader :breakdown
|
24
25
|
|
25
26
|
|
26
27
|
def id=(val)
|
@@ -111,6 +112,22 @@ module ProcessOut
|
|
111
112
|
@created_at = val
|
112
113
|
end
|
113
114
|
|
115
|
+
def breakdown=(val)
|
116
|
+
if val.nil?
|
117
|
+
@breakdown = val
|
118
|
+
return
|
119
|
+
end
|
120
|
+
|
121
|
+
if val.instance_of? PayoutItemAmountBreakdowns
|
122
|
+
@breakdown = val
|
123
|
+
else
|
124
|
+
obj = PayoutItemAmountBreakdowns.new(@client)
|
125
|
+
obj.fill_with_data(val)
|
126
|
+
@breakdown = obj
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
114
131
|
|
115
132
|
# Initializes the PayoutItem object
|
116
133
|
# Params:
|
@@ -132,6 +149,7 @@ module ProcessOut
|
|
132
149
|
self.fees = data.fetch(:fees, nil)
|
133
150
|
self.metadata = data.fetch(:metadata, nil)
|
134
151
|
self.created_at = data.fetch(:created_at, nil)
|
152
|
+
self.breakdown = data.fetch(:breakdown, nil)
|
135
153
|
|
136
154
|
end
|
137
155
|
|
@@ -156,6 +174,7 @@ module ProcessOut
|
|
156
174
|
"fees": self.fees,
|
157
175
|
"metadata": self.metadata,
|
158
176
|
"created_at": self.created_at,
|
177
|
+
"breakdown": self.breakdown,
|
159
178
|
}.to_json
|
160
179
|
end
|
161
180
|
|
@@ -205,6 +224,9 @@ module ProcessOut
|
|
205
224
|
if data.include? "created_at"
|
206
225
|
self.created_at = data["created_at"]
|
207
226
|
end
|
227
|
+
if data.include? "breakdown"
|
228
|
+
self.breakdown = data["breakdown"]
|
229
|
+
end
|
208
230
|
|
209
231
|
self
|
210
232
|
end
|
@@ -229,6 +251,7 @@ module ProcessOut
|
|
229
251
|
self.fees = data.fetch(:fees, self.fees)
|
230
252
|
self.metadata = data.fetch(:metadata, self.metadata)
|
231
253
|
self.created_at = data.fetch(:created_at, self.created_at)
|
254
|
+
self.breakdown = data.fetch(:breakdown, self.breakdown)
|
232
255
|
|
233
256
|
self
|
234
257
|
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# The content of this file was automatically generated
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
require "json"
|
5
|
+
require "processout/networking/request"
|
6
|
+
require "processout/networking/response"
|
7
|
+
|
8
|
+
module ProcessOut
|
9
|
+
class PayoutItemAmountBreakdowns
|
10
|
+
|
11
|
+
attr_reader :scheme_fee
|
12
|
+
attr_reader :interchange_fee
|
13
|
+
attr_reader :gateway_fee
|
14
|
+
attr_reader :markup_fee
|
15
|
+
attr_reader :acquirer_fee
|
16
|
+
attr_reader :other_fee
|
17
|
+
|
18
|
+
|
19
|
+
def scheme_fee=(val)
|
20
|
+
@scheme_fee = val
|
21
|
+
end
|
22
|
+
|
23
|
+
def interchange_fee=(val)
|
24
|
+
@interchange_fee = val
|
25
|
+
end
|
26
|
+
|
27
|
+
def gateway_fee=(val)
|
28
|
+
@gateway_fee = val
|
29
|
+
end
|
30
|
+
|
31
|
+
def markup_fee=(val)
|
32
|
+
@markup_fee = val
|
33
|
+
end
|
34
|
+
|
35
|
+
def acquirer_fee=(val)
|
36
|
+
@acquirer_fee = val
|
37
|
+
end
|
38
|
+
|
39
|
+
def other_fee=(val)
|
40
|
+
@other_fee = val
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
# Initializes the PayoutItemAmountBreakdowns object
|
45
|
+
# Params:
|
46
|
+
# +client+:: +ProcessOut+ client instance
|
47
|
+
# +data+:: data that can be used to fill the object
|
48
|
+
def initialize(client, data = {})
|
49
|
+
@client = client
|
50
|
+
|
51
|
+
self.scheme_fee = data.fetch(:scheme_fee, nil)
|
52
|
+
self.interchange_fee = data.fetch(:interchange_fee, nil)
|
53
|
+
self.gateway_fee = data.fetch(:gateway_fee, nil)
|
54
|
+
self.markup_fee = data.fetch(:markup_fee, nil)
|
55
|
+
self.acquirer_fee = data.fetch(:acquirer_fee, nil)
|
56
|
+
self.other_fee = data.fetch(:other_fee, nil)
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
# Create a new PayoutItemAmountBreakdowns using the current client
|
61
|
+
def new(data = {})
|
62
|
+
PayoutItemAmountBreakdowns.new(@client, data)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Overrides the JSON marshaller to only send the fields we want
|
66
|
+
def to_json(options)
|
67
|
+
{
|
68
|
+
"scheme_fee": self.scheme_fee,
|
69
|
+
"interchange_fee": self.interchange_fee,
|
70
|
+
"gateway_fee": self.gateway_fee,
|
71
|
+
"markup_fee": self.markup_fee,
|
72
|
+
"acquirer_fee": self.acquirer_fee,
|
73
|
+
"other_fee": self.other_fee,
|
74
|
+
}.to_json
|
75
|
+
end
|
76
|
+
|
77
|
+
# Fills the object with data coming from the API
|
78
|
+
# Params:
|
79
|
+
# +data+:: +Hash+ of data coming from the API
|
80
|
+
def fill_with_data(data)
|
81
|
+
if data.nil?
|
82
|
+
return self
|
83
|
+
end
|
84
|
+
if data.include? "scheme_fee"
|
85
|
+
self.scheme_fee = data["scheme_fee"]
|
86
|
+
end
|
87
|
+
if data.include? "interchange_fee"
|
88
|
+
self.interchange_fee = data["interchange_fee"]
|
89
|
+
end
|
90
|
+
if data.include? "gateway_fee"
|
91
|
+
self.gateway_fee = data["gateway_fee"]
|
92
|
+
end
|
93
|
+
if data.include? "markup_fee"
|
94
|
+
self.markup_fee = data["markup_fee"]
|
95
|
+
end
|
96
|
+
if data.include? "acquirer_fee"
|
97
|
+
self.acquirer_fee = data["acquirer_fee"]
|
98
|
+
end
|
99
|
+
if data.include? "other_fee"
|
100
|
+
self.other_fee = data["other_fee"]
|
101
|
+
end
|
102
|
+
|
103
|
+
self
|
104
|
+
end
|
105
|
+
|
106
|
+
# Prefills the object with the data passed as parameters
|
107
|
+
# Params:
|
108
|
+
# +data+:: +Hash+ of data
|
109
|
+
def prefill(data)
|
110
|
+
if data.nil?
|
111
|
+
return self
|
112
|
+
end
|
113
|
+
self.scheme_fee = data.fetch(:scheme_fee, self.scheme_fee)
|
114
|
+
self.interchange_fee = data.fetch(:interchange_fee, self.interchange_fee)
|
115
|
+
self.gateway_fee = data.fetch(:gateway_fee, self.gateway_fee)
|
116
|
+
self.markup_fee = data.fetch(:markup_fee, self.markup_fee)
|
117
|
+
self.acquirer_fee = data.fetch(:acquirer_fee, self.acquirer_fee)
|
118
|
+
self.other_fee = data.fetch(:other_fee, self.other_fee)
|
119
|
+
|
120
|
+
self
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# The content of this file was automatically generated
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
require "json"
|
5
|
+
require "processout/networking/request"
|
6
|
+
require "processout/networking/response"
|
7
|
+
|
8
|
+
module ProcessOut
|
9
|
+
class Phone
|
10
|
+
|
11
|
+
attr_reader :number
|
12
|
+
attr_reader :dialing_code
|
13
|
+
|
14
|
+
|
15
|
+
def number=(val)
|
16
|
+
@number = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def dialing_code=(val)
|
20
|
+
@dialing_code = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the Phone object
|
25
|
+
# Params:
|
26
|
+
# +client+:: +ProcessOut+ client instance
|
27
|
+
# +data+:: data that can be used to fill the object
|
28
|
+
def initialize(client, data = {})
|
29
|
+
@client = client
|
30
|
+
|
31
|
+
self.number = data.fetch(:number, nil)
|
32
|
+
self.dialing_code = data.fetch(:dialing_code, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new Phone using the current client
|
37
|
+
def new(data = {})
|
38
|
+
Phone.new(@client, data)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Overrides the JSON marshaller to only send the fields we want
|
42
|
+
def to_json(options)
|
43
|
+
{
|
44
|
+
"number": self.number,
|
45
|
+
"dialing_code": self.dialing_code,
|
46
|
+
}.to_json
|
47
|
+
end
|
48
|
+
|
49
|
+
# Fills the object with data coming from the API
|
50
|
+
# Params:
|
51
|
+
# +data+:: +Hash+ of data coming from the API
|
52
|
+
def fill_with_data(data)
|
53
|
+
if data.nil?
|
54
|
+
return self
|
55
|
+
end
|
56
|
+
if data.include? "number"
|
57
|
+
self.number = data["number"]
|
58
|
+
end
|
59
|
+
if data.include? "dialing_code"
|
60
|
+
self.dialing_code = data["dialing_code"]
|
61
|
+
end
|
62
|
+
|
63
|
+
self
|
64
|
+
end
|
65
|
+
|
66
|
+
# Prefills the object with the data passed as parameters
|
67
|
+
# Params:
|
68
|
+
# +data+:: +Hash+ of data
|
69
|
+
def prefill(data)
|
70
|
+
if data.nil?
|
71
|
+
return self
|
72
|
+
end
|
73
|
+
self.number = data.fetch(:number, self.number)
|
74
|
+
self.dialing_code = data.fetch(:dialing_code, self.dialing_code)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -63,6 +63,9 @@ module ProcessOut
|
|
63
63
|
attr_reader :created_at
|
64
64
|
attr_reader :chargedback_at
|
65
65
|
attr_reader :refunded_at
|
66
|
+
attr_reader :authorized_at
|
67
|
+
attr_reader :captured_at
|
68
|
+
attr_reader :voided_at
|
66
69
|
attr_reader :three_d_s
|
67
70
|
attr_reader :cvc_check
|
68
71
|
attr_reader :avs_check
|
@@ -422,6 +425,18 @@ module ProcessOut
|
|
422
425
|
@refunded_at = val
|
423
426
|
end
|
424
427
|
|
428
|
+
def authorized_at=(val)
|
429
|
+
@authorized_at = val
|
430
|
+
end
|
431
|
+
|
432
|
+
def captured_at=(val)
|
433
|
+
@captured_at = val
|
434
|
+
end
|
435
|
+
|
436
|
+
def voided_at=(val)
|
437
|
+
@voided_at = val
|
438
|
+
end
|
439
|
+
|
425
440
|
def three_d_s=(val)
|
426
441
|
if val.nil?
|
427
442
|
@three_d_s = val
|
@@ -546,6 +561,9 @@ module ProcessOut
|
|
546
561
|
self.created_at = data.fetch(:created_at, nil)
|
547
562
|
self.chargedback_at = data.fetch(:chargedback_at, nil)
|
548
563
|
self.refunded_at = data.fetch(:refunded_at, nil)
|
564
|
+
self.authorized_at = data.fetch(:authorized_at, nil)
|
565
|
+
self.captured_at = data.fetch(:captured_at, nil)
|
566
|
+
self.voided_at = data.fetch(:voided_at, nil)
|
549
567
|
self.three_d_s = data.fetch(:three_d_s, nil)
|
550
568
|
self.cvc_check = data.fetch(:cvc_check, nil)
|
551
569
|
self.avs_check = data.fetch(:avs_check, nil)
|
@@ -621,6 +639,9 @@ module ProcessOut
|
|
621
639
|
"created_at": self.created_at,
|
622
640
|
"chargedback_at": self.chargedback_at,
|
623
641
|
"refunded_at": self.refunded_at,
|
642
|
+
"authorized_at": self.authorized_at,
|
643
|
+
"captured_at": self.captured_at,
|
644
|
+
"voided_at": self.voided_at,
|
624
645
|
"three_d_s": self.three_d_s,
|
625
646
|
"cvc_check": self.cvc_check,
|
626
647
|
"avs_check": self.avs_check,
|
@@ -805,6 +826,15 @@ module ProcessOut
|
|
805
826
|
if data.include? "refunded_at"
|
806
827
|
self.refunded_at = data["refunded_at"]
|
807
828
|
end
|
829
|
+
if data.include? "authorized_at"
|
830
|
+
self.authorized_at = data["authorized_at"]
|
831
|
+
end
|
832
|
+
if data.include? "captured_at"
|
833
|
+
self.captured_at = data["captured_at"]
|
834
|
+
end
|
835
|
+
if data.include? "voided_at"
|
836
|
+
self.voided_at = data["voided_at"]
|
837
|
+
end
|
808
838
|
if data.include? "three_d_s"
|
809
839
|
self.three_d_s = data["three_d_s"]
|
810
840
|
end
|
@@ -898,6 +928,9 @@ module ProcessOut
|
|
898
928
|
self.created_at = data.fetch(:created_at, self.created_at)
|
899
929
|
self.chargedback_at = data.fetch(:chargedback_at, self.chargedback_at)
|
900
930
|
self.refunded_at = data.fetch(:refunded_at, self.refunded_at)
|
931
|
+
self.authorized_at = data.fetch(:authorized_at, self.authorized_at)
|
932
|
+
self.captured_at = data.fetch(:captured_at, self.captured_at)
|
933
|
+
self.voided_at = data.fetch(:voided_at, self.voided_at)
|
901
934
|
self.three_d_s = data.fetch(:three_d_s, self.three_d_s)
|
902
935
|
self.cvc_check = data.fetch(:cvc_check, self.cvc_check)
|
903
936
|
self.avs_check = data.fetch(:avs_check, self.avs_check)
|
data/lib/processout/version.rb
CHANGED