cybersource_rest_client 0.0.29 → 0.0.33

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 (103) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/authentication/oauth/OAuthToken.rb +15 -0
  3. data/lib/AuthenticationSDK/core/Authorization.rb +4 -1
  4. data/lib/AuthenticationSDK/core/MerchantConfig.rb +93 -19
  5. data/lib/AuthenticationSDK/util/Constants.rb +78 -76
  6. data/lib/cybersource_rest_client.rb +19 -9
  7. data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +3 -3
  8. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +3 -3
  9. data/lib/cybersource_rest_client/api/o_auth_api.rb +104 -0
  10. data/lib/cybersource_rest_client/api/payments_api.rb +2 -2
  11. data/lib/cybersource_rest_client/api/refund_api.rb +4 -4
  12. data/lib/cybersource_rest_client/api/void_api.rb +4 -4
  13. data/lib/cybersource_rest_client/api_client.rb +31 -8
  14. data/lib/cybersource_rest_client/configuration.rb +2 -2
  15. data/lib/cybersource_rest_client/models/access_token_response.rb +244 -0
  16. data/lib/cybersource_rest_client/models/add_negative_list_request.rb +1 -1
  17. data/lib/cybersource_rest_client/models/bad_request_error.rb +192 -0
  18. data/lib/cybersource_rest_client/models/create_access_token_request.rb +254 -0
  19. data/lib/cybersource_rest_client/models/fraud_marking_action_request.rb +1 -1
  20. data/lib/cybersource_rest_client/models/invoicing_v2_invoices_all_get200_response_customer_information.rb +20 -4
  21. data/lib/cybersource_rest_client/models/invoicingv2invoices_customer_information.rb +20 -4
  22. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer.rb → payment_instrument_list.rb} +3 -3
  23. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer__embedded.rb → payment_instrument_list__embedded.rb} +1 -1
  24. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer__links.rb → payment_instrument_list__links.rb} +6 -6
  25. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer__links_first.rb → payment_instrument_list__links_first.rb} +1 -1
  26. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer__links_last.rb → payment_instrument_list__links_last.rb} +1 -1
  27. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer__links_next.rb → payment_instrument_list__links_next.rb} +1 -1
  28. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer__links_prev.rb → payment_instrument_list__links_prev.rb} +1 -1
  29. data/lib/cybersource_rest_client/models/{payment_instrument_list_for_customer__links_self.rb → payment_instrument_list__links_self.rb} +1 -1
  30. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response.rb +10 -1
  31. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information.rb +11 -1
  32. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information.rb +13 -4
  33. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_reward_points_details.rb +270 -0
  34. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information.rb +183 -0
  35. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card.rb +242 -0
  36. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +1 -1
  37. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +1 -1
  38. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processing_information.rb +1 -1
  39. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +17 -1
  40. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_routing.rb +3 -3
  41. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb +6 -0
  42. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_recipient_information_card.rb +1 -1
  43. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +1 -1
  44. data/lib/cybersource_rest_client/models/ptsv2payments_client_reference_information.rb +1 -1
  45. data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +60 -2
  46. data/lib/cybersource_rest_client/models/ptsv2payments_health_care_information_amount_details.rb +1 -1
  47. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +6 -0
  48. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +4 -4
  49. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_fluid_data.rb +3 -3
  50. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
  51. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +36 -38
  52. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +15 -5
  53. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +7 -7
  54. data/lib/cybersource_rest_client/models/ptsv2payments_recurring_payment_information.rb +24 -4
  55. data/lib/cybersource_rest_client/models/ptsv2payments_risk_information.rb +15 -4
  56. data/lib/cybersource_rest_client/models/ptsv2payments_risk_information_auxiliary_data.rb +207 -0
  57. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_payment_information_card.rb +1 -1
  58. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +15 -5
  59. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +4 -4
  60. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information.rb +1 -1
  61. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_client_reference_information.rb +17 -1
  62. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_processing_information.rb +1 -1
  63. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +6 -0
  64. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +4 -4
  65. data/lib/cybersource_rest_client/models/resource_not_found_error.rb +192 -0
  66. data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +1 -1
  67. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +3 -3
  68. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +1 -1
  69. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_card.rb +3 -3
  70. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +1 -1
  71. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_card.rb +3 -3
  72. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_fluid_data.rb +3 -3
  73. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_tokenized_card.rb +1 -1
  74. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_processing_information.rb +1 -1
  75. data/lib/cybersource_rest_client/models/riskv1decisions_client_reference_information.rb +17 -1
  76. data/lib/cybersource_rest_client/models/riskv1decisions_consumer_authentication_information.rb +1 -1
  77. data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +1 -11
  78. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +3 -3
  79. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
  80. data/lib/cybersource_rest_client/models/riskv1decisions_risk_information.rb +15 -4
  81. data/lib/cybersource_rest_client/models/riskv1liststypeentries_client_reference_information.rb +224 -0
  82. data/lib/cybersource_rest_client/models/riskv1liststypeentries_payment_information_card.rb +1 -1
  83. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +5 -5
  84. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_authorization_options.rb +13 -4
  85. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +3 -3
  86. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +1 -1
  87. data/lib/cybersource_rest_client/models/unauthorized_client_error.rb +192 -0
  88. data/lib/cybersource_rest_client/models/validate_export_compliance_request.rb +1 -1
  89. data/lib/cybersource_rest_client/models/verify_customer_address_request.rb +1 -1
  90. metadata +120 -101
  91. data/lib/AuthenticationSDK/resource/TRRReports.json +0 -12
  92. data/lib/AuthenticationSDK/resource/cybs.yml +0 -31
  93. data/lib/AuthenticationSDK/resource/request.json +0 -54
  94. data/lib/AuthenticationSDK/resource/request_capture.json +0 -11
  95. data/lib/AuthenticationSDK/resource/testrest.p12 +0 -0
  96. data/lib/AuthenticationSDK/spec/Authorization_spec.rb +0 -274
  97. data/lib/AuthenticationSDK/spec/MerchantConfigData.rb +0 -59
  98. data/lib/AuthenticationSDK/spec/MerchantConfig_spec.rb +0 -116
  99. data/lib/AuthenticationSDK/spec/PostRequestData.json +0 -54
  100. data/lib/AuthenticationSDK/spec/PutRequestData.json +0 -12
  101. data/lib/AuthenticationSDK/spec/ResponseCodeMessage_spec.rb +0 -60
  102. data/lib/AuthenticationSDK/spec/spec_helper.rb +0 -12
  103. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_card.rb +0 -184
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d0fbf952098aeb918a7b78ec06dda15c74004c5067755c41ac275b7c07a09ac
4
- data.tar.gz: 72db90d8a2d9ff167a44ce068a9f572f3e0da693b07272f6f1f7a5556f3b8ddc
3
+ metadata.gz: 24ef8c5c250397dd132257948c7593810309c5e98c737b3f0b49cd816cb2cae3
4
+ data.tar.gz: bc1876ffa7d0dedc87fdf4056d944a7b6d21a07593b94bc7e93921c9ca202de8
5
5
  SHA512:
