wallee-ruby-sdk 1.0.1 → 1.0.2
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 +5 -5
- data/README.md +21 -11
- data/lib/wallee-ruby-sdk/models/abstract_debt_collection_case_update.rb +270 -0
- data/lib/wallee-ruby-sdk/models/abstract_payment_link_update.rb +302 -0
- data/lib/wallee-ruby-sdk/models/abstract_subscription_affiliate_update.rb +230 -0
- data/lib/wallee-ruby-sdk/models/abstract_transaction_pending.rb +14 -4
- data/lib/wallee-ruby-sdk/models/criteria_operator.rb +1 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_case.rb +502 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_case_create.rb +310 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_case_document.rb +300 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_case_source.rb +232 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_case_state.rb +48 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_case_update.rb +300 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_environment.rb +43 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_receipt.rb +288 -0
- data/lib/wallee-ruby-sdk/models/debt_collection_receipt_source.rb +222 -0
- data/lib/wallee-ruby-sdk/models/debt_collector.rb +222 -0
- data/lib/wallee-ruby-sdk/models/debt_collector_condition.rb +258 -0
- data/lib/wallee-ruby-sdk/models/debt_collector_condition_type.rb +222 -0
- data/lib/wallee-ruby-sdk/models/debt_collector_configuration.rb +302 -0
- data/lib/wallee-ruby-sdk/models/document_template_type.rb +1 -11
- data/lib/wallee-ruby-sdk/models/entity_export_request.rb +215 -0
- data/lib/wallee-ruby-sdk/models/entity_query.rb +1 -1
- data/lib/wallee-ruby-sdk/models/entity_query_order_by.rb +10 -0
- data/lib/wallee-ruby-sdk/models/environment.rb +43 -0
- data/lib/wallee-ruby-sdk/models/metric_usage.rb +232 -0
- data/lib/wallee-ruby-sdk/models/payment_connector.rb +23 -1
- data/lib/wallee-ruby-sdk/models/payment_contract.rb +338 -0
- data/lib/wallee-ruby-sdk/models/payment_contract_state.rb +46 -0
- data/lib/wallee-ruby-sdk/models/payment_contract_type.rb +232 -0
- data/lib/wallee-ruby-sdk/models/payment_link.rb +382 -0
- data/lib/wallee-ruby-sdk/models/payment_link_active.rb +342 -0
- data/lib/wallee-ruby-sdk/models/payment_link_create.rb +337 -0
- data/lib/wallee-ruby-sdk/models/payment_link_protection_mode.rb +43 -0
- data/lib/wallee-ruby-sdk/models/payment_link_update.rb +332 -0
- data/lib/wallee-ruby-sdk/models/payment_method.rb +13 -1
- data/lib/wallee-ruby-sdk/models/payment_processor_configuration.rb +11 -1
- data/lib/wallee-ruby-sdk/models/refund.rb +11 -1
- data/lib/wallee-ruby-sdk/models/rest_address_format.rb +234 -0
- data/lib/wallee-ruby-sdk/models/rest_address_format_field.rb +51 -0
- data/lib/wallee-ruby-sdk/models/rest_country.rb +11 -1
- data/lib/wallee-ruby-sdk/models/subscription.rb +11 -1
- data/lib/wallee-ruby-sdk/models/subscription_affiliate.rb +290 -0
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_create.rb +255 -0
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleted.rb +290 -0
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleting.rb +290 -0
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_inactive.rb +260 -0
- data/lib/wallee-ruby-sdk/models/subscription_affiliate_update.rb +260 -0
- data/lib/wallee-ruby-sdk/models/subscription_change_request.rb +2 -2
- data/lib/wallee-ruby-sdk/models/subscription_create_request.rb +2 -2
- data/lib/wallee-ruby-sdk/models/subscription_pending.rb +11 -1
- data/lib/wallee-ruby-sdk/models/tokenizationn_mode.rb +44 -0
- data/lib/wallee-ruby-sdk/models/transaction.rb +63 -3
- data/lib/wallee-ruby-sdk/models/transaction_create.rb +41 -1
- data/lib/wallee-ruby-sdk/models/transaction_environment_selection_strategy.rb +43 -0
- data/lib/wallee-ruby-sdk/models/transaction_invoice.rb +11 -1
- data/lib/wallee-ruby-sdk/models/transaction_pending.rb +11 -1
- data/lib/wallee-ruby-sdk/models/unencrypted_card_data.rb +228 -0
- data/lib/wallee-ruby-sdk/models/unencrypted_card_data_create.rb +233 -0
- data/lib/wallee-ruby-sdk/models/webhook_listener_entity.rb +1 -11
- data/lib/wallee-ruby-sdk/services/account_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/application_user_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/card_processing_service_api.rb +176 -0
- data/lib/wallee-ruby-sdk/services/charge_attempt_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/charge_flow_level_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/charge_flow_service_api.rb +6 -6
- data/lib/wallee-ruby-sdk/services/condition_type_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/country_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/country_state_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/currency_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/debt_collection_case_service_api.rb +800 -0
- data/lib/wallee-ruby-sdk/services/debt_collector_configuration_service_api.rb +217 -0
- data/lib/wallee-ruby-sdk/services/debt_collector_service_api.rb +143 -0
- data/lib/wallee-ruby-sdk/services/delivery_indication_service_api.rb +6 -6
- data/lib/wallee-ruby-sdk/services/document_template_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/document_template_type_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/human_user_service_api.rb +59 -2
- data/lib/wallee-ruby-sdk/services/installment_payment_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/installment_payment_slice_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/installment_plan_calculation_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/installment_plan_configuration_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/installment_plan_slice_configuration_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/label_description_group_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/label_description_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/language_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/legal_organization_form_service_api.rb +201 -0
- data/lib/wallee-ruby-sdk/services/manual_task_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/mertic_usage_service_api.rb +100 -0
- data/lib/wallee-ruby-sdk/services/payment_connector_configuration_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/payment_connector_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/payment_link_service_api.rb +402 -0
- data/lib/wallee-ruby-sdk/services/payment_method_configuration_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/payment_method_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/payment_processor_configuration_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/payment_processor_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/permission_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/refund_service_api.rb +10 -10
- data/lib/wallee-ruby-sdk/services/space_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/static_value_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/subscriber_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_affiliate_service_api.rb +402 -0
- data/lib/wallee-ruby-sdk/services/subscription_charge_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/subscription_ledger_entry_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_metric_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_metric_usage_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_period_bill_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_component_group_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_component_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_fee_tier_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_metered_fee_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_period_fee_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_retirement_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_setup_fee_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_version_retirement_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_product_version_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_service_api.rb +12 -12
- data/lib/wallee-ruby-sdk/services/subscription_suspension_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/subscription_version_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/token_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/token_version_service_api.rb +4 -4
- data/lib/wallee-ruby-sdk/services/transaction_completion_service_api.rb +6 -6
- data/lib/wallee-ruby-sdk/services/transaction_invoice_service_api.rb +6 -6
- data/lib/wallee-ruby-sdk/services/transaction_service_api.rb +143 -18
- data/lib/wallee-ruby-sdk/services/transaction_void_service_api.rb +6 -6
- data/lib/wallee-ruby-sdk/services/user_account_role_service_api.rb +6 -6
- data/lib/wallee-ruby-sdk/services/user_space_role_service_api.rb +9 -9
- data/lib/wallee-ruby-sdk/services/webhook_listener_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/services/webhook_url_service_api.rb +2 -2
- data/lib/wallee-ruby-sdk/version.rb +1 -1
- data/lib/wallee-ruby-sdk.rb +47 -0
- metadata +50 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: a0bb94110ebf7a605f702d72673a7daa72e4683ad232aaa855d05890326377b9
|
|
4
|
+
data.tar.gz: 092f571d6430e83ec71d970ad5c8b1a353507b36dfecb7aaddaef2cb2518e67b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75e84cb96ade60f4e477fdb36d845ffa9252205b5b979445e8e1b281811f75fe23b459af90ef0633f0fb1ad0b6e908a3751e4ec0f584cc9488c3e1f646776b70
|
|
7
|
+
data.tar.gz: 6e62fa0350d5878d54714440a5fd2d45f08c95ea7a4c55df24aeea58c0c2b74bd8a713fcfab12426499d73262cb87b68bb7fc12d30ba65e052397cc8419ec73f
|
data/README.md
CHANGED
|
@@ -37,26 +37,36 @@ $ gem install wallee-ruby-sdk
|
|
|
37
37
|
# Load the gem
|
|
38
38
|
require 'wallee-ruby-sdk'
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
space_id = 405
|
|
41
|
+
app_user_id = 512
|
|
42
|
+
app_user_key = "FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ="
|
|
43
|
+
|
|
44
|
+
# Setup Application User Id and Application User Key
|
|
41
45
|
Wallee.configure do |config|
|
|
42
|
-
config.user_id =
|
|
43
|
-
config.authentication_key =
|
|
46
|
+
config.user_id = app_user_id
|
|
47
|
+
config.authentication_key = app_user_key
|
|
44
48
|
end
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
# TransactionService
|
|
51
|
+
transaction_service = Wallee::TransactionService.new
|
|
52
|
+
|
|
53
|
+
# Create Filter
|
|
54
|
+
opts = {
|
|
55
|
+
filter: Wallee::EntityQueryFilter.new({
|
|
56
|
+
fieldName: "state",
|
|
57
|
+
operator: Wallee::CriteriaOperator::EQUALS,
|
|
58
|
+
type: Wallee::EntityQueryFilterType::LEAF,
|
|
59
|
+
value: Wallee::TransactionCompletionState::FAILED
|
|
60
|
+
})
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
begin
|
|
53
|
-
#
|
|
54
|
-
result =
|
|
64
|
+
#Returns the number of transaction in the space matching the provided filter
|
|
65
|
+
result = transaction_service.transaction_service_count(space_id, opts)
|
|
55
66
|
p result
|
|
56
67
|
rescue Wallee::ApiError => e
|
|
57
|
-
puts "Exception when calling
|
|
68
|
+
puts "Exception when calling TransactionService->transaction_service_count: #{e}"
|
|
58
69
|
end
|
|
59
|
-
|
|
60
70
|
```
|
|
61
71
|
|
|
62
72
|
## License
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
Wallee API: 1.0.0
|
|
3
|
+
|
|
4
|
+
The wallee API allows an easy interaction with the wallee web service.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
you may not use this file except in compliance with the License.
|
|
10
|
+
You may obtain a copy of the License at
|
|
11
|
+
|
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
|
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
See the License for the specific language governing permissions and
|
|
18
|
+
limitations under the License.
|
|
19
|
+
|
|
20
|
+
=end
|
|
21
|
+
|
|
22
|
+
require 'date'
|
|
23
|
+
|
|
24
|
+
module Wallee
|
|
25
|
+
|
|
26
|
+
class AbstractDebtCollectionCaseUpdate
|
|
27
|
+
# The billing address of the case identifies the debtor.
|
|
28
|
+
attr_accessor :billing_address
|
|
29
|
+
|
|
30
|
+
# The contract date is the date on which the contract with the debtor was signed on.
|
|
31
|
+
attr_accessor :contract_date
|
|
32
|
+
|
|
33
|
+
# The currency defines the billing currency of the debt collection case.
|
|
34
|
+
attr_accessor :currency
|
|
35
|
+
|
|
36
|
+
# The due date indicates the date on which the amount receivable was due. This date has to be always in the past.
|
|
37
|
+
attr_accessor :due_date
|
|
38
|
+
|
|
39
|
+
# The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment.
|
|
40
|
+
attr_accessor :environment
|
|
41
|
+
|
|
42
|
+
# The language indicates the language to be used in the communication with the debtor.
|
|
43
|
+
attr_accessor :language
|
|
44
|
+
|
|
45
|
+
# The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect.
|
|
46
|
+
attr_accessor :line_items
|
|
47
|
+
|
|
48
|
+
#
|
|
49
|
+
attr_accessor :space_view_id
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
|
+
def self.attribute_map
|
|
54
|
+
{
|
|
55
|
+
:'billing_address' => :'billingAddress',
|
|
56
|
+
:'contract_date' => :'contractDate',
|
|
57
|
+
:'currency' => :'currency',
|
|
58
|
+
:'due_date' => :'dueDate',
|
|
59
|
+
:'environment' => :'environment',
|
|
60
|
+
:'language' => :'language',
|
|
61
|
+
:'line_items' => :'lineItems',
|
|
62
|
+
:'space_view_id' => :'spaceViewId'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Attribute type mapping.
|
|
67
|
+
def self.swagger_types
|
|
68
|
+
{
|
|
69
|
+
:'billing_address' => :'AddressCreate',
|
|
70
|
+
:'contract_date' => :'DateTime',
|
|
71
|
+
:'currency' => :'String',
|
|
72
|
+
:'due_date' => :'DateTime',
|
|
73
|
+
:'environment' => :'DebtCollectionEnvironment',
|
|
74
|
+
:'language' => :'String',
|
|
75
|
+
:'line_items' => :'Array<LineItemCreate>',
|
|
76
|
+
:'space_view_id' => :'Integer'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
return unless attributes.is_a?(Hash)
|
|
84
|
+
|
|
85
|
+
# convert string to symbol for hash key
|
|
86
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
87
|
+
|
|
88
|
+
if attributes.has_key?(:'billingAddress')
|
|
89
|
+
self.billing_address = attributes[:'billingAddress']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.has_key?(:'contractDate')
|
|
93
|
+
self.contract_date = attributes[:'contractDate']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.has_key?(:'currency')
|
|
97
|
+
self.currency = attributes[:'currency']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.has_key?(:'dueDate')
|
|
101
|
+
self.due_date = attributes[:'dueDate']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.has_key?(:'environment')
|
|
105
|
+
self.environment = attributes[:'environment']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.has_key?(:'language')
|
|
109
|
+
self.language = attributes[:'language']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.has_key?(:'lineItems')
|
|
113
|
+
if (value = attributes[:'lineItems']).is_a?(Array)
|
|
114
|
+
self.line_items = value
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.has_key?(:'spaceViewId')
|
|
119
|
+
self.space_view_id = attributes[:'spaceViewId']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
125
|
+
# @return Array for valid properies with the reasons
|
|
126
|
+
def list_invalid_properties
|
|
127
|
+
invalid_properties = Array.new
|
|
128
|
+
return invalid_properties
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Check to see if the all the properties in the model are valid
|
|
132
|
+
# @return true if the model is valid
|
|
133
|
+
def valid?
|
|
134
|
+
return true
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Checks equality by comparing each attribute.
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def ==(o)
|
|
140
|
+
return true if self.equal?(o)
|
|
141
|
+
self.class == o.class &&
|
|
142
|
+
billing_address == o.billing_address &&
|
|
143
|
+
contract_date == o.contract_date &&
|
|
144
|
+
currency == o.currency &&
|
|
145
|
+
due_date == o.due_date &&
|
|
146
|
+
environment == o.environment &&
|
|
147
|
+
language == o.language &&
|
|
148
|
+
line_items == o.line_items &&
|
|
149
|
+
space_view_id == o.space_view_id
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# @see the `==` method
|
|
153
|
+
# @param [Object] Object to be compared
|
|
154
|
+
def eql?(o)
|
|
155
|
+
self == o
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Calculates hash code according to all attributes.
|
|
159
|
+
# @return [Fixnum] Hash code
|
|
160
|
+
def hash
|
|
161
|
+
[billing_address, contract_date, currency, due_date, environment, language, line_items, space_view_id].hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Builds the object from hash
|
|
165
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
166
|
+
# @return [Object] Returns the model itself
|
|
167
|
+
def build_from_hash(attributes)
|
|
168
|
+
return nil unless attributes.is_a?(Hash)
|
|
169
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
170
|
+
if type =~ /\AArray<(.*)>/i
|
|
171
|
+
# check to ensure the input is an array given that the the attribute
|
|
172
|
+
# is documented as an array but the input is not
|
|
173
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
174
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
175
|
+
end
|
|
176
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
177
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
178
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
self
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Deserializes the data based on type
|
|
185
|
+
# @param string type Data type
|
|
186
|
+
# @param string value Value to be deserialized
|
|
187
|
+
# @return [Object] Deserialized data
|
|
188
|
+
def _deserialize(type, value)
|
|
189
|
+
case type.to_sym
|
|
190
|
+
when :DateTime
|
|
191
|
+
DateTime.parse(value)
|
|
192
|
+
when :Date
|
|
193
|
+
Date.parse(value)
|
|
194
|
+
when :String
|
|
195
|
+
value.to_s
|
|
196
|
+
when :Integer
|
|
197
|
+
value.to_i
|
|
198
|
+
when :Float
|
|
199
|
+
value.to_f
|
|
200
|
+
when :BOOLEAN
|
|
201
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
202
|
+
true
|
|
203
|
+
else
|
|
204
|
+
false
|
|
205
|
+
end
|
|
206
|
+
when :Object
|
|
207
|
+
# generic object (usually a Hash), return directly
|
|
208
|
+
value
|
|
209
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
210
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
211
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
212
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
213
|
+
k_type = Regexp.last_match[:k_type]
|
|
214
|
+
v_type = Regexp.last_match[:v_type]
|
|
215
|
+
{}.tap do |hash|
|
|
216
|
+
value.each do |k, v|
|
|
217
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
else # model
|
|
221
|
+
temp_model = Wallee.const_get(type).new
|
|
222
|
+
temp_model.build_from_hash(value)
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Returns the string representation of the object
|
|
227
|
+
# @return [String] String presentation of the object
|
|
228
|
+
def to_s
|
|
229
|
+
to_hash.to_s
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
|
234
|
+
def to_body
|
|
235
|
+
to_hash
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Returns the object in the form of hash
|
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
|
240
|
+
def to_hash
|
|
241
|
+
hash = {}
|
|
242
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
243
|
+
value = self.send(attr)
|
|
244
|
+
next if value.nil?
|
|
245
|
+
hash[param] = _to_hash(value)
|
|
246
|
+
end
|
|
247
|
+
hash
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Outputs non-array value in the form of hash
|
|
251
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
252
|
+
# @param [Object] value Any valid value
|
|
253
|
+
# @return [Hash] Returns the value in the form of hash
|
|
254
|
+
def _to_hash(value)
|
|
255
|
+
if value.is_a?(Array)
|
|
256
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
257
|
+
elsif value.is_a?(Hash)
|
|
258
|
+
{}.tap do |hash|
|
|
259
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
260
|
+
end
|
|
261
|
+
elsif value.respond_to? :to_hash
|
|
262
|
+
value.to_hash
|
|
263
|
+
else
|
|
264
|
+
value
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
end
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
Wallee API: 1.0.0
|
|
3
|
+
|
|
4
|
+
The wallee API allows an easy interaction with the wallee web service.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
you may not use this file except in compliance with the License.
|
|
10
|
+
You may obtain a copy of the License at
|
|
11
|
+
|
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
|
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
See the License for the specific language governing permissions and
|
|
18
|
+
limitations under the License.
|
|
19
|
+
|
|
20
|
+
=end
|
|
21
|
+
|
|
22
|
+
require 'date'
|
|
23
|
+
|
|
24
|
+
module Wallee
|
|
25
|
+
|
|
26
|
+
class AbstractPaymentLinkUpdate
|
|
27
|
+
# The allowed payment method configurations restrict the payment methods which can be used with this payment link.
|
|
28
|
+
attr_accessor :allowed_payment_method_configurations
|
|
29
|
+
|
|
30
|
+
# The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page.
|
|
31
|
+
attr_accessor :applied_space_view
|
|
32
|
+
|
|
33
|
+
# The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction.
|
|
34
|
+
attr_accessor :available_from
|
|
35
|
+
|
|
36
|
+
# 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.
|
|
37
|
+
attr_accessor :available_until
|
|
38
|
+
|
|
39
|
+
# By making the billing address required the transaction can only be created when a billing address is provided within the request.
|
|
40
|
+
attr_accessor :billing_address_required
|
|
41
|
+
|
|
42
|
+
# 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'.
|
|
43
|
+
attr_accessor :currency
|
|
44
|
+
|
|
45
|
+
# The language defines the language of the payment page. If no language is provided it can be provided through the request parameter.
|
|
46
|
+
attr_accessor :language
|
|
47
|
+
|
|
48
|
+
# The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters.
|
|
49
|
+
attr_accessor :line_items
|
|
50
|
+
|
|
51
|
+
# The maximal number of transactions limits the number of transactions which can be created with this payment link.
|
|
52
|
+
attr_accessor :maximal_number_of_transactions
|
|
53
|
+
|
|
54
|
+
# 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.
|
|
55
|
+
attr_accessor :name
|
|
56
|
+
|
|
57
|
+
# By making the shipping address required the transaction can only be created when a shipping address is provided within the request.
|
|
58
|
+
attr_accessor :shipping_address_required
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
|
+
def self.attribute_map
|
|
63
|
+
{
|
|
64
|
+
:'allowed_payment_method_configurations' => :'allowedPaymentMethodConfigurations',
|
|
65
|
+
:'applied_space_view' => :'appliedSpaceView',
|
|
66
|
+
:'available_from' => :'availableFrom',
|
|
67
|
+
:'available_until' => :'availableUntil',
|
|
68
|
+
:'billing_address_required' => :'billingAddressRequired',
|
|
69
|
+
:'currency' => :'currency',
|
|
70
|
+
:'language' => :'language',
|
|
71
|
+
:'line_items' => :'lineItems',
|
|
72
|
+
:'maximal_number_of_transactions' => :'maximalNumberOfTransactions',
|
|
73
|
+
:'name' => :'name',
|
|
74
|
+
:'shipping_address_required' => :'shippingAddressRequired'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Attribute type mapping.
|
|
79
|
+
def self.swagger_types
|
|
80
|
+
{
|
|
81
|
+
:'allowed_payment_method_configurations' => :'Array<PaymentMethodConfiguration>',
|
|
82
|
+
:'applied_space_view' => :'Integer',
|
|
83
|
+
:'available_from' => :'DateTime',
|
|
84
|
+
:'available_until' => :'DateTime',
|
|
85
|
+
:'billing_address_required' => :'BOOLEAN',
|
|
86
|
+
:'currency' => :'String',
|
|
87
|
+
:'language' => :'String',
|
|
88
|
+
:'line_items' => :'Array<LineItemCreate>',
|
|
89
|
+
:'maximal_number_of_transactions' => :'Integer',
|
|
90
|
+
:'name' => :'String',
|
|
91
|
+
:'shipping_address_required' => :'BOOLEAN'
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Initializes the object
|
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
97
|
+
def initialize(attributes = {})
|
|
98
|
+
return unless attributes.is_a?(Hash)
|
|
99
|
+
|
|
100
|
+
# convert string to symbol for hash key
|
|
101
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
102
|
+
|
|
103
|
+
if attributes.has_key?(:'allowedPaymentMethodConfigurations')
|
|
104
|
+
if (value = attributes[:'allowedPaymentMethodConfigurations']).is_a?(Array)
|
|
105
|
+
self.allowed_payment_method_configurations = value
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.has_key?(:'appliedSpaceView')
|
|
110
|
+
self.applied_space_view = attributes[:'appliedSpaceView']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.has_key?(:'availableFrom')
|
|
114
|
+
self.available_from = attributes[:'availableFrom']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.has_key?(:'availableUntil')
|
|
118
|
+
self.available_until = attributes[:'availableUntil']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.has_key?(:'billingAddressRequired')
|
|
122
|
+
self.billing_address_required = attributes[:'billingAddressRequired']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.has_key?(:'currency')
|
|
126
|
+
self.currency = attributes[:'currency']
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.has_key?(:'language')
|
|
130
|
+
self.language = attributes[:'language']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.has_key?(:'lineItems')
|
|
134
|
+
if (value = attributes[:'lineItems']).is_a?(Array)
|
|
135
|
+
self.line_items = value
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.has_key?(:'maximalNumberOfTransactions')
|
|
140
|
+
self.maximal_number_of_transactions = attributes[:'maximalNumberOfTransactions']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.has_key?(:'name')
|
|
144
|
+
self.name = attributes[:'name']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.has_key?(:'shippingAddressRequired')
|
|
148
|
+
self.shipping_address_required = attributes[:'shippingAddressRequired']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
154
|
+
# @return Array for valid properies with the reasons
|
|
155
|
+
def list_invalid_properties
|
|
156
|
+
invalid_properties = Array.new
|
|
157
|
+
return invalid_properties
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Check to see if the all the properties in the model are valid
|
|
161
|
+
# @return true if the model is valid
|
|
162
|
+
def valid?
|
|
163
|
+
return true
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Checks equality by comparing each attribute.
|
|
167
|
+
# @param [Object] Object to be compared
|
|
168
|
+
def ==(o)
|
|
169
|
+
return true if self.equal?(o)
|
|
170
|
+
self.class == o.class &&
|
|
171
|
+
allowed_payment_method_configurations == o.allowed_payment_method_configurations &&
|
|
172
|
+
applied_space_view == o.applied_space_view &&
|
|
173
|
+
available_from == o.available_from &&
|
|
174
|
+
available_until == o.available_until &&
|
|
175
|
+
billing_address_required == o.billing_address_required &&
|
|
176
|
+
currency == o.currency &&
|
|
177
|
+
language == o.language &&
|
|
178
|
+
line_items == o.line_items &&
|
|
179
|
+
maximal_number_of_transactions == o.maximal_number_of_transactions &&
|
|
180
|
+
name == o.name &&
|
|
181
|
+
shipping_address_required == o.shipping_address_required
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# @see the `==` method
|
|
185
|
+
# @param [Object] Object to be compared
|
|
186
|
+
def eql?(o)
|
|
187
|
+
self == o
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Calculates hash code according to all attributes.
|
|
191
|
+
# @return [Fixnum] Hash code
|
|
192
|
+
def hash
|
|
193
|
+
[allowed_payment_method_configurations, applied_space_view, available_from, available_until, billing_address_required, currency, language, line_items, maximal_number_of_transactions, name, shipping_address_required].hash
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Builds the object from hash
|
|
197
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
198
|
+
# @return [Object] Returns the model itself
|
|
199
|
+
def build_from_hash(attributes)
|
|
200
|
+
return nil unless attributes.is_a?(Hash)
|
|
201
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
202
|
+
if type =~ /\AArray<(.*)>/i
|
|
203
|
+
# check to ensure the input is an array given that the the attribute
|
|
204
|
+
# is documented as an array but the input is not
|
|
205
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
206
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
207
|
+
end
|
|
208
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
209
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
210
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
self
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Deserializes the data based on type
|
|
217
|
+
# @param string type Data type
|
|
218
|
+
# @param string value Value to be deserialized
|
|
219
|
+
# @return [Object] Deserialized data
|
|
220
|
+
def _deserialize(type, value)
|
|
221
|
+
case type.to_sym
|
|
222
|
+
when :DateTime
|
|
223
|
+
DateTime.parse(value)
|
|
224
|
+
when :Date
|
|
225
|
+
Date.parse(value)
|
|
226
|
+
when :String
|
|
227
|
+
value.to_s
|
|
228
|
+
when :Integer
|
|
229
|
+
value.to_i
|
|
230
|
+
when :Float
|
|
231
|
+
value.to_f
|
|
232
|
+
when :BOOLEAN
|
|
233
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
234
|
+
true
|
|
235
|
+
else
|
|
236
|
+
false
|
|
237
|
+
end
|
|
238
|
+
when :Object
|
|
239
|
+
# generic object (usually a Hash), return directly
|
|
240
|
+
value
|
|
241
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
242
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
243
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
244
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
245
|
+
k_type = Regexp.last_match[:k_type]
|
|
246
|
+
v_type = Regexp.last_match[:v_type]
|
|
247
|
+
{}.tap do |hash|
|
|
248
|
+
value.each do |k, v|
|
|
249
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
else # model
|
|
253
|
+
temp_model = Wallee.const_get(type).new
|
|
254
|
+
temp_model.build_from_hash(value)
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Returns the string representation of the object
|
|
259
|
+
# @return [String] String presentation of the object
|
|
260
|
+
def to_s
|
|
261
|
+
to_hash.to_s
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
|
266
|
+
def to_body
|
|
267
|
+
to_hash
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Returns the object in the form of hash
|
|
271
|
+
# @return [Hash] Returns the object in the form of hash
|
|
272
|
+
def to_hash
|
|
273
|
+
hash = {}
|
|
274
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
275
|
+
value = self.send(attr)
|
|
276
|
+
next if value.nil?
|
|
277
|
+
hash[param] = _to_hash(value)
|
|
278
|
+
end
|
|
279
|
+
hash
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Outputs non-array value in the form of hash
|
|
283
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
284
|
+
# @param [Object] value Any valid value
|
|
285
|
+
# @return [Hash] Returns the value in the form of hash
|
|
286
|
+
def _to_hash(value)
|
|
287
|
+
if value.is_a?(Array)
|
|
288
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
289
|
+
elsif value.is_a?(Hash)
|
|
290
|
+
{}.tap do |hash|
|
|
291
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
292
|
+
end
|
|
293
|
+
elsif value.respond_to? :to_hash
|
|
294
|
+
value.to_hash
|
|
295
|
+
else
|
|
296
|
+
value
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
end
|