cybersource_rest_client 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/download_dtd_api.rb +88 -0
  3. data/lib/cybersource_rest_client/api/download_xsd_api.rb +88 -0
  4. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +2 -2
  5. data/lib/cybersource_rest_client/api/payer_authentication_api.rb +154 -0
  6. data/lib/cybersource_rest_client/api/reversal_api.rb +0 -65
  7. data/lib/cybersource_rest_client/api/search_transactions_api.rb +2 -2
  8. data/lib/cybersource_rest_client/api/transaction_batches_api.rb +2 -76
  9. data/lib/cybersource_rest_client/api/user_management_api.rb +2 -2
  10. data/lib/cybersource_rest_client/api/void_api.rb +0 -65
  11. data/lib/cybersource_rest_client/models/{mit_void_request.rb → authorization_options.rb} +8 -8
  12. data/lib/cybersource_rest_client/models/bill_to.rb +467 -0
  13. data/lib/cybersource_rest_client/models/buyer_information.rb +278 -0
  14. data/lib/cybersource_rest_client/models/card_info.rb +224 -0
  15. data/lib/cybersource_rest_client/models/check_payer_auth_enrollment_request.rb +275 -0
  16. data/lib/cybersource_rest_client/models/der_public_key.rb +205 -0
  17. data/lib/cybersource_rest_client/models/detail.rb +194 -0
  18. data/lib/cybersource_rest_client/models/embedded_instrument_identifier.rb +319 -0
  19. data/lib/cybersource_rest_client/models/error.rb +202 -0
  20. data/lib/cybersource_rest_client/models/error_bean.rb +247 -0
  21. data/lib/cybersource_rest_client/models/error_field_bean.rb +205 -0
  22. data/lib/cybersource_rest_client/models/{inline_response_200.rb → error_links.rb} +24 -22
  23. data/lib/cybersource_rest_client/models/error_response.rb +174 -0
  24. data/lib/cybersource_rest_client/models/error_response_with_hal.rb +174 -0
  25. data/lib/cybersource_rest_client/models/existing_instrument_identifier_id.rb +175 -0
  26. data/lib/cybersource_rest_client/models/file_bean.rb +202 -0
  27. data/lib/cybersource_rest_client/models/file_detail.rb +278 -0
  28. data/lib/cybersource_rest_client/models/file_details_response.rb +194 -0
  29. data/lib/cybersource_rest_client/models/initiator.rb +183 -0
  30. data/lib/cybersource_rest_client/models/instrument_identifier.rb +295 -0
  31. data/lib/cybersource_rest_client/models/instrument_identifier_bank_account.rb +242 -0
  32. data/lib/cybersource_rest_client/models/instrument_identifier_card.rb +208 -0
  33. data/lib/cybersource_rest_client/models/instrument_identifier_enrollable_card.rb +202 -0
  34. data/lib/cybersource_rest_client/models/instrument_identifier_processing_information.rb +183 -0
  35. data/lib/cybersource_rest_client/models/instrument_identifier_update.rb +183 -0
  36. data/lib/cybersource_rest_client/models/json_web_key.rb +225 -0
  37. data/lib/cybersource_rest_client/models/key_parameters.rb +189 -0
  38. data/lib/cybersource_rest_client/models/key_result.rb +202 -0
  39. data/lib/cybersource_rest_client/models/link.rb +183 -0
  40. data/lib/cybersource_rest_client/models/links.rb +201 -0
  41. data/lib/cybersource_rest_client/models/merchant_information.rb +183 -0
  42. data/lib/cybersource_rest_client/models/merchant_initiated_transaction.rb +199 -0
  43. data/lib/cybersource_rest_client/models/metadata.rb +184 -0
  44. data/lib/cybersource_rest_client/models/model_409_link.rb +183 -0
  45. data/lib/cybersource_rest_client/models/model_409_links.rb +183 -0
  46. data/lib/cybersource_rest_client/models/payment_instrument.rb +331 -0
  47. data/lib/cybersource_rest_client/models/payment_instrument_bank_account.rb +218 -0
  48. data/lib/cybersource_rest_client/models/payment_instrument_card.rb +403 -0
  49. data/lib/cybersource_rest_client/models/payment_instrument_for_instrument_identifier_links.rb +219 -0
  50. data/lib/cybersource_rest_client/models/payment_instruments_array.rb +175 -0
  51. data/lib/cybersource_rest_client/models/payment_instruments_for_instrument_identifier.rb +276 -0
  52. data/lib/cybersource_rest_client/models/personal_identification.rb +237 -0
  53. data/lib/cybersource_rest_client/models/personal_identification_array.rb +174 -0
  54. data/lib/cybersource_rest_client/models/pi_for_ii_link_first.rb +184 -0
  55. data/lib/cybersource_rest_client/models/pi_for_ii_link_last.rb +184 -0
  56. data/lib/cybersource_rest_client/models/pi_for_ii_link_next.rb +184 -0
  57. data/lib/cybersource_rest_client/models/pi_for_ii_link_prev.rb +184 -0
  58. data/lib/cybersource_rest_client/models/pi_for_ii_link_self.rb +184 -0
  59. data/lib/cybersource_rest_client/models/processing_information.rb +195 -0
  60. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_credit_amount_details.rb +1 -1
  61. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_processing_information_bank_transfer_options.rb +1 -1
  62. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_order_information_amount_details.rb +1 -1
  63. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_client_reference_information.rb +2 -2
  64. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_error_information.rb +3 -3
  65. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +15 -15
  66. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_issuer_information.rb +2 -2
  67. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_amount_details.rb +1 -1
  68. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_invoice_details.rb +1 -1
  69. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_account_features.rb +13 -13
  70. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_bank_account.rb +1 -1
  71. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_card.rb +1 -1
  72. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +7 -7
  73. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information.rb +1 -1
  74. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information_emv.rb +1 -1
  75. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processing_information_bank_transfer_options.rb +2 -2
  76. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +9 -9
  77. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_ach_verification.rb +2 -2
  78. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_card_verification.rb +2 -2
  79. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_consumer_authentication_response.rb +2 -2
  80. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_customer.rb +1 -1
  81. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_electronic_verification_results.rb +5 -5
  82. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_merchant_advice.rb +2 -2
  83. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_routing.rb +3 -3
  84. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +1 -1
  85. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_refund_amount_details.rb +1 -1
  86. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post400_response.rb +2 -2
  87. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +4 -4
  88. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_reversal_amount_details.rb +3 -3
  89. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post400_response.rb +2 -2
  90. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response_void_amount_details.rb +1 -1
  91. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response.rb +0 -6
  92. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb +3 -3
  93. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_order_information_amount_details.rb +2 -2
  94. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information.rb +1 -1
  95. data/lib/cybersource_rest_client/models/pts_v2_payouts_post400_response.rb +0 -24
  96. data/lib/cybersource_rest_client/models/ptsv2credits_point_of_sale_information.rb +1 -1
  97. data/lib/cybersource_rest_client/models/ptsv2credits_point_of_sale_information_emv.rb +2 -2
  98. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +4 -4
  99. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information_bank_transfer_options.rb +3 -3
  100. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information.rb +1 -1
  101. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +2 -2
  102. data/lib/cybersource_rest_client/models/ptsv2payments_buyer_information.rb +4 -4
  103. data/lib/cybersource_rest_client/models/ptsv2payments_buyer_information_personal_identification.rb +3 -3
  104. data/lib/cybersource_rest_client/models/ptsv2payments_client_reference_information.rb +2 -2
  105. data/lib/cybersource_rest_client/models/ptsv2payments_client_reference_information_partner.rb +2 -2
  106. data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +1 -1
  107. data/lib/cybersource_rest_client/models/ptsv2payments_device_information.rb +3 -3
  108. data/lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb +10 -10
  109. data/lib/cybersource_rest_client/models/ptsv2payments_issuer_information.rb +1 -1
  110. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_defined_information.rb +2 -2
  111. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information.rb +7 -7
  112. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +8 -8
  113. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_initiated_transaction.rb +1 -1
  114. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +7 -7
  115. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_amex_additional_amounts.rb +1 -1
  116. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_tax_details.rb +9 -9
  117. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +62 -12
  118. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to_company.rb +3 -3
  119. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_invoice_details.rb +8 -8
  120. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +6 -6
  121. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_shipping_details.rb +2 -17
  122. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +8 -8
  123. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_customer.rb +1 -1
  124. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_fluid_data.rb +3 -3
  125. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +7 -7
  126. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +9 -9
  127. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information_emv.rb +3 -3
  128. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +4 -4
  129. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +8 -8
  130. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options_initiator.rb +2 -2
  131. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_bank_transfer_options.rb +6 -6
  132. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_capture_options.rb +2 -2
  133. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_recurring_options.rb +2 -2
  134. data/lib/cybersource_rest_client/models/ptsv2payments_recipient_information.rb +3 -3
  135. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information.rb +1 -1
  136. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +2 -2
  137. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_buyer_information.rb +1 -1
  138. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_installment_information.rb +18 -18
  139. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_merchant_information.rb +4 -4
  140. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +6 -6
  141. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_bill_to.rb +10 -10
  142. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_invoice_details.rb +6 -6
  143. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information.rb +1 -1
  144. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information_emv.rb +1 -1
  145. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +4 -4
  146. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information_authorization_options.rb +3 -3
  147. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information_capture_options.rb +2 -2
  148. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_merchant_information.rb +4 -4
  149. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_line_items.rb +6 -6
  150. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +4 -4
  151. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information.rb +4 -4
  152. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information_recurring_options.rb +1 -1
  153. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_client_reference_information.rb +1 -1
  154. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_client_reference_information_partner.rb +2 -2
  155. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_order_information_line_items.rb +2 -2
  156. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_processing_information.rb +4 -4
  157. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_reversal_information.rb +1 -1
  158. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_reversal_information_amount_details.rb +2 -2
  159. data/lib/cybersource_rest_client/models/ptsv2payouts_client_reference_information.rb +1 -1
  160. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information.rb +2 -26
  161. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +6 -6
  162. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_amount_details.rb +2 -2
  163. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_bill_to.rb +10 -10
  164. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +5 -5
  165. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +1 -1
  166. data/lib/cybersource_rest_client/models/{mit_reversal_request.rb → request.rb} +19 -28
  167. data/lib/cybersource_rest_client/models/response_status.rb +225 -0
  168. data/lib/cybersource_rest_client/models/response_status_details.rb +194 -0
  169. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response.rb +285 -0
  170. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response_consumer_authentication_information.rb +324 -0
  171. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response.rb +294 -0
  172. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_consumer_authentication_information.rb +429 -0
  173. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information.rb +183 -0
  174. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information_amount_details.rb +199 -0
  175. data/lib/cybersource_rest_client/models/risk_v1_authentications_post400_response.rb +225 -0
  176. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response.rb +10 -1
  177. data/lib/cybersource_rest_client/models/{risk_v1_decisions_post201_response_risk_information_payment_information.rb → risk_v1_decisions_post201_response_payment_information.rb} +6 -6
  178. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information.rb +15 -15
  179. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_info_codes.rb +8 -8
  180. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_ip_address.rb +34 -34
  181. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_profile.rb +1 -1
  182. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_providers_provider_name.rb +1 -1
  183. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_score.rb +2 -2
  184. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_travel.rb +210 -0
  185. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_travel_actual_final_destination.rb +274 -0
  186. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_travel_first_departure.rb +274 -0
  187. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_travel_first_destination.rb +274 -0
  188. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_travel_last_destination.rb +274 -0
  189. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_velocity.rb +1 -0
  190. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_velocity_morphing.rb +3 -3
  191. data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +214 -0
  192. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information.rb +194 -0
  193. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information_line_items.rb +267 -0
  194. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information.rb +192 -0
  195. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +264 -0
  196. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +264 -0
  197. data/lib/cybersource_rest_client/models/riskv1authentications_buyer_information.rb +196 -0
  198. data/lib/cybersource_rest_client/models/riskv1authentications_client_reference_information.rb +208 -0
  199. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information.rb +552 -0
  200. data/lib/cybersource_rest_client/models/riskv1authentications_device_information.rb +285 -0
  201. data/lib/cybersource_rest_client/models/riskv1authentications_device_information_raw_data.rb +209 -0
  202. data/lib/cybersource_rest_client/models/{inline_response_200_payment_batch_summaries.rb → riskv1authentications_merchant_information.rb} +18 -101
  203. data/lib/cybersource_rest_client/models/riskv1authentications_order_information.rb +258 -0
  204. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_bill_to.rb +496 -0
  205. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_line_items.rb +371 -0
  206. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_ship_to.rb +434 -0
  207. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information.rb +192 -0
  208. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_card.rb +291 -0
  209. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +291 -0
  210. data/lib/cybersource_rest_client/models/riskv1authentications_recurring_payment_information.rb +235 -0
  211. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information.rb +183 -0
  212. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history.rb +262 -0
  213. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_account_history.rb +209 -0
  214. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_customer_account.rb +279 -0
  215. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information.rb +206 -0
  216. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_legs.rb +259 -0
  217. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_passengers.rb +224 -0
  218. data/lib/cybersource_rest_client/models/riskv1decisions_buyer_information.rb +28 -3
  219. data/lib/cybersource_rest_client/models/riskv1decisions_card_verification.rb +1 -1
  220. data/lib/cybersource_rest_client/models/riskv1decisions_client_reference_information.rb +1 -1
  221. data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +5 -5
  222. data/lib/cybersource_rest_client/models/riskv1decisions_merchant_defined_information.rb +1 -1
  223. data/lib/cybersource_rest_client/models/riskv1decisions_order_information.rb +2 -17
  224. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_amount_details.rb +2 -2
  225. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_bill_to.rb +10 -10
  226. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_line_items.rb +5 -22
  227. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_passenger.rb +30 -5
  228. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_shipping_details.rb +2 -17
  229. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +4 -4
  230. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +3 -3
  231. data/lib/cybersource_rest_client/models/riskv1decisions_risk_information.rb +29 -4
  232. data/lib/cybersource_rest_client/models/riskv1decisions_risk_information_profile.rb +1 -1
  233. data/lib/cybersource_rest_client/models/riskv1decisions_travel_information.rb +26 -1
  234. data/lib/cybersource_rest_client/models/riskv1decisions_travel_information_legs.rb +31 -6
  235. data/lib/cybersource_rest_client/models/self_link_bean.rb +192 -0
  236. data/lib/cybersource_rest_client/models/tokenize_parameters.rb +198 -0
  237. data/lib/cybersource_rest_client/models/tokenize_request.rb +1 -1
  238. data/lib/cybersource_rest_client/models/tokenize_result.rb +255 -0
  239. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_application_information_applications.rb +6 -6
  240. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_buyer_information.rb +2 -2
  241. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_client_reference_information.rb +1 -1
  242. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_device_information.rb +3 -3
  243. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_merchant_information_merchant_descriptor.rb +1 -1
  244. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_amount_details.rb +2 -2
  245. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_bill_to.rb +9 -9
  246. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_line_items.rb +1 -1
  247. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_shipping_details.rb +2 -17
  248. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_account_features.rb +1 -1
  249. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +5 -5
  250. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_point_of_sale_information.rb +2 -2
  251. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +1 -1
  252. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_authorization_options.rb +1 -1
  253. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +3 -3
  254. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information_electronic_verification_results.rb +4 -4
  255. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_buyer_information.rb +1 -1
  256. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_client_reference_information.rb +1 -1
  257. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_device_information.rb +1 -1
  258. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_order_information_bill_to.rb +5 -5
  259. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +2 -2
  260. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_point_of_sale_information.rb +2 -2
  261. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +1 -1
  262. data/lib/cybersource_rest_client.rb +96 -8
  263. metadata +100 -8
  264. data/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb +0 -135