6
- metadata.gz: a355afabf680bf375785f8adced5108b99a13b29403648337de0d07862200323701f23618b82e94143cc4df4700e735791b43b04c7c921f60edbc9f2397eb4ed
7
- data.tar.gz: 78090791ce4c5f79e779188b3d0efd400f115b0eed18f361ba33ff46d62235b223840fc03414eee6d973ae645c53bfd09f0a87feb29cc50df16040c34992384a
6
+ metadata.gz: 1d7defc6a9a4ffdcd3b2e60c5d6d95e293e42fdf7b3b8b56025aaa49faa025290de080bfc789cc4731ed9d13083a1bd8b37b9a61328cb14ab60069c3611953bd
7
+ data.tar.gz: 9d916792b1fa803359cd2591350685d7bb895a991fe35ad68ccefd7ad6ed370f82b384e9e1ce52f212a59d603eb80571411d1613db1b029dd3613293dcca64ef
@@ -0,0 +1,15 @@
1
+ require_relative '../../core/ITokenGeneration.rb'
2
+ require_relative '../../util/Constants.rb'
3
+ require_relative '../../util/ApiException.rb'
4
+ require_relative '../../util/Cache.rb'
5
+ public
6
+ #JWT Token-generated based on the Request type
7
+ class GenerateOAuthToken
8
+ def getToken(merchantconfig_obj,gmtDatetime,log_obj)
9
+ token = merchantconfig_obj.accessToken
10
+ rescue StandardError => err
11
+ ApiException.new.apiexception(err,log_obj)
12
+ exit!
13
+ end
14
+ implements TokenInterface
15
+ end
@@ -1,5 +1,6 @@
1
1
  require_relative '../authentication/http/HttpSignatureHeader.rb'
2
2
  require_relative '../authentication/jwt/JwtToken.rb'
3
+ require_relative '../authentication/oauth/OAuthToken.rb'
3
4
  require_relative '../util/Constants.rb'
4
5
  require_relative '../util/ApiException.rb'
5
6
  public
@@ -14,7 +15,9 @@ public
14
15
  token = GenerateHttpSignature.new.getToken(merchantconfig_obj, gmtdatetime, log_obj)
15
16
  elsif authenticationType == Constants::AUTH_TYPE_JWT
16
17
  token = GenerateJwtToken.new.getToken(merchantconfig_obj, gmtdatetime, log_obj)
