cybersource_rest_client 0.0.30 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/AuthenticationSDK/authentication/oauth/OAuthToken.rb +15 -0
- data/lib/AuthenticationSDK/core/Authorization.rb +4 -1
- data/lib/AuthenticationSDK/core/MerchantConfig.rb +93 -19
- data/lib/AuthenticationSDK/util/Constants.rb +77 -75
- data/lib/cybersource_rest_client/api/o_auth_api.rb +104 -0
- data/lib/cybersource_rest_client/api/payments_api.rb +2 -2
- data/lib/cybersource_rest_client/api/refund_api.rb +4 -4
- data/lib/cybersource_rest_client/api/void_api.rb +4 -4
- data/lib/cybersource_rest_client/api_client.rb +31 -8
- data/lib/cybersource_rest_client/configuration.rb +2 -2
- data/lib/cybersource_rest_client/models/access_token_response.rb +244 -0
- data/lib/cybersource_rest_client/models/add_negative_list_request.rb +1 -1
- data/lib/cybersource_rest_client/models/bad_request_error.rb +192 -0
- data/lib/cybersource_rest_client/models/create_access_token_request.rb +254 -0
- data/lib/cybersource_rest_client/models/fraud_marking_action_request.rb +1 -1
- data/lib/cybersource_rest_client/models/inline_response_400_2.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoice_settings_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response_customer_information.rb +20 -4
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response_invoices.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get404_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get502_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_get200_response.rb +2 -2
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/invoicing_v2_invoices_post202_response.rb +1 -1
- data/lib/cybersource_rest_client/models/invoicingv2invoices_customer_information.rb +20 -4
- data/lib/cybersource_rest_client/models/kms_v2_keys_asym_deletes_post200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_asym_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_asym_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_sym_deletes_post200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_sym_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/kms_v2_keys_sym_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get500_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch201_response_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch201_response_processor_information.rb +6 -0
- data/lib/cybersource_rest_client/models/pts_v2_incremental_authorization_patch400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response.rb +13 -4
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information.rb +11 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information.rb +13 -4
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_reward_points_details.rb +270 -0
- data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_payment_information_card.rb → pts_v2_payments_post201_response_payment_account_information.rb} +8 -9
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card.rb +242 -0
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +9 -13
- data/lib/cybersource_rest_client/models/pts_v2_payments_post400_response.rb +2 -2
- data/lib/cybersource_rest_client/models/pts_v2_payments_post502_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb +6 -0
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_recipient_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payments_client_reference_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +27 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +6 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +4 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_fluid_data.rb +3 -3
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +38 -38
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +16 -6
- data/lib/cybersource_rest_client/models/ptsv2payments_risk_information.rb +15 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_risk_information_auxiliary_data.rb +207 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_payment_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +15 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +4 -4
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_client_reference_information.rb +17 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +6 -0
- data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +4 -4
- data/lib/cybersource_rest_client/models/resource_not_found_error.rb +192 -0
- data/lib/cybersource_rest_client/models/risk_v1_address_verifications_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_authentication_setups_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post400_response_1.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_decisions_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_decisions_post400_response_1.rb +1 -1
- data/lib/cybersource_rest_client/models/risk_v1_export_compliance_inquiries_post201_response.rb +3 -3
- data/lib/cybersource_rest_client/models/risk_v1_update_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_fluid_data.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1authenticationsetups_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_client_reference_information.rb +17 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +1 -11
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_risk_information.rb +15 -4
- data/lib/cybersource_rest_client/models/riskv1liststypeentries_client_reference_information.rb +224 -0
- data/lib/cybersource_rest_client/models/riskv1liststypeentries_payment_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response.rb +3 -3
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_consumer_authentication_information.rb +13 -4
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_consumer_authentication_information_strong_authentication.rb +254 -0
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +5 -5
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_authorization_options.rb +13 -4
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +8 -12
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_risk_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_merchant_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_order_information_bill_to.rb +17 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +3 -3
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processor_information.rb +6 -0
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_transaction_summaries.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/unauthorized_client_error.rb +192 -0
- data/lib/cybersource_rest_client/models/validate_export_compliance_request.rb +1 -1
- data/lib/cybersource_rest_client/models/vas_v2_payments_post201_response.rb +2 -2
- data/lib/cybersource_rest_client/models/vas_v2_payments_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/vas_v2_tax_void200_response.rb +2 -2
- data/lib/cybersource_rest_client/models/vas_v2_tax_voids_post400_response.rb +1 -1
- data/lib/cybersource_rest_client/models/verify_customer_address_request.rb +1 -1
- data/lib/cybersource_rest_client.rb +12 -1
- metadata +113 -93
- data/lib/AuthenticationSDK/resource/TRRReports.json +0 -12
- data/lib/AuthenticationSDK/resource/cybs.yml +0 -31
- data/lib/AuthenticationSDK/resource/request.json +0 -54
- data/lib/AuthenticationSDK/resource/request_capture.json +0 -11
- data/lib/AuthenticationSDK/resource/testrest.p12 +0 -0
- data/lib/AuthenticationSDK/spec/Authorization_spec.rb +0 -274
- data/lib/AuthenticationSDK/spec/MerchantConfigData.rb +0 -59
- data/lib/AuthenticationSDK/spec/MerchantConfig_spec.rb +0 -116
- data/lib/AuthenticationSDK/spec/PostRequestData.json +0 -54
- data/lib/AuthenticationSDK/spec/PutRequestData.json +0 -12
- data/lib/AuthenticationSDK/spec/ResponseCodeMessage_spec.rb +0 -60
- data/lib/AuthenticationSDK/spec/spec_helper.rb +0 -12
@@ -0,0 +1,192 @@
|
|
1
|
+
=begin
|
2
|
+
#OAuth2 API
|
3
|
+
|
4
|
+
#OAuth2 Token Service (OAuth2)
|
5
|
+
|
6
|
+
OpenAPI spec version: v3
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CyberSource
|
16
|
+
class BadRequestError
|
17
|
+
attr_accessor :error
|
18
|
+
|
19
|
+
attr_accessor :error_description
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'error' => :'error',
|
25
|
+
:'error_description' => :'error_description'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'error' => :'String',
|
33
|
+
:'error_description' => :'String'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
44
|
+
|
45
|
+
if attributes.has_key?(:'error')
|
46
|
+
self.error = attributes[:'error']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.has_key?(:'error_description')
|
50
|
+
self.error_description = attributes[:'error_description']
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
55
|
+
# @return Array for valid properties with the reasons
|
56
|
+
def list_invalid_properties
|
57
|
+
invalid_properties = Array.new
|
58
|
+
invalid_properties
|
59
|
+
end
|
60
|
+
|
61
|
+
# Check to see if the all the properties in the model are valid
|
62
|
+
# @return true if the model is valid
|
63
|
+
def valid?
|
64
|
+
true
|
65
|
+
end
|
66
|
+
|
67
|
+
# Checks equality by comparing each attribute.
|
68
|
+
# @param [Object] Object to be compared
|
69
|
+
def ==(o)
|
70
|
+
return true if self.equal?(o)
|
71
|
+
self.class == o.class &&
|
72
|
+
error == o.error &&
|
73
|
+
error_description == o.error_description
|
74
|
+
end
|
75
|
+
|
76
|
+
# @see the `==` method
|
77
|
+
# @param [Object] Object to be compared
|
78
|
+
def eql?(o)
|
79
|
+
self == o
|
80
|
+
end
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Fixnum] Hash code
|
84
|
+
def hash
|
85
|
+
[error, error_description].hash
|
86
|
+
end
|
87
|
+
|
88
|
+
# Builds the object from hash
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
# @return [Object] Returns the model itself
|
91
|
+
def build_from_hash(attributes)
|
92
|
+
return nil unless attributes.is_a?(Hash)
|
93
|
+
self.class.swagger_types.each_pair do |key, type|
|
94
|
+
if type =~ /\AArray<(.*)>/i
|
95
|
+
# check to ensure the input is an array given that the the attribute
|
96
|
+
# is documented as an array but the input is not
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
+
end
|
100
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
+
end
|
104
|
+
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserializes the data based on type
|
109
|
+
# @param string type Data type
|
110
|
+
# @param string value Value to be deserialized
|
111
|
+
# @return [Object] Deserialized data
|
112
|
+
def _deserialize(type, value)
|
113
|
+
case type.to_sym
|
114
|
+
when :DateTime
|
115
|
+
DateTime.parse(value)
|
116
|
+
when :Date
|
117
|
+
Date.parse(value)
|
118
|
+
when :String
|
119
|
+
value.to_s
|
120
|
+
when :Integer
|
121
|
+
value.to_i
|
122
|
+
when :Float
|
123
|
+
value.to_f
|
124
|
+
when :BOOLEAN
|
125
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
+
true
|
127
|
+
else
|
128
|
+
false
|
129
|
+
end
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
else # model
|
145
|
+
temp_model = CyberSource.const_get(type).new
|
146
|
+
temp_model.build_from_hash(value)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Returns the string representation of the object
|
151
|
+
# @return [String] String presentation of the object
|
152
|
+
def to_s
|
153
|
+
to_hash.to_s
|
154
|
+
end
|
155
|
+
|
156
|
+
# to_body is an alias to to_hash (backward compatibility)
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
158
|
+
def to_body
|
159
|
+
to_hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the object in the form of hash
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_hash
|
165
|
+
hash = {}
|
166
|
+
self.class.attribute_map.each_pair do |attr, param|
|
167
|
+
value = self.send(attr)
|
168
|
+
next if value.nil?
|
169
|
+
hash[param] = _to_hash(value)
|
170
|
+
end
|
171
|
+
hash
|
172
|
+
end
|
173
|
+
|
174
|
+
# Outputs non-array value in the form of hash
|
175
|
+
# For object, use to_hash. Otherwise, just return the value
|
176
|
+
# @param [Object] value Any valid value
|
177
|
+
# @return [Hash] Returns the value in the form of hash
|
178
|
+
def _to_hash(value)
|
179
|
+
if value.is_a?(Array)
|
180
|
+
value.compact.map { |v| _to_hash(v) }
|
181
|
+
elsif value.is_a?(Hash)
|
182
|
+
{}.tap do |hash|
|
183
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
184
|
+
end
|
185
|
+
elsif value.respond_to? :to_hash
|
186
|
+
value.to_hash
|
187
|
+
else
|
188
|
+
value
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
@@ -0,0 +1,254 @@
|
|
1
|
+
=begin
|
2
|
+
#OAuth2 API
|
3
|
+
|
4
|
+
#OAuth2 Token Service (OAuth2)
|
5
|
+
|
6
|
+
OpenAPI spec version: v3
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CyberSource
|
16
|
+
class CreateAccessTokenRequest
|
17
|
+
# The client ID that you received when you registered your application in the CyberSource Business Center. This identifies your client application.
|
18
|
+
attr_accessor :client_id
|
19
|
+
|
20
|
+
# The client secret that you received when you registered your application in the CyberSource Business Center.
|
21
|
+
attr_accessor :client_secret
|
22
|
+
|
23
|
+
# The grant type value determines which type of flow is used to obtain the access token. The first time your application requests a token, use the value `authorization_code`. When you use this value, you must also include the `code` field in the request. For subsequent request, use `refresh_token`. When you use this value, you must also include the `refresh_token` field in the request. Valid values: - authorization_code - refresh_token
|
24
|
+
attr_accessor :grant_type
|
25
|
+
|
26
|
+
# This value is sent by CyberSource in the redirect URL. For security reasons, the code expires in 10 minutes. If it expires, you must repeat the redirect to request another. Conditional. This value is equired if grant_type is `authorization_code`.
|
27
|
+
attr_accessor :code
|
28
|
+
|
29
|
+
# Conditional. Required if grant_type is `refresh_token`.
|
30
|
+
attr_accessor :refresh_token
|
31
|
+
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:'client_id' => :'client_id',
|
36
|
+
:'client_secret' => :'client_secret',
|
37
|
+
:'grant_type' => :'grant_type',
|
38
|
+
:'code' => :'code',
|
39
|
+
:'refresh_token' => :'refresh_token'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.swagger_types
|
45
|
+
{
|
46
|
+
:'client_id' => :'String',
|
47
|
+
:'client_secret' => :'String',
|
48
|
+
:'grant_type' => :'String',
|
49
|
+
:'code' => :'String',
|
50
|
+
:'refresh_token' => :'String'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
return unless attributes.is_a?(Hash)
|
58
|
+
|
59
|
+
# convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
61
|
+
|
62
|
+
if attributes.has_key?(:'client_id')
|
63
|
+
self.client_id = attributes[:'client_id']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.has_key?(:'client_secret')
|
67
|
+
self.client_secret = attributes[:'client_secret']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.has_key?(:'grant_type')
|
71
|
+
self.grant_type = attributes[:'grant_type']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.has_key?(:'code')
|
75
|
+
self.code = attributes[:'code']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.has_key?(:'refresh_token')
|
79
|
+
self.refresh_token = attributes[:'refresh_token']
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
84
|
+
# @return Array for valid properties with the reasons
|
85
|
+
def list_invalid_properties
|
86
|
+
invalid_properties = Array.new
|
87
|
+
if @client_id.nil?
|
88
|
+
invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
|
89
|
+
end
|
90
|
+
|
91
|
+
if @client_secret.nil?
|
92
|
+
invalid_properties.push('invalid value for "client_secret", client_secret cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
invalid_properties
|
96
|
+
end
|
97
|
+
|
98
|
+
# Check to see if the all the properties in the model are valid
|
99
|
+
# @return true if the model is valid
|
100
|
+
def valid?
|
101
|
+
return false if @client_id.nil?
|
102
|
+
return false if @client_secret.nil?
|
103
|
+
true
|
104
|
+
end
|
105
|
+
|
106
|
+
# Custom attribute writer method with validation
|
107
|
+
# @param [Object] client_id Value to be assigned
|
108
|
+
def client_id=(client_id)
|
109
|
+
if client_id.nil?
|
110
|
+
fail ArgumentError, 'client_id cannot be nil'
|
111
|
+
end
|
112
|
+
|
113
|
+
@client_id = client_id
|
114
|
+
end
|
115
|
+
|
116
|
+
# Custom attribute writer method with validation
|
117
|
+
# @param [Object] client_secret Value to be assigned
|
118
|
+
def client_secret=(client_secret)
|
119
|
+
if client_secret.nil?
|
120
|
+
fail ArgumentError, 'client_secret cannot be nil'
|
121
|
+
end
|
122
|
+
|
123
|
+
@client_secret = client_secret
|
124
|
+
end
|
125
|
+
|
126
|
+
# Checks equality by comparing each attribute.
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def ==(o)
|
129
|
+
return true if self.equal?(o)
|
130
|
+
self.class == o.class &&
|
131
|
+
client_id == o.client_id &&
|
132
|
+
client_secret == o.client_secret &&
|
133
|
+
grant_type == o.grant_type &&
|
134
|
+
code == o.code &&
|
135
|
+
refresh_token == o.refresh_token
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(o)
|
141
|
+
self == o
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Fixnum] Hash code
|
146
|
+
def hash
|
147
|
+
[client_id, client_secret, grant_type, code, refresh_token].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def build_from_hash(attributes)
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
155
|
+
self.class.swagger_types.each_pair do |key, type|
|
156
|
+
if type =~ /\AArray<(.*)>/i
|
157
|
+
# check to ensure the input is an array given that the the attribute
|
158
|
+
# is documented as an array but the input is not
|
159
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
160
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
161
|
+
end
|
162
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
163
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
164
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
165
|
+
end
|
166
|
+
|
167
|
+
self
|
168
|
+
end
|
169
|
+
|
170
|
+
# Deserializes the data based on type
|
171
|
+
# @param string type Data type
|
172
|
+
# @param string value Value to be deserialized
|
173
|
+
# @return [Object] Deserialized data
|
174
|
+
def _deserialize(type, value)
|
175
|
+
case type.to_sym
|
176
|
+
when :DateTime
|
177
|
+
DateTime.parse(value)
|
178
|
+
when :Date
|
179
|
+
Date.parse(value)
|
180
|
+
when :String
|
181
|
+
value.to_s
|
182
|
+
when :Integer
|
183
|
+
value.to_i
|
184
|
+
when :Float
|
185
|
+
value.to_f
|
186
|
+
when :BOOLEAN
|
187
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
188
|
+
true
|
189
|
+
else
|
190
|
+
false
|
191
|
+
end
|
192
|
+
when :Object
|
193
|
+
# generic object (usually a Hash), return directly
|
194
|
+
value
|
195
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
196
|
+
inner_type = Regexp.last_match[:inner_type]
|
197
|
+
value.map { |v| _deserialize(inner_type, v) }
|
198
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
199
|
+
k_type = Regexp.last_match[:k_type]
|
200
|
+
v_type = Regexp.last_match[:v_type]
|
201
|
+
{}.tap do |hash|
|
202
|
+
value.each do |k, v|
|
203
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
else # model
|
207
|
+
temp_model = CyberSource.const_get(type).new
|
208
|
+
temp_model.build_from_hash(value)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the string representation of the object
|
213
|
+
# @return [String] String presentation of the object
|
214
|
+
def to_s
|
215
|
+
to_hash.to_s
|
216
|
+
end
|
217
|
+
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
220
|
+
def to_body
|
221
|
+
to_hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the object in the form of hash
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_hash
|
227
|
+
hash = {}
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
229
|
+
value = self.send(attr)
|
230
|
+
next if value.nil?
|
231
|
+
hash[param] = _to_hash(value)
|
232
|
+
end
|
233
|
+
hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Outputs non-array value in the form of hash
|
237
|
+
# For object, use to_hash. Otherwise, just return the value
|
238
|
+
# @param [Object] value Any valid value
|
239
|
+
# @return [Hash] Returns the value in the form of hash
|
240
|
+
def _to_hash(value)
|
241
|
+
if value.is_a?(Array)
|
242
|
+
value.compact.map { |v| _to_hash(v) }
|
243
|
+
elsif value.is_a?(Hash)
|
244
|
+
{}.tap do |hash|
|
245
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
246
|
+
end
|
247
|
+
elsif value.respond_to? :to_hash
|
248
|
+
value.to_hash
|
249
|
+
else
|
250
|
+
value
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
@@ -30,7 +30,7 @@ module CyberSource
|
|
30
30
|
def self.swagger_types
|
31
31
|
{
|
32
32
|
:'risk_information' => :'Riskv1decisionsidmarkingRiskInformation',
|
33
|
-
:'client_reference_information' => :'
|
33
|
+
:'client_reference_information' => :'Riskv1liststypeentriesClientReferenceInformation'
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|