wallee-ruby-sdk 2.2.4 → 3.0.6
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/LICENSE +1 -1
- data/lib/wallee-ruby-sdk.rb +46 -3
- 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/charge_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/external_transfer_bank_transaction_service_api.rb +213 -0
- data/lib/wallee-ruby-sdk/api/internal_transfer_bank_transaction_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/refund_bank_transaction_service_api.rb +213 -0
- data/lib/wallee-ruby-sdk/api/refund_recovery_bank_transaction_service_api.rb +213 -0
- data/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb +62 -0
- data/lib/wallee-ruby-sdk/api/token_service_api.rb +63 -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/api_client.rb +2 -1
- data/lib/wallee-ruby-sdk/models/abstract_payment_link_update.rb +15 -15
- data/lib/wallee-ruby-sdk/models/abstract_subscription_product_active.rb +11 -1
- 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/bank_account.rb +291 -0
- data/lib/wallee-ruby-sdk/models/bank_account_environment.rb +35 -0
- data/lib/wallee-ruby-sdk/models/bank_account_state.rb +37 -0
- data/lib/wallee-ruby-sdk/models/bank_account_type.rb +227 -0
- data/lib/wallee-ruby-sdk/models/bank_transaction.rb +387 -0
- data/lib/wallee-ruby-sdk/models/bank_transaction_flow_direction.rb +35 -0
- data/lib/wallee-ruby-sdk/models/bank_transaction_source.rb +215 -0
- data/lib/wallee-ruby-sdk/models/bank_transaction_state.rb +35 -0
- data/lib/wallee-ruby-sdk/models/bank_transaction_type.rb +215 -0
- 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 +291 -0
- data/lib/wallee-ruby-sdk/models/currency_bank_account.rb +241 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_case.rb +1 -1
- data/lib/wallee-ruby-sdk/models/debt_collection_case_create.rb +1 -1
- data/lib/wallee-ruby-sdk/models/external_transfer_bank_transaction.rb +251 -0
- data/lib/wallee-ruby-sdk/models/internal_transfer_bank_transaction.rb +231 -0
- data/lib/wallee-ruby-sdk/models/payment_adjustment.rb +231 -0
- data/lib/wallee-ruby-sdk/models/payment_adjustment_type.rb +215 -0
- data/lib/wallee-ruby-sdk/models/payment_contract.rb +1 -25
- data/lib/wallee-ruby-sdk/models/payment_link.rb +16 -40
- data/lib/wallee-ruby-sdk/models/payment_link_active.rb +15 -15
- data/lib/wallee-ruby-sdk/models/payment_link_address_handling_mode.rb +36 -0
- data/lib/wallee-ruby-sdk/models/payment_link_create.rb +16 -44
- data/lib/wallee-ruby-sdk/models/payment_link_update.rb +15 -15
- data/lib/wallee-ruby-sdk/models/payment_terminal.rb +11 -1
- data/lib/wallee-ruby-sdk/models/payment_terminal_address.rb +0 -60
- data/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb +11 -1
- data/lib/wallee-ruby-sdk/models/payment_terminal_location.rb +2 -22
- 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 +281 -0
- data/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb +293 -0
- data/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb +26 -6
- data/lib/wallee-ruby-sdk/models/role.rb +1 -1
- data/lib/wallee-ruby-sdk/models/role_state.rb +37 -0
- data/lib/wallee-ruby-sdk/models/shopify_subscriber.rb +1 -1
- 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 +12 -2
- data/lib/wallee-ruby-sdk/models/shopify_subscription_model_billing_configuration.rb +11 -1
- data/lib/wallee-ruby-sdk/models/shopify_subscription_version.rb +11 -1
- data/lib/wallee-ruby-sdk/models/subscriber.rb +1 -1
- data/lib/wallee-ruby-sdk/models/subscriber_create.rb +1 -1
- data/lib/wallee-ruby-sdk/models/subscription_affiliate.rb +1 -25
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_create.rb +1 -29
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleted.rb +1 -25
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleting.rb +1 -25
- data/lib/wallee-ruby-sdk/models/subscription_charge.rb +1 -1
- data/lib/wallee-ruby-sdk/models/subscription_charge_create.rb +1 -1
- data/lib/wallee-ruby-sdk/models/subscription_ledger_entry.rb +12 -2
- data/lib/wallee-ruby-sdk/models/subscription_ledger_entry_create.rb +1 -1
- data/lib/wallee-ruby-sdk/models/subscription_product.rb +11 -1
- data/lib/wallee-ruby-sdk/models/subscription_product_active.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/subscription_product_create.rb +11 -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/token.rb +1 -25
- data/lib/wallee-ruby-sdk/models/token_create.rb +1 -29
- 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/transaction.rb +64 -4
- 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
- data/test/condition_type_service_test.rb +22 -0
- metadata +50 -5
- data/lib/wallee-ruby-sdk/models/payment_terminal_contact_address.rb +0 -396
|
@@ -147,7 +147,8 @@ module Wallee
|
|
|
147
147
|
# @return [Hash] the authentication headers
|
|
148
148
|
def get_authentication_headers(http_method, path, query)
|
|
149
149
|
base_url = URI(@config.base_url)
|
|
150
|
-
completed_path = "#{base_url.path}#{path}"
|
|
150
|
+
completed_path = "#{base_url.path}#{path}"
|
|
151
|
+
completed_path += "?" + query.map{|k,v| "#{k}=#{v}"}.join('&') unless query.empty?
|
|
151
152
|
version = "1"
|
|
152
153
|
timestamp = Time.now.to_i
|
|
153
154
|
securedData = "#{version}|#{@config.user_id}|#{timestamp}|#{http_method.upcase}|#{completed_path}"
|
|
@@ -31,8 +31,8 @@ module Wallee
|
|
|
31
31
|
# The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction.
|
|
32
32
|
attr_accessor :available_until
|
|
33
33
|
|
|
34
|
-
#
|
|
35
|
-
attr_accessor :
|
|
34
|
+
# The billing address handling mode controls if the address is collected or not and how it is collected.
|
|
35
|
+
attr_accessor :billing_address_handling_mode
|
|
36
36
|
|
|
37
37
|
# The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'.
|
|
38
38
|
attr_accessor :currency
|
|
@@ -49,8 +49,8 @@ module Wallee
|
|
|
49
49
|
# The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive.
|
|
50
50
|
attr_accessor :name
|
|
51
51
|
|
|
52
|
-
#
|
|
53
|
-
attr_accessor :
|
|
52
|
+
# The shipping address handling mode controls if the address is collected or not and how it is collected.
|
|
53
|
+
attr_accessor :shipping_address_handling_mode
|
|
54
54
|
|
|
55
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
56
|
def self.attribute_map
|
|
@@ -59,13 +59,13 @@ module Wallee
|
|
|
59
59
|
:'applied_space_view' => :'appliedSpaceView',
|
|
60
60
|
:'available_from' => :'availableFrom',
|
|
61
61
|
:'available_until' => :'availableUntil',
|
|
62
|
-
:'
|
|
62
|
+
:'billing_address_handling_mode' => :'billingAddressHandlingMode',
|
|
63
63
|
:'currency' => :'currency',
|
|
64
64
|
:'language' => :'language',
|
|
65
65
|
:'line_items' => :'lineItems',
|
|
66
66
|
:'maximal_number_of_transactions' => :'maximalNumberOfTransactions',
|
|
67
67
|
:'name' => :'name',
|
|
68
|
-
:'
|
|
68
|
+
:'shipping_address_handling_mode' => :'shippingAddressHandlingMode'
|
|
69
69
|
}
|
|
70
70
|
end
|
|
71
71
|
|
|
@@ -76,13 +76,13 @@ module Wallee
|
|
|
76
76
|
:'applied_space_view' => :'Integer',
|
|
77
77
|
:'available_from' => :'DateTime',
|
|
78
78
|
:'available_until' => :'DateTime',
|
|
79
|
-
:'
|
|
79
|
+
:'billing_address_handling_mode' => :'PaymentLinkAddressHandlingMode',
|
|
80
80
|
:'currency' => :'String',
|
|
81
81
|
:'language' => :'String',
|
|
82
82
|
:'line_items' => :'Array<LineItemCreate>',
|
|
83
83
|
:'maximal_number_of_transactions' => :'Integer',
|
|
84
84
|
:'name' => :'String',
|
|
85
|
-
:'
|
|
85
|
+
:'shipping_address_handling_mode' => :'PaymentLinkAddressHandlingMode'
|
|
86
86
|
}
|
|
87
87
|
end
|
|
88
88
|
|
|
@@ -112,8 +112,8 @@ module Wallee
|
|
|
112
112
|
self.available_until = attributes[:'availableUntil']
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
if attributes.has_key?(:'
|
|
116
|
-
self.
|
|
115
|
+
if attributes.has_key?(:'billingAddressHandlingMode')
|
|
116
|
+
self.billing_address_handling_mode = attributes[:'billingAddressHandlingMode']
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
if attributes.has_key?(:'currency')
|
|
@@ -138,8 +138,8 @@ module Wallee
|
|
|
138
138
|
self.name = attributes[:'name']
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
-
if attributes.has_key?(:'
|
|
142
|
-
self.
|
|
141
|
+
if attributes.has_key?(:'shippingAddressHandlingMode')
|
|
142
|
+
self.shipping_address_handling_mode = attributes[:'shippingAddressHandlingMode']
|
|
143
143
|
end
|
|
144
144
|
end
|
|
145
145
|
|
|
@@ -180,13 +180,13 @@ module Wallee
|
|
|
180
180
|
applied_space_view == o.applied_space_view &&
|
|
181
181
|
available_from == o.available_from &&
|
|
182
182
|
available_until == o.available_until &&
|
|
183
|
-
|
|
183
|
+
billing_address_handling_mode == o.billing_address_handling_mode &&
|
|
184
184
|
currency == o.currency &&
|
|
185
185
|
language == o.language &&
|
|
186
186
|
line_items == o.line_items &&
|
|
187
187
|
maximal_number_of_transactions == o.maximal_number_of_transactions &&
|
|
188
188
|
name == o.name &&
|
|
189
|
-
|
|
189
|
+
shipping_address_handling_mode == o.shipping_address_handling_mode
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
# @see the `==` method
|
|
@@ -198,7 +198,7 @@ module Wallee
|
|
|
198
198
|
# Calculates hash code according to all attributes.
|
|
199
199
|
# @return [Fixnum] Hash code
|
|
200
200
|
def hash
|
|
201
|
-
[allowed_payment_method_configurations, applied_space_view, available_from, available_until,
|
|
201
|
+
[allowed_payment_method_configurations, applied_space_view, available_from, available_until, billing_address_handling_mode, currency, language, line_items, maximal_number_of_transactions, name, shipping_address_handling_mode].hash
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
# Builds the object from hash
|
|
@@ -28,6 +28,9 @@ module Wallee
|
|
|
28
28
|
# The product name is used internally to identify the configuration in administrative interfaces. For example it is used within search fields and hence it should be distinct and descriptive.
|
|
29
29
|
attr_accessor :name
|
|
30
30
|
|
|
31
|
+
# Marks the product as locked. Meaning that customer can not change away from this product or change to this product later on.
|
|
32
|
+
attr_accessor :product_locked
|
|
33
|
+
|
|
31
34
|
# The sort order controls in which order the product is listed. The sort order is used to order the products in ascending order.
|
|
32
35
|
attr_accessor :sort_order
|
|
33
36
|
|
|
@@ -40,6 +43,7 @@ module Wallee
|
|
|
40
43
|
:'allowed_payment_method_configurations' => :'allowedPaymentMethodConfigurations',
|
|
41
44
|
:'failed_payment_suspension_period' => :'failedPaymentSuspensionPeriod',
|
|
42
45
|
:'name' => :'name',
|
|
46
|
+
:'product_locked' => :'productLocked',
|
|
43
47
|
:'sort_order' => :'sortOrder',
|
|
44
48
|
:'state' => :'state'
|
|
45
49
|
}
|
|
@@ -51,6 +55,7 @@ module Wallee
|
|
|
51
55
|
:'allowed_payment_method_configurations' => :'Array<Integer>',
|
|
52
56
|
:'failed_payment_suspension_period' => :'String',
|
|
53
57
|
:'name' => :'String',
|
|
58
|
+
:'product_locked' => :'BOOLEAN',
|
|
54
59
|
:'sort_order' => :'Integer',
|
|
55
60
|
:'state' => :'SubscriptionProductState'
|
|
56
61
|
}
|
|
@@ -78,6 +83,10 @@ module Wallee
|
|
|
78
83
|
self.name = attributes[:'name']
|
|
79
84
|
end
|
|
80
85
|
|
|
86
|
+
if attributes.has_key?(:'productLocked')
|
|
87
|
+
self.product_locked = attributes[:'productLocked']
|
|
88
|
+
end
|
|
89
|
+
|
|
81
90
|
if attributes.has_key?(:'sortOrder')
|
|
82
91
|
self.sort_order = attributes[:'sortOrder']
|
|
83
92
|
end
|
|
@@ -123,6 +132,7 @@ module Wallee
|
|
|
123
132
|
allowed_payment_method_configurations == o.allowed_payment_method_configurations &&
|
|
124
133
|
failed_payment_suspension_period == o.failed_payment_suspension_period &&
|
|
125
134
|
name == o.name &&
|
|
135
|
+
product_locked == o.product_locked &&
|
|
126
136
|
sort_order == o.sort_order &&
|
|
127
137
|
state == o.state
|
|
128
138
|
end
|
|
@@ -136,7 +146,7 @@ module Wallee
|
|
|
136
146
|
# Calculates hash code according to all attributes.
|
|
137
147
|
# @return [Fixnum] Hash code
|
|
138
148
|
def hash
|
|
139
|
-
[allowed_payment_method_configurations, failed_payment_suspension_period, name, sort_order, state].hash
|
|
149
|
+
[allowed_payment_method_configurations, failed_payment_suspension_period, name, product_locked, sort_order, state].hash
|
|
140
150
|
end
|
|
141
151
|
|
|
142
152
|
# Builds the object from hash
|
|
@@ -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
|