17
- elsif authenticationType != Constants::AUTH_TYPE_HTTP || authenticationType != Constants::AUTH_TYPE_JWT
18
+ elsif authenticationType == Constants::AUTH_TYPE_OAUTH
19
+ token = GenerateOAuthToken.new.getToken(merchantconfig_obj, gmtdatetime, log_obj)
20
+ else
18
21
  raise StandardError.ner(Constants::ERROR_PREFIX + Constants::AUTH_ERROR)
19
22
  end
20
23
  rescue StandardError => err
@@ -30,6 +30,16 @@ public
30
30
  @portfolioID = cybsPropertyObj['portfolioID']
31
31
  @logFilename = cybsPropertyObj['logFilename']
32
32
  @solutionId = cybsPropertyObj['solutionId']
33
+ # MutualAuth & OAuth Parameters
34
+ @enableClientCert = cybsPropertyObj['enableClientCert']
35
+ @clientCertDirectory = cybsPropertyObj['clientCertDirectory']
36
+ @sslClientCert = cybsPropertyObj['sslClientCert']
37
+ @privateKey = cybsPropertyObj['privateKey']
38
+ @sslKeyPassword = cybsPropertyObj['sslKeyPassword']
39
+ @clientId = cybsPropertyObj['clientId']
40
+ @clientSecret = cybsPropertyObj['clientSecret']
41
+ @accessToken = cybsPropertyObj['accessToken']
42
+ @refreshToken = cybsPropertyObj['refreshToken']
33
43
  validateMerchantDetails()
34
44
  logAllProperties(cybsPropertyObj)
35
45
  end
@@ -62,13 +72,7 @@ public
62
72
  @log_obj.logger.info('START> =======================================')
63
73
  if !logmessage.to_s.empty?
64
74
  ApiException.new.apiwarning(logmessage,log_obj)
65
- end
66
- if @merchantId.to_s.empty?
67
- err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::MERCHANT_ID_NULL)
68
- ApiException.new.apiexception(err,log_obj)
69
- elsif !@merchantId.instance_of? String
70
- @merchantId=@merchantId.to_s
71
- end
75
+ end
72
76
  if @authenticationType.to_s.empty?
73
77
  err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::AUTH_TYPE_MANDATORY)
74
78
  ApiException.new.apiexception(err,log_obj)
@@ -80,18 +84,11 @@ public
80
84
  if !@runEnvironment.to_s.empty?
81
85
  if !@runEnvironment.instance_of? String
82
86
  @requestHost = @runEnvironment.to_s
83
- elsif @runEnvironment.upcase == Constants::RUN_ENV_PROD
84
- @requestHost = Constants::PRODUCTION_URL
85
- elsif @runEnvironment.upcase == Constants::RUN_ENV_SANDBOX
86
- @requestHost = Constants::SANDBOX_URL
87
- elsif @runEnvironment.upcase == Constants::BOA_RUN_ENV_PROD
88
- @requestHost = Constants::BOA_PRODUCTION_URL
89
- elsif @runEnvironment.upcase == Constants.BOA_RUN_ENV_SANDBOX
90
- @requestHost = Constants::BOA_SANDBOX_URL
91
- elsif @runEnvironment.upcase == Constants::IDC_RUN_ENV_PROD
92
- @requestHost = Constants::IDC_PRODUCTION_URL
93
- elsif @runEnvironment.upcase == Constants.IDC_RUN_ENV_SANDBOX
94
- @requestHost = Constants::IDC_SANDBOX_URL
87
+ end
88
+
89
+ if Constants::OLD_RUN_ENVIRONMENT_CONSTANTS.include?(@runEnvironment.upcase)
90
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::DERPECATED_ENVIRONMENT)
91
+ ApiException.new.apiexception(err, log_obj)
95
92
  else
96
93
  @requestHost = @runEnvironment
97
94
  end
@@ -99,7 +96,41 @@ public
99
96
  err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::RUN_ENVIRONMENT)
100
97
  ApiException.new.apiexception(err,log_obj)
101
98
  end
99
+
100
+ if !@enableClientCert.nil? && @enableClientCert
101
+ if @sslClientCert.to_s.empty?
102
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::SSL_CLIENT_CERT_EMPTY)
103
+ ApiException.new.apiexception(err,log_obj)
104
+ elsif !@sslClientCert.instance_of? String
105
+ @sslClientCert=@sslClientCert.to_s
106
+ end
107
+ if @privateKey.to_s.empty?
108
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::PRIVATE_KEY_EMPTY)
109
+ ApiException.new.apiexception(err,log_obj)
110
+ elsif !@privateKey.instance_of? String
111
+ @privateKey=@privateKey.to_s
112
+ end
113
+ if @sslKeyPassword.to_s.empty?
114
+ err = Constants::WARNING_PREFIX + Constants::SSL_KEY_PASSWORD_EMPTY
115
+ ApiException.new.apiwarning(err,log_obj)
116
+ elsif !@sslKeyPassword.instance_of? String
117
+ @sslKeyPassword=@sslKeyPassword.to_s
118
+ end
119
+ if @clientCertDirectory.to_s.empty?
120
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::CLIENT_CERT_DIR_EMPTY)
121
+ ApiException.new.apiexception(err,log_obj)
122
+ elsif !@clientCertDirectory.instance_of? String
123
+ @clientCertDirectory=@clientCertDirectory.to_s
124
+ end
125
+ end
126
+
102
127
  if @authenticationType.upcase == Constants::AUTH_TYPE_JWT
