first_data_gateway 1.0.1

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 (176) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +123 -0
  4. data/Rakefile +8 -0
  5. data/docs/AccessTokenResponse.md +11 -0
  6. data/docs/Address.md +14 -0
  7. data/docs/Airline.md +21 -0
  8. data/docs/AirlineAncillaryServiceCategory.md +8 -0
  9. data/docs/AirlineTravelRoute.md +16 -0
  10. data/docs/Amount.md +10 -0
  11. data/docs/AmountComponents.md +14 -0
  12. data/docs/AuthenticationApi.md +68 -0
  13. data/docs/AuthenticationResponseVerification.md +10 -0
  14. data/docs/BasketItem.md +11 -0
  15. data/docs/Billing.md +13 -0
  16. data/docs/CarRental.md +15 -0
  17. data/docs/CarRentalExtraCharges.md +8 -0
  18. data/docs/CardVerificationsTransaction.md +9 -0
  19. data/docs/ClientLocale.md +9 -0
  20. data/docs/Contact.md +11 -0
  21. data/docs/Error.md +10 -0
  22. data/docs/ErrorDetails.md +9 -0
  23. data/docs/ErrorResponse.md +11 -0
  24. data/docs/Expiration.md +9 -0
  25. data/docs/Frequency.md +9 -0
  26. data/docs/IndustrySpecificExtensions.md +10 -0
  27. data/docs/InstallmentOptions.md +10 -0
  28. data/docs/Lodging.md +12 -0
  29. data/docs/LodgingExtraCharges.md +8 -0
  30. data/docs/Order.md +10 -0
  31. data/docs/OrderApi.md +148 -0
  32. data/docs/PayPal.md +8 -0
  33. data/docs/PaymentApi.md +345 -0
  34. data/docs/PaymentCard.md +15 -0
  35. data/docs/PaymentCardAuthenticationRequest.md +8 -0
  36. data/docs/PaymentCardAuthenticationResult.md +12 -0
  37. data/docs/PaymentMethod.md +11 -0
  38. data/docs/PaymentSchedulesRequest.md +21 -0
  39. data/docs/PaymentSchedulesResponse.md +11 -0
  40. data/docs/PaymentUrlRequest.md +11 -0
  41. data/docs/PaymentUrlResponse.md +13 -0
  42. data/docs/PrimaryTransaction.md +18 -0
  43. data/docs/PrimaryTransactionAdditionalDetails.md +14 -0
  44. data/docs/ProcessorData.md +10 -0
  45. data/docs/ResponseType.md +7 -0
  46. data/docs/SecondaryTransaction.md +9 -0
  47. data/docs/Sepa.md +12 -0
  48. data/docs/SepaMandate.md +11 -0
  49. data/docs/Shipping.md +10 -0
  50. data/docs/SplitShipment.md +9 -0
  51. data/docs/StoredCredential.md +11 -0
  52. data/docs/TransactionErrorResponse.md +28 -0
  53. data/docs/TransactionResponse.md +27 -0
  54. data/docs/TransactionResponseAuthenticationRedirect.md +10 -0
  55. data/docs/TransactionResponseAuthenticationRedirectParams.md +10 -0
  56. data/docs/TransactionType.md +7 -0
  57. data/first_data_gateway.gemspec +45 -0
  58. data/git_push.sh +55 -0
  59. data/lib/simple/client_context.rb +15 -0
  60. data/lib/simple/gateway.rb +155 -0
  61. data/lib/simple/merchant_credentials.rb +10 -0
  62. data/lib/simple/signature.rb +52 -0
  63. data/lib/simple_client.rb +4 -0
  64. data/lib/swagger_client.rb +91 -0
  65. data/lib/swagger_client/api/authentication_api.rb +111 -0
  66. data/lib/swagger_client/api/order_api.rb +229 -0
  67. data/lib/swagger_client/api/payment_api.rb +517 -0
  68. data/lib/swagger_client/api_client.rb +390 -0
  69. data/lib/swagger_client/api_error.rb +38 -0
  70. data/lib/swagger_client/configuration.rb +202 -0
  71. data/lib/swagger_client/models/access_token_response.rb +252 -0
  72. data/lib/swagger_client/models/address.rb +361 -0
  73. data/lib/swagger_client/models/airline.rb +487 -0
  74. data/lib/swagger_client/models/airline_ancillary_service_category.rb +221 -0
  75. data/lib/swagger_client/models/airline_travel_route.rb +406 -0
  76. data/lib/swagger_client/models/amount.rb +217 -0
  77. data/lib/swagger_client/models/amount_components.rb +242 -0
  78. data/lib/swagger_client/models/authentication_response_verification.rb +239 -0
  79. data/lib/swagger_client/models/basket_item.rb +218 -0
  80. data/lib/swagger_client/models/billing.rb +282 -0
  81. data/lib/swagger_client/models/car_rental.rb +317 -0
  82. data/lib/swagger_client/models/car_rental_extra_charges.rb +221 -0
  83. data/lib/swagger_client/models/card_verifications_transaction.rb +203 -0
  84. data/lib/swagger_client/models/client_locale.rb +209 -0
  85. data/lib/swagger_client/models/contact.rb +279 -0
  86. data/lib/swagger_client/models/error.rb +211 -0
  87. data/lib/swagger_client/models/error_details.rb +199 -0
  88. data/lib/swagger_client/models/error_response.rb +218 -0
  89. data/lib/swagger_client/models/expiration.rb +207 -0
  90. data/lib/swagger_client/models/frequency.rb +270 -0
  91. data/lib/swagger_client/models/industry_specific_extensions.rb +206 -0
  92. data/lib/swagger_client/models/installment_options.rb +259 -0
  93. data/lib/swagger_client/models/lodging.rb +245 -0
  94. data/lib/swagger_client/models/lodging_extra_charges.rb +221 -0
  95. data/lib/swagger_client/models/order.rb +206 -0
  96. data/lib/swagger_client/models/pay_pal.rb +213 -0
  97. data/lib/swagger_client/models/payment_card.rb +294 -0
  98. data/lib/swagger_client/models/payment_card_authentication_request.rb +222 -0
  99. data/lib/swagger_client/models/payment_card_authentication_result.rb +336 -0
  100. data/lib/swagger_client/models/payment_method.rb +254 -0
  101. data/lib/swagger_client/models/payment_schedules_request.rb +398 -0
  102. data/lib/swagger_client/models/payment_schedules_response.rb +267 -0
  103. data/lib/swagger_client/models/payment_url_request.rb +232 -0
  104. data/lib/swagger_client/models/payment_url_response.rb +286 -0
  105. data/lib/swagger_client/models/primary_transaction.rb +298 -0
  106. data/lib/swagger_client/models/primary_transaction_additional_details.rb +244 -0
  107. data/lib/swagger_client/models/processor_data.rb +216 -0
  108. data/lib/swagger_client/models/response_type.rb +37 -0
  109. data/lib/swagger_client/models/secondary_transaction.rb +197 -0
  110. data/lib/swagger_client/models/sepa.rb +321 -0
  111. data/lib/swagger_client/models/sepa_mandate.rb +321 -0
  112. data/lib/swagger_client/models/shipping.rb +222 -0
  113. data/lib/swagger_client/models/split_shipment.rb +201 -0
  114. data/lib/swagger_client/models/stored_credential.rb +290 -0
  115. data/lib/swagger_client/models/transaction_error_response.rb +445 -0
  116. data/lib/swagger_client/models/transaction_response.rb +436 -0
  117. data/lib/swagger_client/models/transaction_response_authentication_redirect.rb +239 -0
  118. data/lib/swagger_client/models/transaction_response_authentication_redirect_params.rb +206 -0
  119. data/lib/swagger_client/models/transaction_type.rb +36 -0
  120. data/lib/swagger_client/version.rb +15 -0
  121. data/spec/api/authentication_api_spec.rb +51 -0
  122. data/spec/api/order_api_spec.rb +73 -0
  123. data/spec/api/payment_api_spec.rb +126 -0
  124. data/spec/api_client_spec.rb +226 -0
  125. data/spec/configuration_spec.rb +42 -0
  126. data/spec/models/access_token_response_spec.rb +64 -0
  127. data/spec/models/address_spec.rb +78 -0
  128. data/spec/models/airline_ancillary_service_category_spec.rb +46 -0
  129. data/spec/models/airline_spec.rb +124 -0
  130. data/spec/models/airline_travel_route_spec.rb +94 -0
  131. data/spec/models/amount_components_spec.rb +78 -0
  132. data/spec/models/amount_spec.rb +54 -0
  133. data/spec/models/authentication_response_verification_spec.rb +58 -0
  134. data/spec/models/basket_item_spec.rb +60 -0
  135. data/spec/models/billing_spec.rb +76 -0
  136. data/spec/models/car_rental_extra_charges_spec.rb +46 -0
  137. data/spec/models/car_rental_spec.rb +84 -0
  138. data/spec/models/card_verifications_transaction_spec.rb +48 -0
  139. data/spec/models/client_locale_spec.rb +48 -0
  140. data/spec/models/contact_spec.rb +60 -0
  141. data/spec/models/error_details_spec.rb +48 -0
  142. data/spec/models/error_response_spec.rb +60 -0
  143. data/spec/models/error_spec.rb +54 -0
  144. data/spec/models/expiration_spec.rb +48 -0
  145. data/spec/models/frequency_spec.rb +52 -0
  146. data/spec/models/industry_specific_extensions_spec.rb +54 -0
  147. data/spec/models/installment_options_spec.rb +54 -0
  148. data/spec/models/lodging_extra_charges_spec.rb +46 -0
  149. data/spec/models/lodging_spec.rb +66 -0
  150. data/spec/models/order_spec.rb +54 -0
  151. data/spec/models/pay_pal_spec.rb +42 -0
  152. data/spec/models/payment_card_authentication_request_spec.rb +46 -0
  153. data/spec/models/payment_card_authentication_result_spec.rb +78 -0
  154. data/spec/models/payment_card_spec.rb +88 -0
  155. data/spec/models/payment_method_spec.rb +64 -0
  156. data/spec/models/payment_schedules_request_spec.rb +124 -0
  157. data/spec/models/payment_schedules_response_spec.rb +64 -0
  158. data/spec/models/payment_url_request_spec.rb +60 -0
  159. data/spec/models/payment_url_response_spec.rb +76 -0
  160. data/spec/models/primary_transaction_additional_details_spec.rb +78 -0
  161. data/spec/models/primary_transaction_spec.rb +102 -0
  162. data/spec/models/processor_data_spec.rb +54 -0
  163. data/spec/models/response_type_spec.rb +36 -0
  164. data/spec/models/secondary_transaction_spec.rb +48 -0
  165. data/spec/models/sepa_mandate_spec.rb +64 -0
  166. data/spec/models/sepa_spec.rb +66 -0
  167. data/spec/models/shipping_spec.rb +54 -0
  168. data/spec/models/split_shipment_spec.rb +48 -0
  169. data/spec/models/stored_credential_spec.rb +68 -0
  170. data/spec/models/transaction_error_response_spec.rb +170 -0
  171. data/spec/models/transaction_response_authentication_redirect_params_spec.rb +54 -0
  172. data/spec/models/transaction_response_authentication_redirect_spec.rb +58 -0
  173. data/spec/models/transaction_response_spec.rb +164 -0
  174. data/spec/models/transaction_type_spec.rb +36 -0
  175. data/spec/spec_helper.rb +111 -0
  176. metadata +457 -0
