processout 2.14.4 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/processout/balance.rb +81 -0
- data/lib/processout/balances.rb +111 -0
- data/lib/processout/invoice.rb +63 -1
- data/lib/processout/invoice_tax.rb +81 -0
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/three_ds.rb +61 -6
- data/lib/processout/token.rb +24 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout.rb +18 -0
- 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: 559db6651b870cc6583e9bda27526f937b8a1c3f58961769639de5030d2b9249
|
4
|
+
data.tar.gz: 0f31accee517e7222211cfe83c2c11300525a03c5d13d8282a71f9c59369a8c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5afa9e587fd112bb3a96e965aedf18f3d7b3b45f5352f91e8bf946b41817129b402333578da69c308d449d51b5771048a99f8443ce2e28e6c5a1c821e06bf9ce
|
7
|
+
data.tar.gz: d38a55e353ecac2a7cd958201f573037cfead8c43650f1c2607309aa6b26f7d130f4b0c8540c9948cf9dab4796baef73c17e6bac49d74415fda3e01b9f18ad36
|
@@ -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 Balance
|
10
|
+
|
11
|
+
attr_reader :amount
|
12
|
+
attr_reader :currency
|
13
|
+
|
14
|
+
|
15
|
+
def amount=(val)
|
16
|
+
@amount = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def currency=(val)
|
20
|
+
@currency = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the Balance 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.amount = data.fetch(:amount, nil)
|
32
|
+
self.currency = data.fetch(:currency, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new Balance using the current client
|
37
|
+
def new(data = {})
|
38
|
+
Balance.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
|
+
"amount": self.amount,
|
45
|
+
"currency": self.currency,
|
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? "amount"
|
57
|
+
self.amount = data["amount"]
|
58
|
+
end
|
59
|
+
if data.include? "currency"
|
60
|
+
self.currency = data["currency"]
|
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.amount = data.fetch(:amount, self.amount)
|
74
|
+
self.currency = data.fetch(:currency, self.currency)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,111 @@
|
|
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 Balances
|
10
|
+
|
11
|
+
attr_reader :vouchers
|
12
|
+
|
13
|
+
|
14
|
+
def vouchers=(val)
|
15
|
+
if val.nil?
|
16
|
+
@vouchers = []
|
17
|
+
return
|
18
|
+
end
|
19
|
+
|
20
|
+
if val.length > 0 and val[0].instance_of? Balance
|
21
|
+
@vouchers = val
|
22
|
+
else
|
23
|
+
l = Array.new
|
24
|
+
for v in val
|
25
|
+
obj = Balance.new(@client)
|
26
|
+
obj.fill_with_data(v)
|
27
|
+
l.push(obj)
|
28
|
+
end
|
29
|
+
@vouchers = l
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
# Initializes the Balances object
|
36
|
+
# Params:
|
37
|
+
# +client+:: +ProcessOut+ client instance
|
38
|
+
# +data+:: data that can be used to fill the object
|
39
|
+
def initialize(client, data = {})
|
40
|
+
@client = client
|
41
|
+
|
42
|
+
self.vouchers = data.fetch(:vouchers, nil)
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
# Create a new Balances using the current client
|
47
|
+
def new(data = {})
|
48
|
+
Balances.new(@client, data)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Overrides the JSON marshaller to only send the fields we want
|
52
|
+
def to_json(options)
|
53
|
+
{
|
54
|
+
"vouchers": self.vouchers,
|
55
|
+
}.to_json
|
56
|
+
end
|
57
|
+
|
58
|
+
# Fills the object with data coming from the API
|
59
|
+
# Params:
|
60
|
+
# +data+:: +Hash+ of data coming from the API
|
61
|
+
def fill_with_data(data)
|
62
|
+
if data.nil?
|
63
|
+
return self
|
64
|
+
end
|
65
|
+
if data.include? "vouchers"
|
66
|
+
self.vouchers = data["vouchers"]
|
67
|
+
end
|
68
|
+
|
69
|
+
self
|
70
|
+
end
|
71
|
+
|
72
|
+
# Prefills the object with the data passed as parameters
|
73
|
+
# Params:
|
74
|
+
# +data+:: +Hash+ of data
|
75
|
+
def prefill(data)
|
76
|
+
if data.nil?
|
77
|
+
return self
|
78
|
+
end
|
79
|
+
self.vouchers = data.fetch(:vouchers, self.vouchers)
|
80
|
+
|
81
|
+
self
|
82
|
+
end
|
83
|
+
|
84
|
+
# Fetch a customer token's balance
|
85
|
+
# Params:
|
86
|
+
# +token_id+:: ID of the customer's token
|
87
|
+
# +options+:: +Hash+ of options
|
88
|
+
def find(token_id, options = {})
|
89
|
+
self.prefill(options)
|
90
|
+
|
91
|
+
request = Request.new(@client)
|
92
|
+
path = "/balances/tokens/" + CGI.escape(token_id) + ""
|
93
|
+
data = {
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
response = Response.new(request.get(path, data, options))
|
98
|
+
return_values = Array.new
|
99
|
+
|
100
|
+
body = response.body
|
101
|
+
body = body["balances"]
|
102
|
+
balances = Balances.new(@client)
|
103
|
+
return_values.push(balances.fill_with_data(body))
|
104
|
+
|
105
|
+
|
106
|
+
return_values[0]
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
end
|
111
|
+
end
|
data/lib/processout/invoice.rb
CHANGED
@@ -45,6 +45,8 @@ module ProcessOut
|
|
45
45
|
attr_reader :exemption_reason_3ds2
|
46
46
|
attr_reader :sca_exemption_reason
|
47
47
|
attr_reader :challenge_indicator
|
48
|
+
attr_reader :incremental
|
49
|
+
attr_reader :tax
|
48
50
|
|
49
51
|
|
50
52
|
def id=(val)
|
@@ -319,6 +321,26 @@ module ProcessOut
|
|
319
321
|
@challenge_indicator = val
|
320
322
|
end
|
321
323
|
|
324
|
+
def incremental=(val)
|
325
|
+
@incremental = val
|
326
|
+
end
|
327
|
+
|
328
|
+
def tax=(val)
|
329
|
+
if val.nil?
|
330
|
+
@tax = val
|
331
|
+
return
|
332
|
+
end
|
333
|
+
|
334
|
+
if val.instance_of? InvoiceTax
|
335
|
+
@tax = val
|
336
|
+
else
|
337
|
+
obj = InvoiceTax.new(@client)
|
338
|
+
obj.fill_with_data(val)
|
339
|
+
@tax = obj
|
340
|
+
end
|
341
|
+
|
342
|
+
end
|
343
|
+
|
322
344
|
|
323
345
|
# Initializes the Invoice object
|
324
346
|
# Params:
|
@@ -364,6 +386,8 @@ module ProcessOut
|
|
364
386
|
self.exemption_reason_3ds2 = data.fetch(:exemption_reason_3ds2, nil)
|
365
387
|
self.sca_exemption_reason = data.fetch(:sca_exemption_reason, nil)
|
366
388
|
self.challenge_indicator = data.fetch(:challenge_indicator, nil)
|
389
|
+
self.incremental = data.fetch(:incremental, nil)
|
390
|
+
self.tax = data.fetch(:tax, nil)
|
367
391
|
|
368
392
|
end
|
369
393
|
|
@@ -412,6 +436,8 @@ module ProcessOut
|
|
412
436
|
"exemption_reason_3ds2": self.exemption_reason_3ds2,
|
413
437
|
"sca_exemption_reason": self.sca_exemption_reason,
|
414
438
|
"challenge_indicator": self.challenge_indicator,
|
439
|
+
"incremental": self.incremental,
|
440
|
+
"tax": self.tax,
|
415
441
|
}.to_json
|
416
442
|
end
|
417
443
|
|
@@ -533,6 +559,12 @@ module ProcessOut
|
|
533
559
|
if data.include? "challenge_indicator"
|
534
560
|
self.challenge_indicator = data["challenge_indicator"]
|
535
561
|
end
|
562
|
+
if data.include? "incremental"
|
563
|
+
self.incremental = data["incremental"]
|
564
|
+
end
|
565
|
+
if data.include? "tax"
|
566
|
+
self.tax = data["tax"]
|
567
|
+
end
|
536
568
|
|
537
569
|
self
|
538
570
|
end
|
@@ -581,10 +613,37 @@ module ProcessOut
|
|
581
613
|
self.exemption_reason_3ds2 = data.fetch(:exemption_reason_3ds2, self.exemption_reason_3ds2)
|
582
614
|
self.sca_exemption_reason = data.fetch(:sca_exemption_reason, self.sca_exemption_reason)
|
583
615
|
self.challenge_indicator = data.fetch(:challenge_indicator, self.challenge_indicator)
|
616
|
+
self.incremental = data.fetch(:incremental, self.incremental)
|
617
|
+
self.tax = data.fetch(:tax, self.tax)
|
584
618
|
|
585
619
|
self
|
586
620
|
end
|
587
621
|
|
622
|
+
# Create an incremental authorization
|
623
|
+
# Params:
|
624
|
+
# +amount+:: Amount to increment authorization by
|
625
|
+
# +options+:: +Hash+ of options
|
626
|
+
def increment_authorization(amount, options = {})
|
627
|
+
self.prefill(options)
|
628
|
+
|
629
|
+
request = Request.new(@client)
|
630
|
+
path = "/invoices/" + CGI.escape(@id) + "/increment_authorization"
|
631
|
+
data = {
|
632
|
+
"amount" => amount
|
633
|
+
}
|
634
|
+
|
635
|
+
response = Response.new(request.post(path, data, options))
|
636
|
+
return_values = Array.new
|
637
|
+
|
638
|
+
body = response.body
|
639
|
+
body = body["transaction"]
|
640
|
+
transaction = Transaction.new(@client)
|
641
|
+
return_values.push(transaction.fill_with_data(body))
|
642
|
+
|
643
|
+
|
644
|
+
return_values[0]
|
645
|
+
end
|
646
|
+
|
588
647
|
# Authorize the invoice using the given source (customer or token)
|
589
648
|
# Params:
|
590
649
|
# +source+:: Source used to authorization the payment. Can be a card, a token or a gateway request
|
@@ -596,6 +655,7 @@ module ProcessOut
|
|
596
655
|
path = "/invoices/" + CGI.escape(@id) + "/authorize"
|
597
656
|
data = {
|
598
657
|
"device" => @device,
|
658
|
+
"incremental" => @incremental,
|
599
659
|
"synchronous" => options.fetch(:synchronous, nil),
|
600
660
|
"retry_drop_liability_shift" => options.fetch(:retry_drop_liability_shift, nil),
|
601
661
|
"capture_amount" => options.fetch(:capture_amount, nil),
|
@@ -627,6 +687,7 @@ module ProcessOut
|
|
627
687
|
path = "/invoices/" + CGI.escape(@id) + "/capture"
|
628
688
|
data = {
|
629
689
|
"device" => @device,
|
690
|
+
"incremental" => @incremental,
|
630
691
|
"authorize_only" => options.fetch(:authorize_only, nil),
|
631
692
|
"synchronous" => options.fetch(:synchronous, nil),
|
632
693
|
"retry_drop_liability_shift" => options.fetch(:retry_drop_liability_shift, nil),
|
@@ -833,7 +894,8 @@ module ProcessOut
|
|
833
894
|
"shipping" => @shipping,
|
834
895
|
"device" => @device,
|
835
896
|
"require_backend_capture" => @require_backend_capture,
|
836
|
-
"external_fraud_tools" => @external_fraud_tools
|
897
|
+
"external_fraud_tools" => @external_fraud_tools,
|
898
|
+
"tax" => @tax
|
837
899
|
}
|
838
900
|
|
839
901
|
response = Response.new(request.post(path, data, options))
|
@@ -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 InvoiceTax
|
10
|
+
|
11
|
+
attr_reader :amount
|
12
|
+
attr_reader :rate
|
13
|
+
|
14
|
+
|
15
|
+
def amount=(val)
|
16
|
+
@amount = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def rate=(val)
|
20
|
+
@rate = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the InvoiceTax 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.amount = data.fetch(:amount, nil)
|
32
|
+
self.rate = data.fetch(:rate, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new InvoiceTax using the current client
|
37
|
+
def new(data = {})
|
38
|
+
InvoiceTax.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
|
+
"amount": self.amount,
|
45
|
+
"rate": self.rate,
|
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? "amount"
|
57
|
+
self.amount = data["amount"]
|
58
|
+
end
|
59
|
+
if data.include? "rate"
|
60
|
+
self.rate = data["rate"]
|
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.amount = data.fetch(:amount, self.amount)
|
74
|
+
self.rate = data.fetch(:rate, self.rate)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -13,7 +13,7 @@ module ProcessOut
|
|
13
13
|
req.basic_auth @client.project_id, @client.project_secret
|
14
14
|
req.content_type = "application/json"
|
15
15
|
req["API-Version"] = "1.4.0.0"
|
16
|
-
req["User-Agent"] = "ProcessOut Ruby-Bindings/2.
|
16
|
+
req["User-Agent"] = "ProcessOut Ruby-Bindings/2.17.0"
|
17
17
|
|
18
18
|
unless options.nil?
|
19
19
|
req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
|
data/lib/processout/three_ds.rb
CHANGED
@@ -12,6 +12,11 @@ module ProcessOut
|
|
12
12
|
attr_reader :status
|
13
13
|
attr_reader :fingerprinted
|
14
14
|
attr_reader :challenged
|
15
|
+
attr_reader :ares_trans_status
|
16
|
+
attr_reader :cres_trans_status
|
17
|
+
attr_reader :ds_trans_id
|
18
|
+
attr_reader :fingerprint_completion_indicator
|
19
|
+
attr_reader :server_trans_id
|
15
20
|
|
16
21
|
|
17
22
|
def version=(val)
|
@@ -30,6 +35,26 @@ module ProcessOut
|
|
30
35
|
@challenged = val
|
31
36
|
end
|
32
37
|
|
38
|
+
def ares_trans_status=(val)
|
39
|
+
@ares_trans_status = val
|
40
|
+
end
|
41
|
+
|
42
|
+
def cres_trans_status=(val)
|
43
|
+
@cres_trans_status = val
|
44
|
+
end
|
45
|
+
|
46
|
+
def ds_trans_id=(val)
|
47
|
+
@ds_trans_id = val
|
48
|
+
end
|
49
|
+
|
50
|
+
def fingerprint_completion_indicator=(val)
|
51
|
+
@fingerprint_completion_indicator = val
|
52
|
+
end
|
53
|
+
|
54
|
+
def server_trans_id=(val)
|
55
|
+
@server_trans_id = val
|
56
|
+
end
|
57
|
+
|
33
58
|
|
34
59
|
# Initializes the ThreeDS object
|
35
60
|
# Params:
|
@@ -42,6 +67,11 @@ module ProcessOut
|
|
42
67
|
self.status = data.fetch(:status, nil)
|
43
68
|
self.fingerprinted = data.fetch(:fingerprinted, nil)
|
44
69
|
self.challenged = data.fetch(:challenged, nil)
|
70
|
+
self.ares_trans_status = data.fetch(:ares_trans_status, nil)
|
71
|
+
self.cres_trans_status = data.fetch(:cres_trans_status, nil)
|
72
|
+
self.ds_trans_id = data.fetch(:ds_trans_id, nil)
|
73
|
+
self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, nil)
|
74
|
+
self.server_trans_id = data.fetch(:server_trans_id, nil)
|
45
75
|
|
46
76
|
end
|
47
77
|
|
@@ -53,10 +83,15 @@ module ProcessOut
|
|
53
83
|
# Overrides the JSON marshaller to only send the fields we want
|
54
84
|
def to_json(options)
|
55
85
|
{
|
56
|
-
"
|
57
|
-
"
|
86
|
+
"version": self.version,
|
87
|
+
"status": self.status,
|
58
88
|
"fingerprinted": self.fingerprinted,
|
59
89
|
"challenged": self.challenged,
|
90
|
+
"ares_trans_status": self.ares_trans_status,
|
91
|
+
"cres_trans_status": self.cres_trans_status,
|
92
|
+
"ds_trans_id": self.ds_trans_id,
|
93
|
+
"fingerprint_completion_indicator": self.fingerprint_completion_indicator,
|
94
|
+
"server_trans_id": self.server_trans_id,
|
60
95
|
}.to_json
|
61
96
|
end
|
62
97
|
|
@@ -67,11 +102,11 @@ module ProcessOut
|
|
67
102
|
if data.nil?
|
68
103
|
return self
|
69
104
|
end
|
70
|
-
if data.include? "
|
71
|
-
self.version = data["
|
105
|
+
if data.include? "version"
|
106
|
+
self.version = data["version"]
|
72
107
|
end
|
73
|
-
if data.include? "
|
74
|
-
self.status = data["
|
108
|
+
if data.include? "status"
|
109
|
+
self.status = data["status"]
|
75
110
|
end
|
76
111
|
if data.include? "fingerprinted"
|
77
112
|
self.fingerprinted = data["fingerprinted"]
|
@@ -79,6 +114,21 @@ module ProcessOut
|
|
79
114
|
if data.include? "challenged"
|
80
115
|
self.challenged = data["challenged"]
|
81
116
|
end
|
117
|
+
if data.include? "ares_trans_status"
|
118
|
+
self.ares_trans_status = data["ares_trans_status"]
|
119
|
+
end
|
120
|
+
if data.include? "cres_trans_status"
|
121
|
+
self.cres_trans_status = data["cres_trans_status"]
|
122
|
+
end
|
123
|
+
if data.include? "ds_trans_id"
|
124
|
+
self.ds_trans_id = data["ds_trans_id"]
|
125
|
+
end
|
126
|
+
if data.include? "fingerprint_completion_indicator"
|
127
|
+
self.fingerprint_completion_indicator = data["fingerprint_completion_indicator"]
|
128
|
+
end
|
129
|
+
if data.include? "server_trans_id"
|
130
|
+
self.server_trans_id = data["server_trans_id"]
|
131
|
+
end
|
82
132
|
|
83
133
|
self
|
84
134
|
end
|
@@ -94,6 +144,11 @@ module ProcessOut
|
|
94
144
|
self.status = data.fetch(:status, self.status)
|
95
145
|
self.fingerprinted = data.fetch(:fingerprinted, self.fingerprinted)
|
96
146
|
self.challenged = data.fetch(:challenged, self.challenged)
|
147
|
+
self.ares_trans_status = data.fetch(:ares_trans_status, self.ares_trans_status)
|
148
|
+
self.cres_trans_status = data.fetch(:cres_trans_status, self.cres_trans_status)
|
149
|
+
self.ds_trans_id = data.fetch(:ds_trans_id, self.ds_trans_id)
|
150
|
+
self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, self.fingerprint_completion_indicator)
|
151
|
+
self.server_trans_id = data.fetch(:server_trans_id, self.server_trans_id)
|
97
152
|
|
98
153
|
self
|
99
154
|
end
|
data/lib/processout/token.rb
CHANGED
@@ -27,6 +27,8 @@ module ProcessOut
|
|
27
27
|
attr_reader :description
|
28
28
|
attr_reader :invoice
|
29
29
|
attr_reader :invoice_id
|
30
|
+
attr_reader :manual_invoice_cancellation
|
31
|
+
attr_reader :can_get_balance
|
30
32
|
|
31
33
|
|
32
34
|
def id=(val)
|
@@ -153,6 +155,14 @@ module ProcessOut
|
|
153
155
|
@invoice_id = val
|
154
156
|
end
|
155
157
|
|
158
|
+
def manual_invoice_cancellation=(val)
|
159
|
+
@manual_invoice_cancellation = val
|
160
|
+
end
|
161
|
+
|
162
|
+
def can_get_balance=(val)
|
163
|
+
@can_get_balance = val
|
164
|
+
end
|
165
|
+
|
156
166
|
|
157
167
|
# Initializes the Token object
|
158
168
|
# Params:
|
@@ -180,6 +190,8 @@ module ProcessOut
|
|
180
190
|
self.description = data.fetch(:description, nil)
|
181
191
|
self.invoice = data.fetch(:invoice, nil)
|
182
192
|
self.invoice_id = data.fetch(:invoice_id, nil)
|
193
|
+
self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, nil)
|
194
|
+
self.can_get_balance = data.fetch(:can_get_balance, nil)
|
183
195
|
|
184
196
|
end
|
185
197
|
|
@@ -210,6 +222,8 @@ module ProcessOut
|
|
210
222
|
"description": self.description,
|
211
223
|
"invoice": self.invoice,
|
212
224
|
"invoice_id": self.invoice_id,
|
225
|
+
"manual_invoice_cancellation": self.manual_invoice_cancellation,
|
226
|
+
"can_get_balance": self.can_get_balance,
|
213
227
|
}.to_json
|
214
228
|
end
|
215
229
|
|
@@ -277,6 +291,12 @@ module ProcessOut
|
|
277
291
|
if data.include? "invoice_id"
|
278
292
|
self.invoice_id = data["invoice_id"]
|
279
293
|
end
|
294
|
+
if data.include? "manual_invoice_cancellation"
|
295
|
+
self.manual_invoice_cancellation = data["manual_invoice_cancellation"]
|
296
|
+
end
|
297
|
+
if data.include? "can_get_balance"
|
298
|
+
self.can_get_balance = data["can_get_balance"]
|
299
|
+
end
|
280
300
|
|
281
301
|
self
|
282
302
|
end
|
@@ -307,6 +327,8 @@ module ProcessOut
|
|
307
327
|
self.description = data.fetch(:description, self.description)
|
308
328
|
self.invoice = data.fetch(:invoice, self.invoice)
|
309
329
|
self.invoice_id = data.fetch(:invoice_id, self.invoice_id)
|
330
|
+
self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, self.manual_invoice_cancellation)
|
331
|
+
self.can_get_balance = data.fetch(:can_get_balance, self.can_get_balance)
|
310
332
|
|
311
333
|
self
|
312
334
|
end
|
@@ -384,6 +406,8 @@ module ProcessOut
|
|
384
406
|
"return_url" => @return_url,
|
385
407
|
"cancel_url" => @cancel_url,
|
386
408
|
"description" => @description,
|
409
|
+
"invoice_id" => @invoice_id,
|
410
|
+
"manual_invoice_cancellation" => @manual_invoice_cancellation,
|
387
411
|
"source" => options.fetch(:source, nil),
|
388
412
|
"settings" => options.fetch(:settings, nil),
|
389
413
|
"device" => options.fetch(:device, nil),
|
data/lib/processout/version.rb
CHANGED
data/lib/processout.rb
CHANGED
@@ -4,6 +4,8 @@ require "processout/activity"
|
|
4
4
|
require "processout/addon"
|
5
5
|
require "processout/api_request"
|
6
6
|
require "processout/api_version"
|
7
|
+
require "processout/balances"
|
8
|
+
require "processout/balance"
|
7
9
|
require "processout/card"
|
8
10
|
require "processout/card_information"
|
9
11
|
require "processout/coupon"
|
@@ -14,6 +16,7 @@ require "processout/event"
|
|
14
16
|
require "processout/gateway"
|
15
17
|
require "processout/gateway_configuration"
|
16
18
|
require "processout/invoice"
|
19
|
+
require "processout/invoice_tax"
|
17
20
|
require "processout/invoice_external_fraud_tools"
|
18
21
|
require "processout/invoice_risk"
|
19
22
|
require "processout/invoice_device"
|
@@ -68,6 +71,16 @@ module ProcessOut
|
|
68
71
|
obj = APIVersion.new(self, data)
|
69
72
|
end
|
70
73
|
|
74
|
+
# Create a new Balances instance
|
75
|
+
def balances(data = {})
|
76
|
+
obj = Balances.new(self, data)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Create a new Balance instance
|
80
|
+
def balance(data = {})
|
81
|
+
obj = Balance.new(self, data)
|
82
|
+
end
|
83
|
+
|
71
84
|
# Create a new Card instance
|
72
85
|
def card(data = {})
|
73
86
|
obj = Card.new(self, data)
|
@@ -118,6 +131,11 @@ module ProcessOut
|
|
118
131
|
obj = Invoice.new(self, data)
|
119
132
|
end
|
120
133
|
|
134
|
+
# Create a new InvoiceTax instance
|
135
|
+
def invoice_tax(data = {})
|
136
|
+
obj = InvoiceTax.new(self, data)
|
137
|
+
end
|
138
|
+
|
121
139
|
# Create a new InvoiceExternalFraudTools instance
|
122
140
|
def invoice_external_fraud_tools(data = {})
|
123
141
|
obj = InvoiceExternalFraudTools.new(self, data)
|
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.
|
4
|
+
version: 2.17.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: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,6 +75,8 @@ files:
|
|
75
75
|
- lib/processout/addon.rb
|
76
76
|
- lib/processout/api_request.rb
|
77
77
|
- lib/processout/api_version.rb
|
78
|
+
- lib/processout/balance.rb
|
79
|
+
- lib/processout/balances.rb
|
78
80
|
- lib/processout/card.rb
|
79
81
|
- lib/processout/card_information.rb
|
80
82
|
- lib/processout/coupon.rb
|
@@ -97,6 +99,7 @@ files:
|
|
97
99
|
- lib/processout/invoice_external_fraud_tools.rb
|
98
100
|
- lib/processout/invoice_risk.rb
|
99
101
|
- lib/processout/invoice_shipping.rb
|
102
|
+
- lib/processout/invoice_tax.rb
|
100
103
|
- lib/processout/networking/request.rb
|
101
104
|
- lib/processout/networking/response.rb
|
102
105
|
- lib/processout/payment_data_network_authentication.rb
|