cybersource_rest_client 0.0.83 → 0.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb +46 -27
  3. data/lib/AuthenticationSDK/core/MerchantConfig.rb +82 -48
  4. data/lib/AuthenticationSDK/util/Cache.rb +7 -4
  5. data/lib/AuthenticationSDK/util/Constants.rb +6 -0
  6. data/lib/AuthenticationSDK/util/MLEUtility.rb +9 -0
  7. data/lib/cybersource_rest_client/api/batches_api.rb +1 -1
  8. data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +14 -22
  9. data/lib/cybersource_rest_client/api/credentials_api.rb +104 -0
  10. data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +3 -3
  11. data/lib/cybersource_rest_client/api/enrollment_api.rb +2 -2
  12. data/lib/cybersource_rest_client/api/instructions_api.rb +10 -10
  13. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +3 -3
  14. data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +20 -28
  15. data/lib/cybersource_rest_client/api/network_tokens_api.rb +654 -0
  16. data/lib/cybersource_rest_client/api/plans_api.rb +1 -1
  17. data/lib/cybersource_rest_client/api/subscriptions_api.rb +183 -1
  18. data/lib/cybersource_rest_client/api/subscriptions_follow_ons_api.rb +1 -1
  19. data/lib/cybersource_rest_client/api_client.rb +4 -0
  20. data/lib/cybersource_rest_client/models/account_validations_request.rb +15 -5
  21. data/lib/cybersource_rest_client/models/acpv1instructions_decline_threshold.rb +1 -1
  22. data/lib/cybersource_rest_client/models/acpv1instructions_mandates.rb +1 -1
  23. data/lib/cybersource_rest_client/models/acpv1instructions_recurring_payment_information.rb +1 -1
  24. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information.rb +1 -1
  25. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information_payment_instrument.rb +1 -1
  26. data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_amount_detail.rb +1 -1
  27. data/lib/cybersource_rest_client/models/acpv1mppcredentials_challenge.rb +369 -0
  28. data/lib/cybersource_rest_client/models/acpv1mppcredentials_challenge_encryption_jwk.rb +336 -0
  29. data/lib/cybersource_rest_client/models/acpv1tokens_assurance_data.rb +7 -7
  30. data/lib/cybersource_rest_client/models/acpv1tokens_authenticated_identities.rb +1 -1
  31. data/lib/cybersource_rest_client/models/acpv1tokens_authentication_context.rb +1 -1
  32. data/lib/cybersource_rest_client/models/acpv1tokens_bill_to.rb +1 -1
  33. data/lib/cybersource_rest_client/models/acpv1tokens_buyer_information.rb +1 -1
  34. data/lib/cybersource_rest_client/models/acpv1tokens_consumer_identity.rb +1 -1
  35. data/lib/cybersource_rest_client/models/acpv1tokens_device_information.rb +1 -1
  36. data/lib/cybersource_rest_client/models/acpv1tokens_enrollment_reference_data.rb +1 -1
  37. data/lib/cybersource_rest_client/models/acpv1tokens_payment_information.rb +1 -1
  38. data/lib/cybersource_rest_client/models/auth_reversal_request.rb +11 -1
  39. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information.rb +32 -6
  40. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_bank.rb +1 -1
  41. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_bank_account.rb +1 -1
  42. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_customer.rb +196 -0
  43. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_instrument_identifier.rb +196 -0
  44. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_payment_instrument.rb +196 -0
  45. data/lib/cybersource_rest_client/models/bavsv1accountvalidations_token_information.rb +208 -0
  46. data/lib/cybersource_rest_client/models/card_processing_config_common_processors.rb +105 -1
  47. data/lib/cybersource_rest_client/models/commerce_solutions_products.rb +15 -5
  48. data/lib/cybersource_rest_client/models/create_credit_request.rb +15 -5
  49. data/lib/cybersource_rest_client/models/get_all_subscriptions_response_order_information_amount_details_surcharge.rb +22 -5
  50. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response.rb +247 -0
  51. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_1.rb +224 -0
  52. data/lib/cybersource_rest_client/models/{pbl_payment_links_post201_response__links.rb → get_subscriptions_payments_response_1__links.rb} +1 -1
  53. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response__links.rb +209 -0
  54. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_cycles_completed_count.rb +191 -0
  55. data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_subscription_payment.rb +356 -0
  56. data/lib/cybersource_rest_client/models/inline_response_201_1_tokenized_card.rb +26 -5
  57. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_commerce_solutions.rb +15 -5
  58. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_payments.rb +25 -5
  59. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_risk.rb +15 -5
  60. data/lib/cybersource_rest_client/models/inline_response_201_4_setups_value_added_services.rb +25 -5
  61. data/lib/cybersource_rest_client/models/inline_response_400_10.rb +30 -75
  62. data/lib/cybersource_rest_client/models/{inline_response_400_8_details.rb → inline_response_400_10_details.rb} +1 -1
  63. data/lib/cybersource_rest_client/models/inline_response_400_11.rb +235 -0
  64. data/lib/cybersource_rest_client/models/{inline_response_400_7_details.rb → inline_response_400_11_details.rb} +3 -3
  65. data/lib/cybersource_rest_client/models/inline_response_400_12.rb +281 -0
  66. data/lib/cybersource_rest_client/models/inline_response_400_6.rb +37 -60
  67. data/lib/cybersource_rest_client/models/inline_response_400_7.rb +6 -6
  68. data/lib/cybersource_rest_client/models/inline_response_400_8.rb +58 -36
  69. data/lib/cybersource_rest_client/models/{inline_response_400_6_fields.rb → inline_response_400_8_fields.rb} +1 -1
  70. data/lib/cybersource_rest_client/models/inline_response_400_9.rb +16 -16
  71. data/lib/cybersource_rest_client/models/inline_response_400_9_details.rb +2 -2
  72. data/lib/cybersource_rest_client/models/inline_response_404_3.rb +1 -1
  73. data/lib/cybersource_rest_client/models/inline_response_422_1.rb +1 -1
  74. data/lib/cybersource_rest_client/models/iplv2paymentlinks_order_information_line_items.rb +73 -5
  75. data/lib/cybersource_rest_client/models/mit_reversal_request.rb +11 -1
  76. data/lib/cybersource_rest_client/models/mpp_credentials_request.rb +221 -0
  77. data/lib/cybersource_rest_client/models/mpp_credentials_response200.rb +338 -0
  78. data/lib/cybersource_rest_client/models/patch_customer_payment_instrument_request.rb +1 -1
  79. data/lib/cybersource_rest_client/models/patch_customer_request.rb +1 -1
  80. data/lib/cybersource_rest_client/models/patch_payment_instrument_request.rb +1 -1
  81. data/lib/cybersource_rest_client/models/payment_instrument_list_1__embedded.rb +1 -1
  82. data/lib/cybersource_rest_client/models/payment_instrument_list__embedded.rb +1 -1
  83. data/lib/cybersource_rest_client/models/{payment_instrument_list_1__embedded__embedded.rb → payment_instrument_list__embedded__embedded.rb} +1 -1
  84. data/lib/cybersource_rest_client/models/{payment_instrument_list_1__embedded_payment_instruments.rb → payment_instrument_list__embedded_payment_instruments.rb} +2 -2
  85. data/lib/cybersource_rest_client/models/payments_products.rb +25 -5
  86. data/lib/cybersource_rest_client/models/payments_products_currency_conversion_configuration_information_configurations_processors.rb +14 -2
  87. data/lib/cybersource_rest_client/models/payments_products_microform.rb +199 -0
  88. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information.rb +199 -0
  89. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations.rb +189 -0
  90. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations_features.rb +189 -0
  91. data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations_features_gateway_agnostic.rb +189 -0
  92. data/lib/cybersource_rest_client/models/payments_products_microform_subscription_information.rb +227 -0
  93. data/lib/cybersource_rest_client/models/pbl_payment_links_get200_response.rb +1 -1
  94. data/lib/cybersource_rest_client/models/pbl_payment_links_post201_response.rb +1 -1
  95. data/lib/cybersource_rest_client/models/post_customer_payment_instrument_request.rb +1 -1
  96. data/lib/cybersource_rest_client/models/post_customer_request.rb +1 -1
  97. data/lib/cybersource_rest_client/models/post_payment_instrument_request.rb +1 -1
  98. data/lib/cybersource_rest_client/models/post_tokenized_card_request.rb +15 -5
  99. data/lib/cybersource_rest_client/models/pts_v2_create_billing_agreement_post201_response_agreement_information.rb +80 -1
  100. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response.rb +41 -1
  101. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_merchant_information.rb +196 -0
  102. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_account_information.rb +189 -0
  103. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_information.rb +15 -5
  104. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_information_account_features.rb +196 -0
  105. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_token_information.rb +189 -0
  106. data/lib/cybersource_rest_client/models/pts_v2_modify_billing_agreement_post201_response_agreement_information.rb +35 -1
  107. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_point_of_sale_information.rb +22 -5
  108. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_processor_information.rb +1 -1
  109. data/lib/cybersource_rest_client/models/pts_v2_payments_order_post201_response_order_information_shipping_details.rb +1 -1
  110. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information.rb +106 -5
  111. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_strong_authentication.rb +22 -5
  112. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information.rb +15 -5
  113. data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_payment_information_tokenized_card.rb → pts_v2_payments_post201_response_payment_account_information_tokenized_card.rb} +1 -1
  114. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +1 -1
  115. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processing_information.rb +18 -1
  116. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +23 -6
  117. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_token_information.rb +15 -5
  118. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_token_information_third_party_token.rb +213 -0
  119. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +1 -1
  120. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_error_information.rb +1 -1
  121. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_order_information_amount_details.rb +18 -1
  122. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +19 -2
  123. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +1 -1
  124. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response_processor_information.rb +7 -1
  125. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information.rb +45 -5
  126. data/lib/cybersource_rest_client/models/{pull_funds201_response_processor_information_avs.rb → pts_v2_payouts_post201_response_processor_information_avs.rb} +1 -1
  127. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information_customer.rb +196 -0
  128. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information_electronic_verification_results.rb +281 -0
  129. data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_buyer_information.rb +196 -0
  130. data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_order_information_amount_details.rb +1 -1
  131. data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_processing_information.rb +18 -5
  132. data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information.rb +19 -6
  133. data/lib/cybersource_rest_client/models/ptsv2billingagreements_agreement_information.rb +84 -5
  134. data/lib/cybersource_rest_client/models/ptsv2billingagreements_order_information.rb +12 -2
  135. data/lib/cybersource_rest_client/models/ptsv2billingagreements_order_information_amount_details.rb +230 -0
  136. data/lib/cybersource_rest_client/models/{ptsv2intents_order_information_invoice_details.rb → ptsv2billingagreements_order_information_invoice_details.rb} +1 -1
  137. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_bank.rb +15 -5
  138. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_bank_account_alias.rb +207 -0
  139. data/lib/cybersource_rest_client/models/ptsv2billingagreements_processing_information.rb +18 -1
  140. data/lib/cybersource_rest_client/models/ptsv2billingagreementsid_agreement_information.rb +56 -5
  141. data/lib/cybersource_rest_client/models/ptsv2billingagreementsid_processing_information.rb +18 -1
  142. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +35 -5
  143. data/lib/cybersource_rest_client/models/ptsv2credits_token_information.rb +228 -0
  144. data/lib/cybersource_rest_client/models/ptsv2intents_order_information.rb +1 -1
  145. data/lib/cybersource_rest_client/models/ptsv2intentsid_order_information.rb +1 -1
  146. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +15 -5
  147. data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +16 -5
  148. data/lib/cybersource_rest_client/models/ptsv2payments_order_information.rb +28 -1
  149. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_digital_currency.rb +231 -0
  150. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_shipping_details.rb +23 -6
  151. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +32 -5
  152. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank.rb +15 -5
  153. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank_account_alias.rb +207 -0
  154. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_third_party_token.rb +196 -0
  155. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +18 -1
  156. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +72 -6
  157. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_program_indicators.rb +202 -0
  158. data/lib/cybersource_rest_client/models/ptsv2payments_processor_information.rb +56 -5
  159. data/lib/cybersource_rest_client/models/ptsv2payments_recipient_information.rb +16 -5
  160. data/lib/cybersource_rest_client/models/ptsv2payments_sender_information.rb +16 -5
  161. data/lib/cybersource_rest_client/models/ptsv2payments_token_information.rb +32 -5
  162. data/lib/cybersource_rest_client/models/ptsv2payments_token_information_token_authentication_information.rb +193 -0
  163. data/lib/cybersource_rest_client/models/ptsv2payments_token_information_token_authentication_information_authenticated_identities.rb +252 -0
  164. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +15 -5
  165. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_shipping_details.rb +100 -5
  166. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information.rb +22 -5
  167. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +18 -1
  168. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processor_information.rb +39 -5
  169. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information.rb +15 -5
  170. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_shipping_details.rb +196 -0
  171. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information.rb +32 -5
  172. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_device_information.rb +196 -0
  173. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_payment_information.rb +22 -5
  174. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +18 -5
  175. data/lib/cybersource_rest_client/models/pull_funds201_response_processor_information.rb +36 -6
  176. data/lib/cybersource_rest_client/models/pull_funds_request.rb +11 -1
  177. data/lib/cybersource_rest_client/models/push_funds201_response_processor_information.rb +45 -5
  178. data/lib/cybersource_rest_client/models/risk_products.rb +15 -5
  179. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_ship_to.rb +39 -5
  180. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_shipping_details.rb +1 -1
  181. data/lib/cybersource_rest_client/models/tms_card_art.rb +23 -1
  182. data/lib/cybersource_rest_client/models/tms_embedded_instrument_identifier_bill_to.rb +22 -5
  183. data/lib/cybersource_rest_client/models/tms_tokenized_card_delete_request.rb +189 -0
  184. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments__embedded.rb +190 -0
  185. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card.rb +22 -1
  186. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_card.rb +1 -1
  187. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata.rb +16 -5
  188. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer.rb +41 -8
  189. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer_bank_applications.rb +201 -0
  190. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer_capabilities.rb +257 -0
  191. data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_verification_results.rb +202 -0
  192. data/lib/cybersource_rest_client/models/tmsv2customers__embedded.rb +200 -0
  193. data/lib/cybersource_rest_client/models/{tmsv3tokenstoken_idpaymentcredentials_order_information_bill_to.rb → tmsv2tokenizedcards_bill_to.rb} +1 -1
  194. data/lib/cybersource_rest_client/models/tmsv2tokenizedcardstokenized_card_iddelete_reason.rb +208 -0
  195. data/lib/cybersource_rest_client/models/tmsv3tokenstoken_idpaymentcredentials_order_information.rb +1 -1
  196. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_shipping_details.rb +1 -1
  197. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_sender_information.rb +1 -1
  198. data/lib/cybersource_rest_client/models/ucv1sessions_data.rb +44 -14
  199. data/lib/cybersource_rest_client/models/ucv1sessions_data_aggregator_information.rb +325 -0
  200. data/lib/cybersource_rest_client/models/ucv1sessions_data_aggregator_information_sub_merchant.rb +366 -0
  201. data/lib/cybersource_rest_client/models/ucv1sessions_data_consumer_authentication_information.rb +22 -5
  202. data/lib/cybersource_rest_client/models/ucv1sessions_data_installment_information.rb +196 -0
  203. data/lib/cybersource_rest_client/models/ucv1sessions_data_merchant_information.rb +22 -5
  204. data/lib/cybersource_rest_client/models/ucv1sessions_data_merchant_information_merchant_descriptor.rb +18 -1
  205. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information.rb +16 -6
  206. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_amount_details.rb +86 -12
  207. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_invoice_details.rb +242 -0
  208. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_invoice_details_transaction_advice_addendum.rb +196 -0
  209. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_line_items.rb +702 -0
  210. data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_shipping_details.rb +213 -0
  211. data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information.rb +38 -1
  212. data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information_bank_transfer_options.rb +196 -0
  213. data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information_recurring_options.rb +192 -0
  214. data/lib/cybersource_rest_client/models/ucv1sessions_data_recipient_information.rb +107 -53
  215. data/lib/cybersource_rest_client/models/ucv1sessions_data_sender_information.rb +376 -0
  216. data/lib/cybersource_rest_client/models/ucv1sessions_data_sender_information_account.rb +213 -0
  217. data/lib/cybersource_rest_client/models/update_payments.rb +192 -0
  218. data/lib/cybersource_rest_client/models/value_added_services_products.rb +25 -5
  219. data/lib/cybersource_rest_client.rb +71 -12
  220. metadata +78 -19
  221. data/lib/cybersource_rest_client/api/token_api.rb +0 -306
  222. data/lib/cybersource_rest_client/api/tokenized_card_api.rb +0 -371
