processout 2.25.0 → 2.27.1
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/.DS_Store +0 -0
- data/.github/CODEOWNERS +2 -0
- data/.github/stale.yml +17 -0
- data/.github/workflows/ci.yaml +19 -0
- data/.gitignore +2 -1
- data/lib/processout/card.rb +22 -0
- data/lib/processout/category_error_codes.rb +180 -0
- data/lib/processout/customer.rb +29 -4
- data/lib/processout/customer_phone.rb +81 -0
- data/lib/processout/error_codes.rb +107 -0
- data/lib/processout/gateway_configuration.rb +13 -0
- data/lib/processout/invoice.rb +127 -1
- data/lib/processout/invoice_external_fraud_tools.rb +11 -0
- data/lib/processout/invoice_risk.rb +11 -0
- data/lib/processout/invoice_shipping.rb +23 -0
- data/lib/processout/invoice_shipping_phone.rb +81 -0
- data/lib/processout/invoices_process_native_payment_response.rb +105 -0
- data/lib/processout/native_apm_parameter_definition.rb +141 -0
- data/lib/processout/native_apm_parameter_value.rb +81 -0
- data/lib/processout/native_apm_parameter_value_definition.rb +92 -0
- data/lib/processout/native_apm_request.rb +86 -0
- data/lib/processout/native_apm_response.rb +124 -0
- data/lib/processout/native_apm_transaction_details.rb +143 -0
- data/lib/processout/native_apm_transaction_details_gateway.rb +81 -0
- data/lib/processout/native_apm_transaction_details_invoice.rb +81 -0
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/project_sftp_settings.rb +150 -0
- data/lib/processout/refund.rb +26 -0
- data/lib/processout/transaction.rb +46 -0
- data/lib/processout/unsupported_feature_bypass.rb +70 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout.rb +90 -0
- metadata +21 -2
@@ -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 NativeAPMParameterValue
|
10
|
+
|
11
|
+
attr_reader :key
|
12
|
+
attr_reader :value
|
13
|
+
|
14
|
+
|
15
|
+
def key=(val)
|
16
|
+
@key = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def value=(val)
|
20
|
+
@value = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the NativeAPMParameterValue 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.key = data.fetch(:key, nil)
|
32
|
+
self.value = data.fetch(:value, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new NativeAPMParameterValue using the current client
|
37
|
+
def new(data = {})
|
38
|
+
NativeAPMParameterValue.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
|
+
"key": self.key,
|
45
|
+
"value": self.value,
|
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? "key"
|
57
|
+
self.key = data["key"]
|
58
|
+
end
|
59
|
+
if data.include? "value"
|
60
|
+
self.value = data["value"]
|
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.key = data.fetch(:key, self.key)
|
74
|
+
self.value = data.fetch(:value, self.value)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,92 @@
|
|
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 NativeAPMParameterValueDefinition
|
10
|
+
|
11
|
+
attr_reader :value
|
12
|
+
attr_reader :default
|
13
|
+
attr_reader :display_name
|
14
|
+
|
15
|
+
|
16
|
+
def value=(val)
|
17
|
+
@value = val
|
18
|
+
end
|
19
|
+
|
20
|
+
def default=(val)
|
21
|
+
@default = val
|
22
|
+
end
|
23
|
+
|
24
|
+
def display_name=(val)
|
25
|
+
@display_name = val
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
# Initializes the NativeAPMParameterValueDefinition object
|
30
|
+
# Params:
|
31
|
+
# +client+:: +ProcessOut+ client instance
|
32
|
+
# +data+:: data that can be used to fill the object
|
33
|
+
def initialize(client, data = {})
|
34
|
+
@client = client
|
35
|
+
|
36
|
+
self.value = data.fetch(:value, nil)
|
37
|
+
self.default = data.fetch(:default, nil)
|
38
|
+
self.display_name = data.fetch(:display_name, nil)
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
# Create a new NativeAPMParameterValueDefinition using the current client
|
43
|
+
def new(data = {})
|
44
|
+
NativeAPMParameterValueDefinition.new(@client, data)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Overrides the JSON marshaller to only send the fields we want
|
48
|
+
def to_json(options)
|
49
|
+
{
|
50
|
+
"value": self.value,
|
51
|
+
"default": self.default,
|
52
|
+
"display_name": self.display_name,
|
53
|
+
}.to_json
|
54
|
+
end
|
55
|
+
|
56
|
+
# Fills the object with data coming from the API
|
57
|
+
# Params:
|
58
|
+
# +data+:: +Hash+ of data coming from the API
|
59
|
+
def fill_with_data(data)
|
60
|
+
if data.nil?
|
61
|
+
return self
|
62
|
+
end
|
63
|
+
if data.include? "value"
|
64
|
+
self.value = data["value"]
|
65
|
+
end
|
66
|
+
if data.include? "default"
|
67
|
+
self.default = data["default"]
|
68
|
+
end
|
69
|
+
if data.include? "display_name"
|
70
|
+
self.display_name = data["display_name"]
|
71
|
+
end
|
72
|
+
|
73
|
+
self
|
74
|
+
end
|
75
|
+
|
76
|
+
# Prefills the object with the data passed as parameters
|
77
|
+
# Params:
|
78
|
+
# +data+:: +Hash+ of data
|
79
|
+
def prefill(data)
|
80
|
+
if data.nil?
|
81
|
+
return self
|
82
|
+
end
|
83
|
+
self.value = data.fetch(:value, self.value)
|
84
|
+
self.default = data.fetch(:default, self.default)
|
85
|
+
self.display_name = data.fetch(:display_name, self.display_name)
|
86
|
+
|
87
|
+
self
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,86 @@
|
|
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 NativeAPMRequest
|
10
|
+
|
11
|
+
attr_reader :parameter_values
|
12
|
+
|
13
|
+
|
14
|
+
def parameter_values=(val)
|
15
|
+
if val.nil?
|
16
|
+
@parameter_values = []
|
17
|
+
return
|
18
|
+
end
|
19
|
+
|
20
|
+
if val.length > 0 and val[0].instance_of? NativeAPMParameterValue
|
21
|
+
@parameter_values = val
|
22
|
+
else
|
23
|
+
l = Array.new
|
24
|
+
for v in val
|
25
|
+
obj = NativeAPMParameterValue.new(@client)
|
26
|
+
obj.fill_with_data(v)
|
27
|
+
l.push(obj)
|
28
|
+
end
|
29
|
+
@parameter_values = l
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
# Initializes the NativeAPMRequest 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.parameter_values = data.fetch(:parameter_values, nil)
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
# Create a new NativeAPMRequest using the current client
|
47
|
+
def new(data = {})
|
48
|
+
NativeAPMRequest.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
|
+
"parameter_values": self.parameter_values,
|
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? "parameter_values"
|
66
|
+
self.parameter_values = data["parameter_values"]
|
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.parameter_values = data.fetch(:parameter_values, self.parameter_values)
|
80
|
+
|
81
|
+
self
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,124 @@
|
|
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 NativeAPMResponse
|
10
|
+
|
11
|
+
attr_reader :state
|
12
|
+
attr_reader :parameter_definitions
|
13
|
+
attr_reader :parameter_values
|
14
|
+
|
15
|
+
|
16
|
+
def state=(val)
|
17
|
+
@state = val
|
18
|
+
end
|
19
|
+
|
20
|
+
def parameter_definitions=(val)
|
21
|
+
if val.nil?
|
22
|
+
@parameter_definitions = []
|
23
|
+
return
|
24
|
+
end
|
25
|
+
|
26
|
+
if val.length > 0 and val[0].instance_of? NativeAPMParameterDefinition
|
27
|
+
@parameter_definitions = val
|
28
|
+
else
|
29
|
+
l = Array.new
|
30
|
+
for v in val
|
31
|
+
obj = NativeAPMParameterDefinition.new(@client)
|
32
|
+
obj.fill_with_data(v)
|
33
|
+
l.push(obj)
|
34
|
+
end
|
35
|
+
@parameter_definitions = l
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def parameter_values=(val)
|
41
|
+
if val.nil?
|
42
|
+
@parameter_values = []
|
43
|
+
return
|
44
|
+
end
|
45
|
+
|
46
|
+
if val.length > 0 and val[0].instance_of? NativeAPMParameterValue
|
47
|
+
@parameter_values = val
|
48
|
+
else
|
49
|
+
l = Array.new
|
50
|
+
for v in val
|
51
|
+
obj = NativeAPMParameterValue.new(@client)
|
52
|
+
obj.fill_with_data(v)
|
53
|
+
l.push(obj)
|
54
|
+
end
|
55
|
+
@parameter_values = l
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
# Initializes the NativeAPMResponse object
|
62
|
+
# Params:
|
63
|
+
# +client+:: +ProcessOut+ client instance
|
64
|
+
# +data+:: data that can be used to fill the object
|
65
|
+
def initialize(client, data = {})
|
66
|
+
@client = client
|
67
|
+
|
68
|
+
self.state = data.fetch(:state, nil)
|
69
|
+
self.parameter_definitions = data.fetch(:parameter_definitions, nil)
|
70
|
+
self.parameter_values = data.fetch(:parameter_values, nil)
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
# Create a new NativeAPMResponse using the current client
|
75
|
+
def new(data = {})
|
76
|
+
NativeAPMResponse.new(@client, data)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Overrides the JSON marshaller to only send the fields we want
|
80
|
+
def to_json(options)
|
81
|
+
{
|
82
|
+
"state": self.state,
|
83
|
+
"parameter_definitions": self.parameter_definitions,
|
84
|
+
"parameter_values": self.parameter_values,
|
85
|
+
}.to_json
|
86
|
+
end
|
87
|
+
|
88
|
+
# Fills the object with data coming from the API
|
89
|
+
# Params:
|
90
|
+
# +data+:: +Hash+ of data coming from the API
|
91
|
+
def fill_with_data(data)
|
92
|
+
if data.nil?
|
93
|
+
return self
|
94
|
+
end
|
95
|
+
if data.include? "state"
|
96
|
+
self.state = data["state"]
|
97
|
+
end
|
98
|
+
if data.include? "parameter_definitions"
|
99
|
+
self.parameter_definitions = data["parameter_definitions"]
|
100
|
+
end
|
101
|
+
if data.include? "parameter_values"
|
102
|
+
self.parameter_values = data["parameter_values"]
|
103
|
+
end
|
104
|
+
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Prefills the object with the data passed as parameters
|
109
|
+
# Params:
|
110
|
+
# +data+:: +Hash+ of data
|
111
|
+
def prefill(data)
|
112
|
+
if data.nil?
|
113
|
+
return self
|
114
|
+
end
|
115
|
+
self.state = data.fetch(:state, self.state)
|
116
|
+
self.parameter_definitions = data.fetch(:parameter_definitions, self.parameter_definitions)
|
117
|
+
self.parameter_values = data.fetch(:parameter_values, self.parameter_values)
|
118
|
+
|
119
|
+
self
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,143 @@
|
|
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 NativeAPMTransactionDetails
|
10
|
+
|
11
|
+
attr_reader :gateway
|
12
|
+
attr_reader :invoice
|
13
|
+
attr_reader :parameters
|
14
|
+
attr_reader :state
|
15
|
+
|
16
|
+
|
17
|
+
def gateway=(val)
|
18
|
+
if val.nil?
|
19
|
+
@gateway = val
|
20
|
+
return
|
21
|
+
end
|
22
|
+
|
23
|
+
if val.instance_of? NativeAPMTransactionDetailsGateway
|
24
|
+
@gateway = val
|
25
|
+
else
|
26
|
+
obj = NativeAPMTransactionDetailsGateway.new(@client)
|
27
|
+
obj.fill_with_data(val)
|
28
|
+
@gateway = obj
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def invoice=(val)
|
34
|
+
if val.nil?
|
35
|
+
@invoice = val
|
36
|
+
return
|
37
|
+
end
|
38
|
+
|
39
|
+
if val.instance_of? NativeAPMTransactionDetailsInvoice
|
40
|
+
@invoice = val
|
41
|
+
else
|
42
|
+
obj = NativeAPMTransactionDetailsInvoice.new(@client)
|
43
|
+
obj.fill_with_data(val)
|
44
|
+
@invoice = obj
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
def parameters=(val)
|
50
|
+
if val.nil?
|
51
|
+
@parameters = []
|
52
|
+
return
|
53
|
+
end
|
54
|
+
|
55
|
+
if val.length > 0 and val[0].instance_of? NativeAPMParameterDefinition
|
56
|
+
@parameters = val
|
57
|
+
else
|
58
|
+
l = Array.new
|
59
|
+
for v in val
|
60
|
+
obj = NativeAPMParameterDefinition.new(@client)
|
61
|
+
obj.fill_with_data(v)
|
62
|
+
l.push(obj)
|
63
|
+
end
|
64
|
+
@parameters = l
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
def state=(val)
|
70
|
+
@state = val
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
# Initializes the NativeAPMTransactionDetails object
|
75
|
+
# Params:
|
76
|
+
# +client+:: +ProcessOut+ client instance
|
77
|
+
# +data+:: data that can be used to fill the object
|
78
|
+
def initialize(client, data = {})
|
79
|
+
@client = client
|
80
|
+
|
81
|
+
self.gateway = data.fetch(:gateway, nil)
|
82
|
+
self.invoice = data.fetch(:invoice, nil)
|
83
|
+
self.parameters = data.fetch(:parameters, nil)
|
84
|
+
self.state = data.fetch(:state, nil)
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
# Create a new NativeAPMTransactionDetails using the current client
|
89
|
+
def new(data = {})
|
90
|
+
NativeAPMTransactionDetails.new(@client, data)
|
91
|
+
end
|
92
|
+
|
93
|
+
# Overrides the JSON marshaller to only send the fields we want
|
94
|
+
def to_json(options)
|
95
|
+
{
|
96
|
+
"gateway": self.gateway,
|
97
|
+
"invoice": self.invoice,
|
98
|
+
"parameters": self.parameters,
|
99
|
+
"state": self.state,
|
100
|
+
}.to_json
|
101
|
+
end
|
102
|
+
|
103
|
+
# Fills the object with data coming from the API
|
104
|
+
# Params:
|
105
|
+
# +data+:: +Hash+ of data coming from the API
|
106
|
+
def fill_with_data(data)
|
107
|
+
if data.nil?
|
108
|
+
return self
|
109
|
+
end
|
110
|
+
if data.include? "gateway"
|
111
|
+
self.gateway = data["gateway"]
|
112
|
+
end
|
113
|
+
if data.include? "invoice"
|
114
|
+
self.invoice = data["invoice"]
|
115
|
+
end
|
116
|
+
if data.include? "parameters"
|
117
|
+
self.parameters = data["parameters"]
|
118
|
+
end
|
119
|
+
if data.include? "state"
|
120
|
+
self.state = data["state"]
|
121
|
+
end
|
122
|
+
|
123
|
+
self
|
124
|
+
end
|
125
|
+
|
126
|
+
# Prefills the object with the data passed as parameters
|
127
|
+
# Params:
|
128
|
+
# +data+:: +Hash+ of data
|
129
|
+
def prefill(data)
|
130
|
+
if data.nil?
|
131
|
+
return self
|
132
|
+
end
|
133
|
+
self.gateway = data.fetch(:gateway, self.gateway)
|
134
|
+
self.invoice = data.fetch(:invoice, self.invoice)
|
135
|
+
self.parameters = data.fetch(:parameters, self.parameters)
|
136
|
+
self.state = data.fetch(:state, self.state)
|
137
|
+
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
|
142
|
+
end
|
143
|
+
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 NativeAPMTransactionDetailsGateway
|
10
|
+
|
11
|
+
attr_reader :display_name
|
12
|
+
attr_reader :logo_url
|
13
|
+
|
14
|
+
|
15
|
+
def display_name=(val)
|
16
|
+
@display_name = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def logo_url=(val)
|
20
|
+
@logo_url = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the NativeAPMTransactionDetailsGateway 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.display_name = data.fetch(:display_name, nil)
|
32
|
+
self.logo_url = data.fetch(:logo_url, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new NativeAPMTransactionDetailsGateway using the current client
|
37
|
+
def new(data = {})
|
38
|
+
NativeAPMTransactionDetailsGateway.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
|
+
"display_name": self.display_name,
|
45
|
+
"logo_url": self.logo_url,
|
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? "display_name"
|
57
|
+
self.display_name = data["display_name"]
|
58
|
+
end
|
59
|
+
if data.include? "logo_url"
|
60
|
+
self.logo_url = data["logo_url"]
|
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.display_name = data.fetch(:display_name, self.display_name)
|
74
|
+
self.logo_url = data.fetch(:logo_url, self.logo_url)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
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 NativeAPMTransactionDetailsInvoice
|
10
|
+
|
11
|
+
attr_reader :amount
|
12
|
+
attr_reader :currency_code
|
13
|
+
|
14
|
+
|
15
|
+
def amount=(val)
|
16
|
+
@amount = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def currency_code=(val)
|
20
|
+
@currency_code = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the NativeAPMTransactionDetailsInvoice 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_code = data.fetch(:currency_code, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new NativeAPMTransactionDetailsInvoice using the current client
|
37
|
+
def new(data = {})
|
38
|
+
NativeAPMTransactionDetailsInvoice.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_code": self.currency_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? "amount"
|
57
|
+
self.amount = data["amount"]
|
58
|
+
end
|
59
|
+
if data.include? "currency_code"
|
60
|
+
self.currency_code = data["currency_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.amount = data.fetch(:amount, self.amount)
|
74
|
+
self.currency_code = data.fetch(:currency_code, self.currency_code)
|
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.27.1"
|
17
17
|
|
18
18
|
unless options.nil?
|
19
19
|
req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
|