128
+ if @merchantId.to_s.empty?
129
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::MERCHANT_ID_NULL)
130
+ ApiException.new.apiexception(err,log_obj)
131
+ elsif !@merchantId.instance_of? String
132
+ @merchantId=@merchantId.to_s
133
+ end
103
134
  if @keyAlias.to_s.empty?
104
135
  @keyAlias = @merchantId
105
136
  ApiException.new.apiwarning(Constants::WARNING_PREFIX + Constants::KEY_ALIAS_NULL_EMPTY, log_obj)
@@ -128,7 +159,41 @@ public
128
159
  @keyFilename=@keyFilename.to_s
129
160
  end
130
161
  end
162
+ if @authenticationType.upcase == Constants::AUTH_TYPE_MUTUAL_AUTH
163
+ if @clientId.to_s.empty?
164
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::CLIENT_ID_EMPTY)
165
+ ApiException.new.apiexception(err,log_obj)
166
+ elsif !@clientId.instance_of? String
167
+ @clientId=@clientId.to_s
168
+ end
169
+ if @clientSecret.to_s.empty?
170
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::CLIENT_SECRET_EMPTY)
171
+ ApiException.new.apiexception(err,log_obj)
172
+ elsif !@clientSecret.instance_of? String
173
+ @clientSecret=@clientSecret.to_s
174
+ end
175
+ end
176
+ if @authenticationType.upcase == Constants::AUTH_TYPE_OAUTH
177
+ if @accessToken.to_s.empty?
178
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::ACCESS_TOKEN_EMPTY)
179
+ ApiException.new.apiexception(err,log_obj)
180
+ elsif !@accessToken.instance_of? String
181
+ @accessToken=@accessToken.to_s
182
+ end
183
+ if @refreshToken.to_s.empty?
184
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::REFRESH_TOKEN_EMPTY)
185
+ ApiException.new.apiexception(err,log_obj)
186
+ elsif !@refreshToken.instance_of? String
187
+ @refreshToken=@refreshToken.to_s
188
+ end
189
+ end
131
190
  if @authenticationType.upcase == Constants::AUTH_TYPE_HTTP
191
+ if @merchantId.to_s.empty?
192
+ err = raise StandardError.new(Constants::ERROR_PREFIX + Constants::MERCHANT_ID_NULL)
193
+ ApiException.new.apiexception(err,log_obj)
194
+ elsif !@merchantId.instance_of? String
195
+ @merchantId=@merchantId.to_s
196
+ end
132
197
  if @merchantKeyId.to_s.empty?
133
198
  err = raise StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_KEY_ID_MANDATORY)
134
199
  ApiException.new.apiexception(err,log_obj)
@@ -183,6 +248,15 @@ public
183
248
  attr_accessor :keyFilename
184
249
  attr_accessor :useMetaKey
185
250
  attr_accessor :portfolioID
251
+ attr_accessor :enableClientCert
252
+ attr_accessor :clientCertDirectory
253
+ attr_accessor :sslClientCert
254
+ attr_accessor :sslKeyPassword
255
+ attr_accessor :privateKey
256
+ attr_accessor :clientId
257
+ attr_accessor :clientSecret
258
+ attr_accessor :accessToken
259
+ attr_accessor :refreshToken
186
260
  attr_accessor :requestJsonData
187
261
  attr_accessor :requestUrl
188
262
  attr_accessor :requestType
@@ -1,156 +1,158 @@
1
1
  class Constants
2
2
 
3
3
  GET_REQUEST_TYPE_LOWER = 'get' unless const_defined?(:GET_REQUEST_TYPE_LOWER)
4
-
4
+
5
5
  POST_REQUEST_TYPE_LOWER = 'post' unless const_defined?(:POST_REQUEST_TYPE_LOWER)
6
-
6
+
7
7
  PUT_REQUEST_TYPE_LOWER = 'put' unless const_defined?(:PUT_REQUEST_TYPE_LOWER)
8
8
 
9
9
  PATCH_REQUEST_TYPE_LOWER = 'patch' unless const_defined?(:PATCH_REQUEST_TYPE_LOWER)
10
-
10
+
11
11
  DELETE_REQUEST_TYPE_LOWER = 'delete' unless const_defined?(:DELETE_REQUEST_TYPE_LOWER)
12
12
 
13
13
  GET_REQUEST_TYPE = 'GET' unless const_defined?(:GET_REQUEST_TYPE)
