paze-apimatic-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +147 -0
  4. data/bin/console +15 -0
  5. data/lib/paze_checkout_api/api_helper.rb +10 -0
  6. data/lib/paze_checkout_api/client.rb +97 -0
  7. data/lib/paze_checkout_api/configuration.rb +221 -0
  8. data/lib/paze_checkout_api/controllers/base_controller.rb +60 -0
  9. data/lib/paze_checkout_api/controllers/checkout_session_controller.rb +108 -0
  10. data/lib/paze_checkout_api/controllers/identity_controller.rb +43 -0
  11. data/lib/paze_checkout_api/controllers/merchant_onboarding_controller.rb +39 -0
  12. data/lib/paze_checkout_api/controllers/o_auth_authorization_controller.rb +42 -0
  13. data/lib/paze_checkout_api/exceptions/api_error_response_exception.rb +67 -0
  14. data/lib/paze_checkout_api/exceptions/api_exception.rb +21 -0
  15. data/lib/paze_checkout_api/exceptions/base_response_exception.rb +75 -0
  16. data/lib/paze_checkout_api/exceptions/o_auth_provider_exception.rb +64 -0
  17. data/lib/paze_checkout_api/exceptions/simple_error_exception.rb +46 -0
  18. data/lib/paze_checkout_api/http/auth/o_auth2.rb +149 -0
  19. data/lib/paze_checkout_api/http/http_call_back.rb +10 -0
  20. data/lib/paze_checkout_api/http/http_method_enum.rb +10 -0
  21. data/lib/paze_checkout_api/http/http_request.rb +10 -0
  22. data/lib/paze_checkout_api/http/http_response.rb +10 -0
  23. data/lib/paze_checkout_api/http/proxy_settings.rb +22 -0
  24. data/lib/paze_checkout_api/models/api_response_metadata.rb +87 -0
  25. data/lib/paze_checkout_api/models/base_model.rb +110 -0
  26. data/lib/paze_checkout_api/models/billing_preference_enum.rb +36 -0
  27. data/lib/paze_checkout_api/models/checkout_session_complete_request.rb +70 -0
  28. data/lib/paze_checkout_api/models/checkout_session_complete_response.rb +97 -0
  29. data/lib/paze_checkout_api/models/checkout_session_create_request.rb +70 -0
  30. data/lib/paze_checkout_api/models/checkout_session_create_response.rb +97 -0
  31. data/lib/paze_checkout_api/models/checkout_session_review_request.rb +70 -0
  32. data/lib/paze_checkout_api/models/checkout_session_review_response.rb +97 -0
  33. data/lib/paze_checkout_api/models/client.rb +80 -0
  34. data/lib/paze_checkout_api/models/client_assertion_type_enum.rb +27 -0
  35. data/lib/paze_checkout_api/models/complete_session_data.rb +131 -0
  36. data/lib/paze_checkout_api/models/complete_session_response_data.rb +71 -0
  37. data/lib/paze_checkout_api/models/consumer.rb +100 -0
  38. data/lib/paze_checkout_api/models/create_session_data.rb +134 -0
  39. data/lib/paze_checkout_api/models/create_session_response_data.rb +71 -0
  40. data/lib/paze_checkout_api/models/data.rb +62 -0
  41. data/lib/paze_checkout_api/models/ecommerce_data.rb +109 -0
  42. data/lib/paze_checkout_api/models/enhanced_transaction_data.rb +71 -0
  43. data/lib/paze_checkout_api/models/error_detail.rb +81 -0
  44. data/lib/paze_checkout_api/models/error_message.rb +88 -0
  45. data/lib/paze_checkout_api/models/grant_type_enum.rb +26 -0
  46. data/lib/paze_checkout_api/models/intent_enum.rb +40 -0
  47. data/lib/paze_checkout_api/models/links.rb +74 -0
  48. data/lib/paze_checkout_api/models/masked_card.rb +107 -0
  49. data/lib/paze_checkout_api/models/merchant_address.rb +97 -0
  50. data/lib/paze_checkout_api/models/merchant_onboard_data.rb +115 -0
  51. data/lib/paze_checkout_api/models/merchant_onboard_request.rb +70 -0
  52. data/lib/paze_checkout_api/models/merchant_profile.rb +83 -0
  53. data/lib/paze_checkout_api/models/merchant_response.rb +122 -0
  54. data/lib/paze_checkout_api/models/o_auth_provider_error_enum.rb +62 -0
  55. data/lib/paze_checkout_api/models/o_auth_token.rb +96 -0
  56. data/lib/paze_checkout_api/models/o_auth_token_request.rb +75 -0
  57. data/lib/paze_checkout_api/models/o_auth_token_response.rb +78 -0
  58. data/lib/paze_checkout_api/models/onboard_merchant_key.rb +112 -0
  59. data/lib/paze_checkout_api/models/payload_type_indicator_enum.rb +36 -0
  60. data/lib/paze_checkout_api/models/payment_card_brand_enum.rb +40 -0
  61. data/lib/paze_checkout_api/models/payment_card_type_enum.rb +36 -0
  62. data/lib/paze_checkout_api/models/phone.rb +72 -0
  63. data/lib/paze_checkout_api/models/processing_network_enum.rb +40 -0
  64. data/lib/paze_checkout_api/models/review_session_data.rb +68 -0
  65. data/lib/paze_checkout_api/models/review_session_response_data.rb +100 -0
  66. data/lib/paze_checkout_api/models/shipping_address.rb +101 -0
  67. data/lib/paze_checkout_api/models/transaction_options.rb +87 -0
  68. data/lib/paze_checkout_api/models/transaction_type_enum.rb +36 -0
  69. data/lib/paze_checkout_api/models/transaction_value.rb +72 -0
  70. data/lib/paze_checkout_api/models/travel_data.rb +110 -0
  71. data/lib/paze_checkout_api/utilities/date_time_helper.rb +11 -0
  72. data/lib/paze_checkout_api/utilities/file_wrapper.rb +28 -0
  73. data/lib/paze_checkout_api.rb +93 -0
  74. metadata +157 -0
