wallee-ruby-sdk 2.2.5 → 3.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/lib/wallee-ruby-sdk.rb +22 -2
- data/lib/wallee-ruby-sdk/api/bank_account_service_api.rb +213 -0
- data/lib/wallee-ruby-sdk/api/bank_transaction_service_api.rb +213 -0
- data/lib/wallee-ruby-sdk/api/currency_bank_account_service_api.rb +213 -0
- data/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb +71 -0
- data/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb +62 -0
- data/lib/wallee-ruby-sdk/api/transaction_terminal_service_api.rb +21 -32
- data/lib/wallee-ruby-sdk/api/web_app_service_api.rb +200 -0
- data/lib/wallee-ruby-sdk/models/authenticated_card_data.rb +221 -0
- data/lib/wallee-ruby-sdk/models/{unencrypted_card_data.rb → authenticated_card_data_create.rb} +86 -12
- data/lib/wallee-ruby-sdk/models/card_authentication_response.rb +38 -0
- data/lib/wallee-ruby-sdk/models/card_authentication_version.rb +35 -0
- data/lib/wallee-ruby-sdk/models/card_cryptogram.rb +201 -0
- data/lib/wallee-ruby-sdk/models/card_cryptogram_create.rb +211 -0
- data/lib/wallee-ruby-sdk/models/card_cryptogram_type.rb +34 -0
- data/lib/wallee-ruby-sdk/models/cardholder_authentication.rb +231 -0
- data/lib/wallee-ruby-sdk/models/cardholder_authentication_create.rb +241 -0
- data/lib/wallee-ruby-sdk/models/charge_bank_transaction.rb +1 -1
- data/lib/wallee-ruby-sdk/models/payment_terminal.rb +11 -1
- data/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb +11 -1
- data/lib/wallee-ruby-sdk/models/payment_terminal_receipt_type.rb +215 -0
- data/lib/wallee-ruby-sdk/models/permission.rb +14 -4
- data/lib/wallee-ruby-sdk/models/recurring_indicator.rb +37 -0
- data/lib/wallee-ruby-sdk/models/refund_bank_transaction.rb +1 -1
- data/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb +1 -1
- data/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb +26 -6
- data/lib/wallee-ruby-sdk/models/shopify_subscriber_active.rb +241 -0
- data/lib/wallee-ruby-sdk/models/shopify_subscription.rb +11 -1
- data/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb +11 -1
- data/lib/wallee-ruby-sdk/models/subscription_product_component.rb +1 -1
- data/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb +1 -1
- data/lib/wallee-ruby-sdk/models/tax_calculation.rb +2 -2
- data/lib/wallee-ruby-sdk/models/terminal_receipt_fetch_request.rb +221 -0
- data/lib/wallee-ruby-sdk/models/terminal_receipt_format.rb +35 -0
- data/lib/wallee-ruby-sdk/models/tokenized_card_data.rb +211 -0
- data/lib/wallee-ruby-sdk/models/{unencrypted_card_data_create.rb → tokenized_card_data_create.rb} +60 -5
- data/lib/wallee-ruby-sdk/models/web_app_confirmation_request.rb +206 -0
- data/lib/wallee-ruby-sdk/models/web_app_confirmation_response.rb +231 -0
- data/lib/wallee-ruby-sdk/models/webhook_url.rb +11 -1
- data/lib/wallee-ruby-sdk/version.rb +1 -1
- metadata +24 -4
@@ -0,0 +1,200 @@
|
|
1
|
+
=begin
|
2
|
+
The wallee API allows an easy interaction with the wallee web service.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
|
16
|
+
=end
|
17
|
+
|
18
|
+
require "uri"
|
19
|
+
|
20
|
+
module Wallee
|
21
|
+
class WebAppService
|
22
|
+
attr_accessor :api_client
|
23
|
+
|
24
|
+
def initialize(api_client = ApiClient.default)
|
25
|
+
@api_client = api_client
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check Installation
|
29
|
+
# This operation returns true when the app is installed in given space. The web app is implied by the client ID resp. user ID that is been used to invoke this operation.
|
30
|
+
# @param space_id This parameter identifies the space which should be checked if the web app is installed.
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [BOOLEAN]
|
33
|
+
def check_installation(space_id, opts = {})
|
34
|
+
data, _status_code, _headers = check_installation_with_http_info(space_id, opts)
|
35
|
+
return data
|
36
|
+
end
|
37
|
+
|
38
|
+
# Check Installation
|
39
|
+
# This operation returns true when the app is installed in given space. The web app is implied by the client ID resp. user ID that is been used to invoke this operation.
|
40
|
+
# @param space_id This parameter identifies the space which should be checked if the web app is installed.
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @return [Array<(BOOLEAN, Fixnum, Hash)>] BOOLEAN data, response status code and response headers
|
43
|
+
def check_installation_with_http_info(space_id, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug "Calling API: WebAppService.check_installation ..."
|
46
|
+
end
|
47
|
+
# verify the required parameter 'space_id' is set
|
48
|
+
fail ArgumentError, "Missing the required parameter 'space_id' when calling WebAppService.check_installation" if space_id.nil?
|
49
|
+
# resource path
|
50
|
+
local_var_path = "/web-app/check-installation".sub('{format}','json')
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = {}
|
54
|
+
query_params[:'spaceId'] = space_id
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = {}
|
58
|
+
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
local_header_accept = ['application/json;charset=utf-8']
|
61
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
62
|
+
|
63
|
+
# HTTP header 'Content-Type'
|
64
|
+
local_header_content_type = []
|
65
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
66
|
+
|
67
|
+
# form parameters
|
68
|
+
form_params = {}
|
69
|
+
|
70
|
+
# http body (model)
|
71
|
+
post_body = nil
|
72
|
+
auth_names = []
|
73
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
74
|
+
:header_params => header_params,
|
75
|
+
:query_params => query_params,
|
76
|
+
:form_params => form_params,
|
77
|
+
:body => post_body,
|
78
|
+
:auth_names => auth_names,
|
79
|
+
:return_type => 'BOOLEAN')
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: WebAppService#check_installation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
|
86
|
+
# Confirm
|
87
|
+
# This operation confirms the app installation. This method has to be invoked after the user returns to the web app. The request of the user will contain the code as a request parameter. The web app is implied by the client ID resp. user ID that is been used to invoke this operation.
|
88
|
+
# @param request
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [WebAppConfirmationResponse]
|
91
|
+
def confirm(request, opts = {})
|
92
|
+
data, _status_code, _headers = confirm_with_http_info(request, opts)
|
93
|
+
return data
|
94
|
+
end
|
95
|
+
|
96
|
+
# Confirm
|
97
|
+
# This operation confirms the app installation. This method has to be invoked after the user returns to the web app. The request of the user will contain the code as a request parameter. The web app is implied by the client ID resp. user ID that is been used to invoke this operation.
|
98
|
+
# @param request
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Array<(WebAppConfirmationResponse, Fixnum, Hash)>] WebAppConfirmationResponse data, response status code and response headers
|
101
|
+
def confirm_with_http_info(request, opts = {})
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug "Calling API: WebAppService.confirm ..."
|
104
|
+
end
|
105
|
+
# verify the required parameter 'request' is set
|
106
|
+
fail ArgumentError, "Missing the required parameter 'request' when calling WebAppService.confirm" if request.nil?
|
107
|
+
# resource path
|
108
|
+
local_var_path = "/web-app/confirm".sub('{format}','json')
|
109
|
+
|
110
|
+
# query parameters
|
111
|
+
query_params = {}
|
112
|
+
|
113
|
+
# header parameters
|
114
|
+
header_params = {}
|
115
|
+
|
116
|
+
# HTTP header 'Accept' (if needed)
|
117
|
+
local_header_accept = ['application/json;charset=utf-8']
|
118
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
119
|
+
|
120
|
+
# HTTP header 'Content-Type'
|
121
|
+
local_header_content_type = []
|
122
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
123
|
+
|
124
|
+
# form parameters
|
125
|
+
form_params = {}
|
126
|
+
|
127
|
+
# http body (model)
|
128
|
+
post_body = @api_client.object_to_http_body(request)
|
129
|
+
auth_names = []
|
130
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
131
|
+
:header_params => header_params,
|
132
|
+
:query_params => query_params,
|
133
|
+
:form_params => form_params,
|
134
|
+
:body => post_body,
|
135
|
+
:auth_names => auth_names,
|
136
|
+
:return_type => 'WebAppConfirmationResponse')
|
137
|
+
if @api_client.config.debugging
|
138
|
+
@api_client.config.logger.debug "API called: WebAppService#confirm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
139
|
+
end
|
140
|
+
return data, status_code, headers
|
141
|
+
end
|
142
|
+
|
143
|
+
# Uninstall
|
144
|
+
# This operation uninstalls the web app from the provided space. The web app is implied by the client ID resp. user ID that is been used to invoke this operation.
|
145
|
+
# @param space_id This parameter identifies the space within which the web app should be uninstalled.
|
146
|
+
# @param [Hash] opts the optional parameters
|
147
|
+
# @return [nil]
|
148
|
+
def uninstall(space_id, opts = {})
|
149
|
+
uninstall_with_http_info(space_id, opts)
|
150
|
+
return nil
|
151
|
+
end
|
152
|
+
|
153
|
+
# Uninstall
|
154
|
+
# This operation uninstalls the web app from the provided space. The web app is implied by the client ID resp. user ID that is been used to invoke this operation.
|
155
|
+
# @param space_id This parameter identifies the space within which the web app should be uninstalled.
|
156
|
+
# @param [Hash] opts the optional parameters
|
157
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
158
|
+
def uninstall_with_http_info(space_id, opts = {})
|
159
|
+
if @api_client.config.debugging
|
160
|
+
@api_client.config.logger.debug "Calling API: WebAppService.uninstall ..."
|
161
|
+
end
|
162
|
+
# verify the required parameter 'space_id' is set
|
163
|
+
fail ArgumentError, "Missing the required parameter 'space_id' when calling WebAppService.uninstall" if space_id.nil?
|
164
|
+
# resource path
|
165
|
+
local_var_path = "/web-app/uninstall".sub('{format}','json')
|
166
|
+
|
167
|
+
# query parameters
|
168
|
+
query_params = {}
|
169
|
+
query_params[:'spaceId'] = space_id
|
170
|
+
|
171
|
+
# header parameters
|
172
|
+
header_params = {}
|
173
|
+
|
174
|
+
# HTTP header 'Accept' (if needed)
|
175
|
+
local_header_accept = []
|
176
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
177
|
+
|
178
|
+
# HTTP header 'Content-Type'
|
179
|
+
local_header_content_type = []
|
180
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
181
|
+
|
182
|
+
# form parameters
|
183
|
+
form_params = {}
|
184
|
+
|
185
|
+
# http body (model)
|
186
|
+
post_body = nil
|
187
|
+
auth_names = []
|
188
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
189
|
+
:header_params => header_params,
|
190
|
+
:query_params => query_params,
|
191
|
+
:form_params => form_params,
|
192
|
+
:body => post_body,
|
193
|
+
:auth_names => auth_names)
|
194
|
+
if @api_client.config.debugging
|
195
|
+
@api_client.config.logger.debug "API called: WebAppService#uninstall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
196
|
+
end
|
197
|
+
return data, status_code, headers
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
@@ -0,0 +1,221 @@
|
|
1
|
+
=begin
|
2
|
+
The wallee API allows an easy interaction with the wallee web service.
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
|
16
|
+
=end
|
17
|
+
|
18
|
+
require 'date'
|
19
|
+
|
20
|
+
module Wallee
|
21
|
+
# This model holds the card data and optional cardholder authentication details.
|
22
|
+
class AuthenticatedCardData
|
23
|
+
# The additional authentication value used to secure the tokenized card transactions.
|
24
|
+
attr_accessor :cryptogram
|
25
|
+
|
26
|
+
#
|
27
|
+
attr_accessor :recurring_indicator
|
28
|
+
|
29
|
+
#
|
30
|
+
attr_accessor :token_requestor_id
|
31
|
+
|
32
|
+
# The cardholder authentication information. The authentication is optional and can be provided if the cardholder has been already authenticated (e.g. in 3-D Secure system).
|
33
|
+
attr_accessor :cardholder_authentication
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'cryptogram' => :'cryptogram',
|
39
|
+
:'recurring_indicator' => :'recurringIndicator',
|
40
|
+
:'token_requestor_id' => :'tokenRequestorId',
|
41
|
+
:'cardholder_authentication' => :'cardholderAuthentication'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.swagger_types
|
47
|
+
{
|
48
|
+
:'cryptogram' => :'CardCryptogram',
|
49
|
+
:'recurring_indicator' => :'RecurringIndicator',
|
50
|
+
:'token_requestor_id' => :'String',
|
51
|
+
:'cardholder_authentication' => :'CardholderAuthentication'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
62
|
+
|
63
|
+
if attributes.has_key?(:'cryptogram')
|
64
|
+
self.cryptogram = attributes[:'cryptogram']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'recurringIndicator')
|
68
|
+
self.recurring_indicator = attributes[:'recurringIndicator']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'tokenRequestorId')
|
72
|
+
self.token_requestor_id = attributes[:'tokenRequestorId']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'cardholderAuthentication')
|
76
|
+
self.cardholder_authentication = attributes[:'cardholderAuthentication']
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
invalid_properties = Array.new
|
84
|
+
invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
cryptogram == o.cryptogram &&
|
99
|
+
recurring_indicator == o.recurring_indicator &&
|
100
|
+
token_requestor_id == o.token_requestor_id &&
|
101
|
+
cardholder_authentication == o.cardholder_authentication
|
102
|
+
end
|
103
|
+
|
104
|
+
# @see the `==` method
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def eql?(o)
|
107
|
+
self == o
|
108
|
+
end
|
109
|
+
|
110
|
+
# Calculates hash code according to all attributes.
|
111
|
+
# @return [Fixnum] Hash code
|
112
|
+
def hash
|
113
|
+
[cryptogram, recurring_indicator, token_requestor_id, cardholder_authentication].hash
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.swagger_types.each_pair do |key, type|
|
122
|
+
if type =~ /\AArray<(.*)>/i
|
123
|
+
# check to ensure the input is an array given that the attribute
|
124
|
+
# is documented as an array but the input is not
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
127
|
+
end
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
130
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
131
|
+
end
|
132
|
+
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
# Deserializes the data based on type
|
137
|
+
# @param string type Data type
|
138
|
+
# @param string value Value to be deserialized
|
139
|
+
# @return [Object] Deserialized data
|
140
|
+
def _deserialize(type, value)
|
141
|
+
case type.to_sym
|
142
|
+
when :DateTime
|
143
|
+
DateTime.parse(value)
|
144
|
+
when :Date
|
145
|
+
Date.parse(value)
|
146
|
+
when :String
|
147
|
+
value.to_s
|
148
|
+
when :Integer
|
149
|
+
value.to_i
|
150
|
+
when :Float
|
151
|
+
value.to_f
|
152
|
+
when :BOOLEAN
|
153
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
154
|
+
true
|
155
|
+
else
|
156
|
+
false
|
157
|
+
end
|
158
|
+
when :Object
|
159
|
+
# generic object (usually a Hash), return directly
|
160
|
+
value
|
161
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
162
|
+
inner_type = Regexp.last_match[:inner_type]
|
163
|
+
value.map { |v| _deserialize(inner_type, v) }
|
164
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
165
|
+
k_type = Regexp.last_match[:k_type]
|
166
|
+
v_type = Regexp.last_match[:v_type]
|
167
|
+
{}.tap do |hash|
|
168
|
+
value.each do |k, v|
|
169
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
else # model
|
173
|
+
temp_model = Wallee.const_get(type).new
|
174
|
+
temp_model.build_from_hash(value)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the string representation of the object
|
179
|
+
# @return [String] String presentation of the object
|
180
|
+
def to_s
|
181
|
+
to_hash.to_s
|
182
|
+
end
|
183
|
+
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_body
|
187
|
+
to_hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the object in the form of hash
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_hash
|
193
|
+
hash = {}
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
195
|
+
value = self.send(attr)
|
196
|
+
next if value.nil?
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map{ |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
end
|
data/lib/wallee-ruby-sdk/models/{unencrypted_card_data.rb → authenticated_card_data_create.rb}
RENAMED
@@ -18,27 +18,47 @@ limitations under the License.
|
|
18
18
|
require 'date'
|
19
19
|
|
20
20
|
module Wallee
|
21
|
-
# This model holds the card data
|
22
|
-
class
|
21
|
+
# This model holds the card data and optional cardholder authentication details.
|
22
|
+
class AuthenticatedCardDataCreate
|
23
23
|
# The card holder name is the name printed onto the card. It identifies the person who owns the card.
|
24
24
|
attr_accessor :card_holder_name
|
25
25
|
|
26
26
|
# The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional.
|
27
27
|
attr_accessor :card_verification_code
|
28
28
|
|
29
|
+
# The cardholder authentication information. The authentication is optional and can be provided if the cardholder has been already authenticated (e.g. in 3-D Secure system).
|
30
|
+
attr_accessor :cardholder_authentication
|
31
|
+
|
32
|
+
# The additional authentication value used to secure the tokenized card transactions.
|
33
|
+
attr_accessor :cryptogram
|
34
|
+
|
29
35
|
# The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09).
|
30
36
|
attr_accessor :expiry_date
|
31
37
|
|
32
38
|
# The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card.
|
33
39
|
attr_accessor :primary_account_number
|
34
40
|
|
41
|
+
#
|
42
|
+
attr_accessor :recurring_indicator
|
43
|
+
|
44
|
+
#
|
45
|
+
attr_accessor :scheme_transaction_reference
|
46
|
+
|
47
|
+
#
|
48
|
+
attr_accessor :token_requestor_id
|
49
|
+
|
35
50
|
# Attribute mapping from ruby-style variable name to JSON key.
|
36
51
|
def self.attribute_map
|
37
52
|
{
|
38
53
|
:'card_holder_name' => :'cardHolderName',
|
39
54
|
:'card_verification_code' => :'cardVerificationCode',
|
55
|
+
:'cardholder_authentication' => :'cardholderAuthentication',
|
56
|
+
:'cryptogram' => :'cryptogram',
|
40
57
|
:'expiry_date' => :'expiryDate',
|
41
|
-
:'primary_account_number' => :'primaryAccountNumber'
|
58
|
+
:'primary_account_number' => :'primaryAccountNumber',
|
59
|
+
:'recurring_indicator' => :'recurringIndicator',
|
60
|
+
:'scheme_transaction_reference' => :'schemeTransactionReference',
|
61
|
+
:'token_requestor_id' => :'tokenRequestorId'
|
42
62
|
}
|
43
63
|
end
|
44
64
|
|
@@ -47,8 +67,13 @@ module Wallee
|
|
47
67
|
{
|
48
68
|
:'card_holder_name' => :'String',
|
49
69
|
:'card_verification_code' => :'String',
|
70
|
+
:'cardholder_authentication' => :'CardholderAuthenticationCreate',
|
71
|
+
:'cryptogram' => :'CardCryptogramCreate',
|
50
72
|
:'expiry_date' => :'String',
|
51
|
-
:'primary_account_number' => :'String'
|
73
|
+
:'primary_account_number' => :'String',
|
74
|
+
:'recurring_indicator' => :'RecurringIndicator',
|
75
|
+
:'scheme_transaction_reference' => :'String',
|
76
|
+
:'token_requestor_id' => :'String'
|
52
77
|
}
|
53
78
|
end
|
54
79
|
|
@@ -68,6 +93,14 @@ module Wallee
|
|
68
93
|
self.card_verification_code = attributes[:'cardVerificationCode']
|
69
94
|
end
|
70
95
|
|
96
|
+
if attributes.has_key?(:'cardholderAuthentication')
|
97
|
+
self.cardholder_authentication = attributes[:'cardholderAuthentication']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.has_key?(:'cryptogram')
|
101
|
+
self.cryptogram = attributes[:'cryptogram']
|
102
|
+
end
|
103
|
+
|
71
104
|
if attributes.has_key?(:'expiryDate')
|
72
105
|
self.expiry_date = attributes[:'expiryDate']
|
73
106
|
end
|
@@ -75,6 +108,18 @@ module Wallee
|
|
75
108
|
if attributes.has_key?(:'primaryAccountNumber')
|
76
109
|
self.primary_account_number = attributes[:'primaryAccountNumber']
|
77
110
|
end
|
111
|
+
|
112
|
+
if attributes.has_key?(:'recurringIndicator')
|
113
|
+
self.recurring_indicator = attributes[:'recurringIndicator']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.has_key?(:'schemeTransactionReference')
|
117
|
+
self.scheme_transaction_reference = attributes[:'schemeTransactionReference']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.has_key?(:'tokenRequestorId')
|
121
|
+
self.token_requestor_id = attributes[:'tokenRequestorId']
|
122
|
+
end
|
78
123
|
end
|
79
124
|
|
80
125
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -93,14 +138,22 @@ module Wallee
|
|
93
138
|
invalid_properties.push('invalid value for "card_verification_code", the character length must be great than or equal to 3.')
|
94
139
|
end
|
95
140
|
|
96
|
-
if
|
141
|
+
if @primary_account_number.nil?
|
142
|
+
invalid_properties.push('invalid value for "primary_account_number", primary_account_number cannot be nil.')
|
143
|
+
end
|
144
|
+
|
145
|
+
if @primary_account_number.to_s.length > 30
|
97
146
|
invalid_properties.push('invalid value for "primary_account_number", the character length must be smaller than or equal to 30.')
|
98
147
|
end
|
99
148
|
|
100
|
-
if
|
149
|
+
if @primary_account_number.to_s.length < 10
|
101
150
|
invalid_properties.push('invalid value for "primary_account_number", the character length must be great than or equal to 10.')
|
102
151
|
end
|
103
152
|
|
153
|
+
if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100
|
154
|
+
invalid_properties.push('invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.')
|
155
|
+
end
|
156
|
+
|
104
157
|
invalid_properties
|
105
158
|
end
|
106
159
|
|
@@ -110,8 +163,10 @@ module Wallee
|
|
110
163
|
return false if !@card_holder_name.nil? && @card_holder_name.to_s.length > 100
|
111
164
|
return false if !@card_verification_code.nil? && @card_verification_code.to_s.length > 4
|
112
165
|
return false if !@card_verification_code.nil? && @card_verification_code.to_s.length < 3
|
113
|
-
return false if
|
114
|
-
return false if
|
166
|
+
return false if @primary_account_number.nil?
|
167
|
+
return false if @primary_account_number.to_s.length > 30
|
168
|
+
return false if @primary_account_number.to_s.length < 10
|
169
|
+
return false if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100
|
115
170
|
true
|
116
171
|
end
|
117
172
|
|
@@ -142,17 +197,31 @@ module Wallee
|
|
142
197
|
# Custom attribute writer method with validation
|
143
198
|
# @param [Object] primary_account_number Value to be assigned
|
144
199
|
def primary_account_number=(primary_account_number)
|
145
|
-
if
|
200
|
+
if primary_account_number.nil?
|
201
|
+
fail ArgumentError, 'primary_account_number cannot be nil'
|
202
|
+
end
|
203
|
+
|
204
|
+
if primary_account_number.to_s.length > 30
|
146
205
|
fail ArgumentError, 'invalid value for "primary_account_number", the character length must be smaller than or equal to 30.'
|
147
206
|
end
|
148
207
|
|
149
|
-
if
|
208
|
+
if primary_account_number.to_s.length < 10
|
150
209
|
fail ArgumentError, 'invalid value for "primary_account_number", the character length must be great than or equal to 10.'
|
151
210
|
end
|
152
211
|
|
153
212
|
@primary_account_number = primary_account_number
|
154
213
|
end
|
155
214
|
|
215
|
+
# Custom attribute writer method with validation
|
216
|
+
# @param [Object] scheme_transaction_reference Value to be assigned
|
217
|
+
def scheme_transaction_reference=(scheme_transaction_reference)
|
218
|
+
if !scheme_transaction_reference.nil? && scheme_transaction_reference.to_s.length > 100
|
219
|
+
fail ArgumentError, 'invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.'
|
220
|
+
end
|
221
|
+
|
222
|
+
@scheme_transaction_reference = scheme_transaction_reference
|
223
|
+
end
|
224
|
+
|
156
225
|
# Checks equality by comparing each attribute.
|
157
226
|
# @param [Object] Object to be compared
|
158
227
|
def ==(o)
|
@@ -160,8 +229,13 @@ module Wallee
|
|
160
229
|
self.class == o.class &&
|
161
230
|
card_holder_name == o.card_holder_name &&
|
162
231
|
card_verification_code == o.card_verification_code &&
|
232
|
+
cardholder_authentication == o.cardholder_authentication &&
|
233
|
+
cryptogram == o.cryptogram &&
|
163
234
|
expiry_date == o.expiry_date &&
|
164
|
-
primary_account_number == o.primary_account_number
|
235
|
+
primary_account_number == o.primary_account_number &&
|
236
|
+
recurring_indicator == o.recurring_indicator &&
|
237
|
+
scheme_transaction_reference == o.scheme_transaction_reference &&
|
238
|
+
token_requestor_id == o.token_requestor_id
|
165
239
|
end
|
166
240
|
|
167
241
|
# @see the `==` method
|
@@ -173,7 +247,7 @@ module Wallee
|
|
173
247
|
# Calculates hash code according to all attributes.
|
174
248
|
# @return [Fixnum] Hash code
|
175
249
|
def hash
|
176
|
-
[card_holder_name, card_verification_code, expiry_date, primary_account_number].hash
|
250
|
+
[card_holder_name, card_verification_code, cardholder_authentication, cryptogram, expiry_date, primary_account_number, recurring_indicator, scheme_transaction_reference, token_requestor_id].hash
|
177
251
|
end
|
178
252
|
|
179
253
|
# Builds the object from hash
|