@@ -0,0 +1,434 @@
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
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
+
15
+ module CyberSource
16
+ class Riskv1authenticationsOrderInformationShipTo
17
+ # First line of the shipping address.
18
+ attr_accessor :address1
19
+
20
+ # Second line of the shipping address.
21
+ attr_accessor :address2
22
+
23
+ # State or province of the shipping address. Use the State, Province, and Territory Codes for the United States and Canada.
24
+ attr_accessor :administrative_area
25
+
26
+ # Country of the shipping address. Use the two-character ISO Standard Country Codes.
27
+ attr_accessor :country
28
+
29
+ # City of the shipping address.
30
+ attr_accessor :locality
31
+
32
+ # First name of the recipient. **Processor specific maximum length** - Litle: 25 - All other processors: 60
33
+ attr_accessor :first_name
34
+
35
+ # Last name of the recipient. **Processor-specific maximum length** - Litle: 25 - All other processors: 60
36
+ attr_accessor :last_name
37
+
38
+ # Phone number associated with the shipping address.
39
+ attr_accessor :phone_number
40
+
41
+ # Postal code for the shipping address. The postal code must consist of 5 to 9 digits. When the billing country is the U.S., the 9-digit postal code must follow this format: [5 digits][dash][4 digits] Example 12345-6789 When the billing country is Canada, the 6-digit postal code must follow this format: [alpha][numeric][alpha][space][numeric][alpha][numeric] Example A1B 2C3 **American Express Direct**\\ Before sending the postal code to the processor, CyberSource removes all nonalphanumeric characters and, if the remaining value is longer than nine characters, truncates the value starting from the right side.
42
+ attr_accessor :postal_code
43
+
44
+ # Indicates destination chosen for the transaction. Possible values: - 01- Ship to cardholder billing address - 02- Ship to another verified address on file with merchant - 03- Ship to address that is different than billing address - 04- Ship to store (store address should be populated on request) - 05- Digital goods - 06- Travel and event tickets, not shipped - 07- Other
45
+ attr_accessor :destination_code
46
+
47
+ # Shipping method for the product. Possible values: - lowcost: Lowest-cost service - sameday: Courier or same-day service - oneday: Next-day or overnight service - twoday: Two-day service - threeday: Three-day service - pickup: Store pick-up - other: Other shipping method - none: No shipping method because product is a service or subscription Required for American Express SafeKey (U.S.).
48
+ attr_accessor :method
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'address1' => :'address1',
54
+ :'address2' => :'address2',
55
+ :'administrative_area' => :'administrativeArea',
56
+ :'country' => :'country',
57
+ :'locality' => :'locality',
58
+ :'first_name' => :'firstName',
59
+ :'last_name' => :'lastName',
60
+ :'phone_number' => :'phoneNumber',
61
+ :'postal_code' => :'postalCode',
62
+ :'destination_code' => :'destinationCode',
63
+ :'method' => :'method'
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.swagger_types
69
+ {
70
+ :'address1' => :'String',
71
+ :'address2' => :'String',
72
+ :'administrative_area' => :'String',
73
+ :'country' => :'String',
74
+ :'locality' => :'String',
75
+ :'first_name' => :'String',
76
+ :'last_name' => :'String',
77
+ :'phone_number' => :'String',
78
+ :'postal_code' => :'String',
79
+ :'destination_code' => :'Integer',
80
+ :'method' => :'String'
81
+ }
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ return unless attributes.is_a?(Hash)
88
+
89
+ # convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
91
+
92
+ if attributes.has_key?(:'address1')
93
+ self.address1 = attributes[:'address1']
94
+ end
95
+
96
+ if attributes.has_key?(:'address2')
97
+ self.address2 = attributes[:'address2']
98
+ end
99
+
100
+ if attributes.has_key?(:'administrativeArea')
101
+ self.administrative_area = attributes[:'administrativeArea']
102
+ end
103
+
104
+ if attributes.has_key?(:'country')
105
+ self.country = attributes[:'country']
106
+ end
107
+
108
+ if attributes.has_key?(:'locality')
109
+ self.locality = attributes[:'locality']
110
+ end
111
+
112
+ if attributes.has_key?(:'firstName')
113
+ self.first_name = attributes[:'firstName']
114
+ end
115
+
116
+ if attributes.has_key?(:'lastName')
117
+ self.last_name = attributes[:'lastName']
118
+ end
119
+
120
+ if attributes.has_key?(:'phoneNumber')
121
+ self.phone_number = attributes[:'phoneNumber']
122
+ end
123
+
124
+ if attributes.has_key?(:'postalCode')
125
+ self.postal_code = attributes[:'postalCode']
126
+ end
127
+
128
+ if attributes.has_key?(:'destinationCode')
129
+ self.destination_code = attributes[:'destinationCode']
130
+ end
131
+
132
+ if attributes.has_key?(:'method')
133
+ self.method = attributes[:'method']
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ if !@address1.nil? && @address1.to_s.length > 60
142
+ invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 60.')
143
+ end
144
+
145
+ if !@address2.nil? && @address2.to_s.length > 60
146
+ invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 60.')
147
+ end
148
+
149
+ if !@administrative_area.nil? && @administrative_area.to_s.length > 2
150
+ invalid_properties.push('invalid value for "administrative_area", the character length must be smaller than or equal to 2.')
151
+ end
152
+
153
+ if !@country.nil? && @country.to_s.length > 2
154
+ invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 2.')
155
+ end
156
+
157
+ if !@locality.nil? && @locality.to_s.length > 50
158
+ invalid_properties.push('invalid value for "locality", the character length must be smaller than or equal to 50.')
159
+ end
160
+
161
+ if !@first_name.nil? && @first_name.to_s.length > 60
162
+ invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 60.')
163
+ end
164
+
165
+ if !@last_name.nil? && @last_name.to_s.length > 60
166
+ invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 60.')
167
+ end
168
+
169
+ if !@phone_number.nil? && @phone_number.to_s.length > 15
170
+ invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 15.')
171
+ end
172
+
173
+ if !@postal_code.nil? && @postal_code.to_s.length > 10
174
+ invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 10.')
175
+ end
176
+
177
+ if !@method.nil? && @method.to_s.length > 10
178
+ invalid_properties.push('invalid value for "method", the character length must be smaller than or equal to 10.')
179
+ end
180
+
181
+ invalid_properties
182
+ end
183
+
184
+ # Check to see if the all the properties in the model are valid
185
+ # @return true if the model is valid
186
+ def valid?
187
+ return false if !@address1.nil? && @address1.to_s.length > 60
188
+ return false if !@address2.nil? && @address2.to_s.length > 60
189
+ return false if !@administrative_area.nil? && @administrative_area.to_s.length > 2
190
+ return false if !@country.nil? && @country.to_s.length > 2
191
+ return false if !@locality.nil? && @locality.to_s.length > 50
192
+ return false if !@first_name.nil? && @first_name.to_s.length > 60
193
+ return false if !@last_name.nil? && @last_name.to_s.length > 60
194
+ return false if !@phone_number.nil? && @phone_number.to_s.length > 15
195
+ return false if !@postal_code.nil? && @postal_code.to_s.length > 10
196
+ return false if !@method.nil? && @method.to_s.length > 10
197
+ true
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] address1 Value to be assigned
202
+ def address1=(address1)
203
+ if !address1.nil? && address1.to_s.length > 60
204
+ fail ArgumentError, 'invalid value for "address1", the character length must be smaller than or equal to 60.'
205
+ end
206
+
207
+ @address1 = address1
208
+ end
209
+
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] address2 Value to be assigned
212
+ def address2=(address2)
213
+ if !address2.nil? && address2.to_s.length > 60
214
+ fail ArgumentError, 'invalid value for "address2", the character length must be smaller than or equal to 60.'
215
+ end
216
+
217
+ @address2 = address2
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] administrative_area Value to be assigned
222
+ def administrative_area=(administrative_area)
223
+ if !administrative_area.nil? && administrative_area.to_s.length > 2
224
+ fail ArgumentError, 'invalid value for "administrative_area", the character length must be smaller than or equal to 2.'
225
+ end
226
+
227
+ @administrative_area = administrative_area
228
+ end
229
+
230
+ # Custom attribute writer method with validation
231
+ # @param [Object] country Value to be assigned
232
+ def country=(country)
233
+ if !country.nil? && country.to_s.length > 2
234
+ fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 2.'
235
+ end
236
+
237
+ @country = country
238
+ end
239
+
240
+ # Custom attribute writer method with validation
241
+ # @param [Object] locality Value to be assigned
242
+ def locality=(locality)
243
+ if !locality.nil? && locality.to_s.length > 50
244
+ fail ArgumentError, 'invalid value for "locality", the character length must be smaller than or equal to 50.'
245
+ end
246
+
247
+ @locality = locality
248
+ end
249
+
250
+ # Custom attribute writer method with validation
251
+ # @param [Object] first_name Value to be assigned
252
+ def first_name=(first_name)
253
+ if !first_name.nil? && first_name.to_s.length > 60
254
+ fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 60.'
255
+ end
256
+
257
+ @first_name = first_name
258
+ end
259
+
260
+ # Custom attribute writer method with validation
261
+ # @param [Object] last_name Value to be assigned
262
+ def last_name=(last_name)
263
+ if !last_name.nil? && last_name.to_s.length > 60
264
+ fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 60.'
265
+ end
266
+
267
+ @last_name = last_name
268
+ end
269
+
270
+ # Custom attribute writer method with validation
271
+ # @param [Object] phone_number Value to be assigned
272
+ def phone_number=(phone_number)
273
+ if !phone_number.nil? && phone_number.to_s.length > 15
274
+ fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 15.'
275
+ end
276
+
277
+ @phone_number = phone_number
278
+ end
279
+
280
+ # Custom attribute writer method with validation
281
+ # @param [Object] postal_code Value to be assigned
282
+ def postal_code=(postal_code)
283
+ if !postal_code.nil? && postal_code.to_s.length > 10
284
+ fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 10.'
285
+ end
286
+
287
+ @postal_code = postal_code
288
+ end
289
+
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] method Value to be assigned
292
+ def method=(method)
293
+ if !method.nil? && method.to_s.length > 10
294
+ fail ArgumentError, 'invalid value for "method", the character length must be smaller than or equal to 10.'
295
+ end
296
+
297
+ @method = method
298
+ end
299
+
300
+ # Checks equality by comparing each attribute.
301
+ # @param [Object] Object to be compared
302
+ def ==(o)
303
+ return true if self.equal?(o)
304
+ self.class == o.class &&
305
+ address1 == o.address1 &&
306
+ address2 == o.address2 &&
307
+ administrative_area == o.administrative_area &&
308
+ country == o.country &&
309
+ locality == o.locality &&
310
+ first_name == o.first_name &&
311
+ last_name == o.last_name &&
312
+ phone_number == o.phone_number &&
313
+ postal_code == o.postal_code &&
314
+ destination_code == o.destination_code &&
315
+ method == o.method
316
+ end
317
+
318
+ # @see the `==` method
319
+ # @param [Object] Object to be compared
320
+ def eql?(o)
321
+ self == o
322
+ end
323
+
324
+ # Calculates hash code according to all attributes.
325
+ # @return [Fixnum] Hash code
326
+ def hash
327
+ [address1, address2, administrative_area, country, locality, first_name, last_name, phone_number, postal_code, destination_code, method].hash
328
+ end
329
+
330
+ # Builds the object from hash
331
+ # @param [Hash] attributes Model attributes in the form of hash
332
+ # @return [Object] Returns the model itself
333
+ def build_from_hash(attributes)
334
+ return nil unless attributes.is_a?(Hash)
335
+ self.class.swagger_types.each_pair do |key, type|
336
+ if type =~ /\AArray<(.*)>/i
337
+ # check to ensure the input is an array given that the the attribute
338
+ # is documented as an array but the input is not
339
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
340
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
341
+ end
342
+ elsif !attributes[self.class.attribute_map[key]].nil?
343
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
344
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
345
+ end
346
+
347
+ self
348
+ end
349
+
350
+ # Deserializes the data based on type
351
+ # @param string type Data type
352
+ # @param string value Value to be deserialized
353
+ # @return [Object] Deserialized data
354
+ def _deserialize(type, value)
355
+ case type.to_sym
356
+ when :DateTime
357
+ DateTime.parse(value)
358
+ when :Date
359
+ Date.parse(value)
360
+ when :String
361
+ value.to_s
362
+ when :Integer
363
+ value.to_i
364
+ when :Float
365
+ value.to_f
366
+ when :BOOLEAN
367
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
368
+ true
369
+ else
370
+ false
371
+ end
372
+ when :Object
373
+ # generic object (usually a Hash), return directly
374
+ value
375
+ when /\AArray<(?<inner_type>.+)>\z/
376
+ inner_type = Regexp.last_match[:inner_type]
377
+ value.map { |v| _deserialize(inner_type, v) }
378
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
379
+ k_type = Regexp.last_match[:k_type]
380
+ v_type = Regexp.last_match[:v_type]
381
+ {}.tap do |hash|
382
+ value.each do |k, v|
383
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
384
+ end
385
+ end
386
+ else # model
387
+ temp_model = CyberSource.const_get(type).new
388
+ temp_model.build_from_hash(value)
389
+ end
390
+ end
391
+
392
+ # Returns the string representation of the object
393
+ # @return [String] String presentation of the object
394
+ def to_s
395
+ to_hash.to_s
396
+ end
397
+
398
+ # to_body is an alias to to_hash (backward compatibility)
399
+ # @return [Hash] Returns the object in the form of hash
400
+ def to_body
401
+ to_hash
402
+ end
403
+
404
+ # Returns the object in the form of hash
405
+ # @return [Hash] Returns the object in the form of hash
406
+ def to_hash
407
+ hash = {}
408
+ self.class.attribute_map.each_pair do |attr, param|
409
+ value = self.send(attr)
410
+ next if value.nil?
411
+ hash[param] = _to_hash(value)
412
+ end
413
+ hash
414
+ end
415
+
416
+ # Outputs non-array value in the form of hash
417
+ # For object, use to_hash. Otherwise, just return the value
418
+ # @param [Object] value Any valid value
419
+ # @return [Hash] Returns the value in the form of hash
420
+ def _to_hash(value)
421
+ if value.is_a?(Array)
422
+ value.compact.map { |v| _to_hash(v) }
423
+ elsif value.is_a?(Hash)
424
+ {}.tap do |hash|
425
+ value.each { |k, v| hash[k] = _to_hash(v) }
426
+ end
427
+ elsif value.respond_to? :to_hash
428
+ value.to_hash
429
+ else
430
+ value
431
+ end
432
+ end
433
+ end
434
+ end
@@ -0,0 +1,192 @@
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
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
+
15
+ module CyberSource
16
+ class Riskv1authenticationsPaymentInformation
17
+ attr_accessor :card
18
+
19
+ attr_accessor :tokenized_card
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'card' => :'card',
25
+ :'tokenized_card' => :'tokenizedCard'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'card' => :'Riskv1authenticationsPaymentInformationCard',
33
+ :'tokenized_card' => :'Riskv1authenticationsPaymentInformationTokenizedCard'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ if attributes.has_key?(:'card')
46
+ self.card = attributes[:'card']
47
+ end
48
+
49
+ if attributes.has_key?(:'tokenizedCard')
50
+ self.tokenized_card = attributes[:'tokenizedCard']
51
+ end
52
+ end
53
+
54
+ # Show invalid properties with the reasons. Usually used together with valid?
55
+ # @return Array for valid properties with the reasons
56
+ def list_invalid_properties
57
+ invalid_properties = Array.new
58
+ invalid_properties
59
+ end
60
+
61
+ # Check to see if the all the properties in the model are valid
62
+ # @return true if the model is valid
63
+ def valid?
64
+ true
65
+ end
66
+
67
+ # Checks equality by comparing each attribute.
68
+ # @param [Object] Object to be compared
69
+ def ==(o)
70
+ return true if self.equal?(o)
71
+ self.class == o.class &&
72
+ card == o.card &&
73
+ tokenized_card == o.tokenized_card
74
+ end
75
+
76
+ # @see the `==` method
77
+ # @param [Object] Object to be compared
78
+ def eql?(o)
79
+ self == o
80
+ end
81
+
82
+ # Calculates hash code according to all attributes.
83
+ # @return [Fixnum] Hash code
84
+ def hash
85
+ [card, tokenized_card].hash
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.swagger_types.each_pair do |key, type|
94
+ if type =~ /\AArray<(.*)>/i
95
+ # check to ensure the input is an array given that the the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ # Deserializes the data based on type
109
+ # @param string type Data type
110
+ # @param string value Value to be deserialized
111
+ # @return [Object] Deserialized data
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ temp_model = CyberSource.const_get(type).new
146
+ temp_model.build_from_hash(value)
147
+ end
148
+ end
149
+
150
+ # Returns the string representation of the object
151
+ # @return [String] String presentation of the object
152
+ def to_s
153
+ to_hash.to_s
154
+ end
155
+
156
+ # to_body is an alias to to_hash (backward compatibility)
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_body
159
+ to_hash
160
+ end
161
+
162
+ # Returns the object in the form of hash
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_hash
165
+ hash = {}
166
+ self.class.attribute_map.each_pair do |attr, param|
167
+ value = self.send(attr)
168
+ next if value.nil?
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ # Outputs non-array value in the form of hash
175
+ # For object, use to_hash. Otherwise, just return the value
176
+ # @param [Object] value Any valid value
177
+ # @return [Hash] Returns the value in the form of hash
178
+ def _to_hash(value)
179
+ if value.is_a?(Array)
180
+ value.compact.map { |v| _to_hash(v) }
181
+ elsif value.is_a?(Hash)
182
+ {}.tap do |hash|
183
+ value.each { |k, v| hash[k] = _to_hash(v) }
184
+ end
185
+ elsif value.respond_to? :to_hash
186
+ value.to_hash
187
+ else
188
+ value
189
+ end
190
+ end
191
+ end
192
+ end