cybersource_rest_client 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client.rb +3 -39
  3. data/lib/cybersource_rest_client/api/conversion_details_api.rb +4 -4
  4. data/lib/cybersource_rest_client/api/decision_manager_api.rb +2 -2
  5. data/lib/cybersource_rest_client/api/net_fundings_api.rb +4 -4
  6. data/lib/cybersource_rest_client/api/notification_of_changes_api.rb +4 -4
  7. data/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb +4 -10
  8. data/lib/cybersource_rest_client/api/report_downloads_api.rb +2 -2
  9. data/lib/cybersource_rest_client/api/reports_api.rb +12 -25
  10. data/lib/cybersource_rest_client/api/secure_file_share_api.rb +4 -4
  11. data/lib/cybersource_rest_client/api/transaction_batches_api.rb +6 -6
  12. data/lib/cybersource_rest_client/models/capture_payment_request.rb +1 -1
  13. data/lib/cybersource_rest_client/models/create_credit_request.rb +1 -1
  14. data/lib/cybersource_rest_client/models/create_payment_instrument_request.rb +2 -48
  15. data/lib/cybersource_rest_client/models/create_payment_request.rb +1 -1
  16. data/lib/cybersource_rest_client/models/create_search_request.rb +2 -2
  17. data/lib/cybersource_rest_client/models/embedded_instrument_identifier.rb +2 -48
  18. data/lib/cybersource_rest_client/models/file_detail.rb +1 -35
  19. data/lib/cybersource_rest_client/models/instrument_identifier.rb +2 -48
  20. data/lib/cybersource_rest_client/models/payment_instrument.rb +2 -48
  21. data/lib/cybersource_rest_client/models/payment_instrument_bank_account.rb +0 -34
  22. data/lib/cybersource_rest_client/models/payment_instrument_card.rb +2 -36
  23. data/lib/cybersource_rest_client/models/payment_instruments_for_instrument_identifier.rb +1 -35
  24. data/lib/cybersource_rest_client/models/personal_identification.rb +1 -35
  25. data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response.rb +0 -34
  26. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response.rb +0 -34
  27. data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post400_response.rb +0 -46
  28. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response.rb +0 -34
  29. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_error_information.rb +0 -34
  30. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_error_information_details.rb +0 -34
  31. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_issuer_information.rb +1 -1
  32. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_account_features.rb +13 -37
  33. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_bank.rb +1 -1
  34. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +2 -2
  35. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +7 -7
  36. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_avs.rb +15 -0
  37. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_card_verification.rb +1 -1
  38. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_merchant_advice.rb +1 -1
  39. data/lib/cybersource_rest_client/models/pts_v2_payments_post400_response.rb +0 -46
  40. data/lib/cybersource_rest_client/models/pts_v2_payments_post502_response.rb +1 -47
  41. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +0 -34
  42. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +1 -1
  43. data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post400_response.rb +0 -46
  44. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response.rb +0 -34
  45. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +3 -3
  46. data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post400_response.rb +0 -46
  47. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response.rb +0 -34
  48. data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post400_response.rb +0 -46
  49. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response.rb +0 -34
  50. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_error_information.rb +0 -34
  51. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_order_information_amount_details.rb +1 -1
  52. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information.rb +1 -1
  53. data/lib/cybersource_rest_client/models/pts_v2_payouts_post400_response.rb +0 -34
  54. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information_bank_transfer_options.rb +1 -1
  55. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information.rb +2 -2
  56. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +9 -9
  57. data/lib/cybersource_rest_client/models/ptsv2payments_buyer_information_personal_identification.rb +0 -34
  58. data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +6 -6
  59. data/lib/cybersource_rest_client/models/ptsv2payments_device_information.rb +5 -5
  60. data/lib/cybersource_rest_client/models/ptsv2payments_issuer_information.rb +1 -1
  61. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_defined_information.rb +1 -1
  62. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information.rb +1 -1
  63. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_initiated_transaction.rb +2 -2
  64. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +3 -3
  65. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_amex_additional_amounts.rb +1 -1
  66. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_surcharge.rb +1 -1
  67. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details_tax_details.rb +7 -41
  68. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +32 -50
  69. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_invoice_details.rb +1 -1
  70. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +4 -4
  71. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank.rb +1 -1
  72. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank_account.rb +1 -1
  73. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +3 -3
  74. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +1 -1
  75. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +4 -26
  76. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options_initiator.rb +1 -35
  77. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_bank_transfer_options.rb +2 -2
  78. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_capture_options.rb +1 -1
  79. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_recurring_options.rb +2 -2
  80. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information.rb +2 -2
  81. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +8 -8
  82. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +3 -3
  83. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_bill_to.rb +32 -16
  84. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_line_items.rb +3 -3
  85. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_processing_information_recurring_options.rb +1 -1
  86. data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_reversal_information_amount_details.rb +1 -1
  87. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_amount_details.rb +1 -1
  88. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_amount_details_surcharge.rb +1 -1
  89. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information_bill_to.rb +14 -48
  90. data/lib/cybersource_rest_client/models/refund_capture_request.rb +1 -1
  91. data/lib/cybersource_rest_client/models/refund_payment_request.rb +1 -1
  92. data/lib/cybersource_rest_client/models/reporting_v3_net_fundings_get200_response.rb +1 -1
  93. data/lib/cybersource_rest_client/models/reporting_v3_net_fundings_get200_response_net_funding_summaries.rb +1 -34
  94. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_get200_response_report_definitions.rb +0 -22
  95. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response.rb +0 -22
  96. data/lib/cybersource_rest_client/models/reporting_v3_report_subscriptions_get200_response_subscriptions.rb +2 -48
  97. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response.rb +8 -8
  98. data/lib/cybersource_rest_client/models/{reporting_v3_reports_get200_response_reports.rb → reporting_v3_reports_get200_response_report_search_results.rb} +4 -62
  99. data/lib/cybersource_rest_client/models/reporting_v3_reports_id_get200_response.rb +3 -61
  100. data/lib/cybersource_rest_client/models/reportingv3reports_report_preferences.rb +1 -35
  101. data/lib/cybersource_rest_client/models/request_body.rb +1 -35
  102. data/lib/cybersource_rest_client/models/request_body_1.rb +2 -47
  103. data/lib/cybersource_rest_client/models/risk_v1_decisions_post201_response_risk_information_ip_address.rb +1 -1
  104. data/lib/cybersource_rest_client/models/risk_v1_decisions_post400_response.rb +0 -34
  105. data/lib/cybersource_rest_client/models/riskv1decisions_card_verification.rb +1 -1
  106. data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +5 -5
  107. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_amount_details.rb +1 -1
  108. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_bill_to.rb +15 -15
  109. data/lib/cybersource_rest_client/models/riskv1decisions_travel_information_legs.rb +1 -1
  110. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response.rb +1 -35
  111. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_bank_account.rb +0 -34
  112. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_card.rb +2 -36
  113. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_bank_transfer_options.rb +0 -34
  114. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_instrument_identifier.rb +2 -48
  115. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_payment_instruments.rb +2 -48
  116. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_personal_identification.rb +1 -35
  117. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response.rb +2 -48
  118. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response.rb +2 -2
  119. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_application_information.rb +3 -3
  120. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_consumer_authentication_information.rb +2 -2
  121. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_device_information.rb +5 -5
  122. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_error_information.rb +2 -2
  123. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_fraud_marking_information.rb +1 -1
  124. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_amount_details.rb +1 -1
  125. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_bill_to.rb +47 -31
  126. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_line_items.rb +1 -1
  127. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_ship_to.rb +6 -6
  128. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_bank.rb +5 -5
  129. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_bank_account.rb +5 -5
  130. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_bank_mandate.rb +3 -3
  131. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +23 -34
  132. data/lib/cybersource_rest_client/models/{risk_v1_authentications_post400_response.rb → tss_v2_transactions_get200_response_payment_information_payment_type_funding_source.rb} +37 -38
  133. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +1 -1
  134. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information_bank_transfer_options.rb +1 -1
  135. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +3 -3
  136. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response.rb +14 -4
  137. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_consumer_authentication_information.rb +1 -1
  138. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_device_information.rb +5 -5
  139. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_order_information_bill_to.rb +5 -5
  140. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_payment_type.rb +9 -9
  141. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_point_of_sale_information.rb +2 -2
  142. data/lib/cybersource_rest_client/models/{riskv1authentications_device_information_raw_data.rb → tss_v2_transactions_post201_response__embedded_point_of_sale_information_partner.rb} +17 -27
  143. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processing_information.rb +1 -1
  144. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_risk_information_providers_fingerprint.rb +3 -3
  145. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_transaction_summaries.rb +2 -2
  146. data/lib/cybersource_rest_client/models/tss_v2_transactions_post400_response.rb +0 -34
  147. data/lib/cybersource_rest_client/models/ums_v1_users_get200_response_account_information.rb +1 -34
  148. data/lib/cybersource_rest_client/models/update_payment_instrument_request.rb +2 -48
  149. data/lib/cybersource_rest_client/models/v1_file_details_get200_response_file_details.rb +1 -35
  150. metadata +5 -43
  151. data/lib/cybersource_rest_client/api/download_dtd_api.rb +0 -88
  152. data/lib/cybersource_rest_client/api/download_xsd_api.rb +0 -88
  153. data/lib/cybersource_rest_client/api/payer_authentication_api.rb +0 -154
  154. data/lib/cybersource_rest_client/models/check_payer_auth_enrollment_request.rb +0 -275
  155. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to_company.rb +0 -349
  156. data/lib/cybersource_rest_client/models/request.rb +0 -210
  157. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response.rb +0 -285
  158. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response_consumer_authentication_information.rb +0 -324
  159. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response.rb +0 -294
  160. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_consumer_authentication_information.rb +0 -429
  161. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information.rb +0 -183
  162. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information_amount_details.rb +0 -199
  163. data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +0 -214
  164. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information.rb +0 -194
  165. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information_line_items.rb +0 -267
  166. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information.rb +0 -192
  167. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +0 -264
  168. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +0 -264
  169. data/lib/cybersource_rest_client/models/riskv1authentications_buyer_information.rb +0 -196
  170. data/lib/cybersource_rest_client/models/riskv1authentications_client_reference_information.rb +0 -208
  171. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information.rb +0 -552
  172. data/lib/cybersource_rest_client/models/riskv1authentications_device_information.rb +0 -285
  173. data/lib/cybersource_rest_client/models/riskv1authentications_merchant_information.rb +0 -199
  174. data/lib/cybersource_rest_client/models/riskv1authentications_order_information.rb +0 -258
  175. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_bill_to.rb +0 -496
  176. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_line_items.rb +0 -371
  177. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_ship_to.rb +0 -434
  178. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information.rb +0 -192
  179. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_card.rb +0 -291
  180. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +0 -291
  181. data/lib/cybersource_rest_client/models/riskv1authentications_recurring_payment_information.rb +0 -235
  182. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information.rb +0 -183
  183. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history.rb +0 -262
  184. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_account_history.rb +0 -209
  185. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_customer_account.rb +0 -279
  186. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information.rb +0 -206
  187. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_legs.rb +0 -259
  188. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_passengers.rb +0 -224
