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,258 +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 Riskv1authenticationsOrderInformation
17
- attr_accessor :amount_details
18
-
19
- # Indicates whether cardholder is placing an order with a future availability or release date. This field can contain one of these values: - MERCHANDISE_AVAILABLE: Merchandise available - FUTURE_AVAILABILITY: Future availability
20
- attr_accessor :pre_order
21
-
22
- # Expected date that a pre-ordered purchase will be available. Format: YYYYMMDD
23
- attr_accessor :pre_order_date
24
-
25
- # Indicates whether the cardholder is reordering previously purchased merchandise. This field can contain one of these values: - false: First time ordered - true: Reordered
26
- attr_accessor :reordered
27
-
28
- attr_accessor :ship_to
29
-
30
- # This array contains detailed information about individual products in the order.
31
- attr_accessor :line_items
32
-
33
- attr_accessor :bill_to
34
-
35
- # Attribute mapping from ruby-style variable name to JSON key.
36
- def self.attribute_map
37
- {
38
- :'amount_details' => :'amountDetails',
39
- :'pre_order' => :'preOrder',
40
- :'pre_order_date' => :'preOrderDate',
41
- :'reordered' => :'reordered',
42
- :'ship_to' => :'shipTo',
43
- :'line_items' => :'lineItems',
44
- :'bill_to' => :'billTo'
45
- }
46
- end
47
-
48
- # Attribute type mapping.
49
- def self.swagger_types
50
- {
51
- :'amount_details' => :'Riskv1decisionsOrderInformationAmountDetails',
52
- :'pre_order' => :'String',
53
- :'pre_order_date' => :'String',
54
- :'reordered' => :'BOOLEAN',
55
- :'ship_to' => :'Riskv1authenticationsOrderInformationShipTo',
56
- :'line_items' => :'Array<Riskv1authenticationsOrderInformationLineItems>',
57
- :'bill_to' => :'Riskv1authenticationsOrderInformationBillTo'
58
- }
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- return unless attributes.is_a?(Hash)
65
-
66
- # convert string to symbol for hash key
67
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
-
69
- if attributes.has_key?(:'amountDetails')
70
- self.amount_details = attributes[:'amountDetails']
71
- end
72
-
73
- if attributes.has_key?(:'preOrder')
74
- self.pre_order = attributes[:'preOrder']
75
- end
76
-
77
- if attributes.has_key?(:'preOrderDate')
78
- self.pre_order_date = attributes[:'preOrderDate']
79
- end
80
-
81
- if attributes.has_key?(:'reordered')
82
- self.reordered = attributes[:'reordered']
83
- end
84
-
85
- if attributes.has_key?(:'shipTo')
86
- self.ship_to = attributes[:'shipTo']
87
- end
88
-
89
- if attributes.has_key?(:'lineItems')
90
- if (value = attributes[:'lineItems']).is_a?(Array)
91
- self.line_items = value
92
- end
93
- end
94
-
95
- if attributes.has_key?(:'billTo')
96
- self.bill_to = attributes[:'billTo']
97
- end
98
- end
99
-
100
- # Show invalid properties with the reasons. Usually used together with valid?
101
- # @return Array for valid properties with the reasons
102
- def list_invalid_properties
103
- invalid_properties = Array.new
104
- if !@pre_order_date.nil? && @pre_order_date.to_s.length > 10
105
- invalid_properties.push('invalid value for "pre_order_date", the character length must be smaller than or equal to 10.')
106
- end
107
-
108
- invalid_properties
109
- end
110
-
111
- # Check to see if the all the properties in the model are valid
112
- # @return true if the model is valid
113
- def valid?
114
- return false if !@pre_order_date.nil? && @pre_order_date.to_s.length > 10
115
- true
116
- end
117
-
118
- # Custom attribute writer method with validation
119
- # @param [Object] pre_order_date Value to be assigned
120
- def pre_order_date=(pre_order_date)
121
- if !pre_order_date.nil? && pre_order_date.to_s.length > 10
122
- fail ArgumentError, 'invalid value for "pre_order_date", the character length must be smaller than or equal to 10.'
123
- end
124
-
125
- @pre_order_date = pre_order_date
126
- end
127
-
128
- # Checks equality by comparing each attribute.
129
- # @param [Object] Object to be compared
130
- def ==(o)
131
- return true if self.equal?(o)
132
- self.class == o.class &&
133
- amount_details == o.amount_details &&
134
- pre_order == o.pre_order &&
135
- pre_order_date == o.pre_order_date &&
136
- reordered == o.reordered &&
137
- ship_to == o.ship_to &&
138
- line_items == o.line_items &&
139
- bill_to == o.bill_to
140
- end
141
-
142
- # @see the `==` method
143
- # @param [Object] Object to be compared
144
- def eql?(o)
145
- self == o
146
- end
147
-
148
- # Calculates hash code according to all attributes.
149
- # @return [Fixnum] Hash code
150
- def hash
151
- [amount_details, pre_order, pre_order_date, reordered, ship_to, line_items, bill_to].hash
152
- end
153
-
154
- # Builds the object from hash
155
- # @param [Hash] attributes Model attributes in the form of hash
156
- # @return [Object] Returns the model itself
157
- def build_from_hash(attributes)
158
- return nil unless attributes.is_a?(Hash)
159
- self.class.swagger_types.each_pair do |key, type|
160
- if type =~ /\AArray<(.*)>/i
161
- # check to ensure the input is an array given that the the attribute
162
- # is documented as an array but the input is not
163
- if attributes[self.class.attribute_map[key]].is_a?(Array)
164
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
- end
166
- elsif !attributes[self.class.attribute_map[key]].nil?
167
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
- end # or else data not found in attributes(hash), not an issue as the data can be optional
169
- end
170
-
171
- self
172
- end
173
-
174
- # Deserializes the data based on type
175
- # @param string type Data type
176
- # @param string value Value to be deserialized
177
- # @return [Object] Deserialized data
178
- def _deserialize(type, value)
179
- case type.to_sym
180
- when :DateTime
181
- DateTime.parse(value)
182
- when :Date
183
- Date.parse(value)
184
- when :String
185
- value.to_s
186
- when :Integer
187
- value.to_i
188
- when :Float
189
- value.to_f
190
- when :BOOLEAN
191
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
- true
193
- else
194
- false
195
- end
196
- when :Object
197
- # generic object (usually a Hash), return directly
198
- value
199
- when /\AArray<(?<inner_type>.+)>\z/
200
- inner_type = Regexp.last_match[:inner_type]
201
- value.map { |v| _deserialize(inner_type, v) }
202
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
- k_type = Regexp.last_match[:k_type]
204
- v_type = Regexp.last_match[:v_type]
205
- {}.tap do |hash|
206
- value.each do |k, v|
207
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
- end
209
- end
210
- else # model
211
- temp_model = CyberSource.const_get(type).new
212
- temp_model.build_from_hash(value)
213
- end
214
- end
215
-
216
- # Returns the string representation of the object
217
- # @return [String] String presentation of the object
218
- def to_s
219
- to_hash.to_s
220
- end
221
-
222
- # to_body is an alias to to_hash (backward compatibility)
223
- # @return [Hash] Returns the object in the form of hash
224
- def to_body
225
- to_hash
226
- end
227
-
228
- # Returns the object in the form of hash
229
- # @return [Hash] Returns the object in the form of hash
230
- def to_hash
231
- hash = {}
232
- self.class.attribute_map.each_pair do |attr, param|
233
- value = self.send(attr)
234
- next if value.nil?
235
- hash[param] = _to_hash(value)
236
- end
237
- hash
238
- end
239
-
240
- # Outputs non-array value in the form of hash
241
- # For object, use to_hash. Otherwise, just return the value
242
- # @param [Object] value Any valid value
243
- # @return [Hash] Returns the value in the form of hash
244
- def _to_hash(value)
245
- if value.is_a?(Array)
246
- value.compact.map { |v| _to_hash(v) }
247
- elsif value.is_a?(Hash)
248
- {}.tap do |hash|
249
- value.each { |k, v| hash[k] = _to_hash(v) }
250
- end
251
- elsif value.respond_to? :to_hash
252
- value.to_hash
253
- else
254
- value
255
- end
256
- end
257
- end
258
- end
@@ -1,496 +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 Riskv1authenticationsOrderInformationBillTo
17
- # First line of the billing street address as it appears on the credit card issuer’s records. #### Atos This field must not contain colons (:). #### CyberSource through VisaNet **Important** When you populate billing street address 1 and billing street address 2, CyberSource through VisaNet concatenates the two values. If the concatenated value exceeds 40 characters, CyberSource through VisaNet truncates the value at 40 characters before sending it to Visa and the issuing bank. Truncating this value affects AVS results and therefore might also affect risk decisions and chargebacks. Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. #### For Payouts: This field may be sent only for FDC Compass. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `bill_address1` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
18
- attr_accessor :address1
19
-
20
- # Additional address information. For Payouts: This field may be sent only for FDC Compass. #### Atos This field must not contain colons (:). #### Chase Paymentech Solutions, FDC Compass, and TSYS Acquiring Solutions This value is used for AVS. #### CyberSource through VisaNet **Important** When you populate billing street address 1 and billing street address 2, CyberSource through VisaNet concatenates the two values. If the concatenated value exceeds 40 characters, CyberSource through VisaNet truncates the value at 40 characters before sending it to Visa and the issuing bank. Truncating this value affects AVS results and therefore might also affect risk decisions and chargebacks. Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. For processor-specific information, see the `bill_address2` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
21
- attr_accessor :address2
22
-
23
- # State or province of the billing address. Use the State, Province, and Territory Codes for the United States and Canada. For Payouts: This field may be sent only for FDC Compass. ##### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `bill_state` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
24
- attr_accessor :administrative_area
25
-
26
- # Payment card billing country. Use the two-character ISO Standard Country Codes. #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `bill_country` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
27
- attr_accessor :country
28
-
29
- # Payment card billing city. #### Atos This field must not contain colons (:). #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. #### For Payouts: This field may be sent only for FDC Compass. For processor-specific information, see the `bill_city` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
30
- attr_accessor :locality
31
-
32
- # Customer’s first name. This name must be the same as the name on the card. #### CyberSource Latin American Processing **Important** For an authorization request, CyberSource Latin American Processing concatenates `orderInformation.billTo.firstName` and `orderInformation.billTo.lastName`. If the concatenated value exceeds 30 characters, CyberSource Latin American Processing declines the authorization request.\\ **Note** CyberSource Latin American Processing is the name of a specific processing connection that CyberSource supports. In the CyberSource API documentation, CyberSource Latin American Processing does not refer to the general topic of processing in Latin America. The information in this field description is for the specific processing connection called _CyberSource Latin American Processing_. It is not for any other Latin American processors that CyberSource supports. #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. #### For Payouts: This field may be sent only for FDC Compass. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `customer_firstname` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
33
- attr_accessor :first_name
34
-
35
- # Customer’s last name. This name must be the same as the name on the card. #### CyberSource Latin American Processing **Important** For an authorization request, CyberSource Latin American Processing concatenates `orderInformation.billTo.firstName` and `orderInformation.billTo.lastName`. If the concatenated value exceeds 30 characters, CyberSource Latin American Processing declines the authorization request.\\ **Note** CyberSource Latin American Processing is the name of a specific processing connection that CyberSource supports. In the CyberSource API documentation, CyberSource Latin American Processing does not refer to the general topic of processing in Latin America. The information in this field description is for the specific processing connection called CyberSource Latin American Processing. It is not for any other Latin American processors that CyberSource supports. #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. #### For Payouts: This field may be sent only for FDC Compass. For processor-specific information, see the `customer_lastname` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
36
- attr_accessor :last_name
37
-
38
- # Customer’s phone number. #### For Payouts: This field may be sent only for FDC Compass. CyberSource recommends that you include the country code when the order is from outside the U.S. For processor-specific information, see the customer_phone field in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html) #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks.
39
- attr_accessor :phone_number
40
-
41
- # Customer's email address, including the full domain name. **CyberSource through VisaNet** Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `customer_email` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
42
- attr_accessor :email
43
-
44
- # Postal code for the billing 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` **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. #### For Payouts: This field may be sent only for FDC Compass. #### 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. #### Atos This field must not contain colons (:). #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. For processor-specific information, see the `bill_zip` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
45
- attr_accessor :postal_code
46
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'address1' => :'address1',
51
- :'address2' => :'address2',
52
- :'administrative_area' => :'administrativeArea',
53
- :'country' => :'country',
54
- :'locality' => :'locality',
55
- :'first_name' => :'firstName',
56
- :'last_name' => :'lastName',
57
- :'phone_number' => :'phoneNumber',
58
- :'email' => :'email',
59
- :'postal_code' => :'postalCode'
60
- }
61
- end
62
-
63
- # Attribute type mapping.
64
- def self.swagger_types
65
- {
66
- :'address1' => :'String',
67
- :'address2' => :'String',
68
- :'administrative_area' => :'String',
69
- :'country' => :'String',
70
- :'locality' => :'String',
71
- :'first_name' => :'String',
72
- :'last_name' => :'String',
73
- :'phone_number' => :'String',
74
- :'email' => :'String',
75
- :'postal_code' => :'String'
76
- }
77
- end
78
-
79
- # Initializes the object
80
- # @param [Hash] attributes Model attributes in the form of hash
81
- def initialize(attributes = {})
82
- return unless attributes.is_a?(Hash)
83
-
84
- # convert string to symbol for hash key
85
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
86
-
87
- if attributes.has_key?(:'address1')
88
- self.address1 = attributes[:'address1']
89
- end
90
-
91
- if attributes.has_key?(:'address2')
92
- self.address2 = attributes[:'address2']
93
- end
94
-
95
- if attributes.has_key?(:'administrativeArea')
96
- self.administrative_area = attributes[:'administrativeArea']
97
- end
98
-
99
- if attributes.has_key?(:'country')
100
- self.country = attributes[:'country']
101
- end
102
-
103
- if attributes.has_key?(:'locality')
104
- self.locality = attributes[:'locality']
105
- end
106
-
107
- if attributes.has_key?(:'firstName')
108
- self.first_name = attributes[:'firstName']
109
- end
110
-
111
- if attributes.has_key?(:'lastName')
112
- self.last_name = attributes[:'lastName']
113
- end
114
-
115
- if attributes.has_key?(:'phoneNumber')
116
- self.phone_number = attributes[:'phoneNumber']
117
- end
118
-
119
- if attributes.has_key?(:'email')
120
- self.email = attributes[:'email']
121
- end
122
-
123
- if attributes.has_key?(:'postalCode')
124
- self.postal_code = attributes[:'postalCode']
125
- end
126
- end
127
-
128
- # Show invalid properties with the reasons. Usually used together with valid?
129
- # @return Array for valid properties with the reasons
130
- def list_invalid_properties
131
- invalid_properties = Array.new
132
- if @address1.nil?
133
- invalid_properties.push('invalid value for "address1", address1 cannot be nil.')
134
- end
135
-
136
- if @address1.to_s.length > 60
137
- invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 60.')
138
- end
139
-
140
- if !@address2.nil? && @address2.to_s.length > 60
141
- invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 60.')
142
- end
143
-
144
- if @administrative_area.nil?
145
- invalid_properties.push('invalid value for "administrative_area", administrative_area cannot be nil.')
146
- end
147
-
148
- if @administrative_area.to_s.length > 2
149
- invalid_properties.push('invalid value for "administrative_area", the character length must be smaller than or equal to 2.')
150
- end
151
-
152
- if @country.nil?
153
- invalid_properties.push('invalid value for "country", country cannot be nil.')
154
- end
155
-
156
- if @country.to_s.length > 2
157
- invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 2.')
158
- end
159
-
160
- if @locality.nil?
161
- invalid_properties.push('invalid value for "locality", locality cannot be nil.')
162
- end
163
-
164
- if @locality.to_s.length > 50
165
- invalid_properties.push('invalid value for "locality", the character length must be smaller than or equal to 50.')
166
- end
167
-
168
- if @first_name.nil?
169
- invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
170
- end
171
-
172
- if @first_name.to_s.length > 60
173
- invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 60.')
174
- end
175
-
176
- if @last_name.nil?
177
- invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
178
- end
179
-
180
- if @last_name.to_s.length > 60
181
- invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 60.')
182
- end
183
-
184
- if !@phone_number.nil? && @phone_number.to_s.length > 15
185
- invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 15.')
186
- end
187
-
188
- if @email.nil?
189
- invalid_properties.push('invalid value for "email", email cannot be nil.')
190
- end
191
-
192
- if @email.to_s.length > 255
193
- invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 255.')
194
- end
195
-
196
- if @postal_code.nil?
197
- invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.')
198
- end
199
-
200
- if @postal_code.to_s.length > 10
201
- invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 10.')
202
- end
203
-
204
- invalid_properties
205
- end
206
-
207
- # Check to see if the all the properties in the model are valid
208
- # @return true if the model is valid
209
- def valid?
210
- return false if @address1.nil?
211
- return false if @address1.to_s.length > 60
212
- return false if !@address2.nil? && @address2.to_s.length > 60
213
- return false if @administrative_area.nil?
214
- return false if @administrative_area.to_s.length > 2
215
- return false if @country.nil?
216
- return false if @country.to_s.length > 2
217
- return false if @locality.nil?
218
- return false if @locality.to_s.length > 50
219
- return false if @first_name.nil?
220
- return false if @first_name.to_s.length > 60
221
- return false if @last_name.nil?
222
- return false if @last_name.to_s.length > 60
223
- return false if !@phone_number.nil? && @phone_number.to_s.length > 15
224
- return false if @email.nil?
225
- return false if @email.to_s.length > 255
226
- return false if @postal_code.nil?
227
- return false if @postal_code.to_s.length > 10
228
- true
229
- end
230
-
231
- # Custom attribute writer method with validation
232
- # @param [Object] address1 Value to be assigned
233
- def address1=(address1)
234
- if address1.nil?
235
- fail ArgumentError, 'address1 cannot be nil'
236
- end
237
-
238
- if address1.to_s.length > 60
239
- fail ArgumentError, 'invalid value for "address1", the character length must be smaller than or equal to 60.'
240
- end
241
-
242
- @address1 = address1
243
- end
244
-
245
- # Custom attribute writer method with validation
246
- # @param [Object] address2 Value to be assigned
247
- def address2=(address2)
248
- if !address2.nil? && address2.to_s.length > 60
249
- fail ArgumentError, 'invalid value for "address2", the character length must be smaller than or equal to 60.'
250
- end
251
-
252
- @address2 = address2
253
- end
254
-
255
- # Custom attribute writer method with validation
256
- # @param [Object] administrative_area Value to be assigned
257
- def administrative_area=(administrative_area)
258
- if administrative_area.nil?
259
- fail ArgumentError, 'administrative_area cannot be nil'
260
- end
261
-
262
- if administrative_area.to_s.length > 2
263
- fail ArgumentError, 'invalid value for "administrative_area", the character length must be smaller than or equal to 2.'
264
- end
265
-
266
- @administrative_area = administrative_area
267
- end
268
-
269
- # Custom attribute writer method with validation
270
- # @param [Object] country Value to be assigned
271
- def country=(country)
272
- if country.nil?
273
- fail ArgumentError, 'country cannot be nil'
274
- end
275
-
276
- if country.to_s.length > 2
277
- fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 2.'
278
- end
279
-
280
- @country = country
281
- end
282
-
283
- # Custom attribute writer method with validation
284
- # @param [Object] locality Value to be assigned
285
- def locality=(locality)
286
- if locality.nil?
287
- fail ArgumentError, 'locality cannot be nil'
288
- end
289
-
290
- if locality.to_s.length > 50
291
- fail ArgumentError, 'invalid value for "locality", the character length must be smaller than or equal to 50.'
292
- end
293
-
294
- @locality = locality
295
- end
296
-
297
- # Custom attribute writer method with validation
298
- # @param [Object] first_name Value to be assigned
299
- def first_name=(first_name)
300
- if first_name.nil?
301
- fail ArgumentError, 'first_name cannot be nil'
302
- end
303
-
304
- if first_name.to_s.length > 60
305
- fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 60.'
306
- end
307
-
308
- @first_name = first_name
309
- end
310
-
311
- # Custom attribute writer method with validation
312
- # @param [Object] last_name Value to be assigned
313
- def last_name=(last_name)
314
- if last_name.nil?
315
- fail ArgumentError, 'last_name cannot be nil'
316
- end
317
-
318
- if last_name.to_s.length > 60
319
- fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 60.'
320
- end
321
-
322
- @last_name = last_name
323
- end
324
-
325
- # Custom attribute writer method with validation
326
- # @param [Object] phone_number Value to be assigned
327
- def phone_number=(phone_number)
328
- if !phone_number.nil? && phone_number.to_s.length > 15
329
- fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 15.'
330
- end
331
-
332
- @phone_number = phone_number
333
- end
334
-
335
- # Custom attribute writer method with validation
336
- # @param [Object] email Value to be assigned
337
- def email=(email)
338
- if email.nil?
339
- fail ArgumentError, 'email cannot be nil'
340
- end
341
-
342
- if email.to_s.length > 255
343
- fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 255.'
344
- end
345
-
346
- @email = email
347
- end
348
-
349
- # Custom attribute writer method with validation
350
- # @param [Object] postal_code Value to be assigned
351
- def postal_code=(postal_code)
352
- if postal_code.nil?
353
- fail ArgumentError, 'postal_code cannot be nil'
354
- end
355
-
356
- if postal_code.to_s.length > 10
357
- fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 10.'
358
- end
359
-
360
- @postal_code = postal_code
361
- end
362
-
363
- # Checks equality by comparing each attribute.
364
- # @param [Object] Object to be compared
365
- def ==(o)
366
- return true if self.equal?(o)
367
- self.class == o.class &&
368
- address1 == o.address1 &&
369
- address2 == o.address2 &&
370
- administrative_area == o.administrative_area &&
371
- country == o.country &&
372
- locality == o.locality &&
373
- first_name == o.first_name &&
374
- last_name == o.last_name &&
375
- phone_number == o.phone_number &&
376
- email == o.email &&
377
- postal_code == o.postal_code
378
- end
379
-
380
- # @see the `==` method
381
- # @param [Object] Object to be compared
382
- def eql?(o)
383
- self == o
384
- end
385
-
386
- # Calculates hash code according to all attributes.
387
- # @return [Fixnum] Hash code
388
- def hash
389
- [address1, address2, administrative_area, country, locality, first_name, last_name, phone_number, email, postal_code].hash
390
- end
391
-
392
- # Builds the object from hash
393
- # @param [Hash] attributes Model attributes in the form of hash
394
- # @return [Object] Returns the model itself
395
- def build_from_hash(attributes)
396
- return nil unless attributes.is_a?(Hash)
397
- self.class.swagger_types.each_pair do |key, type|
398
- if type =~ /\AArray<(.*)>/i
399
- # check to ensure the input is an array given that the the attribute
400
- # is documented as an array but the input is not
401
- if attributes[self.class.attribute_map[key]].is_a?(Array)
402
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
403
- end
404
- elsif !attributes[self.class.attribute_map[key]].nil?
405
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
406
- end # or else data not found in attributes(hash), not an issue as the data can be optional
407
- end
408
-
409
- self
410
- end
411
-
412
- # Deserializes the data based on type
413
- # @param string type Data type
414
- # @param string value Value to be deserialized
415
- # @return [Object] Deserialized data
416
- def _deserialize(type, value)
417
- case type.to_sym
418
- when :DateTime
419
- DateTime.parse(value)
420
- when :Date
421
- Date.parse(value)
422
- when :String
423
- value.to_s
424
- when :Integer
425
- value.to_i
426
- when :Float
427
- value.to_f
428
- when :BOOLEAN
429
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
430
- true
431
- else
432
- false
433
- end
434
- when :Object
435
- # generic object (usually a Hash), return directly
436
- value
437
- when /\AArray<(?<inner_type>.+)>\z/
438
- inner_type = Regexp.last_match[:inner_type]
439
- value.map { |v| _deserialize(inner_type, v) }
440
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
441
- k_type = Regexp.last_match[:k_type]
442
- v_type = Regexp.last_match[:v_type]
443
- {}.tap do |hash|
444
- value.each do |k, v|
445
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
446
- end
447
- end
448
- else # model
449
- temp_model = CyberSource.const_get(type).new
450
- temp_model.build_from_hash(value)
451
- end
452
- end
453
-
454
- # Returns the string representation of the object
455
- # @return [String] String presentation of the object
456
- def to_s
457
- to_hash.to_s
458
- end
459
-
460
- # to_body is an alias to to_hash (backward compatibility)
461
- # @return [Hash] Returns the object in the form of hash
462
- def to_body
463
- to_hash
464
- end
465
-
466
- # Returns the object in the form of hash
467
- # @return [Hash] Returns the object in the form of hash
468
- def to_hash
469
- hash = {}
470
- self.class.attribute_map.each_pair do |attr, param|
471
- value = self.send(attr)
472
- next if value.nil?
473
- hash[param] = _to_hash(value)
474
- end
475
- hash
476
- end
477
-
478
- # Outputs non-array value in the form of hash
479
- # For object, use to_hash. Otherwise, just return the value
480
- # @param [Object] value Any valid value
481
- # @return [Hash] Returns the value in the form of hash
482
- def _to_hash(value)
483
- if value.is_a?(Array)
484
- value.compact.map { |v| _to_hash(v) }
485
- elsif value.is_a?(Hash)
486
- {}.tap do |hash|
487
- value.each { |k, v| hash[k] = _to_hash(v) }
488
- end
489
- elsif value.respond_to? :to_hash
490
- value.to_hash
491
- else
492
- value
493
- end
494
- end
495
- end
496
- end