14
-
14
+
15
15
  POST_REQUEST_TYPE = 'POST' unless const_defined?(:POST_REQUEST_TYPE)
16
-
16
+
17
17
  PUT_REQUEST_TYPE = 'PUT' unless const_defined?(:PUT_REQUEST_TYPE)
18
18
 
19
19
  PATCH_REQUEST_TYPE = 'PATCH' unless const_defined?(:PATCH_REQUEST_TYPE)
20
-
20
+
21
21
  DELETE_REQUEST_TYPE = 'DELETE' unless const_defined?(:DELETE_REQUEST_TYPE)
22
22
 
23
23
  V_C_MERCHANT_ID = 'v-c-merchant-id' unless const_defined?(:V_C_MERCHANT_ID)
24
-
24
+
25
25
  HOST = 'host' unless const_defined?(:HOST)
26
-
26
+
27
27
  DATE = 'date' unless const_defined?(:DATE)
28
-
28
+
29
29
  REQUEST_TARGET = '(request-target)' unless const_defined?(:REQUEST_TARGET)
30
-
30
+
31
31
  DIGEST = 'digest' unless const_defined?(:DIGEST)
32
-
32
+
33
33
  SIGNATURE = 'Signature' unless const_defined?(:SIGNATURE)
34
-
34
+
35
35
  HTTPS_URI_PREFIX = 'https://' unless const_defined?(:HTTPS_URI_PREFIX)
36
-
36
+
37
37
  BEARER = 'Bearer' unless const_defined?(:BEARER)
38
-
38
+
39
39
  MEDIA_TYPE_JSON = 'application/json' unless const_defined?(:MEDIA_TYPE_JSON)
40
-
40
+
41
41
  SIGNATURE_ALGORITHM = 'HmacSHA256' unless const_defined?(:SIGNATURE_ALGORITHM)
42
-
42
+
43
43
  ALGORITHM = "algorithm=\"" unless const_defined?(:ALGORITHM)
44
-
44
+
45
45
  SHA256 = 'SHA-256=' unless const_defined?(:SHA256)
46
-
46
+
47
47
  CONTENT_TYPE = 'Content-Type' unless const_defined?(:CONTENT_TYPE)
48
-
48
+
49
49
  USER_AGENT = 'User-Agent' unless const_defined?(:USER_AGENT)
50
-
50
+
51
51
  USER_AGENT_VALUE = 'Mozilla/5.0' unless const_defined?(:USER_AGENT_VALUE)
52
-
52
+
53
53
  KEY_ID = "keyid=\"" unless const_defined?(:KEY_ID)
54
-
54
+
55
55
  HEADERS_PARAM = "headers=\"" unless const_defined?(:HEADERS_PARAM)
56
-
56
+
57
57
  SIGNATURE_PARAM = "signature=\"" unless const_defined?(:SIGNATURE_PARAM)
58
58
 
59
59
  AUTH_TYPE_HTTP = 'HTTP_SIGNATURE' unless const_defined?(:AUTH_TYPE_HTTP)
60
-
61
- AUTH_TYPE_JWT = 'JWT' unless const_defined?(:AUTH_TYPE_JWT)
62
60
 
63
- RUN_ENV_SANDBOX = 'CYBERSOURCE.ENVIRONMENT.SANDBOX' unless const_defined?(:RUN_ENV_SANDBOX)
64
-
65
- RUN_ENV_PROD = 'CYBERSOURCE.ENVIRONMENT.PRODUCTION'unless const_defined?(:RUN_ENV_PROD)
66
-
67
- SANDBOX_URL = 'apitest.cybersource.com' unless const_defined?(:SANDBOX_URL)
68
-
69
- PRODUCTION_URL = 'api.cybersource.com' unless const_defined?(:PRODUCTION_URL)
70
-
71
- BOA_RUN_ENV_SANDBOX = 'BANKOFAMERICA.ENVIRONMENT.SANDBOX' unless const_defined?(:RUN_ENV_SANDBOX)
72
-
73
- BOA_RUN_ENV_PROD = 'BANKOFAMERICA.ENVIRONMENT.PRODUCTION'unless const_defined?(:RUN_ENV_PROD)
74
-
75
- BOA_SANDBOX_URL = 'apitest.merchant-services.bankofamerica.com' unless const_defined?(:SANDBOX_URL)
76
-
77
- BOA_PRODUCTION_URL = 'api.merchant-services.bankofamerica.com' unless const_defined?(:PRODUCTION_URL)
78
-
79
- IDC_RUN_ENV_SANDBOX = 'CYBERSOURCE.IN.ENVIRONMENT.SANDBOX' unless const_defined?(:RUN_ENV_SANDBOX)
61
+ AUTH_TYPE_OAUTH = 'OAUTH' unless const_defined?(:AUTH_TYPE_OAUTH)
80
62
 