@@ -0,0 +1,15 @@
1
+ module SimpleClient
2
+ class ClientContext
3
+ attr_reader :client, :config, :credentials
4
+
5
+ def self.create(credentials)
6
+ return self.new(credentials)
7
+ end
8
+
9
+ def initialize(credentials)
10
+ @config = SwaggerClient::Configuration.new
11
+ @client = SwaggerClient::ApiClient.new(@config)
12
+ @credentials = credentials
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,155 @@
1
+ require "json"
2
+
3
+ module SimpleClient
4
+ class Gateway
5
+
6
+ CONTENT_TYPE = "application/json"
7
+
8
+ def self.create(credentials)
9
+ return self.new(ClientContext.new(credentials))
10
+ end
11
+
12
+ def initialize(context)
13
+ @context = context
14
+ @authentication_api = SwaggerClient::AuthenticationApi.new(@context.client)
15
+ @order_api = SwaggerClient::OrderApi.new(@context.client)
16
+ @payment_api = SwaggerClient::PaymentApi.new(@context.client)
17
+ end
18
+
19
+ def request_access_token
20
+ signature_service = get_signature_service
21
+ message_signature = signature_service.sign
22
+ return @authentication_api.v1_authentication_access_tokens_post(
23
+ CONTENT_TYPE,
24
+ signature_service.client_request_id,
25
+ get_api_key,
26
+ signature_service.timestamp,
27
+ message_signature
28
+ )
29
+ end
30
+
31
+ def primary_payment_transaction(payload)
32
+ signature_service = get_signature_service
33
+ message_signature = signature_service.sign(payload)
34
+ return @payment_api.primary_payment_transaction(
35
+ CONTENT_TYPE,
36
+ signature_service.client_request_id,
37
+ get_api_key,
38
+ signature_service.timestamp,
39
+ message_signature,
40
+ payload
41
+ )
42
+ end
43
+
44
+ def return_transaction(transaction_id, payload, store_id=nil)
45
+ opts = {store_id: store_id}
46
+ signature_service = get_signature_service
47
+ message_signature = signature_service.sign(payload)
48
+ return @payment_api.return_transaction(
49
+ CONTENT_TYPE,
50
+ signature_service.client_request_id,
51
+ get_api_key,
52
+ signature_service.timestamp,
53
+ message_signature,
54
+ transaction_id,
55
+ payload,
56
+ opts
57
+ )
58
+ end
59
+
60
+ def transaction_inquiry(transaction_id, store_id=nil)
61
+ opts = {store_id: store_id}
62
+ signature_service = get_signature_service
63
+ message_signature = signature_service.sign
64
+ return @payment_api.transaction_inquiry(
65
+ CONTENT_TYPE,
66
+ signature_service.client_request_id,
67
+ get_api_key,
68
+ signature_service.timestamp,
69
+ message_signature,
70
+ transaction_id,
71
+ opts
72
+ )
73
+ end
74
+
75
+ def void_transaction(transaction_id, store_id=nil)
76
+ opts = {store_id: store_id}
77
+ signature_service = get_signature_service
78
+ message_signature = signature_service.sign
79
+ return @payment_api.void_transaction(
80
+ CONTENT_TYPE,
81
+ signature_service.client_request_id,
82
+ get_api_key,
83
+ signature_service.timestamp,
84
+ message_signature,
85
+ transaction_id,
86
+ opts
87
+ )
88
+ end
89
+
90
+ def perform_payment_post_authorization_by_order(order_id, payload, store_id=nil)
91
+ opts = {store_id: store_id}
92
+ signature_service = get_signature_service
93
+ message_signature = signature_service.sign(payload)
94
+ return @order_api.perform_payment_post_authorisation(
95
+ CONTENT_TYPE,
96
+ signature_service.client_request_id,
97
+ get_api_key,
98
+ signature_service.timestamp,
99
+ message_signature,
100
+ order_id,
101
+ payload,
102
+ opts
103
+ )
104
+ end
105
+
106
+ def perform_payment_authorization_by_transaction(transaction_id, payload, store_id=nil)
107
+ opts = {store_id: store_id}
108
+ signature_service = get_signature_service
109
+ message_signature = signature_service.sign(payload)
110
+ return @payment_api.perform_payment_post_authorisation(
111
+ CONTENT_TYPE,
112
+ signature_service.client_request_id,
113
+ get_api_key,
114
+ signature_service.timestamp,
115
+ message_signature,
116
+ transaction_id,
117
+ payload,
118
+ opts
119
+ )
120
+ end
121
+
122
+ def return_transaction_by_order(order_id, payload, store_id=nil)
123
+ opts = {store_id: store_id}
124
+ signature_service = get_signature_service
125
+ message_signature = signature_service.sign(payload)
126
+ return @order_api.return_transaction(
127
+ CONTENT_TYPE,
128
+ signature_service.client_request_id,
129
+ get_api_key,
130
+ signature_service.timestamp,
131
+ message_signature,
132
+ order_id,
133
+ payload,
134
+ opts
135
+ )
136
+ end
137
+
138
+ private
139
+
140
+ def get_signature_service
141
+ return Signature.new(
142
+ api_key: get_api_key,
143
+ api_secret: get_api_secret
144
+ )
145
+ end
146
+
147
+ def get_api_key
148
+ @context.credentials.api_key
149
+ end
150
+
151
+ def get_api_secret
152
+ @context.credentials.api_secret
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,10 @@
1
+ module SimpleClient
2
+ class MerchantCredentials
3
+ attr_reader :api_key, :api_secret
4
+
5
+ def initialize(api_key, api_secret)
6
+ @api_secret = api_secret
7
+ @api_key = api_key
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,52 @@
1
+ require "json"
2
+ require "openssl"
3
+ require "base64"
4
+ require "securerandom"
5
+ require "date"
6
+
7
+ module SimpleClient
8
+ class Signature
9
+
10
+ ATTR = [
11
+ :api_key,
12
+ :api_secret,
13
+ :digest
14
+ ]
15
+
16
+ attr_reader :client_request_id, :timestamp
17
+
18
+ def initialize(params)
19
+ ATTR.each { |attr| instance_variable_set("@#{attr}", params[attr]) if params[attr] }
20
+ @digest = "sha256" if !@digest
21
+ @client_request_id = SecureRandom.uuid
22
+ @timestamp = DateTime.now.strftime("%Q")
23
+ end
24
+
25
+ def sign(payload=nil)
26
+ data = @api_key + @client_request_id + @timestamp
27
+ data += jsonify(payload) if payload
28
+ hmac = OpenSSL::HMAC.hexdigest(@digest, @api_secret, data)
29
+ Base64.urlsafe_encode64(hmac)
30
+ end
31
+
32
+ def jsonify(model)
33
+ return model if model.nil? || model.is_a?(String)
34
+ local_body = nil
35
+ if model.is_a?(Array)
36
+ local_body = model.map{|m| object_to_hash(m) }
37
+ else
38
+ local_body = object_to_hash(model)
39
+ end
40
+ local_body.to_json
41
+ end
42
+
43
+ def object_to_hash(obj)
44
+ if obj.respond_to?(:to_hash)
45
+ obj.to_hash
46
+ else
47
+ obj
48
+ end
49
+ end
50
+
51
+ end
52
+ end
@@ -0,0 +1,4 @@
1
+ require_relative 'simple/gateway'
2
+ require_relative 'simple/client_context'
3
+ require_relative 'simple/merchant_credentials'
4
+ require_relative 'simple/signature'
@@ -0,0 +1,91 @@
1
+ =begin
2
+ #Payment Gateway API Specification
3
+
4
+ #Payment Gateway API for payment processing.
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'swagger_client/api_client'
15
+ require 'swagger_client/api_error'
16
+ require 'swagger_client/version'
17
+ require 'swagger_client/configuration'
18
+
19
+ # Models
20
+ require 'swagger_client/models/access_token_response'
21
+ require 'swagger_client/models/address'
22
+ require 'swagger_client/models/airline'
23
+ require 'swagger_client/models/airline_ancillary_service_category'
24
+ require 'swagger_client/models/airline_travel_route'
25
+ require 'swagger_client/models/amount'
26
+ require 'swagger_client/models/amount_components'
27
+ require 'swagger_client/models/authentication_response_verification'
28
+ require 'swagger_client/models/basket_item'
29
+ require 'swagger_client/models/billing'
30
+ require 'swagger_client/models/car_rental'
31
+ require 'swagger_client/models/car_rental_extra_charges'
32
+ require 'swagger_client/models/card_verifications_transaction'
33
+ require 'swagger_client/models/client_locale'
34
+ require 'swagger_client/models/contact'
35
+ require 'swagger_client/models/error'
36
+ require 'swagger_client/models/error_details'
37
+ require 'swagger_client/models/error_response'
38
+ require 'swagger_client/models/expiration'
39
+ require 'swagger_client/models/frequency'
40
+ require 'swagger_client/models/industry_specific_extensions'
41
+ require 'swagger_client/models/installment_options'
42
+ require 'swagger_client/models/lodging'
43
+ require 'swagger_client/models/lodging_extra_charges'
44
+ require 'swagger_client/models/order'
45
+ require 'swagger_client/models/pay_pal'
46
+ require 'swagger_client/models/payment_card'
47
+ require 'swagger_client/models/payment_card_authentication_request'
48
+ require 'swagger_client/models/payment_card_authentication_result'
49
+ require 'swagger_client/models/payment_method'
50
+ require 'swagger_client/models/payment_schedules_request'
51
+ require 'swagger_client/models/payment_schedules_response'
52
+ require 'swagger_client/models/payment_url_request'
53
+ require 'swagger_client/models/payment_url_response'
54
+ require 'swagger_client/models/primary_transaction'
55
+ require 'swagger_client/models/primary_transaction_additional_details'
56
+ require 'swagger_client/models/processor_data'
57
+ require 'swagger_client/models/response_type'
58
+ require 'swagger_client/models/secondary_transaction'
59
+ require 'swagger_client/models/sepa'
60
+ require 'swagger_client/models/sepa_mandate'
61
+ require 'swagger_client/models/shipping'
62
+ require 'swagger_client/models/split_shipment'
63
+ require 'swagger_client/models/stored_credential'
64
+ require 'swagger_client/models/transaction_response'
65
+ require 'swagger_client/models/transaction_response_authentication_redirect'
66
+ require 'swagger_client/models/transaction_response_authentication_redirect_params'
67
+ require 'swagger_client/models/transaction_type'
68
+ require 'swagger_client/models/transaction_error_response'
69
+
70
+ # APIs
71
+ require 'swagger_client/api/authentication_api'
72
+ require 'swagger_client/api/order_api'
73
+ require 'swagger_client/api/payment_api'
74
+
75
+ module SwaggerClient
76
+ class << self
77
+ # Customize default settings for the SDK using block.
78
+ # SwaggerClient.configure do |config|
79
+ # config.username = "xxx"
80
+ # config.password = "xxx"
81
+ # end
82
+ # If no block given, return the default Configuration object.
83
+ def configure
84
+ if block_given?
85
+ yield(Configuration.default)
86
+ else
87
+ Configuration.default
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,111 @@
1
+ =begin
2
+ #Payment Gateway API Specification
3
+
4
+ #Payment Gateway API for payment processing.
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module SwaggerClient
16
+ class AuthenticationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Generate an access token for user authentication
24
+ # This is the access token generation call for authorizing subsequent financial transactions. A valid access token is required for web client requests.
25
+ # @param content_type content type
26
+ # @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
27
+ # @param api_key
28
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
29
+ # @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
30
+ # @param [Hash] opts the optional parameters
31
+ # @return [AccessTokenResponse]
32
+ def v1_authentication_access_tokens_post(content_type, client_request_id, api_key, timestamp, message_signature, opts = {})
33
+ data, _status_code, _headers = v1_authentication_access_tokens_post_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, opts)
34
+ return data
35
+ end
36
+
37
+ # Generate an access token for user authentication
38
+ # This is the access token generation call for authorizing subsequent financial transactions. A valid access token is required for web client requests.
39
+ # @param content_type content type
40
+ # @param client_request_id A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.
41
+ # @param api_key
42
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
43
+ # @param message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.
44
+ # @param [Hash] opts the optional parameters
45
+ # @return [Array<(AccessTokenResponse, Fixnum, Hash)>] AccessTokenResponse data, response status code and response headers
46
+ def v1_authentication_access_tokens_post_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, opts = {})
47
+ if @api_client.config.debugging
48
+ @api_client.config.logger.debug "Calling API: AuthenticationApi.v1_authentication_access_tokens_post ..."
49
+ end
50
+ # verify the required parameter 'content_type' is set
51
+ if @api_client.config.client_side_validation && content_type.nil?
52
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling AuthenticationApi.v1_authentication_access_tokens_post"
53
+ end
54
+ # verify enum value
55
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
56
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
57
+ end
58
+ # verify the required parameter 'client_request_id' is set
59
+ if @api_client.config.client_side_validation && client_request_id.nil?
60
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling AuthenticationApi.v1_authentication_access_tokens_post"
61
+ end
62
+ # verify the required parameter 'api_key' is set
63
+ if @api_client.config.client_side_validation && api_key.nil?
64
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling AuthenticationApi.v1_authentication_access_tokens_post"
65
+ end
66
+ # verify the required parameter 'timestamp' is set
67
+ if @api_client.config.client_side_validation && timestamp.nil?
68
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling AuthenticationApi.v1_authentication_access_tokens_post"
69
+ end
70
+ # verify the required parameter 'message_signature' is set
71
+ if @api_client.config.client_side_validation && message_signature.nil?
72
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling AuthenticationApi.v1_authentication_access_tokens_post"
73
+ end
74
+ # resource path
75
+ local_var_path = "/v1/authentication/access-tokens"
76
+
77
+ # query parameters
78
+ query_params = {}
79
+
80
+ # header parameters
81
+ header_params = {}
82
+ # HTTP header 'Accept' (if needed)
83
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
84
+ # HTTP header 'Content-Type'
85
+ # header_params[:'Content-Type'] = content_type
86
+ header_params[:'Client-Request-Id'] = client_request_id
87
+ header_params[:'Api-Key'] = api_key
88
+ header_params[:'Timestamp'] = timestamp
89
+ header_params[:'Message-Signature'] = message_signature
90
+
91
+ # form parameters
92
+ form_params = {}
93
+
94
+ # http body (model)
95
+ post_body = nil
96
+ auth_names = []
97
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
98
+ :header_params => header_params,
99
+ :query_params => query_params,
100
+ :form_params => form_params,
101
+ :body => post_body,
102
+ :auth_names => auth_names,
103
+ :return_type => 'AccessTokenResponse',
104
+ :error_type => 'ErrorResponse')
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug "API called: AuthenticationApi#v1_authentication_access_tokens_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
107
+ end
108
+ return data, status_code, headers
109
+ end
110
+ end
111
+ end