diff --git a/lib/wallee-ruby-sdk.rb b/lib/wallee-ruby-sdk.rb index 071156a..34b8e11 100644 --- a/lib/wallee-ruby-sdk.rb +++ b/lib/wallee-ruby-sdk.rb @@ -48,6 +48,7 @@ require 'wallee-ruby-sdk/models/account_type' require 'wallee-ruby-sdk/models/address' require 'wallee-ruby-sdk/models/address_create' +require 'wallee-ruby-sdk/models/authenticated_card_data_create' require 'wallee-ruby-sdk/models/bank_account' require 'wallee-ruby-sdk/models/bank_account_environment' require 'wallee-ruby-sdk/models/bank_account_state' @@ -57,6 +58,13 @@ require 'wallee-ruby-sdk/models/bank_transaction_source' require 'wallee-ruby-sdk/models/bank_transaction_state' require 'wallee-ruby-sdk/models/bank_transaction_type' +require 'wallee-ruby-sdk/models/card_authentication_response' +require 'wallee-ruby-sdk/models/card_authentication_version' +require 'wallee-ruby-sdk/models/card_cryptogram' +require 'wallee-ruby-sdk/models/card_cryptogram_create' +require 'wallee-ruby-sdk/models/card_cryptogram_type' +require 'wallee-ruby-sdk/models/cardholder_authentication' +require 'wallee-ruby-sdk/models/cardholder_authentication_create' require 'wallee-ruby-sdk/models/charge_attempt_environment' require 'wallee-ruby-sdk/models/charge_attempt_state' require 'wallee-ruby-sdk/models/charge_flow' @@ -176,6 +184,7 @@ require 'wallee-ruby-sdk/models/payment_terminal_location_state' require 'wallee-ruby-sdk/models/payment_terminal_location_version' require 'wallee-ruby-sdk/models/payment_terminal_location_version_state' +require 'wallee-ruby-sdk/models/payment_terminal_receipt_type' require 'wallee-ruby-sdk/models/payment_terminal_state' require 'wallee-ruby-sdk/models/payment_terminal_type' require 'wallee-ruby-sdk/models/permission' @@ -191,6 +200,7 @@ require 'wallee-ruby-sdk/models/product_period_fee_update' require 'wallee-ruby-sdk/models/product_setup_fee' require 'wallee-ruby-sdk/models/product_setup_fee_update' +require 'wallee-ruby-sdk/models/recurring_indicator' require 'wallee-ruby-sdk/models/refund' require 'wallee-ruby-sdk/models/refund_comment' require 'wallee-ruby-sdk/models/refund_create' @@ -217,6 +227,7 @@ require 'wallee-ruby-sdk/models/shopify_recurring_order_state' require 'wallee-ruby-sdk/models/shopify_recurring_order_update_request' require 'wallee-ruby-sdk/models/shopify_subscriber' +require 'wallee-ruby-sdk/models/shopify_subscriber_active' require 'wallee-ruby-sdk/models/shopify_subscriber_creation' require 'wallee-ruby-sdk/models/shopify_subscriber_state' require 'wallee-ruby-sdk/models/shopify_subscription' @@ -305,11 +316,15 @@ require 'wallee-ruby-sdk/models/tax_class' require 'wallee-ruby-sdk/models/tax_create' require 'wallee-ruby-sdk/models/tenant_database' +require 'wallee-ruby-sdk/models/terminal_receipt_fetch_request' +require 'wallee-ruby-sdk/models/terminal_receipt_format' require 'wallee-ruby-sdk/models/token' require 'wallee-ruby-sdk/models/token_version' require 'wallee-ruby-sdk/models/token_version_state' require 'wallee-ruby-sdk/models/token_version_type' require 'wallee-ruby-sdk/models/tokenization_mode' +require 'wallee-ruby-sdk/models/tokenized_card_data' +require 'wallee-ruby-sdk/models/tokenized_card_data_create' require 'wallee-ruby-sdk/models/transaction' require 'wallee-ruby-sdk/models/transaction_aware_entity' require 'wallee-ruby-sdk/models/transaction_comment' @@ -329,12 +344,12 @@ require 'wallee-ruby-sdk/models/transaction_void_mode' require 'wallee-ruby-sdk/models/transaction_void_state' require 'wallee-ruby-sdk/models/two_factor_authentication_type' -require 'wallee-ruby-sdk/models/unencrypted_card_data' -require 'wallee-ruby-sdk/models/unencrypted_card_data_create' require 'wallee-ruby-sdk/models/user' require 'wallee-ruby-sdk/models/user_account_role' require 'wallee-ruby-sdk/models/user_space_role' require 'wallee-ruby-sdk/models/user_type' +require 'wallee-ruby-sdk/models/web_app_confirmation_request' +require 'wallee-ruby-sdk/models/web_app_confirmation_response' require 'wallee-ruby-sdk/models/webhook_identity' require 'wallee-ruby-sdk/models/webhook_listener' require 'wallee-ruby-sdk/models/webhook_listener_entity' @@ -344,6 +359,7 @@ require 'wallee-ruby-sdk/models/application_user' require 'wallee-ruby-sdk/models/application_user_create' require 'wallee-ruby-sdk/models/application_user_update' +require 'wallee-ruby-sdk/models/authenticated_card_data' require 'wallee-ruby-sdk/models/charge' require 'wallee-ruby-sdk/models/charge_attempt' require 'wallee-ruby-sdk/models/charge_bank_transaction' @@ -408,6 +424,8 @@ # APIs require 'wallee-ruby-sdk/api/account_service_api' require 'wallee-ruby-sdk/api/application_user_service_api' +require 'wallee-ruby-sdk/api/bank_account_service_api' +require 'wallee-ruby-sdk/api/bank_transaction_service_api' require 'wallee-ruby-sdk/api/card_processing_service_api' require 'wallee-ruby-sdk/api/charge_attempt_service_api' require 'wallee-ruby-sdk/api/charge_bank_transaction_service_api' @@ -417,6 +435,7 @@ require 'wallee-ruby-sdk/api/condition_type_service_api' require 'wallee-ruby-sdk/api/country_service_api' require 'wallee-ruby-sdk/api/country_state_service_api' +require 'wallee-ruby-sdk/api/currency_bank_account_service_api' require 'wallee-ruby-sdk/api/currency_service_api' require 'wallee-ruby-sdk/api/customer_address_service_api' require 'wallee-ruby-sdk/api/customer_comment_service_api' @@ -500,6 +519,7 @@ require 'wallee-ruby-sdk/api/transaction_void_service_api' require 'wallee-ruby-sdk/api/user_account_role_service_api' require 'wallee-ruby-sdk/api/user_space_role_service_api' +require 'wallee-ruby-sdk/api/web_app_service_api' require 'wallee-ruby-sdk/api/webhook_listener_service_api' require 'wallee-ruby-sdk/api/webhook_url_service_api' diff --git a/lib/wallee-ruby-sdk/api/bank_account_service_api.rb b/lib/wallee-ruby-sdk/api/bank_account_service_api.rb new file mode 100644 index 0000000..6d62b3e --- /dev/null +++ b/lib/wallee-ruby-sdk/api/bank_account_service_api.rb @@ -0,0 +1,213 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require "uri" + +module Wallee + class BankAccountService + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # Count + # Counts the number of items in the database as restricted by the given filter. + # @param space_id + # @param [Hash] opts the optional parameters + # @option opts [EntityQueryFilter] :filter The filter which restricts the entities which are used to calculate the count. + # @return [Integer] + def count(space_id, opts = {}) + data, _status_code, _headers = count_with_http_info(space_id, opts) + return data + end + + # Count + # Counts the number of items in the database as restricted by the given filter. + # @param space_id + # @param [Hash] opts the optional parameters + # @option opts [EntityQueryFilter] :filter The filter which restricts the entities which are used to calculate the count. + # @return [Array<(Integer, Fixnum, Hash)>] Integer data, response status code and response headers + def count_with_http_info(space_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: BankAccountService.count ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling BankAccountService.count" if space_id.nil? + # resource path + local_var_path = "/bank-account/count".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'filter']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Integer') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BankAccountService#count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Read + # Reads the entity with the given 'id' and returns it. + # @param space_id + # @param id The ID of the bank account which should be returned. + # @param [Hash] opts the optional parameters + # @return [BankAccount] + def read(space_id, id, opts = {}) + data, _status_code, _headers = read_with_http_info(space_id, id, opts) + return data + end + + # Read + # Reads the entity with the given 'id' and returns it. + # @param space_id + # @param id The ID of the bank account which should be returned. + # @param [Hash] opts the optional parameters + # @return [Array<(BankAccount, Fixnum, Hash)>] BankAccount data, response status code and response headers + def read_with_http_info(space_id, id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: BankAccountService.read ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling BankAccountService.read" if space_id.nil? + # verify the required parameter 'id' is set + fail ArgumentError, "Missing the required parameter 'id' when calling BankAccountService.read" if id.nil? + # resource path + local_var_path = "/bank-account/read".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + query_params[:'id'] = id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['*/*'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'BankAccount') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BankAccountService#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search + # Searches for the entities as specified by the given query. + # @param space_id + # @param query The query restricts the bank accounts which are returned by the search. + # @param [Hash] opts the optional parameters + # @return [Array] + def search(space_id, query, opts = {}) + data, _status_code, _headers = search_with_http_info(space_id, query, opts) + return data + end + + # Search + # Searches for the entities as specified by the given query. + # @param space_id + # @param query The query restricts the bank accounts which are returned by the search. + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def search_with_http_info(space_id, query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: BankAccountService.search ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling BankAccountService.search" if space_id.nil? + # verify the required parameter 'query' is set + fail ArgumentError, "Missing the required parameter 'query' when calling BankAccountService.search" if query.nil? + # resource path + local_var_path = "/bank-account/search".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(query) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BankAccountService#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/wallee-ruby-sdk/api/bank_transaction_service_api.rb b/lib/wallee-ruby-sdk/api/bank_transaction_service_api.rb new file mode 100644 index 0000000..0ae8117 --- /dev/null +++ b/lib/wallee-ruby-sdk/api/bank_transaction_service_api.rb @@ -0,0 +1,213 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require "uri" + +module Wallee + class BankTransactionService + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # Count + # Counts the number of items in the database as restricted by the given filter. + # @param space_id + # @param [Hash] opts the optional parameters + # @option opts [EntityQueryFilter] :filter The filter which restricts the entities which are used to calculate the count. + # @return [Integer] + def count(space_id, opts = {}) + data, _status_code, _headers = count_with_http_info(space_id, opts) + return data + end + + # Count + # Counts the number of items in the database as restricted by the given filter. + # @param space_id + # @param [Hash] opts the optional parameters + # @option opts [EntityQueryFilter] :filter The filter which restricts the entities which are used to calculate the count. + # @return [Array<(Integer, Fixnum, Hash)>] Integer data, response status code and response headers + def count_with_http_info(space_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: BankTransactionService.count ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling BankTransactionService.count" if space_id.nil? + # resource path + local_var_path = "/bank-transaction/count".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'filter']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Integer') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BankTransactionService#count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Read + # Reads the entity with the given 'id' and returns it. + # @param space_id + # @param id The ID of the bank transaction which should be returned. + # @param [Hash] opts the optional parameters + # @return [BankTransaction] + def read(space_id, id, opts = {}) + data, _status_code, _headers = read_with_http_info(space_id, id, opts) + return data + end + + # Read + # Reads the entity with the given 'id' and returns it. + # @param space_id + # @param id The ID of the bank transaction which should be returned. + # @param [Hash] opts the optional parameters + # @return [Array<(BankTransaction, Fixnum, Hash)>] BankTransaction data, response status code and response headers + def read_with_http_info(space_id, id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: BankTransactionService.read ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling BankTransactionService.read" if space_id.nil? + # verify the required parameter 'id' is set + fail ArgumentError, "Missing the required parameter 'id' when calling BankTransactionService.read" if id.nil? + # resource path + local_var_path = "/bank-transaction/read".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + query_params[:'id'] = id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['*/*'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'BankTransaction') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BankTransactionService#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search + # Searches for the entities as specified by the given query. + # @param space_id + # @param query The query restricts the bank transactions which are returned by the search. + # @param [Hash] opts the optional parameters + # @return [Array] + def search(space_id, query, opts = {}) + data, _status_code, _headers = search_with_http_info(space_id, query, opts) + return data + end + + # Search + # Searches for the entities as specified by the given query. + # @param space_id + # @param query The query restricts the bank transactions which are returned by the search. + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def search_with_http_info(space_id, query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: BankTransactionService.search ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling BankTransactionService.search" if space_id.nil? + # verify the required parameter 'query' is set + fail ArgumentError, "Missing the required parameter 'query' when calling BankTransactionService.search" if query.nil? + # resource path + local_var_path = "/bank-transaction/search".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(query) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BankTransactionService#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/wallee-ruby-sdk/api/currency_bank_account_service_api.rb b/lib/wallee-ruby-sdk/api/currency_bank_account_service_api.rb new file mode 100644 index 0000000..f8f3f07 --- /dev/null +++ b/lib/wallee-ruby-sdk/api/currency_bank_account_service_api.rb @@ -0,0 +1,213 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require "uri" + +module Wallee + class CurrencyBankAccountService + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # Count + # Counts the number of items in the database as restricted by the given filter. + # @param space_id + # @param [Hash] opts the optional parameters + # @option opts [EntityQueryFilter] :filter The filter which restricts the entities which are used to calculate the count. + # @return [Integer] + def count(space_id, opts = {}) + data, _status_code, _headers = count_with_http_info(space_id, opts) + return data + end + + # Count + # Counts the number of items in the database as restricted by the given filter. + # @param space_id + # @param [Hash] opts the optional parameters + # @option opts [EntityQueryFilter] :filter The filter which restricts the entities which are used to calculate the count. + # @return [Array<(Integer, Fixnum, Hash)>] Integer data, response status code and response headers + def count_with_http_info(space_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: CurrencyBankAccountService.count ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling CurrencyBankAccountService.count" if space_id.nil? + # resource path + local_var_path = "/currency-bank-account/count".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'filter']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Integer') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CurrencyBankAccountService#count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Read + # Reads the entity with the given 'id' and returns it. + # @param space_id + # @param id The ID of the currency bank account which should be returned. + # @param [Hash] opts the optional parameters + # @return [CurrencyBankAccount] + def read(space_id, id, opts = {}) + data, _status_code, _headers = read_with_http_info(space_id, id, opts) + return data + end + + # Read + # Reads the entity with the given 'id' and returns it. + # @param space_id + # @param id The ID of the currency bank account which should be returned. + # @param [Hash] opts the optional parameters + # @return [Array<(CurrencyBankAccount, Fixnum, Hash)>] CurrencyBankAccount data, response status code and response headers + def read_with_http_info(space_id, id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: CurrencyBankAccountService.read ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling CurrencyBankAccountService.read" if space_id.nil? + # verify the required parameter 'id' is set + fail ArgumentError, "Missing the required parameter 'id' when calling CurrencyBankAccountService.read" if id.nil? + # resource path + local_var_path = "/currency-bank-account/read".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + query_params[:'id'] = id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['*/*'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'CurrencyBankAccount') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CurrencyBankAccountService#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search + # Searches for the entities as specified by the given query. + # @param space_id + # @param query The query restricts the currency bank accounts which are returned by the search. + # @param [Hash] opts the optional parameters + # @return [Array] + def search(space_id, query, opts = {}) + data, _status_code, _headers = search_with_http_info(space_id, query, opts) + return data + end + + # Search + # Searches for the entities as specified by the given query. + # @param space_id + # @param query The query restricts the currency bank accounts which are returned by the search. + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def search_with_http_info(space_id, query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: CurrencyBankAccountService.search ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling CurrencyBankAccountService.search" if space_id.nil? + # verify the required parameter 'query' is set + fail ArgumentError, "Missing the required parameter 'query' when calling CurrencyBankAccountService.search" if query.nil? + # resource path + local_var_path = "/currency-bank-account/search".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(query) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CurrencyBankAccountService#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb b/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb index c28efb3..a04ff23 100644 --- a/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb +++ b/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb @@ -95,5 +95,76 @@ def perform_transaction_with_http_info(space_id, transaction_id, terminal_id, op end return data, status_code, headers end + + # Perform Payment Terminal Transaction (using TID) + # Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off. + # @param space_id + # @param transaction_id The ID of the transaction which is used to process with the terminal. + # @param terminal_identifier The identifier (aka TID) of the terminal which should be used to process the transaction. + # @param [Hash] opts the optional parameters + # @option opts [String] :language The language in which the messages should be rendered in. + # @return [Transaction] + def perform_transaction_by_identifier(space_id, transaction_id, terminal_identifier, opts = {}) + data, _status_code, _headers = perform_transaction_by_identifier_with_http_info(space_id, transaction_id, terminal_identifier, opts) + return data + end + + # Perform Payment Terminal Transaction (using TID) + # Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off. + # @param space_id + # @param transaction_id The ID of the transaction which is used to process with the terminal. + # @param terminal_identifier The identifier (aka TID) of the terminal which should be used to process the transaction. + # @param [Hash] opts the optional parameters + # @option opts [String] :language The language in which the messages should be rendered in. + # @return [Array<(Transaction, Fixnum, Hash)>] Transaction data, response status code and response headers + def perform_transaction_by_identifier_with_http_info(space_id, transaction_id, terminal_identifier, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: PaymentTerminalTillService.perform_transaction_by_identifier ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling PaymentTerminalTillService.perform_transaction_by_identifier" if space_id.nil? + # verify the required parameter 'transaction_id' is set + fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentTerminalTillService.perform_transaction_by_identifier" if transaction_id.nil? + # verify the required parameter 'terminal_identifier' is set + fail ArgumentError, "Missing the required parameter 'terminal_identifier' when calling PaymentTerminalTillService.perform_transaction_by_identifier" if terminal_identifier.nil? + # resource path + local_var_path = "/payment-terminal-till/perform-transaction-by-identifier".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + query_params[:'transactionId'] = transaction_id + query_params[:'terminalIdentifier'] = terminal_identifier + query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Transaction') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PaymentTerminalTillService#perform_transaction_by_identifier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb b/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb index 8c08408..307b226 100644 --- a/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb +++ b/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb @@ -209,5 +209,67 @@ def search_with_http_info(space_id, query, opts = {}) end return data, status_code, headers end + + # Update + # This updates the entity with the given properties. Only those properties which should be updated can be provided. The 'id' and 'version' are required to identify the entity. + # @param space_id + # @param query The Shopify subscriber object with all the properties which should be updated. The id and the version are required properties. + # @param [Hash] opts the optional parameters + # @return [ShopifySubscriber] + def update(space_id, query, opts = {}) + data, _status_code, _headers = update_with_http_info(space_id, query, opts) + return data + end + + # Update + # This updates the entity with the given properties. Only those properties which should be updated can be provided. The 'id' and 'version' are required to identify the entity. + # @param space_id + # @param query The Shopify subscriber object with all the properties which should be updated. The id and the version are required properties. + # @param [Hash] opts the optional parameters + # @return [Array<(ShopifySubscriber, Fixnum, Hash)>] ShopifySubscriber data, response status code and response headers + def update_with_http_info(space_id, query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: ShopifySubscriberService.update ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling ShopifySubscriberService.update" if space_id.nil? + # verify the required parameter 'query' is set + fail ArgumentError, "Missing the required parameter 'query' when calling ShopifySubscriberService.update" if query.nil? + # resource path + local_var_path = "/shopify-subscriber/update".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = ['application/json;charset=utf-8'] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(query) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ShopifySubscriber') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShopifySubscriberService#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/wallee-ruby-sdk/api/transaction_terminal_service_api.rb b/lib/wallee-ruby-sdk/api/transaction_terminal_service_api.rb index c4516c4..af96968 100644 --- a/lib/wallee-ruby-sdk/api/transaction_terminal_service_api.rb +++ b/lib/wallee-ruby-sdk/api/transaction_terminal_service_api.rb @@ -25,48 +25,37 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end - # getTerminalReceipt - # Returns the PDF document for the requested terminal receipt with the given page width. + # Fetch Receipts + # Returns all receipts for the requested terminal transaction. # @param space_id - # @param transaction_id The ID of the transaction to get the receipt for. - # @param type_id - # @param width + # @param request # @param [Hash] opts the optional parameters - # @return [RenderedTerminalReceipt] - def receipt(space_id, transaction_id, type_id, width, opts = {}) - data, _status_code, _headers = receipt_with_http_info(space_id, transaction_id, type_id, width, opts) + # @return [Array] + def fetch_receipts(space_id, request, opts = {}) + data, _status_code, _headers = fetch_receipts_with_http_info(space_id, request, opts) return data end - # getTerminalReceipt - # Returns the PDF document for the requested terminal receipt with the given page width. + # Fetch Receipts + # Returns all receipts for the requested terminal transaction. # @param space_id - # @param transaction_id The ID of the transaction to get the receipt for. - # @param type_id - # @param width + # @param request # @param [Hash] opts the optional parameters - # @return [Array<(RenderedTerminalReceipt, Fixnum, Hash)>] RenderedTerminalReceipt data, response status code and response headers - def receipt_with_http_info(space_id, transaction_id, type_id, width, opts = {}) + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def fetch_receipts_with_http_info(space_id, request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TransactionTerminalService.receipt ..." + @api_client.config.logger.debug "Calling API: TransactionTerminalService.fetch_receipts ..." end # verify the required parameter 'space_id' is set - fail ArgumentError, "Missing the required parameter 'space_id' when calling TransactionTerminalService.receipt" if space_id.nil? - # verify the required parameter 'transaction_id' is set - fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionTerminalService.receipt" if transaction_id.nil? - # verify the required parameter 'type_id' is set - fail ArgumentError, "Missing the required parameter 'type_id' when calling TransactionTerminalService.receipt" if type_id.nil? - # verify the required parameter 'width' is set - fail ArgumentError, "Missing the required parameter 'width' when calling TransactionTerminalService.receipt" if width.nil? + fail ArgumentError, "Missing the required parameter 'space_id' when calling TransactionTerminalService.fetch_receipts" if space_id.nil? + # verify the required parameter 'request' is set + fail ArgumentError, "Missing the required parameter 'request' when calling TransactionTerminalService.fetch_receipts" if request.nil? # resource path - local_var_path = "/transaction-terminal/receipt".sub('{format}','json') + local_var_path = "/transaction-terminal/fetch-receipts".sub('{format}','json') # query parameters query_params = {} query_params[:'spaceId'] = space_id - query_params[:'transactionId'] = transaction_id - query_params[:'typeId'] = type_id - query_params[:'width'] = width # header parameters header_params = {} @@ -76,24 +65,24 @@ def receipt_with_http_info(space_id, transaction_id, type_id, width, opts = {}) local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' - local_header_content_type = ['*/*'] + local_header_content_type = ['application/json;charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) - post_body = nil + post_body = @api_client.object_to_http_body(request) auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'RenderedTerminalReceipt') + :return_type => 'Array') if @api_client.config.debugging - @api_client.config.logger.debug "API called: TransactionTerminalService#receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TransactionTerminalService#fetch_receipts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/lib/wallee-ruby-sdk/api/web_app_service_api.rb b/lib/wallee-ruby-sdk/api/web_app_service_api.rb new file mode 100644 index 0000000..5e68177 --- /dev/null +++ b/lib/wallee-ruby-sdk/api/web_app_service_api.rb @@ -0,0 +1,200 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require "uri" + +module Wallee + class WebAppService + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # Check Installation + # 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. + # @param space_id This parameter identifies the space which should be checked if the web app is installed. + # @param [Hash] opts the optional parameters + # @return [BOOLEAN] + def check_installation(space_id, opts = {}) + data, _status_code, _headers = check_installation_with_http_info(space_id, opts) + return data + end + + # Check Installation + # 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. + # @param space_id This parameter identifies the space which should be checked if the web app is installed. + # @param [Hash] opts the optional parameters + # @return [Array<(BOOLEAN, Fixnum, Hash)>] BOOLEAN data, response status code and response headers + def check_installation_with_http_info(space_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: WebAppService.check_installation ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling WebAppService.check_installation" if space_id.nil? + # resource path + local_var_path = "/web-app/check-installation".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = [] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'BOOLEAN') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WebAppService#check_installation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Confirm + # 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. + # @param request + # @param [Hash] opts the optional parameters + # @return [WebAppConfirmationResponse] + def confirm(request, opts = {}) + data, _status_code, _headers = confirm_with_http_info(request, opts) + return data + end + + # Confirm + # 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. + # @param request + # @param [Hash] opts the optional parameters + # @return [Array<(WebAppConfirmationResponse, Fixnum, Hash)>] WebAppConfirmationResponse data, response status code and response headers + def confirm_with_http_info(request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: WebAppService.confirm ..." + end + # verify the required parameter 'request' is set + fail ArgumentError, "Missing the required parameter 'request' when calling WebAppService.confirm" if request.nil? + # resource path + local_var_path = "/web-app/confirm".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = ['application/json;charset=utf-8'] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = [] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(request) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'WebAppConfirmationResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WebAppService#confirm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Uninstall + # 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. + # @param space_id This parameter identifies the space within which the web app should be uninstalled. + # @param [Hash] opts the optional parameters + # @return [nil] + def uninstall(space_id, opts = {}) + uninstall_with_http_info(space_id, opts) + return nil + end + + # Uninstall + # 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. + # @param space_id This parameter identifies the space within which the web app should be uninstalled. + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def uninstall_with_http_info(space_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: WebAppService.uninstall ..." + end + # verify the required parameter 'space_id' is set + fail ArgumentError, "Missing the required parameter 'space_id' when calling WebAppService.uninstall" if space_id.nil? + # resource path + local_var_path = "/web-app/uninstall".sub('{format}','json') + + # query parameters + query_params = {} + query_params[:'spaceId'] = space_id + + # header parameters + header_params = {} + + # HTTP header 'Accept' (if needed) + local_header_accept = [] + local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result + + # HTTP header 'Content-Type' + local_header_content_type = [] + header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WebAppService#uninstall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/wallee-ruby-sdk/models/authenticated_card_data.rb b/lib/wallee-ruby-sdk/models/authenticated_card_data.rb new file mode 100644 index 0000000..3f78c6f --- /dev/null +++ b/lib/wallee-ruby-sdk/models/authenticated_card_data.rb @@ -0,0 +1,221 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # This model holds the card data and optional cardholder authentication details. + class AuthenticatedCardData + # The additional authentication value used to secure the tokenized card transactions. + attr_accessor :cryptogram + + # + attr_accessor :recurring_indicator + + # + attr_accessor :token_requestor_id + + # 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). + attr_accessor :cardholder_authentication + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'cryptogram' => :'cryptogram', + :'recurring_indicator' => :'recurringIndicator', + :'token_requestor_id' => :'tokenRequestorId', + :'cardholder_authentication' => :'cardholderAuthentication' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'cryptogram' => :'CardCryptogram', + :'recurring_indicator' => :'RecurringIndicator', + :'token_requestor_id' => :'String', + :'cardholder_authentication' => :'CardholderAuthentication' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'cryptogram') + self.cryptogram = attributes[:'cryptogram'] + end + + if attributes.has_key?(:'recurringIndicator') + self.recurring_indicator = attributes[:'recurringIndicator'] + end + + if attributes.has_key?(:'tokenRequestorId') + self.token_requestor_id = attributes[:'tokenRequestorId'] + end + + if attributes.has_key?(:'cardholderAuthentication') + self.cardholder_authentication = attributes[:'cardholderAuthentication'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cryptogram == o.cryptogram && + recurring_indicator == o.recurring_indicator && + token_requestor_id == o.token_requestor_id && + cardholder_authentication == o.cardholder_authentication + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [cryptogram, recurring_indicator, token_requestor_id, cardholder_authentication].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/unencrypted_card_data.rb b/lib/wallee-ruby-sdk/models/authenticated_card_data_create.rb similarity index 70% rename from lib/wallee-ruby-sdk/models/unencrypted_card_data.rb rename to lib/wallee-ruby-sdk/models/authenticated_card_data_create.rb index 0958259..37b69b2 100644 --- a/lib/wallee-ruby-sdk/models/unencrypted_card_data.rb +++ b/lib/wallee-ruby-sdk/models/authenticated_card_data_create.rb @@ -18,27 +18,47 @@ require 'date' module Wallee - # This model holds the card data in plain. - class UnencryptedCardData + # This model holds the card data and optional cardholder authentication details. + class AuthenticatedCardDataCreate # The card holder name is the name printed onto the card. It identifies the person who owns the card. attr_accessor :card_holder_name # 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. attr_accessor :card_verification_code + # 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). + attr_accessor :cardholder_authentication + + # The additional authentication value used to secure the tokenized card transactions. + attr_accessor :cryptogram + # 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). attr_accessor :expiry_date # The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. attr_accessor :primary_account_number + # + attr_accessor :recurring_indicator + + # + attr_accessor :scheme_transaction_reference + + # + attr_accessor :token_requestor_id + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'card_holder_name' => :'cardHolderName', :'card_verification_code' => :'cardVerificationCode', + :'cardholder_authentication' => :'cardholderAuthentication', + :'cryptogram' => :'cryptogram', :'expiry_date' => :'expiryDate', - :'primary_account_number' => :'primaryAccountNumber' + :'primary_account_number' => :'primaryAccountNumber', + :'recurring_indicator' => :'recurringIndicator', + :'scheme_transaction_reference' => :'schemeTransactionReference', + :'token_requestor_id' => :'tokenRequestorId' } end @@ -47,8 +67,13 @@ def self.swagger_types { :'card_holder_name' => :'String', :'card_verification_code' => :'String', + :'cardholder_authentication' => :'CardholderAuthenticationCreate', + :'cryptogram' => :'CardCryptogramCreate', :'expiry_date' => :'String', - :'primary_account_number' => :'String' + :'primary_account_number' => :'String', + :'recurring_indicator' => :'RecurringIndicator', + :'scheme_transaction_reference' => :'String', + :'token_requestor_id' => :'String' } end @@ -68,6 +93,14 @@ def initialize(attributes = {}) self.card_verification_code = attributes[:'cardVerificationCode'] end + if attributes.has_key?(:'cardholderAuthentication') + self.cardholder_authentication = attributes[:'cardholderAuthentication'] + end + + if attributes.has_key?(:'cryptogram') + self.cryptogram = attributes[:'cryptogram'] + end + if attributes.has_key?(:'expiryDate') self.expiry_date = attributes[:'expiryDate'] end @@ -75,6 +108,18 @@ def initialize(attributes = {}) if attributes.has_key?(:'primaryAccountNumber') self.primary_account_number = attributes[:'primaryAccountNumber'] end + + if attributes.has_key?(:'recurringIndicator') + self.recurring_indicator = attributes[:'recurringIndicator'] + end + + if attributes.has_key?(:'schemeTransactionReference') + self.scheme_transaction_reference = attributes[:'schemeTransactionReference'] + end + + if attributes.has_key?(:'tokenRequestorId') + self.token_requestor_id = attributes[:'tokenRequestorId'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -93,14 +138,22 @@ def list_invalid_properties invalid_properties.push('invalid value for "card_verification_code", the character length must be great than or equal to 3.') end - if !@primary_account_number.nil? && @primary_account_number.to_s.length > 30 + if @primary_account_number.nil? + invalid_properties.push('invalid value for "primary_account_number", primary_account_number cannot be nil.') + end + + if @primary_account_number.to_s.length > 30 invalid_properties.push('invalid value for "primary_account_number", the character length must be smaller than or equal to 30.') end - if !@primary_account_number.nil? && @primary_account_number.to_s.length < 10 + if @primary_account_number.to_s.length < 10 invalid_properties.push('invalid value for "primary_account_number", the character length must be great than or equal to 10.') end + if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100 + invalid_properties.push('invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.') + end + invalid_properties end @@ -110,8 +163,10 @@ def valid? return false if !@card_holder_name.nil? && @card_holder_name.to_s.length > 100 return false if !@card_verification_code.nil? && @card_verification_code.to_s.length > 4 return false if !@card_verification_code.nil? && @card_verification_code.to_s.length < 3 - return false if !@primary_account_number.nil? && @primary_account_number.to_s.length > 30 - return false if !@primary_account_number.nil? && @primary_account_number.to_s.length < 10 + return false if @primary_account_number.nil? + return false if @primary_account_number.to_s.length > 30 + return false if @primary_account_number.to_s.length < 10 + return false if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100 true end @@ -142,17 +197,31 @@ def card_verification_code=(card_verification_code) # Custom attribute writer method with validation # @param [Object] primary_account_number Value to be assigned def primary_account_number=(primary_account_number) - if !primary_account_number.nil? && primary_account_number.to_s.length > 30 + if primary_account_number.nil? + fail ArgumentError, 'primary_account_number cannot be nil' + end + + if primary_account_number.to_s.length > 30 fail ArgumentError, 'invalid value for "primary_account_number", the character length must be smaller than or equal to 30.' end - if !primary_account_number.nil? && primary_account_number.to_s.length < 10 + if primary_account_number.to_s.length < 10 fail ArgumentError, 'invalid value for "primary_account_number", the character length must be great than or equal to 10.' end @primary_account_number = primary_account_number end + # Custom attribute writer method with validation + # @param [Object] scheme_transaction_reference Value to be assigned + def scheme_transaction_reference=(scheme_transaction_reference) + if !scheme_transaction_reference.nil? && scheme_transaction_reference.to_s.length > 100 + fail ArgumentError, 'invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.' + end + + @scheme_transaction_reference = scheme_transaction_reference + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -160,8 +229,13 @@ def ==(o) self.class == o.class && card_holder_name == o.card_holder_name && card_verification_code == o.card_verification_code && + cardholder_authentication == o.cardholder_authentication && + cryptogram == o.cryptogram && expiry_date == o.expiry_date && - primary_account_number == o.primary_account_number + primary_account_number == o.primary_account_number && + recurring_indicator == o.recurring_indicator && + scheme_transaction_reference == o.scheme_transaction_reference && + token_requestor_id == o.token_requestor_id end # @see the `==` method @@ -173,7 +247,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [card_holder_name, card_verification_code, expiry_date, primary_account_number].hash + [card_holder_name, card_verification_code, cardholder_authentication, cryptogram, expiry_date, primary_account_number, recurring_indicator, scheme_transaction_reference, token_requestor_id].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/card_authentication_response.rb b/lib/wallee-ruby-sdk/models/card_authentication_response.rb new file mode 100644 index 0000000..f1253de --- /dev/null +++ b/lib/wallee-ruby-sdk/models/card_authentication_response.rb @@ -0,0 +1,38 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + class CardAuthenticationResponse + + ENROLLMENT_VERIFICATION_ERROR = 'ENROLLMENT_VERIFICATION_ERROR'.freeze + NOT_ENROLLED = 'NOT_ENROLLED'.freeze + AUTHENTICATION_ERROR = 'AUTHENTICATION_ERROR'.freeze + AUTHENTICATION_NOT_REQUIRED = 'AUTHENTICATION_NOT_REQUIRED'.freeze + FULLY_AUTHENTICATED = 'FULLY_AUTHENTICATED'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CardAuthenticationResponse.constants.select { |c| CardAuthenticationResponse::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CardAuthenticationResponse" if constantValues.empty? + value + end + end +end diff --git a/lib/wallee-ruby-sdk/models/card_authentication_version.rb b/lib/wallee-ruby-sdk/models/card_authentication_version.rb new file mode 100644 index 0000000..4fd5964 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/card_authentication_version.rb @@ -0,0 +1,35 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + class CardAuthenticationVersion + + V1 = 'V1'.freeze + V2 = 'V2'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CardAuthenticationVersion.constants.select { |c| CardAuthenticationVersion::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CardAuthenticationVersion" if constantValues.empty? + value + end + end +end diff --git a/lib/wallee-ruby-sdk/models/card_cryptogram.rb b/lib/wallee-ruby-sdk/models/card_cryptogram.rb new file mode 100644 index 0000000..ca45df0 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/card_cryptogram.rb @@ -0,0 +1,201 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # This model holds the additional card authentication. + class CardCryptogram + # + attr_accessor :type + + # + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'type' => :'CardCryptogramType', + :'value' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.has_key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [type, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/card_cryptogram_create.rb b/lib/wallee-ruby-sdk/models/card_cryptogram_create.rb new file mode 100644 index 0000000..3d5a8b4 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/card_cryptogram_create.rb @@ -0,0 +1,211 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # This model holds the additional card authentication. + class CardCryptogramCreate + # + attr_accessor :type + + # + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'type' => :'CardCryptogramType', + :'value' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.has_key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @value.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [type, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/card_cryptogram_type.rb b/lib/wallee-ruby-sdk/models/card_cryptogram_type.rb new file mode 100644 index 0000000..a224ee7 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/card_cryptogram_type.rb @@ -0,0 +1,34 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + class CardCryptogramType + + SCHEME_TOKEN = 'SCHEME_TOKEN'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CardCryptogramType.constants.select { |c| CardCryptogramType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CardCryptogramType" if constantValues.empty? + value + end + end +end diff --git a/lib/wallee-ruby-sdk/models/cardholder_authentication.rb b/lib/wallee-ruby-sdk/models/cardholder_authentication.rb new file mode 100644 index 0000000..4ca38d6 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/cardholder_authentication.rb @@ -0,0 +1,231 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # This model holds the cardholder authentication data (e.g. 3-D Secure authentication). + class CardholderAuthentication + # The authentication identifier as assigned by authentication system (e.g. XID or DSTransactionID). + attr_accessor :authentication_identifier + + # + attr_accessor :authentication_response + + # The cardholder authentication value. Also known as Cardholder Authentication Verification Value (CAVV). + attr_accessor :authentication_value + + # The Electronic Commerce Indicator (ECI) value. The ECI is returned by authentication system and indicates the outcome/status of authentication. + attr_accessor :electronic_commerce_indicator + + # + attr_accessor :version + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'authentication_identifier' => :'authenticationIdentifier', + :'authentication_response' => :'authenticationResponse', + :'authentication_value' => :'authenticationValue', + :'electronic_commerce_indicator' => :'electronicCommerceIndicator', + :'version' => :'version' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'authentication_identifier' => :'String', + :'authentication_response' => :'CardAuthenticationResponse', + :'authentication_value' => :'String', + :'electronic_commerce_indicator' => :'String', + :'version' => :'CardAuthenticationVersion' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'authenticationIdentifier') + self.authentication_identifier = attributes[:'authenticationIdentifier'] + end + + if attributes.has_key?(:'authenticationResponse') + self.authentication_response = attributes[:'authenticationResponse'] + end + + if attributes.has_key?(:'authenticationValue') + self.authentication_value = attributes[:'authenticationValue'] + end + + if attributes.has_key?(:'electronicCommerceIndicator') + self.electronic_commerce_indicator = attributes[:'electronicCommerceIndicator'] + end + + if attributes.has_key?(:'version') + self.version = attributes[:'version'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + authentication_identifier == o.authentication_identifier && + authentication_response == o.authentication_response && + authentication_value == o.authentication_value && + electronic_commerce_indicator == o.electronic_commerce_indicator && + version == o.version + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [authentication_identifier, authentication_response, authentication_value, electronic_commerce_indicator, version].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/cardholder_authentication_create.rb b/lib/wallee-ruby-sdk/models/cardholder_authentication_create.rb new file mode 100644 index 0000000..eae8a02 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/cardholder_authentication_create.rb @@ -0,0 +1,241 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # This model holds the cardholder authentication data (e.g. 3-D Secure authentication). + class CardholderAuthenticationCreate + # The authentication identifier as assigned by authentication system (e.g. XID or DSTransactionID). + attr_accessor :authentication_identifier + + # + attr_accessor :authentication_response + + # The cardholder authentication value. Also known as Cardholder Authentication Verification Value (CAVV). + attr_accessor :authentication_value + + # The Electronic Commerce Indicator (ECI) value. The ECI is returned by authentication system and indicates the outcome/status of authentication. + attr_accessor :electronic_commerce_indicator + + # + attr_accessor :version + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'authentication_identifier' => :'authenticationIdentifier', + :'authentication_response' => :'authenticationResponse', + :'authentication_value' => :'authenticationValue', + :'electronic_commerce_indicator' => :'electronicCommerceIndicator', + :'version' => :'version' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'authentication_identifier' => :'String', + :'authentication_response' => :'CardAuthenticationResponse', + :'authentication_value' => :'String', + :'electronic_commerce_indicator' => :'String', + :'version' => :'CardAuthenticationVersion' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'authenticationIdentifier') + self.authentication_identifier = attributes[:'authenticationIdentifier'] + end + + if attributes.has_key?(:'authenticationResponse') + self.authentication_response = attributes[:'authenticationResponse'] + end + + if attributes.has_key?(:'authenticationValue') + self.authentication_value = attributes[:'authenticationValue'] + end + + if attributes.has_key?(:'electronicCommerceIndicator') + self.electronic_commerce_indicator = attributes[:'electronicCommerceIndicator'] + end + + if attributes.has_key?(:'version') + self.version = attributes[:'version'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @authentication_response.nil? + invalid_properties.push('invalid value for "authentication_response", authentication_response cannot be nil.') + end + + if @version.nil? + invalid_properties.push('invalid value for "version", version cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @authentication_response.nil? + return false if @version.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + authentication_identifier == o.authentication_identifier && + authentication_response == o.authentication_response && + authentication_value == o.authentication_value && + electronic_commerce_indicator == o.electronic_commerce_indicator && + version == o.version + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [authentication_identifier, authentication_response, authentication_value, electronic_commerce_indicator, version].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/charge_bank_transaction.rb b/lib/wallee-ruby-sdk/models/charge_bank_transaction.rb index 5e01886..1b00801 100644 --- a/lib/wallee-ruby-sdk/models/charge_bank_transaction.rb +++ b/lib/wallee-ruby-sdk/models/charge_bank_transaction.rb @@ -80,7 +80,7 @@ def self.swagger_types :'completion' => :'Integer', :'language' => :'String', :'space_view_id' => :'Integer', - :'transaction' => :'Integer', + :'transaction' => :'Transaction', :'transaction_currency_amount' => :'Float', :'transaction_currency_value_amount' => :'Float', :'version' => :'Integer' diff --git a/lib/wallee-ruby-sdk/models/payment_terminal.rb b/lib/wallee-ruby-sdk/models/payment_terminal.rb index 56355d5..b572cb1 100644 --- a/lib/wallee-ruby-sdk/models/payment_terminal.rb +++ b/lib/wallee-ruby-sdk/models/payment_terminal.rb @@ -23,6 +23,9 @@ class PaymentTerminal # attr_accessor :configuration_version + # + attr_accessor :default_currency + # The ID is the primary key of the entity. The ID identifies the entity uniquely. attr_accessor :id @@ -54,6 +57,7 @@ class PaymentTerminal def self.attribute_map { :'configuration_version' => :'configurationVersion', + :'default_currency' => :'defaultCurrency', :'id' => :'id', :'identifier' => :'identifier', :'linked_space_id' => :'linkedSpaceId', @@ -70,6 +74,7 @@ def self.attribute_map def self.swagger_types { :'configuration_version' => :'PaymentTerminalConfigurationVersion', + :'default_currency' => :'String', :'id' => :'Integer', :'identifier' => :'String', :'linked_space_id' => :'Integer', @@ -94,6 +99,10 @@ def initialize(attributes = {}) self.configuration_version = attributes[:'configurationVersion'] end + if attributes.has_key?(:'defaultCurrency') + self.default_currency = attributes[:'defaultCurrency'] + end + if attributes.has_key?(:'id') self.id = attributes[:'id'] end @@ -165,6 +174,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && configuration_version == o.configuration_version && + default_currency == o.default_currency && id == o.id && identifier == o.identifier && linked_space_id == o.linked_space_id && @@ -185,7 +195,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [configuration_version, id, identifier, linked_space_id, location_version, name, planned_purge_date, state, type, version].hash + [configuration_version, default_currency, id, identifier, linked_space_id, location_version, name, planned_purge_date, state, type, version].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb b/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb index c4b6ba1..a299911 100644 --- a/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb +++ b/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb @@ -32,6 +32,9 @@ class PaymentTerminalConfigurationVersion # The created on date indicates the date on which the entity was stored into the database. attr_accessor :created_on + # The currency is derived by default from the terminal location. By setting a specific currency the derived currency is overridden. + attr_accessor :default_currency + # The ID is the primary key of the entity. The ID identifies the entity uniquely. attr_accessor :id @@ -66,6 +69,7 @@ def self.attribute_map :'connector_configurations' => :'connectorConfigurations', :'created_by' => :'createdBy', :'created_on' => :'createdOn', + :'default_currency' => :'defaultCurrency', :'id' => :'id', :'linked_space_id' => :'linkedSpaceId', :'maintenance_window_duration' => :'maintenanceWindowDuration', @@ -85,6 +89,7 @@ def self.swagger_types :'connector_configurations' => :'Array', :'created_by' => :'Integer', :'created_on' => :'DateTime', + :'default_currency' => :'String', :'id' => :'Integer', :'linked_space_id' => :'Integer', :'maintenance_window_duration' => :'String', @@ -123,6 +128,10 @@ def initialize(attributes = {}) self.created_on = attributes[:'createdOn'] end + if attributes.has_key?(:'defaultCurrency') + self.default_currency = attributes[:'defaultCurrency'] + end + if attributes.has_key?(:'id') self.id = attributes[:'id'] end @@ -182,6 +191,7 @@ def ==(o) connector_configurations == o.connector_configurations && created_by == o.created_by && created_on == o.created_on && + default_currency == o.default_currency && id == o.id && linked_space_id == o.linked_space_id && maintenance_window_duration == o.maintenance_window_duration && @@ -202,7 +212,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [configuration, connector_configurations, created_by, created_on, id, linked_space_id, maintenance_window_duration, maintenance_window_start, planned_purge_date, state, time_zone, version, version_applied_immediately].hash + [configuration, connector_configurations, created_by, created_on, default_currency, id, linked_space_id, maintenance_window_duration, maintenance_window_start, planned_purge_date, state, time_zone, version, version_applied_immediately].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/payment_terminal_receipt_type.rb b/lib/wallee-ruby-sdk/models/payment_terminal_receipt_type.rb new file mode 100644 index 0000000..1a1388a --- /dev/null +++ b/lib/wallee-ruby-sdk/models/payment_terminal_receipt_type.rb @@ -0,0 +1,215 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # + class PaymentTerminalReceiptType + # + attr_accessor :description + + # The ID is the primary key of the entity. The ID identifies the entity uniquely. + attr_accessor :id + + # + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'description' => :'description', + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'description' => :'Hash', + :'id' => :'Integer', + :'name' => :'Hash' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'description') + if (value = attributes[:'description']).is_a?(Hash) + self.description = value + end + end + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.has_key?(:'name') + if (value = attributes[:'name']).is_a?(Hash) + self.name = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [description, id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/permission.rb b/lib/wallee-ruby-sdk/models/permission.rb index fca2b01..0eddf7d 100644 --- a/lib/wallee-ruby-sdk/models/permission.rb +++ b/lib/wallee-ruby-sdk/models/permission.rb @@ -50,6 +50,9 @@ class Permission # attr_accessor :two_factor_required + # + attr_accessor :web_app_enabled + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -62,7 +65,8 @@ def self.attribute_map :'parent' => :'parent', :'path_to_root' => :'pathToRoot', :'title' => :'title', - :'two_factor_required' => :'twoFactorRequired' + :'two_factor_required' => :'twoFactorRequired', + :'web_app_enabled' => :'webAppEnabled' } end @@ -78,7 +82,8 @@ def self.swagger_types :'parent' => :'Integer', :'path_to_root' => :'Array', :'title' => :'Hash', - :'two_factor_required' => :'BOOLEAN' + :'two_factor_required' => :'BOOLEAN', + :'web_app_enabled' => :'BOOLEAN' } end @@ -137,6 +142,10 @@ def initialize(attributes = {}) if attributes.has_key?(:'twoFactorRequired') self.two_factor_required = attributes[:'twoFactorRequired'] end + + if attributes.has_key?(:'webAppEnabled') + self.web_app_enabled = attributes[:'webAppEnabled'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -166,7 +175,8 @@ def ==(o) parent == o.parent && path_to_root == o.path_to_root && title == o.title && - two_factor_required == o.two_factor_required + two_factor_required == o.two_factor_required && + web_app_enabled == o.web_app_enabled end # @see the `==` method @@ -178,7 +188,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [description, feature, group, id, leaf, name, parent, path_to_root, title, two_factor_required].hash + [description, feature, group, id, leaf, name, parent, path_to_root, title, two_factor_required, web_app_enabled].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/recurring_indicator.rb b/lib/wallee-ruby-sdk/models/recurring_indicator.rb new file mode 100644 index 0000000..1be6d7d --- /dev/null +++ b/lib/wallee-ruby-sdk/models/recurring_indicator.rb @@ -0,0 +1,37 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + class RecurringIndicator + + REGULAR_TRANSACTION = 'REGULAR_TRANSACTION'.freeze + INITIAL_RECURRING_TRANSACTION = 'INITIAL_RECURRING_TRANSACTION'.freeze + MERCHANT_INITIATED_RECURRING_TRANSACTION = 'MERCHANT_INITIATED_RECURRING_TRANSACTION'.freeze + CUSTOMER_INITIATED_RECURRING_TRANSACTION = 'CUSTOMER_INITIATED_RECURRING_TRANSACTION'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = RecurringIndicator.constants.select { |c| RecurringIndicator::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #RecurringIndicator" if constantValues.empty? + value + end + end +end diff --git a/lib/wallee-ruby-sdk/models/refund_bank_transaction.rb b/lib/wallee-ruby-sdk/models/refund_bank_transaction.rb index 433e8a9..639696c 100644 --- a/lib/wallee-ruby-sdk/models/refund_bank_transaction.rb +++ b/lib/wallee-ruby-sdk/models/refund_bank_transaction.rb @@ -74,7 +74,7 @@ def self.swagger_types :'linked_transaction' => :'Integer', :'bank_transaction' => :'BankTransaction', :'language' => :'String', - :'refund' => :'Integer', + :'refund' => :'Refund', :'refund_currency_amount' => :'Float', :'refund_currency_value_amount' => :'Float', :'space_view_id' => :'Integer', diff --git a/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb b/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb index 2097389..d95e68e 100644 --- a/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb +++ b/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb @@ -79,7 +79,7 @@ def self.swagger_types :'bank_transaction' => :'BankTransaction', :'language' => :'String', :'line_items' => :'Array', - :'refund' => :'Integer', + :'refund' => :'Refund', :'refund_currency_amount' => :'Float', :'refund_currency_value_amount' => :'Float', :'space_view_id' => :'Integer', diff --git a/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb b/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb index 8e58e57..6d78f1d 100644 --- a/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb +++ b/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb @@ -20,17 +20,25 @@ module Wallee # class RenderedTerminalReceipt - # + # The data property contains the binary data of the receipt document encoded as base 64 encoded string. attr_accessor :data - # + # The mime type indicates the format of the receipt document. The mime type depends on the requested receipt format. attr_accessor :mime_type + # The terminal might or might not print the receipt. This property is set to true when the configuration of the terminal forces the printing and the device supports the receipt printing. + attr_accessor :printed + + # Each receipt has a different usage. The receipt type indicates for what resp. for whom the document is for. + attr_accessor :receipt_type + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'data' => :'data', - :'mime_type' => :'mimeType' + :'mime_type' => :'mimeType', + :'printed' => :'printed', + :'receipt_type' => :'receiptType' } end @@ -38,7 +46,9 @@ def self.attribute_map def self.swagger_types { :'data' => :'Array', - :'mime_type' => :'String' + :'mime_type' => :'String', + :'printed' => :'BOOLEAN', + :'receipt_type' => :'PaymentTerminalReceiptType' } end @@ -59,6 +69,14 @@ def initialize(attributes = {}) if attributes.has_key?(:'mimeType') self.mime_type = attributes[:'mimeType'] end + + if attributes.has_key?(:'printed') + self.printed = attributes[:'printed'] + end + + if attributes.has_key?(:'receiptType') + self.receipt_type = attributes[:'receiptType'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -80,7 +98,9 @@ def ==(o) return true if self.equal?(o) self.class == o.class && data == o.data && - mime_type == o.mime_type + mime_type == o.mime_type && + printed == o.printed && + receipt_type == o.receipt_type end # @see the `==` method @@ -92,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [data, mime_type].hash + [data, mime_type, printed, receipt_type].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/shopify_subscriber_active.rb b/lib/wallee-ruby-sdk/models/shopify_subscriber_active.rb new file mode 100644 index 0000000..639bf7a --- /dev/null +++ b/lib/wallee-ruby-sdk/models/shopify_subscriber_active.rb @@ -0,0 +1,241 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # + class ShopifySubscriberActive + # The ID is the primary key of the entity. The ID identifies the entity uniquely. + attr_accessor :id + + # The version number indicates the version of the entity. The version is incremented whenever the entity is changed. + attr_accessor :version + + # + attr_accessor :email_address + + # The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. + attr_accessor :external_id + + # + attr_accessor :phone_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'version' => :'version', + :'email_address' => :'emailAddress', + :'external_id' => :'externalId', + :'phone_number' => :'phoneNumber' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'id' => :'Integer', + :'version' => :'Integer', + :'email_address' => :'String', + :'external_id' => :'String', + :'phone_number' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.has_key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.has_key?(:'emailAddress') + self.email_address = attributes[:'emailAddress'] + end + + if attributes.has_key?(:'externalId') + self.external_id = attributes[:'externalId'] + end + + if attributes.has_key?(:'phoneNumber') + self.phone_number = attributes[:'phoneNumber'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @version.nil? + invalid_properties.push('invalid value for "version", version cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @id.nil? + return false if @version.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + version == o.version && + email_address == o.email_address && + external_id == o.external_id && + phone_number == o.phone_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [id, version, email_address, external_id, phone_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/shopify_subscription.rb b/lib/wallee-ruby-sdk/models/shopify_subscription.rb index ef17d78..3cebfdf 100644 --- a/lib/wallee-ruby-sdk/models/shopify_subscription.rb +++ b/lib/wallee-ruby-sdk/models/shopify_subscription.rb @@ -32,6 +32,9 @@ class ShopifySubscription # The ID is the primary key of the entity. The ID identifies the entity uniquely. attr_accessor :id + # + attr_accessor :initial_execution_date + # attr_accessor :initial_payment_transaction @@ -75,6 +78,7 @@ def self.attribute_map :'created_on' => :'createdOn', :'external_id' => :'externalId', :'id' => :'id', + :'initial_execution_date' => :'initialExecutionDate', :'initial_payment_transaction' => :'initialPaymentTransaction', :'initial_shopify_transaction' => :'initialShopifyTransaction', :'language' => :'language', @@ -97,6 +101,7 @@ def self.swagger_types :'created_on' => :'DateTime', :'external_id' => :'String', :'id' => :'Integer', + :'initial_execution_date' => :'DateTime', :'initial_payment_transaction' => :'Integer', :'initial_shopify_transaction' => :'Integer', :'language' => :'String', @@ -136,6 +141,10 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end + if attributes.has_key?(:'initialExecutionDate') + self.initial_execution_date = attributes[:'initialExecutionDate'] + end + if attributes.has_key?(:'initialPaymentTransaction') self.initial_payment_transaction = attributes[:'initialPaymentTransaction'] end @@ -231,6 +240,7 @@ def ==(o) created_on == o.created_on && external_id == o.external_id && id == o.id && + initial_execution_date == o.initial_execution_date && initial_payment_transaction == o.initial_payment_transaction && initial_shopify_transaction == o.initial_shopify_transaction && language == o.language && @@ -254,7 +264,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [created_by, created_on, external_id, id, initial_payment_transaction, initial_shopify_transaction, language, linked_space_id, order_recurrence_number, shop, state, subscriber, terminated_by, terminated_on, termination_request_date, version].hash + [created_by, created_on, external_id, id, initial_execution_date, initial_payment_transaction, initial_shopify_transaction, language, linked_space_id, order_recurrence_number, shop, state, subscriber, terminated_by, terminated_on, termination_request_date, version].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb b/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb index d8cf6a1..c8a267f 100644 --- a/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb +++ b/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb @@ -32,6 +32,9 @@ class ShopifySubscriptionCreationRequest # The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity. attr_accessor :external_id + # + attr_accessor :initial_execution_date + # attr_accessor :integration @@ -66,6 +69,7 @@ def self.attribute_map :'billing_configuration' => :'billingConfiguration', :'currency' => :'currency', :'external_id' => :'externalId', + :'initial_execution_date' => :'initialExecutionDate', :'integration' => :'integration', :'items' => :'items', :'language' => :'language', @@ -85,6 +89,7 @@ def self.swagger_types :'billing_configuration' => :'ShopifySubscriptionModelBillingConfiguration', :'currency' => :'String', :'external_id' => :'String', + :'initial_execution_date' => :'DateTime', :'integration' => :'Integer', :'items' => :'Array', :'language' => :'String', @@ -121,6 +126,10 @@ def initialize(attributes = {}) self.external_id = attributes[:'externalId'] end + if attributes.has_key?(:'initialExecutionDate') + self.initial_execution_date = attributes[:'initialExecutionDate'] + end + if attributes.has_key?(:'integration') self.integration = attributes[:'integration'] end @@ -222,6 +231,7 @@ def ==(o) billing_configuration == o.billing_configuration && currency == o.currency && external_id == o.external_id && + initial_execution_date == o.initial_execution_date && integration == o.integration && items == o.items && language == o.language && @@ -242,7 +252,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [billing_address, billing_configuration, currency, external_id, integration, items, language, shipping_address, shipping_method_name, space_view_id, store_order_confirmation_email_enabled, subscriber, subscriber_suspension_allowed].hash + [billing_address, billing_configuration, currency, external_id, initial_execution_date, integration, items, language, shipping_address, shipping_method_name, space_view_id, store_order_confirmation_email_enabled, subscriber, subscriber_suspension_allowed].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/subscription_product_component.rb b/lib/wallee-ruby-sdk/models/subscription_product_component.rb index 5ef9d9c..f16d116 100644 --- a/lib/wallee-ruby-sdk/models/subscription_product_component.rb +++ b/lib/wallee-ruby-sdk/models/subscription_product_component.rb @@ -26,7 +26,7 @@ class SubscriptionProductComponent # attr_accessor :component_group - # When a component is marked as a 'default' component it is used when no other component is selected by the user. + # When a component is marked as a 'default' component it is used as the default component in its group and will be preselected in the product configuration. attr_accessor :default_component # The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. diff --git a/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb b/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb index 9a795e2..342a0ef 100644 --- a/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb +++ b/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb @@ -32,7 +32,7 @@ class SubscriptionProductComponentUpdate # attr_accessor :component_group - # When a component is marked as a 'default' component it is used when no other component is selected by the user. + # When a component is marked as a 'default' component it is used as the default component in its group and will be preselected in the product configuration. attr_accessor :default_component # The component description may contain a longer description which gives the subscriber a better understanding of what the component contains. diff --git a/lib/wallee-ruby-sdk/models/tax_calculation.rb b/lib/wallee-ruby-sdk/models/tax_calculation.rb index 7a1c0e4..a87a2d3 100644 --- a/lib/wallee-ruby-sdk/models/tax_calculation.rb +++ b/lib/wallee-ruby-sdk/models/tax_calculation.rb @@ -20,8 +20,8 @@ module Wallee class TaxCalculation - INCLUDED = 'TAX_INCLUDED'.freeze - NOT_INCLUDED = 'TAX_NOT_INCLUDED'.freeze + TAX_INCLUDED = 'TAX_INCLUDED'.freeze + TAX_NOT_INCLUDED = 'TAX_NOT_INCLUDED'.freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/lib/wallee-ruby-sdk/models/terminal_receipt_fetch_request.rb b/lib/wallee-ruby-sdk/models/terminal_receipt_fetch_request.rb new file mode 100644 index 0000000..746e0be --- /dev/null +++ b/lib/wallee-ruby-sdk/models/terminal_receipt_fetch_request.rb @@ -0,0 +1,221 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # The receipt fetch request allows to retrieve the receipt documents for a terminal transaction. + class TerminalReceiptFetchRequest + # The format determines in what format the receipts will be returned in. + attr_accessor :format + + # Provide here the ID of the transaction for which the receipts should be fetched. + attr_accessor :transaction + + # The width controls how width the document will be rendered. In case of the PDF format the width is in mm. In case of the text format the width is in the number of chars per line. + attr_accessor :width + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'format' => :'format', + :'transaction' => :'transaction', + :'width' => :'width' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'format' => :'TerminalReceiptFormat', + :'transaction' => :'Integer', + :'width' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.has_key?(:'transaction') + self.transaction = attributes[:'transaction'] + end + + if attributes.has_key?(:'width') + self.width = attributes[:'width'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @format.nil? + invalid_properties.push('invalid value for "format", format cannot be nil.') + end + + if @transaction.nil? + invalid_properties.push('invalid value for "transaction", transaction cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @format.nil? + return false if @transaction.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + format == o.format && + transaction == o.transaction && + width == o.width + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [format, transaction, width].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/terminal_receipt_format.rb b/lib/wallee-ruby-sdk/models/terminal_receipt_format.rb new file mode 100644 index 0000000..a3d5023 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/terminal_receipt_format.rb @@ -0,0 +1,35 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + class TerminalReceiptFormat + + PDF = 'PDF'.freeze + TXT = 'TXT'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TerminalReceiptFormat.constants.select { |c| TerminalReceiptFormat::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TerminalReceiptFormat" if constantValues.empty? + value + end + end +end diff --git a/lib/wallee-ruby-sdk/models/tokenized_card_data.rb b/lib/wallee-ruby-sdk/models/tokenized_card_data.rb new file mode 100644 index 0000000..9634292 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/tokenized_card_data.rb @@ -0,0 +1,211 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # This model holds the card data in plain. + class TokenizedCardData + # The additional authentication value used to secure the tokenized card transactions. + attr_accessor :cryptogram + + # + attr_accessor :recurring_indicator + + # + attr_accessor :token_requestor_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'cryptogram' => :'cryptogram', + :'recurring_indicator' => :'recurringIndicator', + :'token_requestor_id' => :'tokenRequestorId' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'cryptogram' => :'CardCryptogram', + :'recurring_indicator' => :'RecurringIndicator', + :'token_requestor_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'cryptogram') + self.cryptogram = attributes[:'cryptogram'] + end + + if attributes.has_key?(:'recurringIndicator') + self.recurring_indicator = attributes[:'recurringIndicator'] + end + + if attributes.has_key?(:'tokenRequestorId') + self.token_requestor_id = attributes[:'tokenRequestorId'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cryptogram == o.cryptogram && + recurring_indicator == o.recurring_indicator && + token_requestor_id == o.token_requestor_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [cryptogram, recurring_indicator, token_requestor_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/unencrypted_card_data_create.rb b/lib/wallee-ruby-sdk/models/tokenized_card_data_create.rb similarity index 79% rename from lib/wallee-ruby-sdk/models/unencrypted_card_data_create.rb rename to lib/wallee-ruby-sdk/models/tokenized_card_data_create.rb index b519b81..0c97db3 100644 --- a/lib/wallee-ruby-sdk/models/unencrypted_card_data_create.rb +++ b/lib/wallee-ruby-sdk/models/tokenized_card_data_create.rb @@ -19,26 +19,42 @@ module Wallee # This model holds the card data in plain. - class UnencryptedCardDataCreate + class TokenizedCardDataCreate # The card holder name is the name printed onto the card. It identifies the person who owns the card. attr_accessor :card_holder_name # 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. attr_accessor :card_verification_code + # The additional authentication value used to secure the tokenized card transactions. + attr_accessor :cryptogram + # 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). attr_accessor :expiry_date # The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card. attr_accessor :primary_account_number + # + attr_accessor :recurring_indicator + + # + attr_accessor :scheme_transaction_reference + + # + attr_accessor :token_requestor_id + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'card_holder_name' => :'cardHolderName', :'card_verification_code' => :'cardVerificationCode', + :'cryptogram' => :'cryptogram', :'expiry_date' => :'expiryDate', - :'primary_account_number' => :'primaryAccountNumber' + :'primary_account_number' => :'primaryAccountNumber', + :'recurring_indicator' => :'recurringIndicator', + :'scheme_transaction_reference' => :'schemeTransactionReference', + :'token_requestor_id' => :'tokenRequestorId' } end @@ -47,8 +63,12 @@ def self.swagger_types { :'card_holder_name' => :'String', :'card_verification_code' => :'String', + :'cryptogram' => :'CardCryptogramCreate', :'expiry_date' => :'String', - :'primary_account_number' => :'String' + :'primary_account_number' => :'String', + :'recurring_indicator' => :'RecurringIndicator', + :'scheme_transaction_reference' => :'String', + :'token_requestor_id' => :'String' } end @@ -68,6 +88,10 @@ def initialize(attributes = {}) self.card_verification_code = attributes[:'cardVerificationCode'] end + if attributes.has_key?(:'cryptogram') + self.cryptogram = attributes[:'cryptogram'] + end + if attributes.has_key?(:'expiryDate') self.expiry_date = attributes[:'expiryDate'] end @@ -75,6 +99,18 @@ def initialize(attributes = {}) if attributes.has_key?(:'primaryAccountNumber') self.primary_account_number = attributes[:'primaryAccountNumber'] end + + if attributes.has_key?(:'recurringIndicator') + self.recurring_indicator = attributes[:'recurringIndicator'] + end + + if attributes.has_key?(:'schemeTransactionReference') + self.scheme_transaction_reference = attributes[:'schemeTransactionReference'] + end + + if attributes.has_key?(:'tokenRequestorId') + self.token_requestor_id = attributes[:'tokenRequestorId'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -105,6 +141,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "primary_account_number", the character length must be great than or equal to 10.') end + if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100 + invalid_properties.push('invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.') + end + invalid_properties end @@ -117,6 +157,7 @@ def valid? return false if @primary_account_number.nil? return false if @primary_account_number.to_s.length > 30 return false if @primary_account_number.to_s.length < 10 + return false if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100 true end @@ -162,6 +203,16 @@ def primary_account_number=(primary_account_number) @primary_account_number = primary_account_number end + # Custom attribute writer method with validation + # @param [Object] scheme_transaction_reference Value to be assigned + def scheme_transaction_reference=(scheme_transaction_reference) + if !scheme_transaction_reference.nil? && scheme_transaction_reference.to_s.length > 100 + fail ArgumentError, 'invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.' + end + + @scheme_transaction_reference = scheme_transaction_reference + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -169,8 +220,12 @@ def ==(o) self.class == o.class && card_holder_name == o.card_holder_name && card_verification_code == o.card_verification_code && + cryptogram == o.cryptogram && expiry_date == o.expiry_date && - primary_account_number == o.primary_account_number + primary_account_number == o.primary_account_number && + recurring_indicator == o.recurring_indicator && + scheme_transaction_reference == o.scheme_transaction_reference && + token_requestor_id == o.token_requestor_id end # @see the `==` method @@ -182,7 +237,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [card_holder_name, card_verification_code, expiry_date, primary_account_number].hash + [card_holder_name, card_verification_code, cryptogram, expiry_date, primary_account_number, recurring_indicator, scheme_transaction_reference, token_requestor_id].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/models/web_app_confirmation_request.rb b/lib/wallee-ruby-sdk/models/web_app_confirmation_request.rb new file mode 100644 index 0000000..d18fadc --- /dev/null +++ b/lib/wallee-ruby-sdk/models/web_app_confirmation_request.rb @@ -0,0 +1,206 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # + class WebAppConfirmationRequest + # The user returns to the web app after granting the permission. The HTTP request contains the code. Provide it here to confirm the web app installation. + attr_accessor :code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'code' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'code') + self.code = attributes[:'code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@code.nil? && @code.to_s.length > 100 + invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 100.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@code.nil? && @code.to_s.length > 100 + true + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if !code.nil? && code.to_s.length > 100 + fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 100.' + end + + @code = code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/web_app_confirmation_response.rb b/lib/wallee-ruby-sdk/models/web_app_confirmation_response.rb new file mode 100644 index 0000000..3e401b9 --- /dev/null +++ b/lib/wallee-ruby-sdk/models/web_app_confirmation_response.rb @@ -0,0 +1,231 @@ +=begin +The wallee API allows an easy interaction with the wallee web service. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +=end + +require 'date' + +module Wallee + # The confirmation response provides the details about the installation of the web app. + class WebAppConfirmationResponse + # The access code grants permissions to the web service API according to the OAuth standard. + attr_accessor :access_token + + # The scope contains the permissions granted to the web app within the space. + attr_accessor :scope + + # This is the space into which the web app is installed into. + attr_accessor :space + + # The state contains the state parameter content provided when initiating the app installation. + attr_accessor :state + + # The token type indicates the type of the access token. The type determines the authentication mechanism to use for accessing the web service API. + attr_accessor :token_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'access_token' => :'access_token', + :'scope' => :'scope', + :'space' => :'space', + :'state' => :'state', + :'token_type' => :'token_type' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'access_token' => :'String', + :'scope' => :'String', + :'space' => :'Space', + :'state' => :'String', + :'token_type' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'access_token') + self.access_token = attributes[:'access_token'] + end + + if attributes.has_key?(:'scope') + self.scope = attributes[:'scope'] + end + + if attributes.has_key?(:'space') + self.space = attributes[:'space'] + end + + if attributes.has_key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.has_key?(:'token_type') + self.token_type = attributes[:'token_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + access_token == o.access_token && + scope == o.scope && + space == o.space && + state == o.state && + token_type == o.token_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [access_token, scope, space, state, token_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Wallee.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/lib/wallee-ruby-sdk/models/webhook_url.rb b/lib/wallee-ruby-sdk/models/webhook_url.rb index a4e89dd..c9911d7 100644 --- a/lib/wallee-ruby-sdk/models/webhook_url.rb +++ b/lib/wallee-ruby-sdk/models/webhook_url.rb @@ -20,6 +20,9 @@ module Wallee # class WebhookUrl + # The webhook URL is managed by the application and cannot be changed via the user interface. + attr_accessor :application_managed + # The ID is the primary key of the entity. The ID identifies the entity uniquely. attr_accessor :id @@ -44,6 +47,7 @@ class WebhookUrl # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'application_managed' => :'applicationManaged', :'id' => :'id', :'linked_space_id' => :'linkedSpaceId', :'name' => :'name', @@ -57,6 +61,7 @@ def self.attribute_map # Attribute type mapping. def self.swagger_types { + :'application_managed' => :'BOOLEAN', :'id' => :'Integer', :'linked_space_id' => :'Integer', :'name' => :'String', @@ -75,6 +80,10 @@ def initialize(attributes = {}) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + if attributes.has_key?(:'applicationManaged') + self.application_managed = attributes[:'applicationManaged'] + end + if attributes.has_key?(:'id') self.id = attributes[:'id'] end @@ -161,6 +170,7 @@ def url=(url) def ==(o) return true if self.equal?(o) self.class == o.class && + application_managed == o.application_managed && id == o.id && linked_space_id == o.linked_space_id && name == o.name && @@ -179,7 +189,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [id, linked_space_id, name, planned_purge_date, state, url, version].hash + [application_managed, id, linked_space_id, name, planned_purge_date, state, url, version].hash end # Builds the object from hash diff --git a/lib/wallee-ruby-sdk/version.rb b/lib/wallee-ruby-sdk/version.rb index 8a04e49..8781d9a 100644 --- a/lib/wallee-ruby-sdk/version.rb +++ b/lib/wallee-ruby-sdk/version.rb @@ -16,5 +16,5 @@ =end module Wallee - VERSION = '2.2.5' + VERSION = '3.0.0' end