81
- IDC_RUN_ENV_PROD = 'CYEBRSOURCE.IN.ENVIRONMENT.PRODUCTION'unless const_defined?(:RUN_ENV_PROD)
82
-
83
- IDC_SANDBOX_URL = 'apitest.cybersource.com' unless const_defined?(:SANDBOX_URL)
63
+ AUTH_TYPE_MUTUAL_AUTH = 'MUTUAL_AUTH' unless const_defined?(:AUTH_TYPE_MUTUAL_AUTH)
64
+
65
+ AUTH_TYPE_JWT = 'JWT' unless const_defined?(:AUTH_TYPE_JWT)
84
66
 
85
- IDC_PRODUCTION_URL = 'api.in.cybersource.com' unless const_defined?(:PRODUCTION_URL)
67
+ OLD_RUN_ENVIRONMENT_CONSTANTS = ['CYBERSOURCE.ENVIRONMENT.SANDBOX', 'CYBERSOURCE.ENVIRONMENT.PRODUCTION', 'CYBERSOURCE.IN.ENVIRONMENT.SANDBOX', 'CYBERSOURCE.IN.ENVIRONMENT.PRODUCTION', 'BANKOFAMERICA.ENVIRONMENT.SANDBOX', 'BANKOFAMERICA.ENVIRONMENT.PRODUCTION']
86
68
 
87
69
  # constants for fall back logic
88
70
 
89
- DEFAULT_LOG_SIZE = '10485760' unless const_defined?(:DEFAULT_LOG_SIZE)
90
-
71
+ DEFAULT_LOG_SIZE = 10485760 unless const_defined?(:DEFAULT_LOG_SIZE)
72
+
91
73
  DEFAULT_PROXY_ADDRESS = 'userproxy.visa.com' unless const_defined?(:DEFAULT_PROXY_ADDRESS)
92
-
74
+
93
75
  DEFAULT_PROXY_PORT = '443' unless const_defined?(:DEFAULT_PROXY_PORT)
94
-
76
+
95
77
  DEFAULT_TIMEOUT = '1000' unless const_defined?(:DEFAULT_TIMEOUT)
96
-
78
+
97
79
  DEFAULT_LOG_DIRECTORY = '../log' unless const_defined?(:DEFAULT_LOG_DIRECTORY)
98
-
80
+
99
81
  DEFAULT_KEY_DIRECTORY = 'resource' unless const_defined?(:DEFAULT_KEY_DIRECTORY)
100
-
82
+
101
83
  DEFAULT_LOGFILE_NAME = 'cybs' unless const_defined?(:DEFAULT_LOGFILE_NAME)
102
84
 
103
85
  # Constant for Fall back logic and Exception Handling
104
86
 
105
87
  REQUEST_JSON_ERROR = 'Request Json File missing. File Path :: ' unless const_defined?(:REQUEST_JSON_ERROR)
106
-
88
+
107
89
  INVALID_ENABLE_LOG = 'EnableLog should be (True/False) in cybs.yml' unless const_defined?(:INVALID_ENABLE_LOG)
108
-
90
+
109
91
  REFER_LOG = 'Please refer Log for details' unless const_defined?(:REFER_LOG)
110
-
92
+
111
93
  MERCHANT_ID_NULL = 'MerchantID is mandatory' unless const_defined?(:MERCHANT_ID_NULL)
112
-
94
+
113
95
  INCORRECT_KEY_PASS = 'The keyPass Entered is Incorrect' unless const_defined?(:INCORRECT_KEY_PASS)
114
-
96
+
115
97
  AUTH_TYPE_MANDATORY= 'AuthenticationType is Mandatory' unless const_defined?(:AUTH_TYPE_MANDATORY)
116
-
98
+
117
99
  MERCHANT_KEY_ID_MANDATORY = 'MerchantKeyId is Mandatory' unless const_defined?(:MERCHANT_KEY_ID_MANDATORY)
118
-
100
+
119
101
  MERCHANT_SECRET_KEY_MANDATORY = 'MerchantSecretKey is Mandatory' unless const_defined?(:MERCHANT_SECRET_KEY_MANDATORY)
120
102
 
121
103
  PORTFOLIO_ID_MANDATORY = 'PortfolioID is Mandatory' unless const_defined?(:PORTFOLIO_ID_MANDATORY)
122
-
104
+
123
105
  KEY_PASS_NULL = 'keyPass is empty, Assigining merchantID value' unless const_defined?(:KEY_PASS_NULL)
124
-
106
+
125
107
  REQUEST_JSON_PATH_EMPTY = 'RequestJsonPath not provided. Using Default Value:'unless const_defined?(:REQUEST_JSON_PATH_EMPTY)
126
-
108
+
127
109
  REQUEST_TYPE_EMPTY = 'RequestType Property of Merchant Config Not Set' unless const_defined?(:REQUEST_TYPE_EMPTY)