@@ -0,0 +1,213 @@
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.4.38
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module CyberSource
15
+ class Ucv1sessionsDataOrderInformationShippingDetails
16
+ # 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
17
+ attr_accessor :shipping_method
18
+
19
+ # Postal code for the address from which the goods are shipped, which is used to establish nexus. The default is the postal code associated with your CyberSource account. 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 This field is frequently used for Level II and Level III transactions.
20
+ attr_accessor :ship_from_postal_code
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'shipping_method' => :'shippingMethod',
26
+ :'ship_from_postal_code' => :'shipFromPostalCode'
27
+ }
28
+ end
29
+
30
+ # Attribute mapping from JSON key to ruby-style variable name.
31
+ def self.json_map
32
+ {
33
+ :'shipping_method' => :'shipping_method',
34
+ :'ship_from_postal_code' => :'ship_from_postal_code'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'shipping_method' => :'String',
42
+ :'ship_from_postal_code' => :'String'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
53
+
54
+ if attributes.has_key?(:'shippingMethod')
55
+ self.shipping_method = attributes[:'shippingMethod']
56
+ end
57
+
58
+ if attributes.has_key?(:'shipFromPostalCode')
59
+ self.ship_from_postal_code = attributes[:'shipFromPostalCode']
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param [Object] shipping_method Value to be assigned
78
+ def shipping_method=(shipping_method)
79
+ @shipping_method = shipping_method
80
+ end
81
+
82
+ # Custom attribute writer method with validation
83
+ # @param [Object] ship_from_postal_code Value to be assigned
84
+ def ship_from_postal_code=(ship_from_postal_code)
85
+ @ship_from_postal_code = ship_from_postal_code
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ shipping_method == o.shipping_method &&
94
+ ship_from_postal_code == o.ship_from_postal_code
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [shipping_method, ship_from_postal_code].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = CyberSource.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+ end
213
+ end
@@ -16,8 +16,15 @@ module CyberSource
16
16
  # The reconciliation ID
17
17
  attr_accessor :reconciliation_id
18
18
 
19
+ # This field is applicable for AFT and OCT transactions. For list of supported values, please refer to Developer Guide.
20
+ attr_accessor :purpose_of_payment
21
+
19
22
  attr_accessor :authorization_options
20
23
 
24
+ attr_accessor :recurring_options
25
+
26
+ attr_accessor :bank_transfer_options
27
+
21
28
  # The business application Id<br><br> Optional field: This field cannot be configured through the Merchant Experience screens in the Business Center, but if required should be provided on a per‑transaction basis in the uc/v1/sessions API request.
22
29
  attr_accessor :business_application_id
23
30
 
@@ -31,7 +38,10 @@ module CyberSource
31
38
  def self.attribute_map
32
39
  {
33
40
  :'reconciliation_id' => :'reconciliationId',
41
+ :'purpose_of_payment' => :'purposeOfPayment',
34
42
  :'authorization_options' => :'authorizationOptions',
43
+ :'recurring_options' => :'recurringOptions',
44
+ :'bank_transfer_options' => :'bankTransferOptions',
35
45
  :'business_application_id' => :'businessApplicationId',
36
46
  :'commerce_indicator' => :'commerceIndicator',
37
47
  :'processing_instruction' => :'processingInstruction'
@@ -42,7 +52,10 @@ module CyberSource
42
52
  def self.json_map
43
53
  {
44
54
  :'reconciliation_id' => :'reconciliation_id',
55
+ :'purpose_of_payment' => :'purpose_of_payment',
45
56
  :'authorization_options' => :'authorization_options',
57
+ :'recurring_options' => :'recurring_options',
58
+ :'bank_transfer_options' => :'bank_transfer_options',
46
59
  :'business_application_id' => :'business_application_id',
47
60
  :'commerce_indicator' => :'commerce_indicator',
48
61
  :'processing_instruction' => :'processing_instruction'
@@ -53,7 +66,10 @@ module CyberSource
53
66
  def self.swagger_types
54
67
  {
55
68
  :'reconciliation_id' => :'String',
69
+ :'purpose_of_payment' => :'String',
56
70
  :'authorization_options' => :'Ucv1sessionsDataProcessingInformationAuthorizationOptions',
71
+ :'recurring_options' => :'Ucv1sessionsDataProcessingInformationRecurringOptions',
72
+ :'bank_transfer_options' => :'Ucv1sessionsDataProcessingInformationBankTransferOptions',
57
73
  :'business_application_id' => :'String',
58
74
  :'commerce_indicator' => :'String',
59
75
  :'processing_instruction' => :'String'
@@ -72,10 +88,22 @@ module CyberSource
72
88
  self.reconciliation_id = attributes[:'reconciliationId']
73
89
  end
74
90
 
91
+ if attributes.has_key?(:'purposeOfPayment')
92
+ self.purpose_of_payment = attributes[:'purposeOfPayment']
93
+ end
94
+
75
95
  if attributes.has_key?(:'authorizationOptions')
76
96
  self.authorization_options = attributes[:'authorizationOptions']
77
97
  end
78
98
 
99
+ if attributes.has_key?(:'recurringOptions')
100
+ self.recurring_options = attributes[:'recurringOptions']
101
+ end
102
+
103
+ if attributes.has_key?(:'bankTransferOptions')
104
+ self.bank_transfer_options = attributes[:'bankTransferOptions']
105
+ end
106
+
79
107
  if attributes.has_key?(:'businessApplicationId')
80
108
  self.business_application_id = attributes[:'businessApplicationId']
81
109
  end
@@ -108,6 +136,12 @@ module CyberSource
108
136
  @reconciliation_id = reconciliation_id
109
137
  end
110
138
 
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] purpose_of_payment Value to be assigned
141
+ def purpose_of_payment=(purpose_of_payment)
142
+ @purpose_of_payment = purpose_of_payment
143
+ end
144
+
111
145
  # Custom attribute writer method with validation
112
146
  # @param [Object] business_application_id Value to be assigned
113
147
  def business_application_id=(business_application_id)
@@ -132,7 +166,10 @@ module CyberSource
132
166
  return true if self.equal?(o)
133
167
  self.class == o.class &&
134
168
  reconciliation_id == o.reconciliation_id &&
169
+ purpose_of_payment == o.purpose_of_payment &&
135
170
  authorization_options == o.authorization_options &&
171
+ recurring_options == o.recurring_options &&
172
+ bank_transfer_options == o.bank_transfer_options &&
136
173
  business_application_id == o.business_application_id &&
137
174
  commerce_indicator == o.commerce_indicator &&
138
175
  processing_instruction == o.processing_instruction
@@ -147,7 +184,7 @@ module CyberSource
147
184
  # Calculates hash code according to all attributes.
148
185
  # @return [Fixnum] Hash code
149
186
  def hash
150
- [reconciliation_id, authorization_options, business_application_id, commerce_indicator, processing_instruction].hash
187
+ [reconciliation_id, purpose_of_payment, authorization_options, recurring_options, bank_transfer_options, business_application_id, commerce_indicator, processing_instruction].hash
151
188
  end
152
189
 
153
190
  # Builds the object from hash
@@ -0,0 +1,196 @@
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.4.38
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module CyberSource
15
+ class Ucv1sessionsDataProcessingInformationBankTransferOptions
16
+ # Specifies the authorization method for the transaction. #### TeleCheck Accepts only the following values: - `ARC`: account receivable conversion - `CCD`: corporate cash disbursement - `POP`: point of purchase conversion - `PPD`: prearranged payment and deposit entry - `TEL`: telephone-initiated entry - `WEB`: internet-initiated entry
17
+ attr_accessor :sec_code
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'sec_code' => :'secCode'
23
+ }
24
+ end
25
+
26
+ # Attribute mapping from JSON key to ruby-style variable name.
27
+ def self.json_map
28
+ {
29
+ :'sec_code' => :'sec_code'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'sec_code' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'secCode')
49
+ self.sec_code = attributes[:'secCode']
50
+ end
51
+ end
52
+
53
+ # Show invalid properties with the reasons. Usually used together with valid?
54
+ # @return Array for valid properties with the reasons
55
+ def list_invalid_properties
56
+ invalid_properties = Array.new
57
+ invalid_properties
58
+ end
59
+
60
+ # Check to see if the all the properties in the model are valid
61
+ # @return true if the model is valid
62
+ def valid?
63
+ true
64
+ end
65
+
66
+ # Custom attribute writer method with validation
67
+ # @param [Object] sec_code Value to be assigned
68
+ def sec_code=(sec_code)
69
+ @sec_code = sec_code
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ sec_code == o.sec_code
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(o)
83
+ self == o
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Fixnum] Hash code
88
+ def hash
89
+ [sec_code].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def build_from_hash(attributes)
96
+ return nil unless attributes.is_a?(Hash)
97
+ self.class.swagger_types.each_pair do |key, type|
98
+ if type =~ /\AArray<(.*)>/i
99
+ # check to ensure the input is an array given that the the attribute
100
+ # is documented as an array but the input is not
101
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
102
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
103
+ end
104
+ elsif !attributes[self.class.attribute_map[key]].nil?
105
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
106
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
107
+ end
108
+
109
+ self
110
+ end
111
+
112
+ # Deserializes the data based on type
113
+ # @param string type Data type
114
+ # @param string value Value to be deserialized
115
+ # @return [Object] Deserialized data
116
+ def _deserialize(type, value)
117
+ case type.to_sym
118
+ when :DateTime
119
+ DateTime.parse(value)
120
+ when :Date
121
+ Date.parse(value)
122
+ when :String
123
+ value.to_s
124
+ when :Integer
125
+ value.to_i
126
+ when :Float
127
+ value.to_f
128
+ when :BOOLEAN
129
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
130
+ true
131
+ else
132
+ false
133
+ end
134
+ when :Object
135
+ # generic object (usually a Hash), return directly
136
+ value
137
+ when /\AArray<(?<inner_type>.+)>\z/
138
+ inner_type = Regexp.last_match[:inner_type]
139
+ value.map { |v| _deserialize(inner_type, v) }
140
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
141
+ k_type = Regexp.last_match[:k_type]
142
+ v_type = Regexp.last_match[:v_type]
143
+ {}.tap do |hash|
144
+ value.each do |k, v|
145
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
146
+ end
147
+ end
148
+ else # model
149
+ temp_model = CyberSource.const_get(type).new
150
+ temp_model.build_from_hash(value)
151
+ end
152
+ end
153
+
154
+ # Returns the string representation of the object
155
+ # @return [String] String presentation of the object
156
+ def to_s
157
+ to_hash.to_s
158
+ end
159
+
160
+ # to_body is an alias to to_hash (backward compatibility)
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_body
163
+ to_hash
164
+ end
165
+
166
+ # Returns the object in the form of hash
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_hash
169
+ hash = {}
170
+ self.class.attribute_map.each_pair do |attr, param|
171
+ value = self.send(attr)
172
+ next if value.nil?
173
+ hash[param] = _to_hash(value)
174
+ end
175
+ hash
176
+ end
177
+
178
+ # Outputs non-array value in the form of hash
179
+ # For object, use to_hash. Otherwise, just return the value
180
+ # @param [Object] value Any valid value
181
+ # @return [Hash] Returns the value in the form of hash
182
+ def _to_hash(value)
183
+ if value.is_a?(Array)
184
+ value.compact.map { |v| _to_hash(v) }
185
+ elsif value.is_a?(Hash)
186
+ {}.tap do |hash|
187
+ value.each { |k, v| hash[k] = _to_hash(v) }
188
+ end
189
+ elsif value.respond_to? :to_hash
190
+ value.to_hash
191
+ else
192
+ value
193
+ end
194
+ end
195
+ end
196
+ 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.4.38
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module CyberSource
15
+ class Ucv1sessionsDataProcessingInformationRecurringOptions
16
+ # Flag that indicates whether this transaction is the first in a series of recurring payments. This field is supported only for **Atos**, **FDC Nashville Global**, and **OmniPay Direct**. Possible values: - `true` Indicates this is the first payment in a series of recurring payments - `false` (default) Indicates this is not the first payment in a series of recurring payments.
17
+ attr_accessor :first_recurring_payment
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'first_recurring_payment' => :'firstRecurringPayment'
23
+ }
24
+ end
25
+
26
+ # Attribute mapping from JSON key to ruby-style variable name.
27
+ def self.json_map
28
+ {
29
+ :'first_recurring_payment' => :'first_recurring_payment'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'first_recurring_payment' => :'BOOLEAN'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'firstRecurringPayment')
49
+ self.first_recurring_payment = attributes[:'firstRecurringPayment']
50
+ else
51
+ self.first_recurring_payment = false
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ first_recurring_payment == o.first_recurring_payment
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
+ [first_recurring_payment].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("#{self.class.json_map[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("#{self.class.json_map[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