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,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
+ # CheckoutSessionReviewResponse Model.
9
+ class CheckoutSessionReviewResponse < 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 [ReviewSessionResponseData]
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 = ReviewSessionResponseData.from_hash(hash['data']) if hash['data']
71
+
72
+ # Create object from extracted values.
73
+ CheckoutSessionReviewResponse.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,80 @@
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
+ # Client Model.
8
+ class Client < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :name
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :profile_id
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['id'] = 'id'
28
+ @_hash['name'] = 'name'
29
+ @_hash['profile_id'] = 'profileId'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ name
37
+ profile_id
38
+ ]
39
+ end
40
+
41
+ # An array for nullable fields
42
+ def self.nullables
43
+ []
44
+ end
45
+
46
+ def initialize(id = nil, name = SKIP, profile_id = SKIP)
47
+ @id = id
48
+ @name = name unless name == SKIP
49
+ @profile_id = profile_id unless profile_id == SKIP
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
+ id = hash.key?('id') ? hash['id'] : nil
58
+ name = hash.key?('name') ? hash['name'] : SKIP
59
+ profile_id = hash.key?('profileId') ? hash['profileId'] : SKIP
60
+
61
+ # Create object from extracted values.
62
+ Client.new(id,
63
+ name,
64
+ profile_id)
65
+ end
66
+
67
+ # Provides a human-readable string representation of the object.
68
+ def to_s
69
+ class_name = self.class.name.split('::').last
70
+ "<#{class_name} id: #{@id}, name: #{@name}, profile_id: #{@profile_id}>"
71
+ end
72
+
73
+ # Provides a debugging-friendly string with detailed object information.
74
+ def inspect
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, profile_id:"\
77
+ " #{@profile_id.inspect}>"
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,27 @@
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
+ # ClientAssertionType.
8
+ class ClientAssertionTypeEnum
9
+ CLIENT_ASSERTION_TYPE_ENUM = [
10
+ # TODO: Write general description for
11
+ # ENUM_URNIETFPARAMSOAUTHCLIENTASSERTIONTYPEJWTBEARER
12
+ ENUM_URNIETFPARAMSOAUTHCLIENTASSERTIONTYPEJWTBEARER = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'.freeze
13
+ ].freeze
14
+
15
+ def self.validate(value)
16
+ return false if value.nil?
17
+
18
+ CLIENT_ASSERTION_TYPE_ENUM.include?(value)
19
+ end
20
+
21
+ def self.from_value(value, default_value = ENUM_URNIETFPARAMSOAUTHCLIENTASSERTIONTYPEJWTBEARER)
22
+ return default_value if value.nil?
23
+
24
+ default_value
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,131 @@
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
+ # CompleteSessionData Model.
8
+ class CompleteSessionData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :session_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :code
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [TransactionTypeEnum]
22
+ attr_accessor :transaction_type
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [ProcessingNetworkEnum]
26
+ attr_accessor :processing_network
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [TransactionOptions]
30
+ attr_accessor :transaction_options
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [TransactionValue]
34
+ attr_accessor :transaction_value
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [EnhancedTransactionData]
38
+ attr_accessor :enhanced_transaction_data
39
+
40
+ # A mapping from model property names to API property names.
41
+ def self.names
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['session_id'] = 'sessionId'
44
+ @_hash['code'] = 'code'
45
+ @_hash['transaction_type'] = 'transactionType'
46
+ @_hash['processing_network'] = 'processingNetwork'
47
+ @_hash['transaction_options'] = 'transactionOptions'
48
+ @_hash['transaction_value'] = 'transactionValue'
49
+ @_hash['enhanced_transaction_data'] = 'enhancedTransactionData'
50
+ @_hash
51
+ end
52
+
53
+ # An array for optional fields
54
+ def self.optionals
55
+ %w[
56
+ processing_network
57
+ transaction_options
58
+ transaction_value
59
+ enhanced_transaction_data
60
+ ]
61
+ end
62
+
63
+ # An array for nullable fields
64
+ def self.nullables
65
+ []
66
+ end
67
+
68
+ def initialize(session_id = nil, code = nil, transaction_type = nil,
69
+ processing_network = SKIP, transaction_options = SKIP,
70
+ transaction_value = SKIP, enhanced_transaction_data = SKIP)
71
+ @session_id = session_id
72
+ @code = code
73
+ @transaction_type = transaction_type
74
+ @processing_network = processing_network unless processing_network == SKIP
75
+ @transaction_options = transaction_options unless transaction_options == SKIP
76
+ @transaction_value = transaction_value unless transaction_value == SKIP
77
+ unless enhanced_transaction_data == SKIP
78
+ @enhanced_transaction_data =
79
+ enhanced_transaction_data
80
+ end
81
+ end
82
+
83
+ # Creates an instance of the object from a hash.
84
+ def self.from_hash(hash)
85
+ return nil unless hash
86
+
87
+ # Extract variables from the hash.
88
+ session_id = hash.key?('sessionId') ? hash['sessionId'] : nil
89
+ code = hash.key?('code') ? hash['code'] : nil
90
+ transaction_type =
91
+ hash.key?('transactionType') ? hash['transactionType'] : nil
92
+ processing_network =
93
+ hash.key?('processingNetwork') ? hash['processingNetwork'] : SKIP
94
+ transaction_options = TransactionOptions.from_hash(hash['transactionOptions']) if
95
+ hash['transactionOptions']
96
+ transaction_value = TransactionValue.from_hash(hash['transactionValue']) if
97
+ hash['transactionValue']
98
+ if hash['enhancedTransactionData']
99
+ enhanced_transaction_data = EnhancedTransactionData.from_hash(hash['enhancedTransactionData'])
100
+ end
101
+
102
+ # Create object from extracted values.
103
+ CompleteSessionData.new(session_id,
104
+ code,
105
+ transaction_type,
106
+ processing_network,
107
+ transaction_options,
108
+ transaction_value,
109
+ enhanced_transaction_data)
110
+ end
111
+
112
+ # Provides a human-readable string representation of the object.
113
+ def to_s
114
+ class_name = self.class.name.split('::').last
115
+ "<#{class_name} session_id: #{@session_id}, code: #{@code}, transaction_type:"\
116
+ " #{@transaction_type}, processing_network: #{@processing_network}, transaction_options:"\
117
+ " #{@transaction_options}, transaction_value: #{@transaction_value},"\
118
+ " enhanced_transaction_data: #{@enhanced_transaction_data}>"
119
+ end
120
+
121
+ # Provides a debugging-friendly string with detailed object information.
122
+ def inspect
123
+ class_name = self.class.name.split('::').last
124
+ "<#{class_name} session_id: #{@session_id.inspect}, code: #{@code.inspect},"\
125
+ " transaction_type: #{@transaction_type.inspect}, processing_network:"\
126
+ " #{@processing_network.inspect}, transaction_options: #{@transaction_options.inspect},"\
127
+ " transaction_value: #{@transaction_value.inspect}, enhanced_transaction_data:"\
128
+ " #{@enhanced_transaction_data.inspect}>"
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,71 @@
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
+ # CompleteSessionResponseData Model.
8
+ class CompleteSessionResponseData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :payload_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :secure_payload
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['payload_id'] = 'payloadId'
24
+ @_hash['secure_payload'] = 'securePayload'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ secure_payload
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ []
38
+ end
39
+
40
+ def initialize(payload_id = nil, secure_payload = SKIP)
41
+ @payload_id = payload_id
42
+ @secure_payload = secure_payload unless secure_payload == SKIP
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
+ payload_id = hash.key?('payloadId') ? hash['payloadId'] : nil
51
+ secure_payload = hash.key?('securePayload') ? hash['securePayload'] : SKIP
52
+
53
+ # Create object from extracted values.
54
+ CompleteSessionResponseData.new(payload_id,
55
+ secure_payload)
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} payload_id: #{@payload_id}, secure_payload: #{@secure_payload}>"
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} payload_id: #{@payload_id.inspect}, secure_payload:"\
68
+ " #{@secure_payload.inspect}>"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,100 @@
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
+ # Consumer Model.
8
+ class Consumer < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :first_name
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :last_name
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :full_name
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :email_address
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [Phone]
30
+ attr_accessor :mobile_number
31
+
32
+ # A mapping from model property names to API property names.
33
+ def self.names
34
+ @_hash = {} if @_hash.nil?
35
+ @_hash['first_name'] = 'firstName'
36
+ @_hash['last_name'] = 'lastName'
37
+ @_hash['full_name'] = 'fullName'
38
+ @_hash['email_address'] = 'emailAddress'
39
+ @_hash['mobile_number'] = 'mobileNumber'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ first_name
47
+ last_name
48
+ mobile_number
49
+ ]
50
+ end
51
+
52
+ # An array for nullable fields
53
+ def self.nullables
54
+ []
55
+ end
56
+
57
+ def initialize(full_name = nil, email_address = nil, first_name = SKIP,
58
+ last_name = SKIP, mobile_number = SKIP)
59
+ @first_name = first_name unless first_name == SKIP
60
+ @last_name = last_name unless last_name == SKIP
61
+ @full_name = full_name
62
+ @email_address = email_address
63
+ @mobile_number = mobile_number unless mobile_number == SKIP
64
+ end
65
+
66
+ # Creates an instance of the object from a hash.
67
+ def self.from_hash(hash)
68
+ return nil unless hash
69
+
70
+ # Extract variables from the hash.
71
+ full_name = hash.key?('fullName') ? hash['fullName'] : nil
72
+ email_address = hash.key?('emailAddress') ? hash['emailAddress'] : nil
73
+ first_name = hash.key?('firstName') ? hash['firstName'] : SKIP
74
+ last_name = hash.key?('lastName') ? hash['lastName'] : SKIP
75
+ mobile_number = Phone.from_hash(hash['mobileNumber']) if hash['mobileNumber']
76
+
77
+ # Create object from extracted values.
78
+ Consumer.new(full_name,
79
+ email_address,
80
+ first_name,
81
+ last_name,
82
+ mobile_number)
83
+ end
84
+
85
+ # Provides a human-readable string representation of the object.
86
+ def to_s
87
+ class_name = self.class.name.split('::').last
88
+ "<#{class_name} first_name: #{@first_name}, last_name: #{@last_name}, full_name:"\
89
+ " #{@full_name}, email_address: #{@email_address}, mobile_number: #{@mobile_number}>"
90
+ end
91
+
92
+ # Provides a debugging-friendly string with detailed object information.
93
+ def inspect
94
+ class_name = self.class.name.split('::').last
95
+ "<#{class_name} first_name: #{@first_name.inspect}, last_name: #{@last_name.inspect},"\
96
+ " full_name: #{@full_name.inspect}, email_address: #{@email_address.inspect}, mobile_number:"\
97
+ " #{@mobile_number.inspect}>"
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,134 @@
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
+ # CreateSessionData Model.
8
+ class CreateSessionData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Client]
14
+ attr_accessor :client
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :session_id
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :callback_url_scheme
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [IntentEnum]
26
+ attr_accessor :intent
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :phone_number
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [String]
34
+ attr_accessor :email_address
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [TransactionTypeEnum]
38
+ attr_accessor :transaction_type
39
+
40
+ # TODO: Write general description for this method
41
+ # @return [TransactionValue]
42
+ attr_accessor :transaction_value
43
+
44
+ # A mapping from model property names to API property names.
45
+ def self.names
46
+ @_hash = {} if @_hash.nil?
47
+ @_hash['client'] = 'client'
48
+ @_hash['session_id'] = 'sessionId'
49
+ @_hash['callback_url_scheme'] = 'callbackURLScheme'
50
+ @_hash['intent'] = 'intent'
51
+ @_hash['phone_number'] = 'phoneNumber'
52
+ @_hash['email_address'] = 'emailAddress'
53
+ @_hash['transaction_type'] = 'transactionType'
54
+ @_hash['transaction_value'] = 'transactionValue'
55
+ @_hash
56
+ end
57
+
58
+ # An array for optional fields
59
+ def self.optionals
60
+ %w[
61
+ intent
62
+ phone_number
63
+ email_address
64
+ transaction_type
65
+ transaction_value
66
+ ]
67
+ end
68
+
69
+ # An array for nullable fields
70
+ def self.nullables
71
+ []
72
+ end
73
+
74
+ def initialize(client = nil, session_id = nil, callback_url_scheme = nil,
75
+ intent = SKIP, phone_number = SKIP, email_address = SKIP,
76
+ transaction_type = SKIP, transaction_value = SKIP)
77
+ @client = client
78
+ @session_id = session_id
79
+ @callback_url_scheme = callback_url_scheme
80
+ @intent = intent unless intent == SKIP
81
+ @phone_number = phone_number unless phone_number == SKIP
82
+ @email_address = email_address unless email_address == SKIP
83
+ @transaction_type = transaction_type unless transaction_type == SKIP
84
+ @transaction_value = transaction_value unless transaction_value == SKIP
85
+ end
86
+
87
+ # Creates an instance of the object from a hash.
88
+ def self.from_hash(hash)
89
+ return nil unless hash
90
+
91
+ # Extract variables from the hash.
92
+ client = Client.from_hash(hash['client']) if hash['client']
93
+ session_id = hash.key?('sessionId') ? hash['sessionId'] : nil
94
+ callback_url_scheme =
95
+ hash.key?('callbackURLScheme') ? hash['callbackURLScheme'] : nil
96
+ intent = hash.key?('intent') ? hash['intent'] : SKIP
97
+ phone_number = hash.key?('phoneNumber') ? hash['phoneNumber'] : SKIP
98
+ email_address = hash.key?('emailAddress') ? hash['emailAddress'] : SKIP
99
+ transaction_type =
100
+ hash.key?('transactionType') ? hash['transactionType'] : SKIP
101
+ transaction_value = TransactionValue.from_hash(hash['transactionValue']) if
102
+ hash['transactionValue']
103
+
104
+ # Create object from extracted values.
105
+ CreateSessionData.new(client,
106
+ session_id,
107
+ callback_url_scheme,
108
+ intent,
109
+ phone_number,
110
+ email_address,
111
+ transaction_type,
112
+ transaction_value)
113
+ end
114
+
115
+ # Provides a human-readable string representation of the object.
116
+ def to_s
117
+ class_name = self.class.name.split('::').last
118
+ "<#{class_name} client: #{@client}, session_id: #{@session_id}, callback_url_scheme:"\
119
+ " #{@callback_url_scheme}, intent: #{@intent}, phone_number: #{@phone_number},"\
120
+ " email_address: #{@email_address}, transaction_type: #{@transaction_type},"\
121
+ " transaction_value: #{@transaction_value}>"
122
+ end
123
+
124
+ # Provides a debugging-friendly string with detailed object information.
125
+ def inspect
126
+ class_name = self.class.name.split('::').last
127
+ "<#{class_name} client: #{@client.inspect}, session_id: #{@session_id.inspect},"\
128
+ " callback_url_scheme: #{@callback_url_scheme.inspect}, intent: #{@intent.inspect},"\
129
+ " phone_number: #{@phone_number.inspect}, email_address: #{@email_address.inspect},"\
130
+ " transaction_type: #{@transaction_type.inspect}, transaction_value:"\
131
+ " #{@transaction_value.inspect}>"
132
+ end
133
+ end
134
+ end