128
-
110
+
129
111
  INVALID_REQUEST_TYPE_METHOD = 'Entered Request Type should be (GET/POST/PUT)' unless const_defined?(:INVALID_REQUEST_TYPE_METHOD)
130
-
112
+
131
113
  INVALID_LOG_DIRECTORY = 'Entered LogDirectory is Incorrect. Using Default Path: ' unless const_defined?(:INVALID_LOG_DIRECTORY)
132
-
114
+
133
115
  RUN_ENVIRONMENT_ERROR = 'Entered RunEnvironment is Incorrect.' unless const_defined?(:RUN_ENVIRONMENT_ERROR)
134
-
116
+
135
117
  PROPERTY_FILE_NOT_FOUND = 'Cybs.yml file not found' unless const_defined?(:PROPERTY_FILE_NOT_FOUND)
136
118
 
137
119
  ERROR_PREFIX = 'Error: ' unless const_defined?(:ERROR_PREFIX)
138
-
120
+
139
121
  WARNING_PREFIX = 'Warning: ' unless const_defined?(:WARNING_PREFIX)
140
-
122
+
141
123
  HIDDEN_MERCHANT_PROPERTIES = 'merchantID,merchantKeyId,merchantsecretKey,keyAlias,keyPass' unless const_defined?(:HIDDEN_MERCHANT_PROPERTIES)
142
-
124
+
143
125
  RUN_ENVIRONMENT = 'RunEnvironment is Mandatory' unless const_defined?(:RUN_ENVIRONMENT)
144
-
126
+
145
127
  KEY_DIRECTORY_EMPTY = 'KeysDirectory not provided. Using Default Path:' unless const_defined?(:KEY_DIRECTORY_EMPTY)
146
-
128
+
147
129
  FILE_NOT_FOUND = 'File not found, Re-Enter path/file name, Entered path/file name :: ' unless const_defined?(:FILE_NOT_FOUND)
148
-
130
+
149
131
  AUTH_ERROR = 'Check Authentication Type (HTTP_Signature/JWT) in cybs.yml.' unless const_defined?(:AUTH_ERROR)
150
-
132
+
151
133
  KEY_FILE_NAME_NULL_EMPTY = 'KeyFilename Empty/Null. Assigining merchantID value' unless const_defined?(:KEY_FILE_NAME_NULL_EMPTY)
152
-
134
+
153
135
  KEY_ALIAS_NULL_EMPTY = 'KeyAlias Empty/Null. Assigining merchantID value' unless const_defined?(:KEY_ALIAS_NULL_EMPTY)
154
-
136
+
155
137
  INCORRECT_KEY_ALIAS = 'The Entered KeyAlias is Incorrect. Assigining merchantID value' unless const_defined?(:INCORRECT_KEY_ALIAS)
138
+
139
+ ENABLE_CLIENT_CERT_EMPTY = 'Enable Clientcert is Empty/Null.' unless const_defined?(:ENABLE_CLIENT_CERT_EMPTY)
140
+
141
+ CLIENT_CERT_DIR_EMPTY = 'Client Cert Directory is Empty/Null' unless const_defined?(:CLIENT_CERT_DIR_EMPTY)
142
+
143
+ SSL_CLIENT_CERT_EMPTY = 'SSL Client Cert is Empty/Null' unless const_defined?(:SSL_CLIENT_CERT_EMPTY)
144
+
145
+ PRIVATE_KEY_EMPTY = 'Private Key is Empty/Null' unless const_defined?(:PRIVATE_KEY_EMPTY)
146
+
147
+ SSL_KEY_PASSWORD_EMPTY = 'SSL Key Password is Empty/Null' unless const_defined?(:SSL_KEY_PASSWORD_EMPTY)
148
+
149
+ CLIENT_ID_EMPTY = 'Client Id is Empty/Null' unless const_defined?(:CLIENT_ID_EMPTY)
150
+
151
+ CLIENT_SECRET_EMPTY = 'Client Secret is Empty/Null' unless const_defined?(:CLIENT_SECRET_EMPTY)
152
+
153
+ ACCESS_TOKEN_EMPTY = 'AccessToken is Empty/Null' unless const_defined?(:ACCESS_TOKEN_REQ)
154
+
155
+ REFRESH_TOKEN_EMPTY = 'RefreshToken is Empty/Null' unless const_defined?(:REFRESH_TOKEN_REQ)
156
+
157
+ DERPECATED_ENVIRONMENT = 'The value provided for this field `RunEnvironment` has been deprecated and will not be used anymore.\n\nPlease refer to the README file [ https://github.com/CyberSource/cybersource-rest-samples-node/blob/master/README.md ] for information about the new values that are accepted.'
156
158
  end
@@ -32,6 +32,11 @@ require 'cybersource_rest_client/version'
32
32
  require 'cybersource_rest_client/configuration'
