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.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +147 -0
- data/bin/console +15 -0
- data/lib/paze_checkout_api/api_helper.rb +10 -0
- data/lib/paze_checkout_api/client.rb +97 -0
- data/lib/paze_checkout_api/configuration.rb +221 -0
- data/lib/paze_checkout_api/controllers/base_controller.rb +60 -0
- data/lib/paze_checkout_api/controllers/checkout_session_controller.rb +108 -0
- data/lib/paze_checkout_api/controllers/identity_controller.rb +43 -0
- data/lib/paze_checkout_api/controllers/merchant_onboarding_controller.rb +39 -0
- data/lib/paze_checkout_api/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/paze_checkout_api/exceptions/api_error_response_exception.rb +67 -0
- data/lib/paze_checkout_api/exceptions/api_exception.rb +21 -0
- data/lib/paze_checkout_api/exceptions/base_response_exception.rb +75 -0
- data/lib/paze_checkout_api/exceptions/o_auth_provider_exception.rb +64 -0
- data/lib/paze_checkout_api/exceptions/simple_error_exception.rb +46 -0
- data/lib/paze_checkout_api/http/auth/o_auth2.rb +149 -0
- data/lib/paze_checkout_api/http/http_call_back.rb +10 -0
- data/lib/paze_checkout_api/http/http_method_enum.rb +10 -0
- data/lib/paze_checkout_api/http/http_request.rb +10 -0
- data/lib/paze_checkout_api/http/http_response.rb +10 -0
- data/lib/paze_checkout_api/http/proxy_settings.rb +22 -0
- data/lib/paze_checkout_api/models/api_response_metadata.rb +87 -0
- data/lib/paze_checkout_api/models/base_model.rb +110 -0
- data/lib/paze_checkout_api/models/billing_preference_enum.rb +36 -0
- data/lib/paze_checkout_api/models/checkout_session_complete_request.rb +70 -0
- data/lib/paze_checkout_api/models/checkout_session_complete_response.rb +97 -0
- data/lib/paze_checkout_api/models/checkout_session_create_request.rb +70 -0
- data/lib/paze_checkout_api/models/checkout_session_create_response.rb +97 -0
- data/lib/paze_checkout_api/models/checkout_session_review_request.rb +70 -0
- data/lib/paze_checkout_api/models/checkout_session_review_response.rb +97 -0
- data/lib/paze_checkout_api/models/client.rb +80 -0
- data/lib/paze_checkout_api/models/client_assertion_type_enum.rb +27 -0
- data/lib/paze_checkout_api/models/complete_session_data.rb +131 -0
- data/lib/paze_checkout_api/models/complete_session_response_data.rb +71 -0
- data/lib/paze_checkout_api/models/consumer.rb +100 -0
- data/lib/paze_checkout_api/models/create_session_data.rb +134 -0
- data/lib/paze_checkout_api/models/create_session_response_data.rb +71 -0
- data/lib/paze_checkout_api/models/data.rb +62 -0
- data/lib/paze_checkout_api/models/ecommerce_data.rb +109 -0
- data/lib/paze_checkout_api/models/enhanced_transaction_data.rb +71 -0
- data/lib/paze_checkout_api/models/error_detail.rb +81 -0
- data/lib/paze_checkout_api/models/error_message.rb +88 -0
- data/lib/paze_checkout_api/models/grant_type_enum.rb +26 -0
- data/lib/paze_checkout_api/models/intent_enum.rb +40 -0
- data/lib/paze_checkout_api/models/links.rb +74 -0
- data/lib/paze_checkout_api/models/masked_card.rb +107 -0
- data/lib/paze_checkout_api/models/merchant_address.rb +97 -0
- data/lib/paze_checkout_api/models/merchant_onboard_data.rb +115 -0
- data/lib/paze_checkout_api/models/merchant_onboard_request.rb +70 -0
- data/lib/paze_checkout_api/models/merchant_profile.rb +83 -0
- data/lib/paze_checkout_api/models/merchant_response.rb +122 -0
- data/lib/paze_checkout_api/models/o_auth_provider_error_enum.rb +62 -0
- data/lib/paze_checkout_api/models/o_auth_token.rb +96 -0
- data/lib/paze_checkout_api/models/o_auth_token_request.rb +75 -0
- data/lib/paze_checkout_api/models/o_auth_token_response.rb +78 -0
- data/lib/paze_checkout_api/models/onboard_merchant_key.rb +112 -0
- data/lib/paze_checkout_api/models/payload_type_indicator_enum.rb +36 -0
- data/lib/paze_checkout_api/models/payment_card_brand_enum.rb +40 -0
- data/lib/paze_checkout_api/models/payment_card_type_enum.rb +36 -0
- data/lib/paze_checkout_api/models/phone.rb +72 -0
- data/lib/paze_checkout_api/models/processing_network_enum.rb +40 -0
- data/lib/paze_checkout_api/models/review_session_data.rb +68 -0
- data/lib/paze_checkout_api/models/review_session_response_data.rb +100 -0
- data/lib/paze_checkout_api/models/shipping_address.rb +101 -0
- data/lib/paze_checkout_api/models/transaction_options.rb +87 -0
- data/lib/paze_checkout_api/models/transaction_type_enum.rb +36 -0
- data/lib/paze_checkout_api/models/transaction_value.rb +72 -0
- data/lib/paze_checkout_api/models/travel_data.rb +110 -0
- data/lib/paze_checkout_api/utilities/date_time_helper.rb +11 -0
- data/lib/paze_checkout_api/utilities/file_wrapper.rb +28 -0
- data/lib/paze_checkout_api.rb +93 -0
- metadata +157 -0
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
# OAuth 2 Authorization endpoint response
|
|
8
|
+
class OAuthToken < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Access token
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :access_token
|
|
15
|
+
|
|
16
|
+
# Type of access token
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :token_type
|
|
19
|
+
|
|
20
|
+
# Time in seconds before the access token expires
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :expires_in
|
|
23
|
+
|
|
24
|
+
# List of scopes granted
|
|
25
|
+
# This is a space-delimited list of strings.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :scope
|
|
28
|
+
|
|
29
|
+
# Time of token expiry as unix timestamp (UTC)
|
|
30
|
+
# @return [Integer]
|
|
31
|
+
attr_accessor :expiry
|
|
32
|
+
|
|
33
|
+
# Refresh token
|
|
34
|
+
# Used to get a new access token when it expires.
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :refresh_token
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['access_token'] = 'access_token'
|
|
42
|
+
@_hash['token_type'] = 'token_type'
|
|
43
|
+
@_hash['expires_in'] = 'expires_in'
|
|
44
|
+
@_hash['scope'] = 'scope'
|
|
45
|
+
@_hash['expiry'] = 'expiry'
|
|
46
|
+
@_hash['refresh_token'] = 'refresh_token'
|
|
47
|
+
@_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for optional fields
|
|
51
|
+
def self.optionals
|
|
52
|
+
%w[
|
|
53
|
+
expires_in
|
|
54
|
+
scope
|
|
55
|
+
expiry
|
|
56
|
+
refresh_token
|
|
57
|
+
]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# An array for nullable fields
|
|
61
|
+
def self.nullables
|
|
62
|
+
[]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def initialize(access_token = nil, token_type = nil, expires_in = SKIP,
|
|
66
|
+
scope = SKIP, expiry = SKIP, refresh_token = SKIP)
|
|
67
|
+
@access_token = access_token
|
|
68
|
+
@token_type = token_type
|
|
69
|
+
@expires_in = expires_in unless expires_in == SKIP
|
|
70
|
+
@scope = scope unless scope == SKIP
|
|
71
|
+
@expiry = expiry unless expiry == SKIP
|
|
72
|
+
@refresh_token = refresh_token unless refresh_token == SKIP
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Creates an instance of the object from a hash.
|
|
76
|
+
def self.from_hash(hash)
|
|
77
|
+
return nil unless hash
|
|
78
|
+
|
|
79
|
+
# Extract variables from the hash.
|
|
80
|
+
access_token = hash.key?('access_token') ? hash['access_token'] : nil
|
|
81
|
+
token_type = hash.key?('token_type') ? hash['token_type'] : nil
|
|
82
|
+
expires_in = hash.key?('expires_in') ? hash['expires_in'] : SKIP
|
|
83
|
+
scope = hash.key?('scope') ? hash['scope'] : SKIP
|
|
84
|
+
expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
|
|
85
|
+
refresh_token = hash.key?('refresh_token') ? hash['refresh_token'] : SKIP
|
|
86
|
+
|
|
87
|
+
# Create object from extracted values.
|
|
88
|
+
OAuthToken.new(access_token,
|
|
89
|
+
token_type,
|
|
90
|
+
expires_in,
|
|
91
|
+
scope,
|
|
92
|
+
expiry,
|
|
93
|
+
refresh_token)
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
# OAuthTokenRequest Model.
|
|
8
|
+
class OAuthTokenRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :grant_type
|
|
15
|
+
|
|
16
|
+
# JWT client assertion
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :client_assertion
|
|
19
|
+
|
|
20
|
+
# JWT client assertion
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_reader :client_assertion_type
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['grant_type'] = 'grant_type'
|
|
28
|
+
@_hash['client_assertion'] = 'client_assertion'
|
|
29
|
+
@_hash['client_assertion_type'] = 'client_assertion_type'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for nullable fields
|
|
39
|
+
def self.nullables
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def initialize(client_assertion = nil)
|
|
44
|
+
@grant_type = 'client_credentials'
|
|
45
|
+
@client_assertion = client_assertion
|
|
46
|
+
@client_assertion_type = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Creates an instance of the object from a hash.
|
|
50
|
+
def self.from_hash(hash)
|
|
51
|
+
return nil unless hash
|
|
52
|
+
|
|
53
|
+
# Extract variables from the hash.
|
|
54
|
+
client_assertion =
|
|
55
|
+
hash.key?('client_assertion') ? hash['client_assertion'] : nil
|
|
56
|
+
|
|
57
|
+
# Create object from extracted values.
|
|
58
|
+
OAuthTokenRequest.new(client_assertion)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Provides a human-readable string representation of the object.
|
|
62
|
+
def to_s
|
|
63
|
+
class_name = self.class.name.split('::').last
|
|
64
|
+
"<#{class_name} grant_type: #{@grant_type}, client_assertion: #{@client_assertion},"\
|
|
65
|
+
" client_assertion_type: #{@client_assertion_type}>"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
69
|
+
def inspect
|
|
70
|
+
class_name = self.class.name.split('::').last
|
|
71
|
+
"<#{class_name} grant_type: #{@grant_type.inspect}, client_assertion:"\
|
|
72
|
+
" #{@client_assertion.inspect}, client_assertion_type: #{@client_assertion_type.inspect}>"
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
# OAuthTokenResponse Model.
|
|
8
|
+
class OAuthTokenResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :access_token
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
attr_accessor :expires_in
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :token_type
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['access_token'] = 'access_token'
|
|
28
|
+
@_hash['expires_in'] = 'expires_in'
|
|
29
|
+
@_hash['token_type'] = 'token_type'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for nullable fields
|
|
39
|
+
def self.nullables
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def initialize(access_token = nil, expires_in = nil, token_type = nil)
|
|
44
|
+
@access_token = access_token
|
|
45
|
+
@expires_in = expires_in
|
|
46
|
+
@token_type = token_type
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Creates an instance of the object from a hash.
|
|
50
|
+
def self.from_hash(hash)
|
|
51
|
+
return nil unless hash
|
|
52
|
+
|
|
53
|
+
# Extract variables from the hash.
|
|
54
|
+
access_token = hash.key?('access_token') ? hash['access_token'] : nil
|
|
55
|
+
expires_in = hash.key?('expires_in') ? hash['expires_in'] : nil
|
|
56
|
+
token_type = hash.key?('token_type') ? hash['token_type'] : nil
|
|
57
|
+
|
|
58
|
+
# Create object from extracted values.
|
|
59
|
+
OAuthTokenResponse.new(access_token,
|
|
60
|
+
expires_in,
|
|
61
|
+
token_type)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Provides a human-readable string representation of the object.
|
|
65
|
+
def to_s
|
|
66
|
+
class_name = self.class.name.split('::').last
|
|
67
|
+
"<#{class_name} access_token: #{@access_token}, expires_in: #{@expires_in}, token_type:"\
|
|
68
|
+
" #{@token_type}>"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
72
|
+
def inspect
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} access_token: #{@access_token.inspect}, expires_in: #{@expires_in.inspect},"\
|
|
75
|
+
" token_type: #{@token_type.inspect}>"
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
# OnboardMerchantKey Model.
|
|
9
|
+
class OnboardMerchantKey < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :partner_id
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :partner_key_alias
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :certificate
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :key_alias
|
|
28
|
+
|
|
29
|
+
# TODO: Write general description for this method
|
|
30
|
+
# @return [DateTime]
|
|
31
|
+
attr_accessor :key_expiry
|
|
32
|
+
|
|
33
|
+
# A mapping from model property names to API property names.
|
|
34
|
+
def self.names
|
|
35
|
+
@_hash = {} if @_hash.nil?
|
|
36
|
+
@_hash['partner_id'] = 'partnerId'
|
|
37
|
+
@_hash['partner_key_alias'] = 'partnerKeyAlias'
|
|
38
|
+
@_hash['certificate'] = 'certificate'
|
|
39
|
+
@_hash['key_alias'] = 'keyAlias'
|
|
40
|
+
@_hash['key_expiry'] = 'keyExpiry'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
%w[
|
|
47
|
+
partner_id
|
|
48
|
+
partner_key_alias
|
|
49
|
+
certificate
|
|
50
|
+
key_alias
|
|
51
|
+
key_expiry
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# An array for nullable fields
|
|
56
|
+
def self.nullables
|
|
57
|
+
[]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def initialize(partner_id = SKIP, partner_key_alias = SKIP,
|
|
61
|
+
certificate = SKIP, key_alias = SKIP, key_expiry = SKIP)
|
|
62
|
+
@partner_id = partner_id unless partner_id == SKIP
|
|
63
|
+
@partner_key_alias = partner_key_alias unless partner_key_alias == SKIP
|
|
64
|
+
@certificate = certificate unless certificate == SKIP
|
|
65
|
+
@key_alias = key_alias unless key_alias == SKIP
|
|
66
|
+
@key_expiry = key_expiry unless key_expiry == SKIP
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Creates an instance of the object from a hash.
|
|
70
|
+
def self.from_hash(hash)
|
|
71
|
+
return nil unless hash
|
|
72
|
+
|
|
73
|
+
# Extract variables from the hash.
|
|
74
|
+
partner_id = hash.key?('partnerId') ? hash['partnerId'] : SKIP
|
|
75
|
+
partner_key_alias =
|
|
76
|
+
hash.key?('partnerKeyAlias') ? hash['partnerKeyAlias'] : SKIP
|
|
77
|
+
certificate = hash.key?('certificate') ? hash['certificate'] : SKIP
|
|
78
|
+
key_alias = hash.key?('keyAlias') ? hash['keyAlias'] : SKIP
|
|
79
|
+
key_expiry = if hash.key?('keyExpiry')
|
|
80
|
+
(DateTimeHelper.from_rfc3339(hash['keyExpiry']) if hash['keyExpiry'])
|
|
81
|
+
else
|
|
82
|
+
SKIP
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Create object from extracted values.
|
|
86
|
+
OnboardMerchantKey.new(partner_id,
|
|
87
|
+
partner_key_alias,
|
|
88
|
+
certificate,
|
|
89
|
+
key_alias,
|
|
90
|
+
key_expiry)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def to_custom_key_expiry
|
|
94
|
+
DateTimeHelper.to_rfc3339(key_expiry)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Provides a human-readable string representation of the object.
|
|
98
|
+
def to_s
|
|
99
|
+
class_name = self.class.name.split('::').last
|
|
100
|
+
"<#{class_name} partner_id: #{@partner_id}, partner_key_alias: #{@partner_key_alias},"\
|
|
101
|
+
" certificate: #{@certificate}, key_alias: #{@key_alias}, key_expiry: #{@key_expiry}>"
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
105
|
+
def inspect
|
|
106
|
+
class_name = self.class.name.split('::').last
|
|
107
|
+
"<#{class_name} partner_id: #{@partner_id.inspect}, partner_key_alias:"\
|
|
108
|
+
" #{@partner_key_alias.inspect}, certificate: #{@certificate.inspect}, key_alias:"\
|
|
109
|
+
" #{@key_alias.inspect}, key_expiry: #{@key_expiry.inspect}>"
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
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
|
+
# PayloadTypeIndicator.
|
|
8
|
+
class PayloadTypeIndicatorEnum
|
|
9
|
+
PAYLOAD_TYPE_INDICATOR_ENUM = [
|
|
10
|
+
# TODO: Write general description for ID
|
|
11
|
+
ID = 'ID'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for PAYMENT
|
|
14
|
+
PAYMENT = 'PAYMENT'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
PAYLOAD_TYPE_INDICATOR_ENUM.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = ID)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'id' then ID
|
|
30
|
+
when 'payment' then PAYMENT
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
# PaymentCardBrand.
|
|
8
|
+
class PaymentCardBrandEnum
|
|
9
|
+
PAYMENT_CARD_BRAND_ENUM = [
|
|
10
|
+
# TODO: Write general description for VISA
|
|
11
|
+
VISA = 'VISA'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for MASTERCARD
|
|
14
|
+
MASTERCARD = 'MASTERCARD'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DISCOVER
|
|
17
|
+
DISCOVER = 'DISCOVER'.freeze
|
|
18
|
+
].freeze
|
|
19
|
+
|
|
20
|
+
def self.validate(value)
|
|
21
|
+
return false if value.nil?
|
|
22
|
+
|
|
23
|
+
PAYMENT_CARD_BRAND_ENUM.include?(value)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = VISA)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'visa' then VISA
|
|
33
|
+
when 'mastercard' then MASTERCARD
|
|
34
|
+
when 'discover' then DISCOVER
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
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
|
+
# PaymentCardType.
|
|
8
|
+
class PaymentCardTypeEnum
|
|
9
|
+
PAYMENT_CARD_TYPE_ENUM = [
|
|
10
|
+
# TODO: Write general description for CREDIT
|
|
11
|
+
CREDIT = 'CREDIT'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for DEBIT
|
|
14
|
+
DEBIT = 'DEBIT'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
PAYMENT_CARD_TYPE_ENUM.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = CREDIT)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'credit' then CREDIT
|
|
30
|
+
when 'debit' then DEBIT
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
# Phone Model.
|
|
8
|
+
class Phone < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :country_code
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :phone_number
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['country_code'] = 'countryCode'
|
|
24
|
+
@_hash['phone_number'] = 'phoneNumber'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
country_code
|
|
32
|
+
phone_number
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(country_code = SKIP, phone_number = SKIP)
|
|
42
|
+
@country_code = country_code unless country_code == SKIP
|
|
43
|
+
@phone_number = phone_number unless phone_number == SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Creates an instance of the object from a hash.
|
|
47
|
+
def self.from_hash(hash)
|
|
48
|
+
return nil unless hash
|
|
49
|
+
|
|
50
|
+
# Extract variables from the hash.
|
|
51
|
+
country_code = hash.key?('countryCode') ? hash['countryCode'] : SKIP
|
|
52
|
+
phone_number = hash.key?('phoneNumber') ? hash['phoneNumber'] : SKIP
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
Phone.new(country_code,
|
|
56
|
+
phone_number)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Provides a human-readable string representation of the object.
|
|
60
|
+
def to_s
|
|
61
|
+
class_name = self.class.name.split('::').last
|
|
62
|
+
"<#{class_name} country_code: #{@country_code}, phone_number: #{@phone_number}>"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
66
|
+
def inspect
|
|
67
|
+
class_name = self.class.name.split('::').last
|
|
68
|
+
"<#{class_name} country_code: #{@country_code.inspect}, phone_number:"\
|
|
69
|
+
" #{@phone_number.inspect}>"
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
# ProcessingNetwork.
|
|
8
|
+
class ProcessingNetworkEnum
|
|
9
|
+
PROCESSING_NETWORK_ENUM = [
|
|
10
|
+
# TODO: Write general description for VISA
|
|
11
|
+
VISA = 'VISA'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for MASTERCARD
|
|
14
|
+
MASTERCARD = 'MASTERCARD'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DISCOVER
|
|
17
|
+
DISCOVER = 'DISCOVER'.freeze
|
|
18
|
+
].freeze
|
|
19
|
+
|
|
20
|
+
def self.validate(value)
|
|
21
|
+
return false if value.nil?
|
|
22
|
+
|
|
23
|
+
PROCESSING_NETWORK_ENUM.include?(value)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = VISA)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'visa' then VISA
|
|
33
|
+
when 'mastercard' then MASTERCARD
|
|
34
|
+
when 'discover' then DISCOVER
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
# ReviewSessionData Model.
|
|
8
|
+
class ReviewSessionData < 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
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['session_id'] = 'sessionId'
|
|
24
|
+
@_hash['code'] = 'code'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(session_id = nil, code = nil)
|
|
39
|
+
@session_id = session_id
|
|
40
|
+
@code = code
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
session_id = hash.key?('sessionId') ? hash['sessionId'] : nil
|
|
49
|
+
code = hash.key?('code') ? hash['code'] : nil
|
|
50
|
+
|
|
51
|
+
# Create object from extracted values.
|
|
52
|
+
ReviewSessionData.new(session_id,
|
|
53
|
+
code)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Provides a human-readable string representation of the object.
|
|
57
|
+
def to_s
|
|
58
|
+
class_name = self.class.name.split('::').last
|
|
59
|
+
"<#{class_name} session_id: #{@session_id}, code: #{@code}>"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
63
|
+
def inspect
|
|
64
|
+
class_name = self.class.name.split('::').last
|
|
65
|
+
"<#{class_name} session_id: #{@session_id.inspect}, code: #{@code.inspect}>"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|