cybersource_rest_client 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (363) hide show
  1. checksums.yaml +4 -4
  2. data/AuthenticationSDK/Cybersource.gemspec +24 -23
  3. data/AuthenticationSDK/authentication/http/GetSignatureParameter.rb +64 -64
  4. data/AuthenticationSDK/authentication/http/HttpSignatureHeader.rb +52 -52
  5. data/AuthenticationSDK/authentication/jwt/JwtToken.rb +62 -62
  6. data/AuthenticationSDK/authentication/payloadDigest/digest.rb +10 -10
  7. data/AuthenticationSDK/core/Authorization.rb +24 -24
  8. data/AuthenticationSDK/core/ITokenGeneration.rb +4 -4
  9. data/AuthenticationSDK/core/Logger.rb +26 -26
  10. data/AuthenticationSDK/core/MerchantConfig.rb +181 -181
  11. data/AuthenticationSDK/resource/TRRReports.json +12 -0
  12. data/AuthenticationSDK/resource/cybs.yml +31 -0
  13. data/AuthenticationSDK/resource/request.json +54 -0
  14. data/AuthenticationSDK/resource/request_capture.json +11 -0
  15. data/AuthenticationSDK/resource/testrest.p12 +0 -0
  16. data/AuthenticationSDK/spec/Authorization_spec.rb +274 -0
  17. data/AuthenticationSDK/spec/MerchantConfigData.rb +59 -0
  18. data/AuthenticationSDK/spec/MerchantConfig_spec.rb +116 -0
  19. data/AuthenticationSDK/spec/PostRequestData.json +54 -0
  20. data/AuthenticationSDK/spec/PutRequestData.json +12 -0
  21. data/AuthenticationSDK/spec/ResponseCodeMessage_spec.rb +60 -0
  22. data/AuthenticationSDK/spec/spec_helper.rb +12 -0
  23. data/AuthenticationSDK/util/ApiException.rb +18 -18
  24. data/AuthenticationSDK/util/Cache.rb +36 -36
  25. data/AuthenticationSDK/util/Constants.rb +137 -137
  26. data/AuthenticationSDK/util/PropertiesUtil.rb +20 -21
  27. data/AuthenticationSDK/util/Utility.rb +30 -30
  28. data/lib/cybersource_rest_client/api/capture_api.rb +84 -84
  29. data/lib/cybersource_rest_client/api/credit_api.rb +78 -78
  30. data/lib/cybersource_rest_client/api/flex_token_api.rb +74 -74
  31. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +254 -254
  32. data/lib/cybersource_rest_client/api/instrument_identifiers_api.rb +91 -91
  33. data/lib/cybersource_rest_client/api/key_generation_api.rb +74 -74
  34. data/lib/cybersource_rest_client/api/notification_of_changes_api.rb +86 -86
  35. data/lib/cybersource_rest_client/api/payment_instruments_api.rb +414 -414
  36. data/lib/cybersource_rest_client/api/payments_api.rb +78 -78
  37. data/lib/cybersource_rest_client/api/process_a_payout_api.rb +77 -77
  38. data/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb +124 -129
  39. data/lib/cybersource_rest_client/api/refund_api.rb +144 -144
  40. data/lib/cybersource_rest_client/api/report_definitions_api.rb +147 -156
  41. data/lib/cybersource_rest_client/api/report_downloads_api.rb +96 -100
  42. data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +254 -262
  43. data/lib/cybersource_rest_client/api/reports_api.rb +250 -258
  44. data/lib/cybersource_rest_client/api/reversal_api.rb +84 -84
  45. data/lib/cybersource_rest_client/api/search_transactions_api.rb +132 -132
  46. data/lib/cybersource_rest_client/api/secure_file_share_api.rb +161 -169
  47. data/lib/cybersource_rest_client/api/transaction_batch_api.rb +77 -77
  48. data/lib/cybersource_rest_client/api/transaction_batches_api.rb +86 -86
  49. data/lib/cybersource_rest_client/api/transaction_details_api.rb +78 -78
  50. data/lib/cybersource_rest_client/api/user_management_api.rb +84 -84
  51. data/lib/cybersource_rest_client/api/void_api.rb +264 -264
  52. data/lib/cybersource_rest_client/api_client.rb +449 -447
  53. data/lib/cybersource_rest_client/api_error.rb +38 -38
  54. data/lib/cybersource_rest_client/configuration.rb +202 -202
  55. data/lib/cybersource_rest_client/models/auth_reversal_request.rb +219 -219
  56. data/lib/cybersource_rest_client/models/body.rb +295 -295
  57. data/lib/cybersource_rest_client/models/body_1.rb +183 -183
  58. data/lib/cybersource_rest_client/models/body_2.rb +331 -331
  59. data/lib/cybersource_rest_client/models/body_3.rb +331 -331
  60. data/lib/cybersource_rest_client/models/capture_payment_request.rb +267 -267
  61. data/lib/cybersource_rest_client/models/card_info.rb +214 -214
  62. data/lib/cybersource_rest_client/models/create_credit_request.rb +267 -267
  63. data/lib/cybersource_rest_client/models/create_payment_request.rb +285 -285
  64. data/lib/cybersource_rest_client/models/der_public_key.rb +205 -205
  65. data/lib/cybersource_rest_client/models/error.rb +192 -192
  66. data/lib/cybersource_rest_client/models/error_links.rb +205 -205
  67. data/lib/cybersource_rest_client/models/error_response.rb +192 -192
  68. data/lib/cybersource_rest_client/models/flex_v1_keys_post200_response.rb +202 -202
  69. data/lib/cybersource_rest_client/models/flex_v1_keys_post200_response_der.rb +205 -205
  70. data/lib/cybersource_rest_client/models/flex_v1_keys_post200_response_jwk.rb +225 -225
  71. data/lib/cybersource_rest_client/models/flex_v1_tokens_post200_response.rb +255 -255
  72. data/lib/cybersource_rest_client/models/flexv1tokens_card_info.rb +214 -214
  73. data/lib/cybersource_rest_client/models/generate_public_key_request.rb +249 -249
  74. data/lib/cybersource_rest_client/models/inline_response_400.rb +202 -202
  75. data/lib/cybersource_rest_client/models/inline_response_default.rb +192 -192
  76. data/lib/cybersource_rest_client/models/inline_response_default__links.rb +205 -205
  77. data/lib/cybersource_rest_client/models/inline_response_default__links_next.rb +204 -204
  78. data/lib/cybersource_rest_client/models/inline_response_default_response_status.rb +225 -225
  79. data/lib/cybersource_rest_client/models/inline_response_default_response_status_details.rb +194 -194
  80. data/lib/cybersource_rest_client/models/json_web_key.rb +225 -225
  81. data/lib/cybersource_rest_client/models/key_parameters.rb +184 -184
  82. data/lib/cybersource_rest_client/models/key_result.rb +202 -202
  83. data/lib/cybersource_rest_client/models/link.rb +204 -204
  84. data/lib/cybersource_rest_client/models/links.rb +205 -205
  85. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get200_response.rb +204 -204
  86. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get200_response__links.rb +183 -183
  87. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get200_response__links_self.rb +192 -192
  88. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get200_response_transaction_batches.rb +277 -277
  89. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get400_response.rb +193 -193
  90. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get400_response_error_information.rb +203 -203
  91. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get400_response_error_information_details.rb +194 -194
  92. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get500_response.rb +193 -193
  93. data/lib/cybersource_rest_client/models/pts_v1_transaction_batches_get500_response_error_information.rb +194 -194
  94. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response.rb +323 -323
  95. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_credit_amount_details.rb +224 -224
  96. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response.rb +314 -314
  97. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response__links.rb +201 -201
  98. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_order_information.rb +192 -192
  99. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_order_information_amount_details.rb +224 -224
  100. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_processor_information.rb +199 -199
  101. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post400_response.rb +271 -271
  102. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response.rb +341 -341
  103. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response__links.rb +201 -201
  104. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response__links_self.rb +194 -194
  105. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_client_reference_information.rb +199 -199
  106. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_error_information.rb +239 -239
  107. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_error_information_details.rb +228 -228
  108. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information.rb +192 -192
  109. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_amount_details.rb +249 -249
  110. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_invoice_details.rb +184 -184
  111. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +201 -201
  112. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_account_features.rb +623 -623
  113. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_card.rb +199 -199
  114. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +349 -349
  115. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information.rb +208 -208
  116. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information_emv.rb +199 -199
  117. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +642 -642
  118. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_avs.rb +224 -224
  119. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_card_verification.rb +224 -224
  120. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_consumer_authentication_response.rb +224 -224
  121. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_customer.rb +199 -199
  122. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_electronic_verification_results.rb +474 -474
  123. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_issuer.rb +224 -224
  124. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_merchant_advice.rb +224 -224
  125. data/lib/cybersource_rest_client/models/pts_v2_payments_post400_response.rb +271 -271
  126. data/lib/cybersource_rest_client/models/pts_v2_payments_post502_response.rb +260 -260
  127. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +323 -323
  128. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response__links.rb +192 -192
  129. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_order_information.rb +183 -183
  130. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +224 -224
  131. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_refund_amount_details.rb +224 -224
  132. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post400_response.rb +271 -271
  133. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response.rb +332 -332
  134. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response__links.rb +183 -183
  135. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_authorization_information.rb +224 -224
  136. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +324 -324
  137. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_reversal_amount_details.rb +249 -249
  138. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post400_response.rb +271 -271
  139. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response.rb +280 -280
  140. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response_void_amount_details.rb +219 -219
  141. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post400_response.rb +271 -271
  142. data/lib/cybersource_rest_client/models/pts_v2_payouts_post400_response.rb +259 -259
  143. data/lib/cybersource_rest_client/models/pts_v2_payouts_post_response.rb +237 -237
  144. data/lib/cybersource_rest_client/models/ptsv2credits_point_of_sale_information.rb +183 -183
  145. data/lib/cybersource_rest_client/models/ptsv2credits_point_of_sale_information_emv.rb +221 -221
  146. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +383 -383
  147. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information.rb +233 -233
  148. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +424 -424
  149. data/lib/cybersource_rest_client/models/ptsv2payments_buyer_information.rb +285 -285
  150. data/lib/cybersource_rest_client/models/ptsv2payments_buyer_information_personal_identification.rb +252 -252
  151. data/lib/cybersource_rest_client/models/ptsv2payments_client_reference_information.rb +219 -219
  152. data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +374 -374
  153. data/lib/cybersource_rest_client/models/ptsv2payments_device_information.rb +249 -249
  154. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_defined_information.rb +224 -224
  155. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information.rb +308 -308
  156. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +365 -374
  157. data/lib/cybersource_rest_client/models/ptsv2payments_order_information.rb +230 -230
  158. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +605 -605
  159. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_amex_additional_amounts.rb +224 -224
  160. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_surcharge.rb +209 -209
  161. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_tax_details.rb +328 -328
  162. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +618 -618
  163. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_invoice_details.rb +360 -360
  164. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_invoice_details_transaction_advice_addendum.rb +199 -199
  165. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +649 -649
  166. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_ship_to.rb +474 -474
  167. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_shipping_details.rb +234 -234
  168. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +210 -210
  169. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +474 -474
  170. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_customer.rb +190 -199
  171. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_fluid_data.rb +259 -259
  172. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +424 -424
  173. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +440 -440
  174. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information_emv.rb +256 -256
  175. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +432 -432
  176. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +361 -361
  177. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options_initiator.rb +247 -247
  178. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options_merchant_initiated_transaction.rb +224 -224
  179. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_capture_options.rb +267 -267
  180. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_issuer.rb +199 -199
  181. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_recurring_options.rb +198 -198
  182. data/lib/cybersource_rest_client/models/ptsv2payments_recipient_information.rb +249 -249
  183. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information.rb +233 -233
  184. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +374 -374
  185. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_buyer_information.rb +224 -224
  186. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_merchant_information.rb +258 -258
  187. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information.rb +230 -230
  188. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +546 -546
  189. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_bill_to.rb +449 -449
  190. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_invoice_details.rb +320 -320
  191. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_ship_to.rb +249 -249
  192. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_shipping_details.rb +199 -199
  193. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_payment_information.rb +183 -183
  194. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information.rb +208 -208
  195. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information_emv.rb +211 -211
  196. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +351 -351
  197. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information_authorization_options.rb +249 -249
  198. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information_capture_options.rb +242 -242
  199. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_merchant_information.rb +258 -258
  200. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information.rb +230 -230
  201. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_line_items.rb +639 -639
  202. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information.rb +183 -183
  203. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +374 -374
  204. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_point_of_sale_information.rb +183 -183
  205. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information.rb +333 -333
  206. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information_recurring_options.rb +186 -186
  207. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_client_reference_information.rb +209 -209
  208. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_order_information.rb +185 -185
  209. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_order_information_line_items.rb +233 -233
  210. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_point_of_sale_information.rb +183 -183
  211. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_processing_information.rb +308 -308
  212. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_reversal_information.rb +208 -208
  213. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_reversal_information_amount_details.rb +224 -224
  214. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information.rb +258 -258
  215. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +324 -324
  216. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information.rb +192 -192
  217. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_amount_details.rb +233 -233
  218. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_amount_details_surcharge.rb +199 -199
  219. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_bill_to.rb +443 -443
  220. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information.rb +183 -183
  221. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +299 -299
  222. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +283 -283
  223. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_payouts_options.rb +274 -274
  224. data/lib/cybersource_rest_client/models/ptsv2payouts_recipient_information.rb +433 -433
  225. data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information.rb +517 -517
  226. data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information_account.rb +233 -233
  227. data/lib/cybersource_rest_client/models/refund_capture_request.rb +267 -267
  228. data/lib/cybersource_rest_client/models/refund_payment_request.rb +267 -267
  229. data/lib/cybersource_rest_client/models/reporting_v3_notificationof_changes_get200_response.rb +186 -186
  230. data/lib/cybersource_rest_client/models/reporting_v3_notificationof_changes_get200_response_notification_of_changes.rb +255 -255
  231. data/lib/cybersource_rest_client/models/reporting_v3_notificationof_changes_get400_response.rb +247 -247
  232. data/lib/cybersource_rest_client/models/reporting_v3_notificationof_changes_get400_response_fields.rb +205 -205
  233. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_get200_response.rb +185 -185
  234. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_get200_response_report_definitions.rb +243 -243
  235. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response.rb +254 -254
  236. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response_attributes.rb +237 -237
  237. data/lib/cybersource_rest_client/models/reporting_v3_report_subscriptions_get200_response.rb +185 -185
  238. data/lib/cybersource_rest_client/models/reporting_v3_report_subscriptions_get200_response_report_preferences.rb +229 -229
  239. data/lib/cybersource_rest_client/models/reporting_v3_report_subscriptions_get200_response_subscriptions.rb +354 -354
  240. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response.rb +185 -185
  241. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response_reports.rb +373 -373
  242. data/lib/cybersource_rest_client/models/reporting_v3_reports_id_get200_response.rb +376 -376
  243. data/lib/cybersource_rest_client/models/request_body.rb +446 -463
  244. data/lib/cybersource_rest_client/models/request_body_1.rb +398 -415
  245. data/lib/cybersource_rest_client/models/response_status.rb +225 -225
  246. data/lib/cybersource_rest_client/models/response_status_details.rb +194 -194
  247. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_delete409_response.rb +183 -183
  248. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_delete409_response__links.rb +183 -183
  249. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_delete409_response__links_payment_instruments.rb +183 -183
  250. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_paymentinstruments_get200_response.rb +277 -277
  251. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_paymentinstruments_get200_response__links.rb +219 -219
  252. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_paymentinstruments_get200_response__links_first.rb +184 -184
  253. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_paymentinstruments_get200_response__links_last.rb +184 -184
  254. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_paymentinstruments_get200_response__links_next.rb +184 -184
  255. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_paymentinstruments_get200_response__links_prev.rb +184 -184
  256. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_paymentinstruments_get200_response__links_self.rb +184 -184
  257. data/lib/cybersource_rest_client/models/tms_v1_instrumentidentifiers_post200_response.rb +295 -295
  258. data/lib/cybersource_rest_client/models/tms_v1_paymentinstruments_post201_response.rb +331 -331
  259. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers__links.rb +201 -201
  260. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers__links_self.rb +183 -183
  261. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_authorization_options_merchant_initiated_transaction.rb +184 -184
  262. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_bank_account.rb +194 -194
  263. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_card.rb +184 -184
  264. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_details.rb +194 -194
  265. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_metadata.rb +184 -184
  266. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_processing_information.rb +183 -183
  267. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_processing_information_authorization_options.rb +183 -183
  268. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_processing_information_authorization_options_initiator.rb +183 -183
  269. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_bank_account.rb +184 -184
  270. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_bill_to.rb +284 -284
  271. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_buyer_information.rb +215 -215
  272. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_buyer_information_issued_by.rb +184 -184
  273. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_buyer_information_personal_identification.rb +203 -203
  274. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_card.rb +278 -278
  275. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_instrument_identifier.rb +295 -295
  276. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_merchant_information.rb +183 -183
  277. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_merchant_information_merchant_descriptor.rb +184 -184
  278. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_processing_information.rb +193 -193
  279. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_processing_information_bank_transfer_options.rb +184 -184
  280. data/lib/cybersource_rest_client/models/tokenize_parameters.rb +193 -193
  281. data/lib/cybersource_rest_client/models/tokenize_request.rb +193 -193
  282. data/lib/cybersource_rest_client/models/tokenize_result.rb +255 -255
  283. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response.rb +444 -444
  284. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_application_information.rb +225 -225
  285. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_application_information_applications.rb +254 -254
  286. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_buyer_information.rb +224 -224
  287. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_client_reference_information.rb +239 -239
  288. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_consumer_authentication_information.rb +259 -259
  289. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_device_information.rb +234 -234
  290. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_error_information.rb +205 -205
  291. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_fraud_marking_information.rb +184 -184
  292. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_installment_information.rb +184 -184
  293. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_merchant_defined_information.rb +224 -224
  294. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_merchant_information.rb +183 -183
  295. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_merchant_information_merchant_descriptor.rb +199 -199
  296. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information.rb +222 -222
  297. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_amount_details.rb +274 -274
  298. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_bill_to.rb +524 -524
  299. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_line_items.rb +343 -343
  300. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_ship_to.rb +424 -424
  301. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_shipping_details.rb +209 -209
  302. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information.rb +228 -228
  303. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_account_features.rb +249 -249
  304. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_bank.rb +242 -242
  305. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_bank_account.rb +244 -244
  306. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_bank_mandate.rb +204 -204
  307. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +424 -424
  308. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_invoice.rb +204 -204
  309. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +244 -244
  310. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_point_of_sale_information.rb +233 -233
  311. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +252 -252
  312. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_authorization_options.rb +199 -199
  313. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_bank_transfer_options.rb +184 -184
  314. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +309 -309
  315. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information_ach_verification.rb +224 -224
  316. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information_card_verification.rb +199 -199
  317. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information_electronic_verification_results.rb +424 -424
  318. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information_processor.rb +199 -199
  319. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_risk_information.rb +233 -233
  320. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_risk_information_profile.rb +194 -194
  321. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_risk_information_score.rb +196 -196
  322. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_sender_information.rb +199 -199
  323. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response.rb +317 -317
  324. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded.rb +186 -186
  325. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded__links.rb +183 -183
  326. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_buyer_information.rb +199 -199
  327. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_client_reference_information.rb +219 -219
  328. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_consumer_authentication_information.rb +209 -209
  329. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_device_information.rb +199 -199
  330. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_merchant_information.rb +199 -199
  331. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_order_information.rb +201 -201
  332. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_order_information_bill_to.rb +299 -299
  333. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_order_information_ship_to.rb +299 -299
  334. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information.rb +201 -201
  335. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +249 -249
  336. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_payment_method.rb +184 -184
  337. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_point_of_sale_information.rb +228 -228
  338. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_point_of_sale_information_partner.rb +199 -199
  339. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +209 -209
  340. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processor_information.rb +183 -183
  341. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_risk_information.rb +183 -183
  342. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_risk_information_providers.rb +183 -183
  343. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_risk_information_providers_fingerprint.rb +249 -249
  344. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_transaction_summaries.rb +357 -357
  345. data/lib/cybersource_rest_client/models/tss_v2_transactions_post400_response.rb +249 -249
  346. data/lib/cybersource_rest_client/models/tss_v2_transactions_post_response.rb +244 -244
  347. data/lib/cybersource_rest_client/models/ums_v1_users_get200_response.rb +185 -185
  348. data/lib/cybersource_rest_client/models/ums_v1_users_get200_response_account_information.rb +282 -282
  349. data/lib/cybersource_rest_client/models/ums_v1_users_get200_response_contact_information.rb +210 -210
  350. data/lib/cybersource_rest_client/models/ums_v1_users_get200_response_organization_information.rb +183 -183
  351. data/lib/cybersource_rest_client/models/ums_v1_users_get200_response_users.rb +201 -201
  352. data/lib/cybersource_rest_client/models/v1_file_details_get200_response.rb +194 -194
  353. data/lib/cybersource_rest_client/models/v1_file_details_get200_response__links.rb +194 -194
  354. data/lib/cybersource_rest_client/models/v1_file_details_get200_response__links_files.rb +202 -202
  355. data/lib/cybersource_rest_client/models/v1_file_details_get200_response__links_self.rb +192 -192
  356. data/lib/cybersource_rest_client/models/v1_file_details_get200_response_file_details.rb +278 -278
  357. data/lib/cybersource_rest_client/models/void_capture_request.rb +183 -183
  358. data/lib/cybersource_rest_client/models/void_credit_request.rb +183 -183
  359. data/lib/cybersource_rest_client/models/void_payment_request.rb +183 -183
  360. data/lib/cybersource_rest_client/models/void_refund_request.rb +183 -183
  361. data/lib/cybersource_rest_client/version.rb +15 -15
  362. data/lib/cybersource_rest_client.rb +369 -369
  363. metadata +14 -2