33
33
 
34
34
  # Models
35
+ require 'cybersource_rest_client/models/resource_not_found_error'
36
+ require 'cybersource_rest_client/models/unauthorized_client_error'
37
+ require 'cybersource_rest_client/models/access_token_response'
38
+ require 'cybersource_rest_client/models/bad_request_error'
39
+ require 'cybersource_rest_client/models/create_access_token_request'
35
40
  require 'cybersource_rest_client/models/add_negative_list_request'
36
41
  require 'cybersource_rest_client/models/auth_reversal_request'
37
42
  require 'cybersource_rest_client/models/capture_payment_request'
@@ -125,14 +130,14 @@ require 'cybersource_rest_client/models/patch_customer_shipping_address_request'
125
130
  require 'cybersource_rest_client/models/patch_instrument_identifier_request'
126
131
  require 'cybersource_rest_client/models/patch_payment_instrument_request'
127
132
  require 'cybersource_rest_client/models/payer_auth_setup_request'
128
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer'
129
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer__embedded'
130
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer__links'
131
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer__links_first'
132
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer__links_last'
133
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer__links_next'
134
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer__links_prev'
135
- require 'cybersource_rest_client/models/payment_instrument_list_for_customer__links_self'
133
+ require 'cybersource_rest_client/models/payment_instrument_list'
134
+ require 'cybersource_rest_client/models/payment_instrument_list__embedded'
135
+ require 'cybersource_rest_client/models/payment_instrument_list__links'
136
+ require 'cybersource_rest_client/models/payment_instrument_list__links_first'
137
+ require 'cybersource_rest_client/models/payment_instrument_list__links_last'
138
+ require 'cybersource_rest_client/models/payment_instrument_list__links_next'
139
+ require 'cybersource_rest_client/models/payment_instrument_list__links_prev'
140
+ require 'cybersource_rest_client/models/payment_instrument_list__links_self'
136
141
  require 'cybersource_rest_client/models/post_customer_payment_instrument_request'
137
142
  require 'cybersource_rest_client/models/post_customer_request'
138
143
  require 'cybersource_rest_client/models/post_customer_shipping_address_request'
@@ -188,12 +193,14 @@ require 'cybersource_rest_client/models/pts_v2_payments_post201_response__links_
188
193
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_order_information'
189
194
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_amount_details'
190
195
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_invoice_details'
196
+ require 'cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_reward_points_details'
197
+ require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information'
198
+ require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card'
191
199
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information'
192
200
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_account_features'
193
201
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_account_features_balances'
194
202
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_bank'
195
203
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_bank_account'
196
- require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_card'
197
204
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_instrument_identifier'
198
205
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card'
199
206
  require 'cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information'
@@ -326,6 +333,7 @@ require 'cybersource_rest_client/models/ptsv2payments_promotion_information'
326
333
  require 'cybersource_rest_client/models/ptsv2payments_recipient_information'
327
334
  require 'cybersource_rest_client/models/ptsv2payments_recurring_payment_information'
328
335
  require 'cybersource_rest_client/models/ptsv2payments_risk_information'
336
+ require 'cybersource_rest_client/models/ptsv2payments_risk_information_auxiliary_data'
329
337
  require 'cybersource_rest_client/models/ptsv2payments_risk_information_buyer_history'
330
338
  require 'cybersource_rest_client/models/ptsv2payments_risk_information_buyer_history_account_history'
331
339
  require 'cybersource_rest_client/models/ptsv2payments_risk_information_buyer_history_customer_account'
@@ -538,6 +546,7 @@ require 'cybersource_rest_client/models/riskv1exportcomplianceinquiries_order_in
538
546
  require 'cybersource_rest_client/models/riskv1exportcomplianceinquiries_order_information_line_items'
539
547
  require 'cybersource_rest_client/models/riskv1exportcomplianceinquiries_order_information_ship_to'
540
548
  require 'cybersource_rest_client/models/riskv1liststypeentries_buyer_information'
549
+ require 'cybersource_rest_client/models/riskv1liststypeentries_client_reference_information'
541
550
  require 'cybersource_rest_client/models/riskv1liststypeentries_device_information'
542
551
  require 'cybersource_rest_client/models/riskv1liststypeentries_order_information'
543
552
  require 'cybersource_rest_client/models/riskv1liststypeentries_order_information_address'
@@ -724,6 +733,7 @@ require 'cybersource_rest_client/models/void_refund_request'
724
733
  require 'cybersource_rest_client/models/void_tax_request'
725
734
 
726
735
  # APIs
736
+ require 'cybersource_rest_client/api/o_auth_api'
727
737
  require 'cybersource_rest_client/api/asymmetric_key_management_api'
728
738
  require 'cybersource_rest_client/api/capture_api'
729
739
  require 'cybersource_rest_client/api/conversion_details_api'