@@ -0,0 +1,10 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # HTTP Methods Enumeration.
8
+ class HttpMethodEnum < CoreLibrary::HttpMethod
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # Represents a single Http Request.
8
+ class HttpRequest < CoreLibrary::HttpRequest
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # Http response received.
8
+ class HttpResponse < CoreLibrary::HttpResponse
9
+ end
10
+ end
@@ -0,0 +1,22 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ ##
8
+ # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
+ # including optional basic authentication.
10
+ #
11
+ class ProxySettings < CoreLibrary::ProxySettings
12
+ def self.from_env
13
+ address = ENV['PROXY_ADDRESS']
14
+ port = ENV['PROXY_PORT']
15
+ username = ENV['PROXY_USERNAME']
16
+ password = ENV['PROXY_PASSWORD']
17
+ return nil if address.nil? || address.strip.empty?
18
+
19
+ new(address: address, port: port, username: username, password: password)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,87 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module PazeCheckoutApi
8
+ # ApiResponseMetadata Model.
9
+ class ApiResponseMetadata < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :client_context
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :ew_sid
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [DateTime]
23
+ attr_accessor :timestamp_iso8601
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['client_context'] = 'clientContext'
29
+ @_hash['ew_sid'] = 'ewSID'
30
+ @_hash['timestamp_iso8601'] = 'timestampISO8601'
31
+ @_hash
32
+ end
33
+
34
+ # An array for optional fields
35
+ def self.optionals
36
+ %w[
37
+ client_context
38
+ ]
39
+ end
40
+
41
+ # An array for nullable fields
42
+ def self.nullables
43
+ []
44
+ end
45
+
46
+ def initialize(ew_sid = nil, timestamp_iso8601 = nil, client_context = SKIP)
47
+ @client_context = client_context unless client_context == SKIP
48
+ @ew_sid = ew_sid
49
+ @timestamp_iso8601 = timestamp_iso8601
50
+ end
51
+
52
+ # Creates an instance of the object from a hash.
53
+ def self.from_hash(hash)
54
+ return nil unless hash
55
+
56
+ # Extract variables from the hash.
57
+ ew_sid = hash.key?('ewSID') ? hash['ewSID'] : nil
58
+ timestamp_iso8601 = if hash.key?('timestampISO8601')
59
+ (DateTimeHelper.from_rfc3339(hash['timestampISO8601']) if hash['timestampISO8601'])
60
+ end
61
+ client_context = hash.key?('clientContext') ? hash['clientContext'] : SKIP
62
+
63
+ # Create object from extracted values.
64
+ ApiResponseMetadata.new(ew_sid,
65
+ timestamp_iso8601,
66
+ client_context)
67
+ end
68
+
69
+ def to_custom_timestamp_iso8601
70
+ DateTimeHelper.to_rfc3339(timestamp_iso8601)
71
+ end
72
+
73
+ # Provides a human-readable string representation of the object.
74
+ def to_s
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} client_context: #{@client_context}, ew_sid: #{@ew_sid}, timestamp_iso8601:"\
77
+ " #{@timestamp_iso8601}>"
78
+ end
79
+
80
+ # Provides a debugging-friendly string with detailed object information.
81
+ def inspect
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} client_context: #{@client_context.inspect}, ew_sid: #{@ew_sid.inspect},"\
84
+ " timestamp_iso8601: #{@timestamp_iso8601.inspect}>"
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,110 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # Base model.
8
+ # rubocop:disable all
9
+ class BaseModel < CoreLibrary::BaseModel
10
+ # Returns a Hash representation of the current object.
11
+ def to_hash
12
+ # validating the model being serialized
13
+ self.class.validate(self) if self.class.respond_to?(:validate)
14
+
15
+ hash = {}
16
+ instance_variables.each do |name|
17
+ value = instance_variable_get(name)
18
+ name = name[1..]
19
+ if name == 'additional_properties'
20
+ additional_properties = process_additional_properties(value, self.class.names)
21
+ hash.merge!(additional_properties)
22
+ else
23
+ key = self.class.names.key?(name) ? self.class.names[name] : name
24
+ optional_fields = self.class.optionals
25
+ nullable_fields = self.class.nullables
26
+ if value.nil?
27
+ next unless nullable_fields.include?(name)
28
+
29
+ if !optional_fields.include?(name) && !nullable_fields.include?(name)
30
+ raise ArgumentError,
31
+ "`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
32
+ end
33
+ end
34
+
35
+ hash[key] = nil
36
+ unless value.nil?
37
+ if respond_to?("to_custom_#{name}")
38
+ if (value.instance_of? Array) || (value.instance_of? Hash)
39
+ params = [hash, key]
40
+ hash[key] = send("to_custom_#{name}", *params)
41
+ else
42
+ hash[key] = send("to_custom_#{name}")
43
+ end
44
+ elsif respond_to?("to_union_type_#{name}")
45
+ hash[key] = send("to_union_type_#{name}")
46
+ elsif value.instance_of? Array
47
+ hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
48
+ elsif value.instance_of? Hash
49
+ hash[key] = {}
50
+ value.each do |k, v|
51
+ hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
52
+ end
53
+ else
54
+ hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
55
+ end
56
+ end
57
+ end
58
+ end
59
+ hash
60
+ end
61
+
62
+ # Processes additional properties, ensuring no conflicts with existing properties.
63
+ def process_additional_properties(additional_properties, existing_prop_names)
64
+ hash = {}
65
+ additional_properties.each do |name, value|
66
+ check_for_conflict(name, existing_prop_names)
67
+
68
+ hash[name] = if value.is_a?(Array)
69
+ process_array(value)
70
+ elsif value.is_a?(Hash)
71
+ process_hash(value)
72
+ else
73
+ process_basic_value(value)
74
+ end
75
+ end
76
+ hash
77
+ end
78
+
79
+ # Checks if an additional property conflicts with a model's existing property.
80
+ def check_for_conflict(name, existing_prop_names)
81
+ return unless existing_prop_names.key?(name)
82
+
83
+ raise ArgumentError, "An additional property key, '#{name}' conflicts with one of the model's properties"
84
+ end
85
+
86
+ # Processes an array of values, recursively calling `to_hash` on BaseModel objects.
87
+ def process_array(value)
88
+ value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
89
+ end
90
+
91
+ # Processes a hash of values, recursively calling `to_hash` on BaseModel objects.
92
+ def process_hash(value)
93
+ value.transform_values do |v|
94
+ v.is_a?(BaseModel) ? v.to_hash : v
95
+ end
96
+ end
97
+
98
+ # Processes a basic value (non-array, non-hash).
99
+ def process_basic_value(value)
100
+ value.is_a?(BaseModel) ? value.to_hash : value
101
+ end
102
+
103
+ # Returns a JSON representation of the curent object.
104
+ def to_json(options = {})
105
+ hash = to_hash
106
+ hash.to_json(options)
107
+ end
108
+ end
109
+ # rubocop:enable all
110
+ end
@@ -0,0 +1,36 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # BillingPreference.
8
+ class BillingPreferenceEnum
9
+ BILLING_PREFERENCE_ENUM = [
10
+ # TODO: Write general description for ALL
11
+ ALL = 'ALL'.freeze,
12
+
13
+ # TODO: Write general description for NONE
14
+ NONE = 'NONE'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ BILLING_PREFERENCE_ENUM.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = ALL)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'all' then ALL
30
+ when 'none' then NONE
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,70 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # CheckoutSessionCompleteRequest Model.
8
+ class CheckoutSessionCompleteRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :client_context
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [CompleteSessionData]
18
+ attr_accessor :data
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['client_context'] = 'clientContext'
24
+ @_hash['data'] = 'data'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ client_context
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ []
38
+ end
39
+
40
+ def initialize(data = nil, client_context = SKIP)
41
+ @client_context = client_context unless client_context == SKIP
42
+ @data = data
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ data = CompleteSessionData.from_hash(hash['data']) if hash['data']
51
+ client_context = hash.key?('clientContext') ? hash['clientContext'] : SKIP
52
+
53
+ # Create object from extracted values.
54
+ CheckoutSessionCompleteRequest.new(data,
55
+ client_context)
56
+ end
57
+
58
+ # Provides a human-readable string representation of the object.
59
+ def to_s
60
+ class_name = self.class.name.split('::').last
61
+ "<#{class_name} client_context: #{@client_context}, data: #{@data}>"
62
+ end
63
+
64
+ # Provides a debugging-friendly string with detailed object information.
65
+ def inspect
66
+ class_name = self.class.name.split('::').last
67
+ "<#{class_name} client_context: #{@client_context.inspect}, data: #{@data.inspect}>"
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,97 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module PazeCheckoutApi
8
+ # CheckoutSessionCompleteResponse Model.
9
+ class CheckoutSessionCompleteResponse < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :client_context
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :ew_sid
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [DateTime]
23
+ attr_accessor :timestamp_iso8601
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [CompleteSessionResponseData]
27
+ attr_accessor :data
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['client_context'] = 'clientContext'
33
+ @_hash['ew_sid'] = 'ewSID'
34
+ @_hash['timestamp_iso8601'] = 'timestampISO8601'
35
+ @_hash['data'] = 'data'
36
+ @_hash
37
+ end
38
+
39
+ # An array for optional fields
40
+ def self.optionals
41
+ %w[
42
+ client_context
43
+ data
44
+ ]
45
+ end
46
+
47
+ # An array for nullable fields
48
+ def self.nullables
49
+ []
50
+ end
51
+
52
+ def initialize(ew_sid = nil, timestamp_iso8601 = nil, client_context = SKIP,
53
+ data = SKIP)
54
+ @client_context = client_context unless client_context == SKIP
55
+ @ew_sid = ew_sid
56
+ @timestamp_iso8601 = timestamp_iso8601
57
+ @data = data unless data == SKIP
58
+ end
59
+
60
+ # Creates an instance of the object from a hash.
61
+ def self.from_hash(hash)
62
+ return nil unless hash
63
+
64
+ # Extract variables from the hash.
65
+ ew_sid = hash.key?('ewSID') ? hash['ewSID'] : nil
66
+ timestamp_iso8601 = if hash.key?('timestampISO8601')
67
+ (DateTimeHelper.from_rfc3339(hash['timestampISO8601']) if hash['timestampISO8601'])
68
+ end
69
+ client_context = hash.key?('clientContext') ? hash['clientContext'] : SKIP
70
+ data = CompleteSessionResponseData.from_hash(hash['data']) if hash['data']
71
+
72
+ # Create object from extracted values.
73
+ CheckoutSessionCompleteResponse.new(ew_sid,
74
+ timestamp_iso8601,
75
+ client_context,
76
+ data)
77
+ end
78
+
79
+ def to_custom_timestamp_iso8601
80
+ DateTimeHelper.to_rfc3339(timestamp_iso8601)
81
+ end
82
+
83
+ # Provides a human-readable string representation of the object.
84
+ def to_s
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} client_context: #{@client_context}, ew_sid: #{@ew_sid}, timestamp_iso8601:"\
87
+ " #{@timestamp_iso8601}, data: #{@data}>"
88
+ end
89
+
90
+ # Provides a debugging-friendly string with detailed object information.
91
+ def inspect
92
+ class_name = self.class.name.split('::').last
93
+ "<#{class_name} client_context: #{@client_context.inspect}, ew_sid: #{@ew_sid.inspect},"\
94
+ " timestamp_iso8601: #{@timestamp_iso8601.inspect}, data: #{@data.inspect}>"
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,70 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # CheckoutSessionCreateRequest Model.
8
+ class CheckoutSessionCreateRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :client_context
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [CreateSessionData]
18
+ attr_accessor :data
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['client_context'] = 'clientContext'
24
+ @_hash['data'] = 'data'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ client_context
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ []
38
+ end
39
+
40
+ def initialize(data = nil, client_context = SKIP)
41
+ @client_context = client_context unless client_context == SKIP
42
+ @data = data
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ data = CreateSessionData.from_hash(hash['data']) if hash['data']
51
+ client_context = hash.key?('clientContext') ? hash['clientContext'] : SKIP
52
+
53
+ # Create object from extracted values.
54
+ CheckoutSessionCreateRequest.new(data,
55
+ client_context)
56
+ end
57
+
58
+ # Provides a human-readable string representation of the object.
59
+ def to_s
60
+ class_name = self.class.name.split('::').last
61
+ "<#{class_name} client_context: #{@client_context}, data: #{@data}>"
62
+ end
63
+
64
+ # Provides a debugging-friendly string with detailed object information.
65
+ def inspect
66
+ class_name = self.class.name.split('::').last
67
+ "<#{class_name} client_context: #{@client_context.inspect}, data: #{@data.inspect}>"
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,97 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module PazeCheckoutApi
8
+ # CheckoutSessionCreateResponse Model.
9
+ class CheckoutSessionCreateResponse < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :client_context
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :ew_sid
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [DateTime]
23
+ attr_accessor :timestamp_iso8601
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [CreateSessionResponseData]
27
+ attr_accessor :data
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['client_context'] = 'clientContext'
33
+ @_hash['ew_sid'] = 'ewSID'
34
+ @_hash['timestamp_iso8601'] = 'timestampISO8601'
35
+ @_hash['data'] = 'data'
36
+ @_hash
37
+ end
38
+
39
+ # An array for optional fields
40
+ def self.optionals
41
+ %w[
42
+ client_context
43
+ data
44
+ ]
45
+ end
46
+
47
+ # An array for nullable fields
48
+ def self.nullables
49
+ []
50
+ end
51
+
52
+ def initialize(ew_sid = nil, timestamp_iso8601 = nil, client_context = SKIP,
53
+ data = SKIP)
54
+ @client_context = client_context unless client_context == SKIP
55
+ @ew_sid = ew_sid
56
+ @timestamp_iso8601 = timestamp_iso8601
57
+ @data = data unless data == SKIP
58
+ end
59
+
60
+ # Creates an instance of the object from a hash.
61
+ def self.from_hash(hash)
62
+ return nil unless hash
63
+
64
+ # Extract variables from the hash.
65
+ ew_sid = hash.key?('ewSID') ? hash['ewSID'] : nil
66
+ timestamp_iso8601 = if hash.key?('timestampISO8601')
67
+ (DateTimeHelper.from_rfc3339(hash['timestampISO8601']) if hash['timestampISO8601'])
68
+ end
69
+ client_context = hash.key?('clientContext') ? hash['clientContext'] : SKIP
70
+ data = CreateSessionResponseData.from_hash(hash['data']) if hash['data']
71
+
72
+ # Create object from extracted values.
73
+ CheckoutSessionCreateResponse.new(ew_sid,
74
+ timestamp_iso8601,
75
+ client_context,
76
+ data)
77
+ end
78
+
79
+ def to_custom_timestamp_iso8601
80
+ DateTimeHelper.to_rfc3339(timestamp_iso8601)
81
+ end
82
+
83
+ # Provides a human-readable string representation of the object.
84
+ def to_s
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} client_context: #{@client_context}, ew_sid: #{@ew_sid}, timestamp_iso8601:"\
87
+ " #{@timestamp_iso8601}, data: #{@data}>"
88
+ end
89
+
90
+ # Provides a debugging-friendly string with detailed object information.
91
+ def inspect
92
+ class_name = self.class.name.split('::').last
93
+ "<#{class_name} client_context: #{@client_context.inspect}, ew_sid: #{@ew_sid.inspect},"\
94
+ " timestamp_iso8601: #{@timestamp_iso8601.inspect}, data: #{@data.inspect}>"
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,70 @@
1
+ # paze_checkout_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module PazeCheckoutApi
7
+ # CheckoutSessionReviewRequest Model.
8
+ class CheckoutSessionReviewRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :client_context
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [ReviewSessionData]
18
+ attr_accessor :data
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['client_context'] = 'clientContext'
24
+ @_hash['data'] = 'data'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ client_context
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ []
38
+ end
39
+
40
+ def initialize(data = nil, client_context = SKIP)
41
+ @client_context = client_context unless client_context == SKIP
42
+ @data = data
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ data = ReviewSessionData.from_hash(hash['data']) if hash['data']
51
+ client_context = hash.key?('clientContext') ? hash['clientContext'] : SKIP
52
+
53
+ # Create object from extracted values.
54
+ CheckoutSessionReviewRequest.new(data,
55
+ client_context)
56
+ end
57
+
58
+ # Provides a human-readable string representation of the object.
59
+ def to_s
60
+ class_name = self.class.name.split('::').last
61
+ "<#{class_name} client_context: #{@client_context}, data: #{@data}>"
62
+ end
63
+
64
+ # Provides a debugging-friendly string with detailed object information.
65
+ def inspect
66
+ class_name = self.class.name.split('::').last
67
+ "<#{class_name} client_context: #{@client_context.inspect}, data: #{@data.inspect}>"
68
+ end
69
+ end
70
+ end