@@ -1,447 +1,449 @@
1
- =begin
2
- #CyberSource Flex API
3
-
4
- #Simple PAN tokenization service
5
-
6
- OpenAPI spec version: 0.0.1
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
- require 'json'
15
- require 'logger'
16
- require 'tempfile'
17
- require 'typhoeus'
18
- require 'uri'
19
-
20
- module CyberSource
21
- class ApiClient
22
- # The Configuration object holding settings to be used in the API client.
23
- attr_accessor :config
24
-
25
- # Defines the headers to be used in HTTP requests of all API calls by default.
26
- #
27
- # @return [Hash]
28
- attr_accessor :default_headers
29
-
30
- # Initializes the ApiClient
31
- # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
- def initialize(config = Configuration.default)
33
- @config = config
34
- @user_agent = "Mozilla/5.0"
35
- @default_headers = {
36
- 'Content-Type' => 'application/json',
37
- 'User-Agent' => @user_agent
38
- }
39
- end
40
-
41
- def self.default
42
- @@default ||= ApiClient.new
43
- end
44
-
45
- # Call an API with given options.
46
- #
47
- # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
48
- # the data deserialized from response body (could be nil), response status code and response headers.
49
- def call_api(http_method, path, opts = {})
50
- request = build_request(http_method, path, opts)
51
- response = request.run
52
-
53
- if @config.debugging
54
- @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
55
- end
56
-
57
- unless response.success?
58
- if response.timed_out?
59
- fail ApiError.new('Connection timed out')
60
- elsif response.code == 0
61
- # Errors from libcurl will be made visible here
62
- fail ApiError.new(:code => 0,
63
- :message => response.return_message)
64
- else
65
- fail ApiError.new(:code => response.code,
66
- :response_headers => response.headers,
67
- :response_body => response.body),
68
- response.status_message
69
- end
70
- end
71
-
72
- if opts[:return_type]
73
- data = deserialize(response, opts[:return_type])
74
- else
75
- data = nil
76
- end
77
- return response.body, response.code, response.headers
78
- end
79
-
80
- # Builds the HTTP request
81
- #
82
- # @param [String] http_method HTTP method/verb (e.g. POST)
83
- # @param [String] path URL path (e.g. /account/new)
84
- # @option opts [Hash] :header_params Header parameters
85
- # @option opts [Hash] :query_params Query parameters
86
- # @option opts [Hash] :form_params Query parameters
87
- # @option opts [Object] :body HTTP body (JSON/XML)
88
- # @return [Typhoeus::Request] A Typhoeus Request
89
- def build_request(http_method, path, opts = {})
90
- url = build_request_url(path)
91
- body_params = opts[:body] || {}
92
- query_params = opts[:query_params] || {}
93
- headers = CallAuthenticationHeader(http_method, path, body_params, opts[:header_params], query_params)
94
- http_method = http_method.to_sym.downcase
95
- header_params = @default_headers.merge(headers || {})
96
- form_params = opts[:form_params] || {}
97
-
98
-
99
- # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
100
- _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
101
-
102
- req_opts = {
103
- :method => http_method,
104
- :headers => header_params,
105
- :params => query_params,
106
- :params_encoding => @config.params_encoding,
107
- :timeout => @config.timeout,
108
- :ssl_verifypeer => @config.verify_ssl,
109
- :ssl_verifyhost => _verify_ssl_host,
110
- :sslcert => @config.cert_file,
111
- :sslkey => @config.key_file,
112
- :verbose => @config.debugging
113
- }
114
-
115
- # set custom cert, if provided
116
- req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
117
-
118
- if [:post, :patch, :put, :delete].include?(http_method)
119
- req_body = build_request_body(header_params, form_params, opts[:body])
120
- req_opts.update :body => req_body
121
- if @config.debugging
122
- @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
123
- end
124
- end
125
-
126
- request = Typhoeus::Request.new(url, req_opts)
127
- download_file(request) if opts[:return_type] == 'File'
128
- request
129
- end
130
- # set merchantConfig
131
- def set_configuration(config)
132
- require_relative '../../AuthenticationSDK/core/Merchantconfig.rb'
133
- $merchantconfig_obj = Merchantconfig.new(config)
134
- end
135
- # Calling Authentication
136
- def CallAuthenticationHeader(http_method, path, body_params, header_params, query_params)
137
- # require Dir.getwd + '/data/Configuration.rb'
138
- require_relative '../../AuthenticationSDK/core/Authorization.rb'
139
- require_relative '../../AuthenticationSDK/authentication/payloadDigest/Digest.rb'
140
- request_target = get_query_param(path, query_params)
141
- # Request Type. [Non-Editable]
142
- request_type = http_method.to_s
143
- # cybsproperty_obj = MerchantConfiguration.new.merchantConfigProp
144
- # $merchantconfig_obj = Merchantconfig.new(cybsproperty_obj)
145
- log_obj = Log.new $merchantconfig_obj.logDirectory, $merchantconfig_obj.logFilename, $merchantconfig_obj.logSize, $merchantconfig_obj.enableLog
146
- # Set Request Type into the merchant config object.
147
- $merchantconfig_obj.requestType = request_type
148
- # Set Request Target into the merchant config object.
149
- $merchantconfig_obj.requestTarget = request_target
150
- # Construct the URL.
151
- url = Constants::HTTPS_URI_PREFIX + $merchantconfig_obj.requestHost + $merchantconfig_obj.requestTarget
152
- # set Request Json to Merchant config object
153
- $merchantconfig_obj.requestJsonData = body_params
154
- # Set URL into the merchant config object.
155
- $merchantconfig_obj.requestUrl = url
156
- # Calling APISDK, Apisdk.controller.
157
- gmtDateTime = DateTime.now.httpdate
158
- token = Authorization.new.getToken($merchantconfig_obj, gmtDateTime, log_obj)
159
- # HTTP header 'Accept' (if needed)
160
- if $merchantconfig_obj.authenticationType.upcase == Constants::AUTH_TYPE_HTTP
161
- # Appending headers for Get Connection
162
- header_params['v-c-merchant-id'] = $merchantconfig_obj.merchantId
163
- header_params['Date'] = gmtDateTime
164
- header_params['Host'] = $merchantconfig_obj.requestHost
165
- header_params['Signature'] = token
166
- if request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE || request_type == Constants::PATCH_REQUEST_TYPE
167
- digest = DigestGeneration.new.generateDigest(body_params, log_obj)
168
- digest_payload = Constants::SHA256 + digest
169
- header_params['Digest'] = digest_payload
170
- end
171
- end
172
- if $merchantconfig_obj.authenticationType.upcase == Constants::AUTH_TYPE_JWT
173
- token = "Bearer " + token
174
- header_params['Authorization'] = token
175
- end
176
- header_params.each do |key, value|
177
- log_obj.logger.info("#{key} : #{value}")
178
- end
179
- return header_params
180
- end
181
- def get_query_param(path, query_params)
182
- if !query_params.empty?
183
- request_target = @config.base_path + path + '?' + URI.encode_www_form(query_params)
184
- else
185
- request_target = @config.base_path + path
186
- end
187
- request_target
188
- end
189
- # Check if the given MIME is a JSON MIME.
190
- # JSON MIME examples:
191
- # application/json
192
- # application/json; charset=UTF8
193
- # APPLICATION/JSON
194
- # */*
195
- # @param [String] mime MIME
196
- # @return [Boolean] True if the MIME is application/json
197
- def json_mime?(mime)
198
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
199
- end
200
-
201
- # Deserialize the response to the given return type.
202
- #
203
- # @param [Response] response HTTP response
204
- # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
205
- def deserialize(response, return_type)
206
- body = response.body
207
-
208
- # handle file downloading - return the File instance processed in request callbacks
209
- # note that response body is empty when the file is written in chunks in request on_body callback
210
- return @tempfile if return_type == 'File'
211
-
212
- return nil if body.nil? || body.empty?
213
-
214
- # return response body directly for String return type
215
- return body if return_type == 'String'
216
-
217
- # ensuring a default content type
218
- content_type = response.headers['Content-Type'] || 'application/json'
219
-
220
- fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
221
-
222
- begin
223
- data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
224
- rescue JSON::ParserError => e
225
- if %w(String Date DateTime).include?(return_type)
226
- data = body
227
- else
228
- raise e
229
- end
230
- end
231
-
232
- convert_to_type data, return_type
233
- end
234
-
235
- # Convert data to the given return type.
236
- # @param [Object] data Data to be converted
237
- # @param [String] return_type Return type
238
- # @return [Mixed] Data in a particular type
239
- def convert_to_type(data, return_type)
240
- return nil if data.nil?
241
- case return_type
242
- when 'String'
243
- data.to_s
244
- when 'Integer'
245
- data.to_i
246
- when 'Float'
247
- data.to_f
248
- when 'BOOLEAN'
249
- data == true
250
- when 'DateTime'
251
- # parse date time (expecting ISO 8601 format)
252
- DateTime.parse data
253
- when 'Date'
254
- # parse date time (expecting ISO 8601 format)
255
- Date.parse data
256
- when 'Object'
257
- # generic object (usually a Hash), return directly
258
- data
259
- when /\AArray<(.+)>\z/
260
- # e.g. Array<Pet>
261
- sub_type = $1
262
- data.map { |item| convert_to_type(item, sub_type) }
263
- when /\AHash\<String, (.+)\>\z/
264
- # e.g. Hash<String, Integer>
265
- sub_type = $1
266
- {}.tap do |hash|
267
- data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
268
- end
269
- else
270
- # models, e.g. Pet
271
- CyberSource.const_get(return_type).new.tap do |model|
272
- model.build_from_hash data
273
- end
274
- end
275
- end
276
-
277
- # Save response body into a file in (the defined) temporary folder, using the filename
278
- # from the "Content-Disposition" header if provided, otherwise a random filename.
279
- # The response body is written to the file in chunks in order to handle files which
280
- # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
281
- # process can use.
282
- #
283
- # @see Configuration#temp_folder_path
284
- def download_file(request)
285
- tempfile = nil
286
- encoding = nil
287
- request.on_headers do |response|
288
- content_disposition = response.headers['Content-Disposition']
289
- if content_disposition && content_disposition =~ /filename=/i
290
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
291
- prefix = sanitize_filename(filename)
292
- else
293
- prefix = 'download-'
294
- end
295
- prefix = prefix + '-' unless prefix.end_with?('-')
296
- encoding = response.body.encoding
297
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
298
- @tempfile = tempfile
299
- end
300
- request.on_body do |chunk|
301
- chunk.force_encoding(encoding)
302
- tempfile.write(chunk)
303
- end
304
- request.on_complete do |response|
305
- tempfile.close
306
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
307
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
308
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
309
- "explicitly with `tempfile.delete`"
310
- end
311
- end
312
-
313
- # Sanitize filename by removing path.
314
- # e.g. ../../sun.gif becomes sun.gif
315
- #
316
- # @param [String] filename the filename to be sanitized
317
- # @return [String] the sanitized filename
318
- def sanitize_filename(filename)
319
- filename.gsub(/.*[\/\\]/, '')
320
- end
321
-
322
- def build_request_url(path)
323
- # Add leading and trailing slashes to path
324
- path = "/#{path}".gsub(/\/+/, '/')
325
- URI.encode(@config.base_url + path)
326
- end
327
-
328
- # Builds the HTTP request body
329
- #
330
- # @param [Hash] header_params Header parameters
331
- # @param [Hash] form_params Query parameters
332
- # @param [Object] body HTTP body (JSON/XML)
333
- # @return [String] HTTP body data in the form of string
334
- def build_request_body(header_params, form_params, body)
335
- # http form
336
- if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
337
- header_params['Content-Type'] == 'multipart/form-data'
338
- data = {}
339
- form_params.each do |key, value|
340
- case value
341
- when ::File, ::Array, nil
342
- # let typhoeus handle File, Array and nil parameters
343
- data[key] = value
344
- else
345
- data[key] = value.to_s
346
- end
347
- end
348
- elsif body
349
- data = body.is_a?(String) ? body : body.to_json
350
- else
351
- data = nil
352
- end
353
- data
354
- end
355
-
356
- # Update hearder and query params based on authentication settings.
357
- #
358
- # @param [Hash] header_params Header parameters
359
- # @param [Hash] query_params Query parameters
360
- # @param [String] auth_names Authentication scheme name
361
- def update_params_for_auth!(header_params, query_params, auth_names)
362
- Array(auth_names).each do |auth_name|
363
- auth_setting = @config.auth_settings[auth_name]
364
- next unless auth_setting
365
- case auth_setting[:in]
366
- when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
367
- when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
368
- else fail ArgumentError, 'Authentication token must be in `query` of `header`'
369
- end
370
- end
371
- end
372
-
373
- # Sets user agent in HTTP header
374
- #
375
- # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
376
- def user_agent=(user_agent)
377
- @user_agent = user_agent
378
- @default_headers['User-Agent'] = @user_agent
379
- end
380
-
381
- # Return Accept header based on an array of accepts provided.
382
- # @param [Array] accepts array for Accept
383
- # @return [String] the Accept header (e.g. application/json)
384
- def select_header_accept(accepts)
385
- return nil if accepts.nil? || accepts.empty?
386
- # use JSON when present, otherwise use all of the provided
387
- json_accept = accepts.find { |s| json_mime?(s) }
388
- json_accept || accepts.join(',')
389
- end
390
-
391
- # Return Content-Type header based on an array of content types provided.
392
- # @param [Array] content_types array for Content-Type
393
- # @return [String] the Content-Type header (e.g. application/json)
394
- def select_header_content_type(content_types)
395
- # use application/json by default
396
- return 'application/json' if content_types.nil? || content_types.empty?
397
- # use JSON when present, otherwise use the first one
398
- json_content_type = content_types.find { |s| json_mime?(s) }
399
- json_content_type || content_types.first
400
- end
401
-
402
- # Convert object (array, hash, object, etc) to JSON string.
403
- # @param [Object] model object to be converted into JSON string
404
- # @return [String] JSON string representation of the object
405
- def object_to_http_body(model)
406
- return model if model.nil? || model.is_a?(String)
407
- local_body = nil
408
- if model.is_a?(Array)
409
- local_body = model.map { |m| object_to_hash(m) }
410
- else
411
- local_body = object_to_hash(model)
412
- end
413
- local_body.to_json
414
- end
415
-
416
- # Convert object(non-array) to hash.
417
- # @param [Object] obj object to be converted into JSON string
418
- # @return [String] JSON string representation of the object
419
- def object_to_hash(obj)
420
- if obj.respond_to?(:to_hash)
421
- obj.to_hash
422
- else
423
- obj
424
- end
425
- end
426
-
427
- # Build parameter value according to the given collection format.
428
- # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
429
- def build_collection_param(param, collection_format)
430
- case collection_format
431
- when :csv
432
- param.join(',')
433
- when :ssv
434
- param.join(' ')
435
- when :tsv
436
- param.join("\t")
437
- when :pipes
438
- param.join('|')
439
- when :multi
440
- # return the array directly as typhoeus will handle it as expected
441
- param
442
- else
443
- fail "unknown collection format: #{collection_format.inspect}"
444
- end
445
- end
446
- end
447
- end
1
+ =begin
2
+ #CyberSource Flex API
3
+
4
+ #Simple PAN tokenization service
5
+
6
+ OpenAPI spec version: 0.0.1
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
+ require 'json'
15
+ require 'logger'
16
+ require 'tempfile'
17
+ require 'typhoeus'
18
+ require 'uri'
19
+ require 'addressable/uri'
20
+
21
+ module CyberSource
22
+ class ApiClient
23
+ # The Configuration object holding settings to be used in the API client.
24
+ attr_accessor :config
25
+
26
+ # Defines the headers to be used in HTTP requests of all API calls by default.
27
+ #
28
+ # @return [Hash]
29
+ attr_accessor :default_headers
30
+
31
+ # Initializes the ApiClient
32
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
33
+ def initialize(config = Configuration.default)
34
+ @config = config
35
+ @user_agent = "Mozilla/5.0"
36
+ @default_headers = {
37
+ 'Content-Type' => 'application/json',
38
+ 'User-Agent' => @user_agent
39
+ }
40
+ end
41
+
42
+ def self.default
43
+ @@default ||= ApiClient.new
44
+ end
45
+
46
+ # Call an API with given options.
47
+ #
48
+ # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
49
+ # the data deserialized from response body (could be nil), response status code and response headers.
50
+ def call_api(http_method, path, opts = {})
51
+ request = build_request(http_method, path, opts)
52
+ response = request.run
53
+ if @config.debugging
54
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
55
+ end
56
+
57
+ unless response.success?
58
+ if response.timed_out?
59
+ fail ApiError.new('Connection timed out')
60
+ elsif response.code == 0
61
+ # Errors from libcurl will be made visible here
62
+ fail ApiError.new(:code => 0,
63
+ :message => response.return_message)
64
+ else
65
+ fail ApiError.new(:code => response.code,
66
+ :response_headers => response.headers,
67
+ :response_body => response.body),
68
+ response.status_message
69
+ end
70
+ end
71
+
72
+ if opts[:return_type]
73
+ data = deserialize(response, opts[:return_type])
74
+ else
75
+ data = nil
76
+ end
77
+ return response.body, response.code, response.headers
78
+ end
79
+
80
+ # Builds the HTTP request
81
+ #
82
+ # @param [String] http_method HTTP method/verb (e.g. POST)
83
+ # @param [String] path URL path (e.g. /account/new)
84
+ # @option opts [Hash] :header_params Header parameters
85
+ # @option opts [Hash] :query_params Query parameters
86
+ # @option opts [Hash] :form_params Query parameters
87
+ # @option opts [Object] :body HTTP body (JSON/XML)
88
+ # @return [Typhoeus::Request] A Typhoeus Request
89
+ def build_request(http_method, path, opts = {})
90
+ url = build_request_url(path)
91
+ body_params = opts[:body] || {}
92
+ query_params = opts[:query_params] || {}
93
+ if !query_params.empty?
94
+ query_params = URI.encode_www_form(query_params)
95
+ end
96
+ headers = CallAuthenticationHeader(http_method, path, body_params, opts[:header_params], query_params)
97
+ http_method = http_method.to_sym.downcase
98
+ header_params = @default_headers.merge(headers || {})
99
+ form_params = opts[:form_params] || {}
100
+
101
+
102
+ # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
103
+ _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
104
+
105
+ req_opts = {
106
+ :method => http_method,
107
+ :headers => header_params,
108
+ :params => query_params,
109
+ :params_encoding => @config.params_encoding,
110
+ :timeout => @config.timeout,
111
+ :ssl_verifypeer => @config.verify_ssl,
112
+ :ssl_verifyhost => _verify_ssl_host,
113
+ :sslcert => @config.cert_file,
114
+ :sslkey => @config.key_file,
115
+ :verbose => @config.debugging
116
+ }
117
+
118
+ # set custom cert, if provided
119
+ req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
120
+
121
+ if [:post, :patch, :put, :delete].include?(http_method)
122
+ req_body = build_request_body(header_params, form_params, opts[:body])
123
+ req_opts.update :body => req_body
124
+ if @config.debugging
125
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
126
+ end
127
+ end
128
+
129
+ request = Typhoeus::Request.new(url, req_opts)
130
+ download_file(request) if opts[:return_type] == 'File'
131
+ request
132
+ end
133
+ # set merchantConfig
134
+ def set_configuration(config)
135
+ require_relative '../../AuthenticationSDK/core/Merchantconfig.rb'
136
+ $merchantconfig_obj = Merchantconfig.new(config)
137
+ @config.host = $merchantconfig_obj.requestHost
138
+ end
139
+ # Calling Authentication
140
+ def CallAuthenticationHeader(http_method, path, body_params, header_params, query_params)
141
+ require_relative '../../AuthenticationSDK/core/Authorization.rb'
142
+ require_relative '../../AuthenticationSDK/authentication/payloadDigest/Digest.rb'
143
+ request_target = get_query_param(path, query_params)
144
+ # Request Type. [Non-Editable]
145
+ request_type = http_method.to_s
146
+ log_obj = Log.new $merchantconfig_obj.logDirectory, $merchantconfig_obj.logFilename, $merchantconfig_obj.logSize, $merchantconfig_obj.enableLog
147
+ # Set Request Type into the merchant config object.
148
+ $merchantconfig_obj.requestType = request_type
149
+ # Set Request Target into the merchant config object.
150
+ $merchantconfig_obj.requestTarget = request_target
151
+ # Construct the URL.
152
+ url = Constants::HTTPS_URI_PREFIX + $merchantconfig_obj.requestHost + $merchantconfig_obj.requestTarget
153
+ # set Request Json to Merchant config object
154
+ $merchantconfig_obj.requestJsonData = body_params
155
+ # Set URL into the merchant config object.
156
+ $merchantconfig_obj.requestUrl = url
157
+ # Calling APISDK, Apisdk.controller.
158
+ gmtDateTime = DateTime.now.httpdate
159
+ token = Authorization.new.getToken($merchantconfig_obj, gmtDateTime, log_obj)
160
+ # HTTP header 'Accept' (if needed)
161
+ if $merchantconfig_obj.authenticationType.upcase == Constants::AUTH_TYPE_HTTP
162
+ # Appending headers for Get Connection
163
+ header_params['v-c-merchant-id'] = $merchantconfig_obj.merchantId
164
+ header_params['Date'] = gmtDateTime
165
+ header_params['Host'] = $merchantconfig_obj.requestHost
166
+ header_params['Signature'] = token
167
+ if request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE || request_type == Constants::PATCH_REQUEST_TYPE
168
+ digest = DigestGeneration.new.generateDigest(body_params, log_obj)
169
+ digest_payload = Constants::SHA256 + digest
170
+ header_params['Digest'] = digest_payload
171
+ end
172
+ end
173
+ if $merchantconfig_obj.authenticationType.upcase == Constants::AUTH_TYPE_JWT
174
+ token = "Bearer " + token
175
+ header_params['Authorization'] = token
176
+ end
177
+ header_params.each do |key, value|
178
+ log_obj.logger.info("#{key} : #{value}")
179
+ end
180
+ return header_params
181
+ end
182
+ def get_query_param(path, query_params)
183
+ request_target = ''
184
+ if !query_params.empty?
185
+ request_target = @config.base_path + path + '?' + query_params
186
+ else
187
+ request_target = @config.base_path + path
188
+ end
189
+ request_target
190
+ end
191
+ # Check if the given MIME is a JSON MIME.
192
+ # JSON MIME examples:
193
+ # application/json
194
+ # application/json; charset=UTF8
195
+ # APPLICATION/JSON
196
+ # */*
197
+ # @param [String] mime MIME
198
+ # @return [Boolean] True if the MIME is application/json
199
+ def json_mime?(mime)
200
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
201
+ end
202
+
203
+ # Deserialize the response to the given return type.
204
+ #
205
+ # @param [Response] response HTTP response
206
+ # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
207
+ def deserialize(response, return_type)
208
+ body = response.body
209
+
210
+ # handle file downloading - return the File instance processed in request callbacks
211
+ # note that response body is empty when the file is written in chunks in request on_body callback
212
+ return @tempfile if return_type == 'File'
213
+
214
+ return nil if body.nil? || body.empty?
215
+
216
+ # return response body directly for String return type
217
+ return body if return_type == 'String'
218
+
219
+ # ensuring a default content type
220
+ content_type = response.headers['Content-Type'] || 'application/json'
221
+
222
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
223
+
224
+ begin
225
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
226
+ rescue JSON::ParserError => e
227
+ if %w(String Date DateTime).include?(return_type)
228
+ data = body
229
+ else
230
+ raise e
231
+ end
232
+ end
233
+
234
+ convert_to_type data, return_type
235
+ end
236
+
237
+ # Convert data to the given return type.
238
+ # @param [Object] data Data to be converted
239
+ # @param [String] return_type Return type
240
+ # @return [Mixed] Data in a particular type
241
+ def convert_to_type(data, return_type)
242
+ return nil if data.nil?
243
+ case return_type
244
+ when 'String'
245
+ data.to_s
246
+ when 'Integer'
247
+ data.to_i
248
+ when 'Float'
249
+ data.to_f
250
+ when 'BOOLEAN'
251
+ data == true
252
+ when 'DateTime'
253
+ # parse date time (expecting ISO 8601 format)
254
+ DateTime.parse data
255
+ when 'Date'
256
+ # parse date time (expecting ISO 8601 format)
257
+ Date.parse data
258
+ when 'Object'
259
+ # generic object (usually a Hash), return directly
260
+ data
261
+ when /\AArray<(.+)>\z/
262
+ # e.g. Array<Pet>
263
+ sub_type = $1
264
+ data.map { |item| convert_to_type(item, sub_type) }
265
+ when /\AHash\<String, (.+)\>\z/
266
+ # e.g. Hash<String, Integer>
267
+ sub_type = $1
268
+ {}.tap do |hash|
269
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
270
+ end
271
+ else
272
+ # models, e.g. Pet
273
+ CyberSource.const_get(return_type).new.tap do |model|
274
+ model.build_from_hash data
275
+ end
276
+ end
277
+ end
278
+
279
+ # Save response body into a file in (the defined) temporary folder, using the filename
280
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
281
+ # The response body is written to the file in chunks in order to handle files which
282
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
283
+ # process can use.
284
+ #
285
+ # @see Configuration#temp_folder_path
286
+ def download_file(request)
287
+ tempfile = nil
288
+ encoding = nil
289
+ request.on_headers do |response|
290
+ content_disposition = response.headers['Content-Disposition']
291
+ if content_disposition && content_disposition =~ /filename=/i
292
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
293
+ prefix = sanitize_filename(filename)
294
+ else
295
+ prefix = 'download-'
296
+ end
297
+ prefix = prefix + '-' unless prefix.end_with?('-')
298
+ encoding = response.body.encoding
299
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
300
+ @tempfile = tempfile
301
+ end
302
+ request.on_body do |chunk|
303
+ chunk.force_encoding(encoding)
304
+ tempfile.write(chunk)
305
+ end
306
+ request.on_complete do |response|
307
+ tempfile.close
308
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
309
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
310
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
311
+ "explicitly with `tempfile.delete`"
312
+ end
313
+ end
314
+
315
+ # Sanitize filename by removing path.
316
+ # e.g. ../../sun.gif becomes sun.gif
317
+ #
318
+ # @param [String] filename the filename to be sanitized
319
+ # @return [String] the sanitized filename
320
+ def sanitize_filename(filename)
321
+ filename.gsub(/.*[\/\\]/, '')
322
+ end
323
+
324
+ def build_request_url(path)
325
+ # Add leading and trailing slashes to path
326
+ path = "/#{path}".gsub(/\/+/, '/')
327
+ URI.encode(@config.base_url + path)
328
+ end
329
+
330
+ # Builds the HTTP request body
331
+ #
332
+ # @param [Hash] header_params Header parameters
333
+ # @param [Hash] form_params Query parameters
334
+ # @param [Object] body HTTP body (JSON/XML)
335
+ # @return [String] HTTP body data in the form of string
336
+ def build_request_body(header_params, form_params, body)
337
+ # http form
338
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
339
+ header_params['Content-Type'] == 'multipart/form-data'
340
+ data = {}
341
+ form_params.each do |key, value|
342
+ case value
343
+ when ::File, ::Array, nil
344
+ # let typhoeus handle File, Array and nil parameters
345
+ data[key] = value
346
+ else
347
+ data[key] = value.to_s
348
+ end
349
+ end
350
+ elsif body
351
+ data = body.is_a?(String) ? body : body.to_json
352
+ else
353
+ data = nil
354
+ end
355
+ data
356
+ end
357
+
358
+ # Update hearder and query params based on authentication settings.
359
+ #
360
+ # @param [Hash] header_params Header parameters
361
+ # @param [Hash] query_params Query parameters
362
+ # @param [String] auth_names Authentication scheme name
363
+ def update_params_for_auth!(header_params, query_params, auth_names)
364
+ Array(auth_names).each do |auth_name|
365
+ auth_setting = @config.auth_settings[auth_name]
366
+ next unless auth_setting
367
+ case auth_setting[:in]
368
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
369
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
370
+ else fail ArgumentError, 'Authentication token must be in `query` of `header`'
371
+ end
372
+ end
373
+ end
374
+
375
+ # Sets user agent in HTTP header
376
+ #
377
+ # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
378
+ def user_agent=(user_agent)
379
+ @user_agent = user_agent
380
+ @default_headers['User-Agent'] = @user_agent
381
+ end
382
+
383
+ # Return Accept header based on an array of accepts provided.
384
+ # @param [Array] accepts array for Accept
385
+ # @return [String] the Accept header (e.g. application/json)
386
+ def select_header_accept(accepts)
387
+ return nil if accepts.nil? || accepts.empty?
388
+ # use JSON when present, otherwise use all of the provided
389
+ json_accept = accepts.find { |s| json_mime?(s) }
390
+ json_accept || accepts.join(',')
391
+ end
392
+
393
+ # Return Content-Type header based on an array of content types provided.
394
+ # @param [Array] content_types array for Content-Type
395
+ # @return [String] the Content-Type header (e.g. application/json)
396
+ def select_header_content_type(content_types)
397
+ # use application/json by default
398
+ return 'application/json' if content_types.nil? || content_types.empty?
399
+ # use JSON when present, otherwise use the first one
400
+ json_content_type = content_types.find { |s| json_mime?(s) }
401
+ json_content_type || content_types.first
402
+ end
403
+
404
+ # Convert object (array, hash, object, etc) to JSON string.
405
+ # @param [Object] model object to be converted into JSON string
406
+ # @return [String] JSON string representation of the object
407
+ def object_to_http_body(model)
408
+ return model if model.nil? || model.is_a?(String)
409
+ local_body = nil
410
+ if model.is_a?(Array)
411
+ local_body = model.map { |m| object_to_hash(m) }
412
+ else
413
+ local_body = object_to_hash(model)
414
+ end
415
+ local_body.to_json
416
+ end
417
+
418
+ # Convert object(non-array) to hash.
419
+ # @param [Object] obj object to be converted into JSON string
420
+ # @return [String] JSON string representation of the object
421
+ def object_to_hash(obj)
422
+ if obj.respond_to?(:to_hash)
423
+ obj.to_hash
424
+ else
425
+ obj
426
+ end
427
+ end
428
+
429
+ # Build parameter value according to the given collection format.
430
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
431
+ def build_collection_param(param, collection_format)
432
+ case collection_format
433
+ when :csv
434
+ param.join(',')
435
+ when :ssv
436
+ param.join(' ')
437
+ when :tsv
438
+ param.join("\t")
439
+ when :pipes
440
+ param.join('|')
441
+ when :multi
442
+ # return the array directly as typhoeus will handle it as expected
443
+ param
444
+ else
445
+ fail "unknown collection format: #{collection_format.inspect}"
446
+ end
447
+ end
448
+ end
449
+ end