@@ -1,371 +0,0 @@
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 Riskv1authenticationsOrderInformationLineItems
17
- # Total amount for the item. Normally calculated as the unit price times quantity. When `orderInformation.lineItems[].productCode` is \"gift_card\", this is the purchase amount total for prepaid gift cards in major units. Example: 123.45 USD = 123
18
- attr_accessor :total_amount
19
-
20
- # Per-item price of the product. This value cannot be negative. You can include a decimal point (.), but you cannot include any other special characters. CyberSource truncates the amount to the correct number of decimal places. For processor-specific information, see the `amount` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html) **Important** Some processors have specific requirements and limitations, such as maximum amounts and maximum field lengths. See these guides for details: - [Merchant Descriptors Using the SCMP API Guide] (https://apps.cybersource.com/library/documentation/dev_guides/Merchant_Descriptors_SCMP_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm) - \"Capture Information for Specific Processors\" section in the [Credit Card Services Using the SCMP API Guide](https://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm) #### DCC with a Third-Party Provider Set this field to the converted amount that was returned by the DCC provider. You must include either the 1st line item in the order and this field, or the request-level field `orderInformation.amountDetails.totalAmount` in your request. For details, see \"Dynamic Currency Conversion with a Third Party Provider\" in the [Credit Card Services Using the SCMP API Guide.](https://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm) #### FDMS South If you accept IDR or CLP currencies, see the entry for FDMS South in the [Merchant Descriptors Using the SCMP API Guide.] (https://apps.cybersource.com/library/documentation/dev_guides/Merchant_Descriptors_SCMP_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm) #### Zero Amount Authorizations If your processor supports zero amount authorizations, you can set this field to 0 for the authorization to check if the card is lost or stolen. See \"Zero Amount Authorizations\" in the [Credit Card Services Using the SCMP API Guide.](https://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm)
21
- attr_accessor :unit_price
22
-
23
- # Number of units for this order. The default is `1`. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when _orderInformation.lineItems[].productCode_ is not set to **default** or one of the other values that are related to shipping and/or handling. When orderInformation.lineItems[].productCode is \"gift_card\", this is the total count of individual prepaid gift cards purchased.
24
- attr_accessor :quantity
25
-
26
- # When `orderInformation.lineItems[].productCode` is \"gift_card\", this is the currency used for the gift card purchase. For details, see `pa_gift_card_currency` field description in [CyberSource Payer Authentication Using the SCMP API.] (https://apps.cybersource.com/library/documentation/dev_guides/Payer_Authentication_SCMP_API/Payer_Authentication_SCMP_API.pdf) For the possible values, see the [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/currencies.pdf)
27
- attr_accessor :gift_card_currency
28
-
29
- # Stock Keeping Unit (SKU) code for the product. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when _orderInformation.lineItems[].productCode_ is not set to **default** or one of the other values that are related to shipping and/or handling.
30
- attr_accessor :product_sku
31
-
32
- # Brief description of item.
33
- attr_accessor :product_description
34
-
35
- # For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not set to `default` or one of the other values that are related to shipping and/or handling.
36
- attr_accessor :product_name
37
-
38
- attr_accessor :passenger
39
-
40
- # Total tax to apply to the product. This value cannot be negative. The tax amount and the offer amount must be in the same currency. The tax amount field is additive. The following example uses a two-exponent currency such as USD: 1. You include each line item in your request. ..- 1st line item has amount=10.00, quantity=1, and taxAmount=0.80 ..- 2nd line item has amount=20.00, quantity=1, and taxAmount=1.60 2. The total amount authorized will be 32.40, not 30.00 with 2.40 of tax included. If you want to include the tax amount and also request the ics_tax service, see Tax Calculation Service Using the SCMP API. This field is frequently used for Level II and Level III transactions. See Level II and Level III Processing Using the SCMP API.
41
- attr_accessor :tax_amount
42
-
43
- # Attribute mapping from ruby-style variable name to JSON key.
44
- def self.attribute_map
45
- {
46
- :'total_amount' => :'totalAmount',
47
- :'unit_price' => :'unitPrice',
48
- :'quantity' => :'quantity',
49
- :'gift_card_currency' => :'giftCardCurrency',
50
- :'product_sku' => :'productSKU',
51
- :'product_description' => :'productDescription',
52
- :'product_name' => :'productName',
53
- :'passenger' => :'passenger',
54
- :'tax_amount' => :'taxAmount'
55
- }
56
- end
57
-
58
- # Attribute type mapping.
59
- def self.swagger_types
60
- {
61
- :'total_amount' => :'String',
62
- :'unit_price' => :'String',
63
- :'quantity' => :'Float',
64
- :'gift_card_currency' => :'Integer',
65
- :'product_sku' => :'String',
66
- :'product_description' => :'String',
67
- :'product_name' => :'String',
68
- :'passenger' => :'Riskv1decisionsOrderInformationPassenger',
69
- :'tax_amount' => :'String'
70
- }
71
- end
72
-
73
- # Initializes the object
74
- # @param [Hash] attributes Model attributes in the form of hash
75
- def initialize(attributes = {})
76
- return unless attributes.is_a?(Hash)
77
-
78
- # convert string to symbol for hash key
79
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
80
-
81
- if attributes.has_key?(:'totalAmount')
82
- self.total_amount = attributes[:'totalAmount']
83
- end
84
-
85
- if attributes.has_key?(:'unitPrice')
86
- self.unit_price = attributes[:'unitPrice']
87
- end
88
-
89
- if attributes.has_key?(:'quantity')
90
- self.quantity = attributes[:'quantity']
91
- end
92
-
93
- if attributes.has_key?(:'giftCardCurrency')
94
- self.gift_card_currency = attributes[:'giftCardCurrency']
95
- end
96
-
97
- if attributes.has_key?(:'productSKU')
98
- self.product_sku = attributes[:'productSKU']
99
- end
100
-
101
- if attributes.has_key?(:'productDescription')
102
- self.product_description = attributes[:'productDescription']
103
- end
104
-
105
- if attributes.has_key?(:'productName')
106
- self.product_name = attributes[:'productName']
107
- end
108
-
109
- if attributes.has_key?(:'passenger')
110
- self.passenger = attributes[:'passenger']
111
- end
112
-
113
- if attributes.has_key?(:'taxAmount')
114
- self.tax_amount = attributes[:'taxAmount']
115
- end
116
- end
117
-
118
- # Show invalid properties with the reasons. Usually used together with valid?
119
- # @return Array for valid properties with the reasons
120
- def list_invalid_properties
121
- invalid_properties = Array.new
122
- if !@total_amount.nil? && @total_amount.to_s.length > 13
123
- invalid_properties.push('invalid value for "total_amount", the character length must be smaller than or equal to 13.')
124
- end
125
-
126
- if @unit_price.nil?
127
- invalid_properties.push('invalid value for "unit_price", unit_price cannot be nil.')
128
- end
129
-
130
- if @unit_price.to_s.length > 15
131
- invalid_properties.push('invalid value for "unit_price", the character length must be smaller than or equal to 15.')
132
- end
133
-
134
- if !@quantity.nil? && @quantity > 9999999999
135
- invalid_properties.push('invalid value for "quantity", must be smaller than or equal to 9999999999.')
136
- end
137
-
138
- if !@quantity.nil? && @quantity < 1
139
- invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
140
- end
141
-
142
- if !@product_sku.nil? && @product_sku.to_s.length > 255
143
- invalid_properties.push('invalid value for "product_sku", the character length must be smaller than or equal to 255.')
144
- end
145
-
146
- if !@product_name.nil? && @product_name.to_s.length > 255
147
- invalid_properties.push('invalid value for "product_name", the character length must be smaller than or equal to 255.')
148
- end
149
-
150
- if !@tax_amount.nil? && @tax_amount.to_s.length > 15
151
- invalid_properties.push('invalid value for "tax_amount", the character length must be smaller than or equal to 15.')
152
- end
153
-
154
- invalid_properties
155
- end
156
-
157
- # Check to see if the all the properties in the model are valid
158
- # @return true if the model is valid
159
- def valid?
160
- return false if !@total_amount.nil? && @total_amount.to_s.length > 13
161
- return false if @unit_price.nil?
162
- return false if @unit_price.to_s.length > 15
163
- return false if !@quantity.nil? && @quantity > 9999999999
164
- return false if !@quantity.nil? && @quantity < 1
165
- return false if !@product_sku.nil? && @product_sku.to_s.length > 255
166
- return false if !@product_name.nil? && @product_name.to_s.length > 255
167
- return false if !@tax_amount.nil? && @tax_amount.to_s.length > 15
168
- true
169
- end
170
-
171
- # Custom attribute writer method with validation
172
- # @param [Object] total_amount Value to be assigned
173
- def total_amount=(total_amount)
174
- if !total_amount.nil? && total_amount.to_s.length > 13
175
- fail ArgumentError, 'invalid value for "total_amount", the character length must be smaller than or equal to 13.'
176
- end
177
-
178
- @total_amount = total_amount
179
- end
180
-
181
- # Custom attribute writer method with validation
182
- # @param [Object] unit_price Value to be assigned
183
- def unit_price=(unit_price)
184
- if unit_price.nil?
185
- fail ArgumentError, 'unit_price cannot be nil'
186
- end
187
-
188
- if unit_price.to_s.length > 15
189
- fail ArgumentError, 'invalid value for "unit_price", the character length must be smaller than or equal to 15.'
190
- end
191
-
192
- @unit_price = unit_price
193
- end
194
-
195
- # Custom attribute writer method with validation
196
- # @param [Object] quantity Value to be assigned
197
- def quantity=(quantity)
198
- if !quantity.nil? && quantity > 9999999999
199
- fail ArgumentError, 'invalid value for "quantity", must be smaller than or equal to 9999999999.'
200
- end
201
-
202
- if !quantity.nil? && quantity < 1
203
- fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 1.'
204
- end
205
-
206
- @quantity = quantity
207
- end
208
-
209
- # Custom attribute writer method with validation
210
- # @param [Object] product_sku Value to be assigned
211
- def product_sku=(product_sku)
212
- if !product_sku.nil? && product_sku.to_s.length > 255
213
- fail ArgumentError, 'invalid value for "product_sku", the character length must be smaller than or equal to 255.'
214
- end
215
-
216
- @product_sku = product_sku
217
- end
218
-
219
- # Custom attribute writer method with validation
220
- # @param [Object] product_name Value to be assigned
221
- def product_name=(product_name)
222
- if !product_name.nil? && product_name.to_s.length > 255
223
- fail ArgumentError, 'invalid value for "product_name", the character length must be smaller than or equal to 255.'
224
- end
225
-
226
- @product_name = product_name
227
- end
228
-
229
- # Custom attribute writer method with validation
230
- # @param [Object] tax_amount Value to be assigned
231
- def tax_amount=(tax_amount)
232
- if !tax_amount.nil? && tax_amount.to_s.length > 15
233
- fail ArgumentError, 'invalid value for "tax_amount", the character length must be smaller than or equal to 15.'
234
- end
235
-
236
- @tax_amount = tax_amount
237
- end
238
-
239
- # Checks equality by comparing each attribute.
240
- # @param [Object] Object to be compared
241
- def ==(o)
242
- return true if self.equal?(o)
243
- self.class == o.class &&
244
- total_amount == o.total_amount &&
245
- unit_price == o.unit_price &&
246
- quantity == o.quantity &&
247
- gift_card_currency == o.gift_card_currency &&
248
- product_sku == o.product_sku &&
249
- product_description == o.product_description &&
250
- product_name == o.product_name &&
251
- passenger == o.passenger &&
252
- tax_amount == o.tax_amount
253
- end
254
-
255
- # @see the `==` method
256
- # @param [Object] Object to be compared
257
- def eql?(o)
258
- self == o
259
- end
260
-
261
- # Calculates hash code according to all attributes.
262
- # @return [Fixnum] Hash code
263
- def hash
264
- [total_amount, unit_price, quantity, gift_card_currency, product_sku, product_description, product_name, passenger, tax_amount].hash
265
- end
266
-
267
- # Builds the object from hash
268
- # @param [Hash] attributes Model attributes in the form of hash
269
- # @return [Object] Returns the model itself
270
- def build_from_hash(attributes)
271
- return nil unless attributes.is_a?(Hash)
272
- self.class.swagger_types.each_pair do |key, type|
273
- if type =~ /\AArray<(.*)>/i
274
- # check to ensure the input is an array given that the the attribute
275
- # is documented as an array but the input is not
276
- if attributes[self.class.attribute_map[key]].is_a?(Array)
277
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
278
- end
279
- elsif !attributes[self.class.attribute_map[key]].nil?
280
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
281
- end # or else data not found in attributes(hash), not an issue as the data can be optional
282
- end
283
-
284
- self
285
- end
286
-
287
- # Deserializes the data based on type
288
- # @param string type Data type
289
- # @param string value Value to be deserialized
290
- # @return [Object] Deserialized data
291
- def _deserialize(type, value)
292
- case type.to_sym
293
- when :DateTime
294
- DateTime.parse(value)
295
- when :Date
296
- Date.parse(value)
297
- when :String
298
- value.to_s
299
- when :Integer
300
- value.to_i
301
- when :Float
302
- value.to_f
303
- when :BOOLEAN
304
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
305
- true
306
- else
307
- false
308
- end
309
- when :Object
310
- # generic object (usually a Hash), return directly
311
- value
312
- when /\AArray<(?<inner_type>.+)>\z/
313
- inner_type = Regexp.last_match[:inner_type]
314
- value.map { |v| _deserialize(inner_type, v) }
315
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
316
- k_type = Regexp.last_match[:k_type]
317
- v_type = Regexp.last_match[:v_type]
318
- {}.tap do |hash|
319
- value.each do |k, v|
320
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
321
- end
322
- end
323
- else # model
324
- temp_model = CyberSource.const_get(type).new
325
- temp_model.build_from_hash(value)
326
- end
327
- end
328
-
329
- # Returns the string representation of the object
330
- # @return [String] String presentation of the object
331
- def to_s
332
- to_hash.to_s
333
- end
334
-
335
- # to_body is an alias to to_hash (backward compatibility)
336
- # @return [Hash] Returns the object in the form of hash
337
- def to_body
338
- to_hash
339
- end
340
-
341
- # Returns the object in the form of hash
342
- # @return [Hash] Returns the object in the form of hash
343
- def to_hash
344
- hash = {}
345
- self.class.attribute_map.each_pair do |attr, param|
346
- value = self.send(attr)
347
- next if value.nil?
348
- hash[param] = _to_hash(value)
349
- end
350
- hash
351
- end
352
-
353
- # Outputs non-array value in the form of hash
354
- # For object, use to_hash. Otherwise, just return the value
355
- # @param [Object] value Any valid value
356
- # @return [Hash] Returns the value in the form of hash
357
- def _to_hash(value)
358
- if value.is_a?(Array)
359
- value.compact.map { |v| _to_hash(v) }
360
- elsif value.is_a?(Hash)
361
- {}.tap do |hash|
362
- value.each { |k, v| hash[k] = _to_hash(v) }
363
- end
364
- elsif value.respond_to? :to_hash
365
- value.to_hash
366
- else
367
- value
368
- end
369
- end
370
- end
371
- end
@@ -1,434 +0,0 @@
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