postfinancecheckout-ruby-sdk 7.0.0 → 8.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/Gemfile.lock +16 -16
- data/README.md +15 -1
- data/lib/postfinancecheckout-ruby-sdk/api_client.rb +1 -1
- data/lib/postfinancecheckout-ruby-sdk/models/charge_attempt_projection.rb +13 -4
- data/lib/postfinancecheckout-ruby-sdk/models/fulfillment_state.rb +2 -1
- data/lib/postfinancecheckout-ruby-sdk/models/merchant_application_submit_request_dto.rb +232 -0
- data/lib/postfinancecheckout-ruby-sdk/models/merchant_application_submitted_dto.rb +273 -0
- data/lib/postfinancecheckout-ruby-sdk/models/{payment_terminal_update.rb → payment_terminal_update_request.rb} +15 -41
- data/lib/postfinancecheckout-ruby-sdk/models/subscription_partial_update_request.rb +250 -0
- data/lib/postfinancecheckout-ruby-sdk/models/subscription_update_request.rb +45 -22
- data/lib/postfinancecheckout-ruby-sdk/models/transaction_amounts.rb +257 -0
- data/lib/postfinancecheckout-ruby-sdk/models/walleejoin_create_partnership_api_request_dto.rb +20 -1
- data/lib/postfinancecheckout-ruby-sdk/service/merchant_applications_service.rb +151 -0
- data/lib/postfinancecheckout-ruby-sdk/service/payment_terminals_service.rb +9 -9
- data/lib/postfinancecheckout-ruby-sdk/service/subscriptions_service.rb +9 -9
- data/lib/postfinancecheckout-ruby-sdk/version.rb +1 -1
- data/lib/postfinancecheckout-ruby-sdk.rb +5 -1
- data/postfinancecheckout-ruby-sdk.gemspec +3 -3
- metadata +887 -866
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0729a9f72f26c066a82f7220c2666d71ac8a0d992c17541a7cbb8de71b3760ff
|
|
4
|
+
data.tar.gz: 109fbe75ebc615ab2245871c1076c054b9b79025f82d24b87ac5d50eccab1f79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e575d636d219359ea919822168687929b02e9b7adba75002126ac64cf8d9bd50708c82743c75c567e93203ef50209cf160a8f87aa6c64ca0db9df6e91f9f6d45
|
|
7
|
+
data.tar.gz: 284148a205de42a9927e836841f357e3f398e341aa180c9a2c3156aeb6dc9012a176741b6cc6a76e902781c1a584acc92203bbdf3e00c9bfe267f0a9095a0581
|
data/Gemfile.lock
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
postfinancecheckout-ruby-sdk (
|
|
5
|
-
concurrent-ruby (~> 1.3.
|
|
6
|
-
faraday (
|
|
4
|
+
postfinancecheckout-ruby-sdk (8.0.0)
|
|
5
|
+
concurrent-ruby (~> 1.3.7)
|
|
6
|
+
faraday (>= 2.14.3, < 3.0)
|
|
7
7
|
faraday-multipart (~> 1.1.0)
|
|
8
|
-
jwt (~> 2.10.
|
|
8
|
+
jwt (~> 2.10.3)
|
|
9
9
|
marcel (~> 1.0.4)
|
|
10
10
|
|
|
11
11
|
GEM
|
|
@@ -18,17 +18,17 @@ GEM
|
|
|
18
18
|
coderay (1.1.3)
|
|
19
19
|
concurrent-ruby (1.3.8)
|
|
20
20
|
date (3.6.0)
|
|
21
|
-
faraday (2.
|
|
22
|
-
faraday-net_http (>= 2.0, < 3.
|
|
21
|
+
faraday (2.15.1)
|
|
22
|
+
faraday-net_http (>= 2.0, < 3.6)
|
|
23
23
|
json
|
|
24
24
|
logger
|
|
25
25
|
faraday-multipart (1.1.1)
|
|
26
26
|
multipart-post (~> 2.0)
|
|
27
|
-
faraday-net_http (3.
|
|
27
|
+
faraday-net_http (3.5.0)
|
|
28
28
|
net-http (~> 0.5)
|
|
29
29
|
io-console (0.9.5)
|
|
30
30
|
jaro_winkler (1.5.6)
|
|
31
|
-
json (3.
|
|
31
|
+
json (3.2.0)
|
|
32
32
|
jwt (2.10.3)
|
|
33
33
|
base64
|
|
34
34
|
logger (1.7.0)
|
|
@@ -41,7 +41,7 @@ GEM
|
|
|
41
41
|
net-protocol (0.4.0)
|
|
42
42
|
timeout
|
|
43
43
|
parallel (1.28.0)
|
|
44
|
-
parser (3.3.
|
|
44
|
+
parser (3.3.14.0)
|
|
45
45
|
ast (~> 2.4.1)
|
|
46
46
|
racc
|
|
47
47
|
power_assert (3.1.0)
|
|
@@ -90,17 +90,17 @@ DEPENDENCIES
|
|
|
90
90
|
CHECKSUMS
|
|
91
91
|
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
92
92
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
93
|
-
bundler (4.
|
|
93
|
+
bundler (4.1.1) sha256=7a76aebebc2e476cbc1e11314200d7fe83c7398d6930f1d048e4d3dd2d0e93e3
|
|
94
94
|
byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d
|
|
95
95
|
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
|
|
96
96
|
concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
|
|
97
97
|
date (3.6.0) sha256=18ac945c4e24ebd93534f8eab8c2fd8c5604b3e977105b3798d62a1e8d27b580
|
|
98
|
-
faraday (2.
|
|
98
|
+
faraday (2.15.1) sha256=8708154deda739c5e86cc42b74960e23e8491fce0eba9e11639a6a34b1ac288f
|
|
99
99
|
faraday-multipart (1.1.1) sha256=77a18ff40149030fd1aef55bb4fc7a67ce46419a8a3fcd010e28c2526e8d8903
|
|
100
|
-
faraday-net_http (3.
|
|
100
|
+
faraday-net_http (3.5.0) sha256=2e7094c34e38754ee048cc3df47376f8657005d9375f8473bce1c3b526a22e36
|
|
101
101
|
io-console (0.9.5) sha256=83dd9bbf4c4680416629245b39cd4212eb5f4d9a4ea91804870c1f6b846414d5
|
|
102
102
|
jaro_winkler (1.5.6) sha256=007db7805527ada1cc12f2547676181d63b0a504ec4dd7a9a2eb2424521ccd81
|
|
103
|
-
json (3.
|
|
103
|
+
json (3.2.0) sha256=4a4e222a9ee6ffb296ab3171b6b39d85fec83afc4e7b57eee17edf68c74aec87
|
|
104
104
|
jwt (2.10.3) sha256=e4d9352fbc7309b1a7448c7dd713dfe4d8c47077af80759cdbed8f878ea0b484
|
|
105
105
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
106
106
|
marcel (1.0.4) sha256=0d5649feb64b8f19f3d3468b96c680bae9746335d02194270287868a661516a4
|
|
@@ -109,8 +109,8 @@ CHECKSUMS
|
|
|
109
109
|
net-http (0.10.0) sha256=1a2ff6e37a05724973c43f2bf7bf105f59c36a4cd0a7e9b1c021a0a566987c27
|
|
110
110
|
net-protocol (0.4.0) sha256=f9f90c8c6f64794a45160bf422177a336db12809de3beeeaa26b88fcd2e8c853
|
|
111
111
|
parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970
|
|
112
|
-
parser (3.3.
|
|
113
|
-
postfinancecheckout-ruby-sdk (
|
|
112
|
+
parser (3.3.14.0) sha256=62f8f76af7b919425ee2d811880e9dcb8011ab40bfd59970dfb583141697e58f
|
|
113
|
+
postfinancecheckout-ruby-sdk (8.0.0)
|
|
114
114
|
power_assert (3.1.0) sha256=fefe98ed5d3140628138f3f9f9194d6ece01f1320e69700d3c928adca7518251
|
|
115
115
|
pry (0.16.1) sha256=d92d82c86e7f2dc34beec6d2892d5cf5ea517eea22eed3ceabb38ee62a98accc
|
|
116
116
|
pry-byebug (3.12.0) sha256=594e094ae8a8390a7ad4c7b36ae36e13304ed02664c67417d108dc5f7213d1b7
|
|
@@ -128,4 +128,4 @@ CHECKSUMS
|
|
|
128
128
|
uri (1.1.2) sha256=89292e98eabbef6248b0a0ed5e7e398e152f83f17560023a6d94a7f492b169fb
|
|
129
129
|
|
|
130
130
|
BUNDLED WITH
|
|
131
|
-
4.
|
|
131
|
+
4.1.1
|
data/README.md
CHANGED
|
@@ -948,6 +948,11 @@ Web API client: [*link*](https://checkout.postfinance.ch//api/client)<br>
|
|
|
948
948
|
<strong>GET</strong> /members/space
|
|
949
949
|
List all members of the space
|
|
950
950
|
<br><br>
|
|
951
|
+
- <strong>MerchantApplicationsService</strong><br>
|
|
952
|
+
* <code>get_onboarding_merchant_applications_by_account</code>
|
|
953
|
+
<strong>GET</strong> /onboarding/merchant-applications/by-account
|
|
954
|
+
Retrieve a merchant application by account
|
|
955
|
+
<br><br>
|
|
951
956
|
- <strong>MerchantApplicationsService</strong><br>
|
|
952
957
|
* <code>get_onboarding_merchant_applications_id_status</code>
|
|
953
958
|
<strong>GET</strong> /onboarding/merchant-applications/{id}/status
|
|
@@ -968,6 +973,11 @@ Web API client: [*link*](https://checkout.postfinance.ch//api/client)<br>
|
|
|
968
973
|
<strong>POST</strong> /onboarding/merchant-applications
|
|
969
974
|
Create a merchant application
|
|
970
975
|
<br><br>
|
|
976
|
+
- <strong>MerchantApplicationsService</strong><br>
|
|
977
|
+
* <code>post_onboarding_merchant_applications_id_submit</code>
|
|
978
|
+
<strong>POST</strong> /onboarding/merchant-applications/{id}/submit
|
|
979
|
+
Submit a merchant application and create an organization
|
|
980
|
+
<br><br>
|
|
971
981
|
- <strong>PaymentConnectorConfigurationsService</strong><br>
|
|
972
982
|
* <code>delete_payment_connector_configurations_id</code>
|
|
973
983
|
<strong>DELETE</strong> /payment/connector-configurations/{id}
|
|
@@ -2890,6 +2900,8 @@ Additional Api models documentation: [*link*](https://checkout.postfinance.ch/en
|
|
|
2890
2900
|
* <strong>MerchantApplicationDataDto</strong>
|
|
2891
2901
|
* <strong>MerchantApplicationState</strong>
|
|
2892
2902
|
* <strong>MerchantApplicationStatusDto</strong>
|
|
2903
|
+
* <strong>MerchantApplicationSubmitRequestDto</strong>
|
|
2904
|
+
* <strong>MerchantApplicationSubmittedDto</strong>
|
|
2893
2905
|
* <strong>MerchantBankDetailsDto</strong>
|
|
2894
2906
|
* <strong>MerchantCompanyDetailsDto</strong>
|
|
2895
2907
|
* <strong>MerchantContractRevenueDto</strong>
|
|
@@ -2975,7 +2987,7 @@ Additional Api models documentation: [*link*](https://checkout.postfinance.ch/en
|
|
|
2975
2987
|
* <strong>PaymentTerminalTransactionSummary</strong>
|
|
2976
2988
|
* <strong>PaymentTerminalTransactionSummaryReference</strong>
|
|
2977
2989
|
* <strong>PaymentTerminalType</strong>
|
|
2978
|
-
* <strong>
|
|
2990
|
+
* <strong>PaymentTerminalUpdateRequest</strong>
|
|
2979
2991
|
* <strong>PayoutAccountInfo</strong>
|
|
2980
2992
|
* <strong>Permission</strong>
|
|
2981
2993
|
* <strong>PermissionListResponse</strong>
|
|
@@ -3130,6 +3142,7 @@ Additional Api models documentation: [*link*](https://checkout.postfinance.ch/en
|
|
|
3130
3142
|
* <strong>SubscriptionMetricUpdate</strong>
|
|
3131
3143
|
* <strong>SubscriptionMetricUsageReport</strong>
|
|
3132
3144
|
* <strong>SubscriptionMetricUsageReportCreate</strong>
|
|
3145
|
+
* <strong>SubscriptionPartialUpdateRequest</strong>
|
|
3133
3146
|
* <strong>SubscriptionPending</strong>
|
|
3134
3147
|
* <strong>SubscriptionPeriodBill</strong>
|
|
3135
3148
|
* <strong>SubscriptionPeriodBillListResponse</strong>
|
|
@@ -3195,6 +3208,7 @@ Additional Api models documentation: [*link*](https://checkout.postfinance.ch/en
|
|
|
3195
3208
|
* <strong>TokenizedCardRequest</strong>
|
|
3196
3209
|
* <strong>TrackingNumberRequest</strong>
|
|
3197
3210
|
* <strong>Transaction</strong>
|
|
3211
|
+
* <strong>TransactionAmounts</strong>
|
|
3198
3212
|
* <strong>TransactionClientPlatformInformation</strong>
|
|
3199
3213
|
* <strong>TransactionComment</strong>
|
|
3200
3214
|
* <strong>TransactionCommentActive</strong>
|
|
@@ -118,7 +118,7 @@ module PostfinancecheckoutRubySdk
|
|
|
118
118
|
http_method = http_method.to_sym.downcase
|
|
119
119
|
|
|
120
120
|
default_headers = {
|
|
121
|
-
'x-meta-sdk-version': "
|
|
121
|
+
'x-meta-sdk-version': "8.0.0",
|
|
122
122
|
'x-meta-sdk-language': "ruby",
|
|
123
123
|
'x-meta-sdk-provider': "postfinancecheckout",
|
|
124
124
|
'x-meta-sdk-language-version': RUBY_VERSION
|
|
@@ -101,6 +101,8 @@ module PostfinancecheckoutRubySdk
|
|
|
101
101
|
# The date and time when the charge attempt failed.
|
|
102
102
|
attr_accessor :failed_on
|
|
103
103
|
|
|
104
|
+
attr_accessor :transaction_amounts
|
|
105
|
+
|
|
104
106
|
class EnumAttributeValidator
|
|
105
107
|
attr_reader :datatype
|
|
106
108
|
attr_reader :allowable_values
|
|
@@ -154,7 +156,8 @@ module PostfinancecheckoutRubySdk
|
|
|
154
156
|
:'next_update_on' => :'nextUpdateOn',
|
|
155
157
|
:'failure_reason' => :'failureReason',
|
|
156
158
|
:'customers_presence' => :'customersPresence',
|
|
157
|
-
:'failed_on' => :'failedOn'
|
|
159
|
+
:'failed_on' => :'failedOn',
|
|
160
|
+
:'transaction_amounts' => :'transactionAmounts'
|
|
158
161
|
}
|
|
159
162
|
end
|
|
160
163
|
|
|
@@ -199,7 +202,8 @@ module PostfinancecheckoutRubySdk
|
|
|
199
202
|
:'next_update_on' => :'Time',
|
|
200
203
|
:'failure_reason' => :'FailureReason',
|
|
201
204
|
:'customers_presence' => :'CustomersPresence',
|
|
202
|
-
:'failed_on' => :'Time'
|
|
205
|
+
:'failed_on' => :'Time',
|
|
206
|
+
:'transaction_amounts' => :'TransactionAmounts'
|
|
203
207
|
}
|
|
204
208
|
end
|
|
205
209
|
|
|
@@ -349,6 +353,10 @@ module PostfinancecheckoutRubySdk
|
|
|
349
353
|
if attributes.key?(:'failed_on')
|
|
350
354
|
self.failed_on = attributes[:'failed_on']
|
|
351
355
|
end
|
|
356
|
+
|
|
357
|
+
if attributes.key?(:'transaction_amounts')
|
|
358
|
+
self.transaction_amounts = attributes[:'transaction_amounts']
|
|
359
|
+
end
|
|
352
360
|
end
|
|
353
361
|
|
|
354
362
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -428,7 +436,8 @@ module PostfinancecheckoutRubySdk
|
|
|
428
436
|
next_update_on == o.next_update_on &&
|
|
429
437
|
failure_reason == o.failure_reason &&
|
|
430
438
|
customers_presence == o.customers_presence &&
|
|
431
|
-
failed_on == o.failed_on
|
|
439
|
+
failed_on == o.failed_on &&
|
|
440
|
+
transaction_amounts == o.transaction_amounts
|
|
432
441
|
end
|
|
433
442
|
|
|
434
443
|
# @see the `==` method
|
|
@@ -440,7 +449,7 @@ module PostfinancecheckoutRubySdk
|
|
|
440
449
|
# Calculates hash code according to all attributes.
|
|
441
450
|
# @return [Integer] Hash code
|
|
442
451
|
def hash
|
|
443
|
-
[language, sales_channel, created_on, initializing_token_version, token_version, succeeded_on, id, state, linked_transaction, redirection_url, charge, wallet, planned_purge_date, time_zone, space_view_id, terminal, user_failure_message, completion_behavior, version, labels, linked_space_id, timeout_on, environment, invocation, connector_configuration, next_update_on, failure_reason, customers_presence, failed_on].hash
|
|
452
|
+
[language, sales_channel, created_on, initializing_token_version, token_version, succeeded_on, id, state, linked_transaction, redirection_url, charge, wallet, planned_purge_date, time_zone, space_view_id, terminal, user_failure_message, completion_behavior, version, labels, linked_space_id, timeout_on, environment, invocation, connector_configuration, next_update_on, failure_reason, customers_presence, failed_on, transaction_amounts].hash
|
|
444
453
|
end
|
|
445
454
|
|
|
446
455
|
# Builds the object from hash
|
|
@@ -29,9 +29,10 @@ module PostfinancecheckoutRubySdk
|
|
|
29
29
|
TRACKING = "TRACKING".freeze
|
|
30
30
|
FULFILLED = "FULFILLED".freeze
|
|
31
31
|
FAILED = "FAILED".freeze
|
|
32
|
+
CANCELED = "CANCELED".freeze
|
|
32
33
|
|
|
33
34
|
def self.all_vars
|
|
34
|
-
@all_vars ||= [CREATING, TRACKING, FULFILLED, FAILED].freeze
|
|
35
|
+
@all_vars ||= [CREATING, TRACKING, FULFILLED, FAILED, CANCELED].freeze
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
# Builds the enum from string
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
# PostFinance Ruby SDK
|
|
3
|
+
#
|
|
4
|
+
# This library allows to interact with the PostFinance payment service.
|
|
5
|
+
#
|
|
6
|
+
# Copyright owner: Wallee AG
|
|
7
|
+
# Website: https://www.postfinance.ch/en/private.html
|
|
8
|
+
# Developer email: ecosystem-team@wallee.com
|
|
9
|
+
#
|
|
10
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
# you may not use this file except in compliance with the License.
|
|
12
|
+
# You may obtain a copy of the License at
|
|
13
|
+
#
|
|
14
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
#
|
|
16
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
# See the License for the specific language governing permissions and
|
|
20
|
+
# limitations under the License.
|
|
21
|
+
=end
|
|
22
|
+
|
|
23
|
+
require 'date'
|
|
24
|
+
require 'time'
|
|
25
|
+
|
|
26
|
+
module PostfinancecheckoutRubySdk
|
|
27
|
+
# The confirmation required to submit a merchant application.
|
|
28
|
+
class MerchantApplicationSubmitRequestDto
|
|
29
|
+
# Whether the merchant accepts the terms and conditions required for submission.
|
|
30
|
+
attr_accessor :accepted_wallee_terms
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'accepted_wallee_terms' => :'acceptedWalleeTerms'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
acceptable_attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'accepted_wallee_terms' => :'Boolean'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PostfinancecheckoutRubySdk::MerchantApplicationSubmitRequestDto` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PostfinancecheckoutRubySdk::MerchantApplicationSubmitRequestDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'accepted_wallee_terms')
|
|
79
|
+
self.accepted_wallee_terms = attributes[:'accepted_wallee_terms']
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
invalid_properties
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Check to see if the all the properties in the model are valid
|
|
92
|
+
# @return true if the model is valid
|
|
93
|
+
def valid?
|
|
94
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
95
|
+
true
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Checks equality by comparing each attribute.
|
|
99
|
+
# @param [Object] Object to be compared
|
|
100
|
+
def ==(o)
|
|
101
|
+
return true if self.equal?(o)
|
|
102
|
+
self.class == o.class &&
|
|
103
|
+
accepted_wallee_terms == o.accepted_wallee_terms
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @see the `==` method
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def eql?(o)
|
|
109
|
+
self == o
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Calculates hash code according to all attributes.
|
|
113
|
+
# @return [Integer] Hash code
|
|
114
|
+
def hash
|
|
115
|
+
[accepted_wallee_terms].hash
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Builds the object from hash
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
# @return [Object] Returns the model itself
|
|
121
|
+
def self.build_from_hash(attributes)
|
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
|
123
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
124
|
+
transformed_hash = {}
|
|
125
|
+
openapi_types.each_pair do |key, type|
|
|
126
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
127
|
+
transformed_hash["#{key}"] = nil
|
|
128
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
129
|
+
# check to ensure the input is an array given that the attribute
|
|
130
|
+
# is documented as an array but the input is not
|
|
131
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
132
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
133
|
+
end
|
|
134
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
new(transformed_hash)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Deserializes the data based on type
|
|
142
|
+
# @param string type Data type
|
|
143
|
+
# @param string value Value to be deserialized
|
|
144
|
+
# @return [Object] Deserialized data
|
|
145
|
+
def self._deserialize(type, value)
|
|
146
|
+
case type.to_sym
|
|
147
|
+
when :Time
|
|
148
|
+
Time.parse(value)
|
|
149
|
+
when :Date
|
|
150
|
+
Date.parse(value)
|
|
151
|
+
when :String
|
|
152
|
+
value.to_s
|
|
153
|
+
when :Integer
|
|
154
|
+
value.to_i
|
|
155
|
+
when :Float
|
|
156
|
+
value.to_f
|
|
157
|
+
when :Boolean
|
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
159
|
+
true
|
|
160
|
+
else
|
|
161
|
+
false
|
|
162
|
+
end
|
|
163
|
+
when :Object
|
|
164
|
+
# generic object (usually a Hash), return directly
|
|
165
|
+
value
|
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
|
172
|
+
{}.tap do |hash|
|
|
173
|
+
value.each do |k, v|
|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
else # model
|
|
178
|
+
# models (e.g. Pet) or oneOf
|
|
179
|
+
klass = PostfinancecheckoutRubySdk.const_get(type)
|
|
180
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Returns the string representation of the object
|
|
185
|
+
# @return [String] String presentation of the object
|
|
186
|
+
def to_s
|
|
187
|
+
to_hash.to_s
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_body
|
|
193
|
+
to_hash
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Returns the object in the form of hash
|
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
|
198
|
+
def to_hash
|
|
199
|
+
hash = {}
|
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
201
|
+
value = self.send(attr)
|
|
202
|
+
if value.nil?
|
|
203
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
204
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
hash[param] = _to_hash(value)
|
|
208
|
+
end
|
|
209
|
+
hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Outputs non-array value in the form of hash
|
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
214
|
+
# @param [Object] value Any valid value
|
|
215
|
+
# @return [Hash] Returns the value in the form of hash
|
|
216
|
+
def _to_hash(value)
|
|
217
|
+
if value.is_a?(Array)
|
|
218
|
+
value.compact.map { |v| _to_hash(v) }
|
|
219
|
+
elsif value.is_a?(Hash)
|
|
220
|
+
{}.tap do |hash|
|
|
221
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
222
|
+
end
|
|
223
|
+
elsif value.respond_to? :to_hash
|
|
224
|
+
value.to_hash
|
|
225
|
+
else
|
|
226
|
+
value
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
end
|