first_data_gateway 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -2
  3. data/lib/openapi_client.rb +41 -13
  4. data/lib/openapi_client/api/authentication_api.rb +2 -2
  5. data/lib/openapi_client/api/card_info_lookup_api.rb +2 -2
  6. data/lib/openapi_client/api/card_verification_api.rb +2 -2
  7. data/lib/openapi_client/api/currency_conversion_api.rb +2 -2
  8. data/lib/openapi_client/api/fraud_detect_api.rb +214 -4
  9. data/lib/openapi_client/api/order_api.rb +4 -4
  10. data/lib/openapi_client/api/payment_api.rb +9 -9
  11. data/lib/openapi_client/api/payment_schedules_api.rb +5 -5
  12. data/lib/openapi_client/api/payment_token_api.rb +7 -6
  13. data/lib/openapi_client/api/payment_url_api.rb +233 -2
  14. data/lib/openapi_client/api_client.rb +31 -31
  15. data/lib/openapi_client/api_error.rb +1 -1
  16. data/lib/openapi_client/configuration.rb +2 -5
  17. data/lib/openapi_client/models/access_token_response.rb +1 -1
  18. data/lib/openapi_client/models/account_updater_response.rb +1 -1
  19. data/lib/openapi_client/models/additional_amount_rate.rb +1 -1
  20. data/lib/openapi_client/models/additional_details.rb +1 -1
  21. data/lib/openapi_client/models/additional_transaction_details.rb +3 -3
  22. data/lib/openapi_client/models/address.rb +1 -1
  23. data/lib/openapi_client/models/airline.rb +1 -1
  24. data/lib/openapi_client/models/airline_ancillary_service_category.rb +1 -1
  25. data/lib/openapi_client/models/airline_travel_route.rb +1 -1
  26. data/lib/openapi_client/models/ali_pay.rb +1 -1
  27. data/lib/openapi_client/models/ali_pay_payment_method.rb +1 -1
  28. data/lib/openapi_client/models/ali_pay_payment_method_all_of.rb +1 -1
  29. data/lib/openapi_client/models/ali_pay_sale_transaction.rb +1 -1
  30. data/lib/openapi_client/models/ali_pay_sale_transaction_all_of.rb +1 -1
  31. data/lib/openapi_client/models/amount.rb +1 -1
  32. data/lib/openapi_client/models/amount_components.rb +1 -1
  33. data/lib/openapi_client/models/authentication.rb +1 -1
  34. data/lib/openapi_client/models/authentication_redirect.rb +1 -1
  35. data/lib/openapi_client/models/authentication_redirect_params.rb +1 -1
  36. data/lib/openapi_client/models/authentication_verification_request.rb +1 -1
  37. data/lib/openapi_client/models/avs_response.rb +1 -1
  38. data/lib/openapi_client/models/basic_response.rb +1 -1
  39. data/lib/openapi_client/models/billing.rb +1 -1
  40. data/lib/openapi_client/models/billing_address.rb +2 -2
  41. data/lib/openapi_client/models/car_rental.rb +1 -1
  42. data/lib/openapi_client/models/car_rental_extra_charges.rb +1 -1
  43. data/lib/openapi_client/models/card.rb +1 -1
  44. data/lib/openapi_client/models/card_function.rb +1 -1
  45. data/lib/openapi_client/models/card_info.rb +1 -1
  46. data/lib/openapi_client/models/card_info_lookup_request.rb +1 -1
  47. data/lib/openapi_client/models/card_info_lookup_response.rb +1 -1
  48. data/lib/openapi_client/models/card_verification_request.rb +1 -1
  49. data/lib/openapi_client/models/china_domestic.rb +1 -1
  50. data/lib/openapi_client/models/china_domestic_payment_method.rb +1 -1
  51. data/lib/openapi_client/models/china_domestic_payment_method_all_of.rb +1 -1
  52. data/lib/openapi_client/models/china_pn_r_sale_transaction.rb +1 -1
  53. data/lib/openapi_client/models/china_pn_r_sale_transaction_all_of.rb +1 -1
  54. data/lib/openapi_client/models/client_locale.rb +1 -1
  55. data/lib/openapi_client/models/client_registration.rb +281 -0
  56. data/lib/openapi_client/models/contact.rb +1 -1
  57. data/lib/openapi_client/models/create_payment_token.rb +1 -1
  58. data/lib/openapi_client/models/currency_conversion.rb +1 -1
  59. data/lib/openapi_client/models/customer.rb +1 -1
  60. data/lib/openapi_client/models/customer_address.rb +21 -14
  61. data/lib/openapi_client/models/dcc.rb +1 -1
  62. data/lib/openapi_client/models/dcc_all_of.rb +1 -1
  63. data/lib/openapi_client/models/dcc_exchange_rate_request.rb +1 -1
  64. data/lib/openapi_client/models/dcc_exchange_rate_request_all_of.rb +1 -1
  65. data/lib/openapi_client/models/device.rb +2 -2
  66. data/lib/openapi_client/models/disbursement.rb +1 -1
  67. data/lib/openapi_client/models/disbursement_transaction_type.rb +1 -1
  68. data/lib/openapi_client/models/document.rb +1 -1
  69. data/lib/openapi_client/models/dynamic_pricing.rb +13 -4
  70. data/lib/openapi_client/models/dynamic_pricing_all_of.rb +13 -4
  71. data/lib/openapi_client/models/dynamic_pricing_exchange_rate_request.rb +1 -1
  72. data/lib/openapi_client/models/dynamic_pricing_exchange_rate_request_all_of.rb +1 -1
  73. data/lib/openapi_client/models/encrypted_apple_pay.rb +1 -1
  74. data/lib/openapi_client/models/encrypted_apple_pay_header.rb +1 -1
  75. data/lib/openapi_client/models/encrypted_apple_pay_wallet_payment_method.rb +1 -1
  76. data/lib/openapi_client/models/encrypted_apple_pay_wallet_payment_method_all_of.rb +1 -1
  77. data/lib/openapi_client/models/encrypted_google_pay.rb +1 -1
  78. data/lib/openapi_client/models/encrypted_google_pay_data.rb +1 -1
  79. data/lib/openapi_client/models/encrypted_google_pay_wallet_payment_method.rb +1 -1
  80. data/lib/openapi_client/models/encrypted_google_pay_wallet_payment_method_all_of.rb +1 -1
  81. data/lib/openapi_client/models/encrypted_samsung_pay.rb +251 -0
  82. data/lib/openapi_client/models/encrypted_samsung_pay_wallet_payment_method.rb +225 -0
  83. data/lib/openapi_client/models/encrypted_samsung_pay_wallet_payment_method_all_of.rb +201 -0
  84. data/lib/openapi_client/models/error.rb +1 -1
  85. data/lib/openapi_client/models/error_details.rb +1 -1
  86. data/lib/openapi_client/models/error_message.rb +208 -0
  87. data/lib/openapi_client/models/error_response.rb +1 -1
  88. data/lib/openapi_client/models/exchange_rate_request.rb +1 -1
  89. data/lib/openapi_client/models/exchange_rate_response.rb +1 -1
  90. data/lib/openapi_client/models/expiration.rb +1 -1
  91. data/lib/openapi_client/models/{merchant_location_merchant_address.rb → fraud_address.rb} +9 -9
  92. data/lib/openapi_client/models/fraud_order.rb +2 -2
  93. data/lib/openapi_client/models/fraud_order_items.rb +1 -1
  94. data/lib/openapi_client/models/fraud_registration.rb +259 -0
  95. data/lib/openapi_client/models/fraud_registration_card.rb +248 -0
  96. data/lib/openapi_client/models/fraud_registration_device.rb +375 -0
  97. data/lib/openapi_client/models/fraud_registration_device_items.rb +287 -0
  98. data/lib/openapi_client/models/{billing_address_phone.rb → fraud_registration_error.rb} +14 -23
  99. data/lib/openapi_client/models/fraud_registration_response.rb +279 -0
  100. data/lib/openapi_client/models/fraud_score.rb +232 -0
  101. data/lib/openapi_client/models/frequency.rb +1 -1
  102. data/lib/openapi_client/models/funding_transaction_type.rb +1 -1
  103. data/lib/openapi_client/models/industry_specific_extensions.rb +1 -1
  104. data/lib/openapi_client/models/installment_options.rb +1 -1
  105. data/lib/openapi_client/models/{payment_issuer_response.rb → issuer_response.rb} +4 -4
  106. data/lib/openapi_client/models/{device_networks.rb → items.rb} +4 -4
  107. data/lib/openapi_client/models/{merchant_location.rb → location.rb} +5 -5
  108. data/lib/openapi_client/models/lodging.rb +1 -1
  109. data/lib/openapi_client/models/lodging_extra_charges.rb +1 -1
  110. data/lib/openapi_client/models/loyalty.rb +1 -1
  111. data/lib/openapi_client/models/merchant.rb +2 -2
  112. data/lib/openapi_client/models/{payment_pay_method.rb → method.rb} +4 -4
  113. data/lib/openapi_client/models/order.rb +1 -1
  114. data/lib/openapi_client/models/order_error_response.rb +9 -28
  115. data/lib/openapi_client/models/order_response.rb +9 -28
  116. data/lib/openapi_client/models/pay_pal.rb +1 -1
  117. data/lib/openapi_client/models/pay_pal_payment_method.rb +1 -1
  118. data/lib/openapi_client/models/pay_pal_payment_method_all_of.rb +1 -1
  119. data/lib/openapi_client/models/payment.rb +10 -10
  120. data/lib/openapi_client/models/payment_card.rb +1 -1
  121. data/lib/openapi_client/models/payment_card_credit_transaction.rb +1 -1
  122. data/lib/openapi_client/models/payment_card_disbursement_transaction.rb +1 -1
  123. data/lib/openapi_client/models/payment_card_disbursement_transaction_all_of.rb +1 -1
  124. data/lib/openapi_client/models/payment_card_forced_ticket_transaction.rb +1 -1
  125. data/lib/openapi_client/models/payment_card_forced_ticket_transaction_all_of.rb +1 -1
  126. data/lib/openapi_client/models/payment_card_payer_auth_transaction.rb +1 -1
  127. data/lib/openapi_client/models/payment_card_payer_auth_transaction_all_of.rb +1 -1
  128. data/lib/openapi_client/models/payment_card_payment_method.rb +1 -1
  129. data/lib/openapi_client/models/payment_card_payment_method_all_of.rb +1 -1
  130. data/lib/openapi_client/models/payment_card_payment_tokenization_request.rb +1 -1
  131. data/lib/openapi_client/models/payment_card_payment_tokenization_request_all_of.rb +1 -1
  132. data/lib/openapi_client/models/payment_card_pre_auth_transaction.rb +1 -1
  133. data/lib/openapi_client/models/payment_card_pre_auth_transaction_all_of.rb +1 -1
  134. data/lib/openapi_client/models/payment_card_sale_transaction.rb +1 -1
  135. data/lib/openapi_client/models/payment_card_sale_transaction_all_of.rb +1 -1
  136. data/lib/openapi_client/models/payment_device.rb +336 -0
  137. data/lib/openapi_client/models/payment_device_credit_transaction.rb +307 -0
  138. data/lib/openapi_client/models/payment_device_credit_transaction_all_of.rb +201 -0
  139. data/lib/openapi_client/models/payment_device_disbursement_transaction.rb +321 -0
  140. data/lib/openapi_client/models/payment_device_disbursement_transaction_all_of.rb +215 -0
  141. data/lib/openapi_client/models/payment_device_payment_method.rb +219 -0
  142. data/lib/openapi_client/models/payment_device_payment_method_all_of.rb +210 -0
  143. data/lib/openapi_client/models/payment_device_payment_tokenization_request.rb +285 -0
  144. data/lib/openapi_client/models/payment_device_payment_tokenization_request_all_of.rb +201 -0
  145. data/lib/openapi_client/models/payment_device_pre_auth_transaction.rb +346 -0
  146. data/lib/openapi_client/models/payment_device_pre_auth_transaction_all_of.rb +240 -0
  147. data/lib/openapi_client/models/payment_device_sale_transaction.rb +325 -0
  148. data/lib/openapi_client/models/payment_device_sale_transaction_all_of.rb +219 -0
  149. data/lib/openapi_client/models/payment_facilitator.rb +1 -1
  150. data/lib/openapi_client/models/payment_method_details.rb +1 -1
  151. data/lib/openapi_client/models/payment_method_payment_schedules_request.rb +1 -1
  152. data/lib/openapi_client/models/payment_method_payment_schedules_request_all_of.rb +1 -1
  153. data/lib/openapi_client/models/payment_method_type.rb +2 -1
  154. data/lib/openapi_client/models/payment_registration.rb +331 -0
  155. data/lib/openapi_client/models/payment_schedules_error_response.rb +1 -1
  156. data/lib/openapi_client/models/payment_schedules_request.rb +1 -1
  157. data/lib/openapi_client/models/payment_schedules_response.rb +1 -1
  158. data/lib/openapi_client/models/payment_token_credit_transaction.rb +1 -1
  159. data/lib/openapi_client/models/payment_token_credit_transaction_all_of.rb +1 -1
  160. data/lib/openapi_client/models/payment_token_details.rb +1 -1
  161. data/lib/openapi_client/models/payment_token_details_all_of.rb +1 -1
  162. data/lib/openapi_client/models/payment_token_disbursement_transaction.rb +1 -1
  163. data/lib/openapi_client/models/payment_token_disbursement_transaction_all_of.rb +1 -1
  164. data/lib/openapi_client/models/payment_token_payment_method.rb +1 -1
  165. data/lib/openapi_client/models/payment_token_payment_method_all_of.rb +1 -1
  166. data/lib/openapi_client/models/payment_token_pre_auth_transaction.rb +1 -1
  167. data/lib/openapi_client/models/payment_token_pre_auth_transaction_all_of.rb +1 -1
  168. data/lib/openapi_client/models/payment_token_sale_transaction.rb +1 -1
  169. data/lib/openapi_client/models/payment_token_sale_transaction_all_of.rb +1 -1
  170. data/lib/openapi_client/models/payment_tokenization_error_response.rb +1 -1
  171. data/lib/openapi_client/models/payment_tokenization_request.rb +1 -1
  172. data/lib/openapi_client/models/payment_tokenization_response.rb +1 -1
  173. data/lib/openapi_client/models/payment_url_detail.rb +252 -0
  174. data/lib/openapi_client/models/payment_url_detail_response.rb +236 -0
  175. data/lib/openapi_client/models/payment_url_error_response.rb +1 -1
  176. data/lib/openapi_client/models/payment_url_request.rb +1 -1
  177. data/lib/openapi_client/models/payment_url_response.rb +1 -1
  178. data/lib/openapi_client/models/payment_url_status.rb +38 -0
  179. data/lib/openapi_client/models/paypal_credit_transaction.rb +1 -1
  180. data/lib/openapi_client/models/paypal_credit_transaction_all_of.rb +1 -1
  181. data/lib/openapi_client/models/{customer_address_phone.rb → phone.rb} +4 -4
  182. data/lib/openapi_client/models/post_auth_transaction.rb +1 -1
  183. data/lib/openapi_client/models/post_auth_transaction_all_of.rb +1 -1
  184. data/lib/openapi_client/models/primary_transaction.rb +1 -1
  185. data/lib/openapi_client/models/processor_data.rb +1 -1
  186. data/lib/openapi_client/models/purchase_cards.rb +1 -1
  187. data/lib/openapi_client/models/purchase_cards_level2.rb +1 -1
  188. data/lib/openapi_client/models/purchase_cards_level3.rb +2 -2
  189. data/lib/openapi_client/models/purchase_cards_level3_line_items.rb +1 -1
  190. data/lib/openapi_client/models/receiver_info.rb +1 -1
  191. data/lib/openapi_client/models/recurring_payment_details.rb +1 -1
  192. data/lib/openapi_client/models/recurring_payment_details_response.rb +9 -28
  193. data/lib/openapi_client/models/referenced_order_payment_schedules_request.rb +1 -1
  194. data/lib/openapi_client/models/referenced_order_payment_schedules_request_all_of.rb +1 -1
  195. data/lib/openapi_client/models/referenced_order_payment_tokenization_request.rb +1 -1
  196. data/lib/openapi_client/models/referenced_order_payment_tokenization_request_all_of.rb +1 -1
  197. data/lib/openapi_client/models/registration_method.rb +300 -0
  198. data/lib/openapi_client/models/response_amount_components.rb +1 -1
  199. data/lib/openapi_client/models/response_amount_components_all_of.rb +1 -1
  200. data/lib/openapi_client/models/response_type.rb +1 -1
  201. data/lib/openapi_client/models/return_transaction.rb +1 -1
  202. data/lib/openapi_client/models/return_transaction_all_of.rb +1 -1
  203. data/lib/openapi_client/models/score_only_request.rb +1 -13
  204. data/lib/openapi_client/models/score_only_response.rb +1 -1
  205. data/lib/openapi_client/models/score_only_response_fraud_score.rb +1 -1
  206. data/lib/openapi_client/models/score_only_response_fraud_score_explanations.rb +1 -1
  207. data/lib/openapi_client/models/secondary_transaction.rb +1 -1
  208. data/lib/openapi_client/models/secure3_d10_authentication_result.rb +1 -1
  209. data/lib/openapi_client/models/secure3_d10_authentication_result_all_of.rb +1 -1
  210. data/lib/openapi_client/models/secure3_d21_authentication_result.rb +1 -1
  211. data/lib/openapi_client/models/secure3_d21_authentication_result_all_of.rb +1 -1
  212. data/lib/openapi_client/models/secure3d_authentication_request.rb +1 -1
  213. data/lib/openapi_client/models/secure3d_authentication_verification_request.rb +1 -1
  214. data/lib/openapi_client/models/secure3d_authentication_verification_request_all_of.rb +1 -1
  215. data/lib/openapi_client/models/secure3d_response.rb +1 -1
  216. data/lib/openapi_client/models/sender_info.rb +1 -1
  217. data/lib/openapi_client/models/sepa.rb +1 -1
  218. data/lib/openapi_client/models/sepa_mandate.rb +1 -1
  219. data/lib/openapi_client/models/sepa_payment_method.rb +1 -1
  220. data/lib/openapi_client/models/sepa_payment_method_all_of.rb +1 -1
  221. data/lib/openapi_client/models/sepa_sale_transaction.rb +1 -1
  222. data/lib/openapi_client/models/sepa_sale_transaction_all_of.rb +1 -1
  223. data/lib/openapi_client/models/{fraud_order_ship_to_address.rb → ship_to_address.rb} +4 -4
  224. data/lib/openapi_client/models/shipping.rb +1 -1
  225. data/lib/openapi_client/models/soft_descriptor.rb +1 -1
  226. data/lib/openapi_client/models/split_shipment.rb +1 -1
  227. data/lib/openapi_client/models/stored_credential.rb +1 -1
  228. data/lib/openapi_client/models/sub_merchant_data.rb +1 -1
  229. data/lib/openapi_client/models/sub_merchant_split.rb +1 -1
  230. data/lib/openapi_client/models/transaction_error_response.rb +1 -1
  231. data/lib/openapi_client/models/transaction_origin.rb +1 -1
  232. data/lib/openapi_client/models/transaction_response.rb +1 -1
  233. data/lib/openapi_client/models/transaction_type.rb +1 -1
  234. data/lib/openapi_client/models/union_pay_authentication_request.rb +1 -1
  235. data/lib/openapi_client/models/union_pay_authentication_request_all_of.rb +1 -1
  236. data/lib/openapi_client/models/union_pay_authentication_verification_request.rb +1 -1
  237. data/lib/openapi_client/models/union_pay_authentication_verification_request_all_of.rb +1 -1
  238. data/lib/openapi_client/models/use_payment_token.rb +27 -2
  239. data/lib/openapi_client/models/{payment_verification3ds.rb → verification3ds.rb} +4 -4
  240. data/lib/openapi_client/models/{payment_verification_avs.rb → verification_avs.rb} +4 -4
  241. data/lib/openapi_client/models/{payment_verification_cvv.rb → verification_cvv.rb} +4 -4
  242. data/lib/openapi_client/models/void_transaction.rb +1 -1
  243. data/lib/openapi_client/models/wallet_payment_method.rb +2 -2
  244. data/lib/openapi_client/models/wallet_pre_auth_transaction.rb +1 -1
  245. data/lib/openapi_client/models/wallet_pre_auth_transaction_all_of.rb +1 -1
  246. data/lib/openapi_client/models/wallet_sale_transaction.rb +1 -1
  247. data/lib/openapi_client/models/wallet_sale_transaction_all_of.rb +1 -1
  248. data/lib/openapi_client/version.rb +2 -2
  249. data/lib/simple/gateway.rb +73 -0
  250. metadata +42 -17
  251. data/lib/openapi_client/.DS_Store +0 -0
  252. data/lib/openapi_client/api/.DS_Store +0 -0
  253. data/lib/openapi_client/models/.DS_Store +0 -0
  254. data/lib/openapi_client/models/transaction.rb +0 -350
@@ -0,0 +1,321 @@
1
+ =begin
2
+ #Payment Gateway API Specification.
3
+
4
+ #The documentation here is designed to provide all of the technical guidance required to consume and integrate with our APIs for payment processing. To learn more about our APIs please visit https://docs.firstdata.com/org/gateway.
5
+
6
+ The version of the OpenAPI document: 6.8.0.20190731.002
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OpenapiClient
16
+ # Request to create disbursement transaction using decrypted card details from payment device. The transaction origin will be fixed as PHONE when data is manually entered into the device and as RETAIL when data is entered into the device via swipe.
17
+ class PaymentDeviceDisbursementTransaction
18
+ # Object name of the primary transaction request.
19
+ attr_accessor :request_type
20
+
21
+ attr_accessor :transaction_amount
22
+
23
+ # An optional outlet ID for clients that support multiple stores in the same app.
24
+ attr_accessor :store_id
25
+
26
+ # The unique merchant transaction ID from the request header, if supplied.
27
+ attr_accessor :merchant_transaction_id
28
+
29
+ attr_accessor :transaction_origin
30
+
31
+ attr_accessor :order
32
+
33
+ attr_accessor :payment_method
34
+
35
+ attr_accessor :disbursement
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'request_type' => :'requestType',
41
+ :'transaction_amount' => :'transactionAmount',
42
+ :'store_id' => :'storeId',
43
+ :'merchant_transaction_id' => :'merchantTransactionId',
44
+ :'transaction_origin' => :'transactionOrigin',
45
+ :'order' => :'order',
46
+ :'payment_method' => :'paymentMethod',
47
+ :'disbursement' => :'disbursement'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'request_type' => :'String',
55
+ :'transaction_amount' => :'Amount',
56
+ :'store_id' => :'String',
57
+ :'merchant_transaction_id' => :'String',
58
+ :'transaction_origin' => :'TransactionOrigin',
59
+ :'order' => :'Order',
60
+ :'payment_method' => :'PaymentDevicePaymentMethod',
61
+ :'disbursement' => :'Disbursement'
62
+ }
63
+ end
64
+
65
+ # List of class defined in allOf (OpenAPI v3)
66
+ def self.openapi_all_of
67
+ [
68
+ :'PaymentDeviceDisbursementTransactionAllOf',
69
+ :'PrimaryTransaction'
70
+ ]
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::PaymentDeviceDisbursementTransaction` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::PaymentDeviceDisbursementTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'request_type')
89
+ self.request_type = attributes[:'request_type']
90
+ end
91
+
92
+ if attributes.key?(:'transaction_amount')
93
+ self.transaction_amount = attributes[:'transaction_amount']
94
+ end
95
+
96
+ if attributes.key?(:'store_id')
97
+ self.store_id = attributes[:'store_id']
98
+ end
99
+
100
+ if attributes.key?(:'merchant_transaction_id')
101
+ self.merchant_transaction_id = attributes[:'merchant_transaction_id']
102
+ end
103
+
104
+ if attributes.key?(:'transaction_origin')
105
+ self.transaction_origin = attributes[:'transaction_origin']
106
+ end
107
+
108
+ if attributes.key?(:'order')
109
+ self.order = attributes[:'order']
110
+ end
111
+
112
+ if attributes.key?(:'payment_method')
113
+ self.payment_method = attributes[:'payment_method']
114
+ end
115
+
116
+ if attributes.key?(:'disbursement')
117
+ self.disbursement = attributes[:'disbursement']
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ invalid_properties = Array.new
125
+ if @request_type.nil?
126
+ invalid_properties.push('invalid value for "request_type", request_type cannot be nil.')
127
+ end
128
+
129
+ if @transaction_amount.nil?
130
+ invalid_properties.push('invalid value for "transaction_amount", transaction_amount cannot be nil.')
131
+ end
132
+
133
+ if !@store_id.nil? && @store_id.to_s.length > 20
134
+ invalid_properties.push('invalid value for "store_id", the character length must be smaller than or equal to 20.')
135
+ end
136
+
137
+ if !@merchant_transaction_id.nil? && @merchant_transaction_id.to_s.length > 40
138
+ invalid_properties.push('invalid value for "merchant_transaction_id", the character length must be smaller than or equal to 40.')
139
+ end
140
+
141
+ if @payment_method.nil?
142
+ invalid_properties.push('invalid value for "payment_method", payment_method cannot be nil.')
143
+ end
144
+
145
+ if @disbursement.nil?
146
+ invalid_properties.push('invalid value for "disbursement", disbursement cannot be nil.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ return false if @request_type.nil?
156
+ return false if @transaction_amount.nil?
157
+ return false if !@store_id.nil? && @store_id.to_s.length > 20
158
+ return false if !@merchant_transaction_id.nil? && @merchant_transaction_id.to_s.length > 40
159
+ return false if @payment_method.nil?
160
+ return false if @disbursement.nil?
161
+ true
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] store_id Value to be assigned
166
+ def store_id=(store_id)
167
+ if !store_id.nil? && store_id.to_s.length > 20
168
+ fail ArgumentError, 'invalid value for "store_id", the character length must be smaller than or equal to 20.'
169
+ end
170
+
171
+ @store_id = store_id
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] merchant_transaction_id Value to be assigned
176
+ def merchant_transaction_id=(merchant_transaction_id)
177
+ if !merchant_transaction_id.nil? && merchant_transaction_id.to_s.length > 40
178
+ fail ArgumentError, 'invalid value for "merchant_transaction_id", the character length must be smaller than or equal to 40.'
179
+ end
180
+
181
+ @merchant_transaction_id = merchant_transaction_id
182
+ end
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ request_type == o.request_type &&
190
+ transaction_amount == o.transaction_amount &&
191
+ store_id == o.store_id &&
192
+ merchant_transaction_id == o.merchant_transaction_id &&
193
+ transaction_origin == o.transaction_origin &&
194
+ order == o.order &&
195
+ payment_method == o.payment_method &&
196
+ disbursement == o.disbursement
197
+ end
198
+
199
+ # @see the `==` method
200
+ # @param [Object] Object to be compared
201
+ def eql?(o)
202
+ self == o
203
+ end
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Integer] Hash code
207
+ def hash
208
+ [request_type, transaction_amount, store_id, merchant_transaction_id, transaction_origin, order, payment_method, disbursement].hash
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def self.build_from_hash(attributes)
215
+ new.build_from_hash(attributes)
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ self.class.openapi_types.each_pair do |key, type|
224
+ if type =~ /\AArray<(.*)>/i
225
+ # check to ensure the input is an array given that the attribute
226
+ # is documented as an array but the input is not
227
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
228
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
229
+ end
230
+ elsif !attributes[self.class.attribute_map[key]].nil?
231
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
232
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
233
+ end
234
+
235
+ self
236
+ end
237
+
238
+ # Deserializes the data based on type
239
+ # @param string type Data type
240
+ # @param string value Value to be deserialized
241
+ # @return [Object] Deserialized data
242
+ def _deserialize(type, value)
243
+ case type.to_sym
244
+ when :DateTime
245
+ DateTime.parse(value)
246
+ when :Date
247
+ Date.parse(value)
248
+ when :String
249
+ value.to_s
250
+ when :Integer
251
+ value.to_i
252
+ when :Float
253
+ value.to_f
254
+ when :Boolean
255
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
256
+ true
257
+ else
258
+ false
259
+ end
260
+ when :Object
261
+ # generic object (usually a Hash), return directly
262
+ value
263
+ when /\AArray<(?<inner_type>.+)>\z/
264
+ inner_type = Regexp.last_match[:inner_type]
265
+ value.map { |v| _deserialize(inner_type, v) }
266
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
267
+ k_type = Regexp.last_match[:k_type]
268
+ v_type = Regexp.last_match[:v_type]
269
+ {}.tap do |hash|
270
+ value.each do |k, v|
271
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
272
+ end
273
+ end
274
+ else # model
275
+ OpenapiClient.const_get(type).build_from_hash(value)
276
+ end
277
+ end
278
+
279
+ # Returns the string representation of the object
280
+ # @return [String] String presentation of the object
281
+ def to_s
282
+ to_hash.to_s
283
+ end
284
+
285
+ # to_body is an alias to to_hash (backward compatibility)
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_body
288
+ to_hash
289
+ end
290
+
291
+ # Returns the object in the form of hash
292
+ # @return [Hash] Returns the object in the form of hash
293
+ def to_hash
294
+ hash = {}
295
+ self.class.attribute_map.each_pair do |attr, param|
296
+ value = self.send(attr)
297
+ next if value.nil?
298
+ hash[param] = _to_hash(value)
299
+ end
300
+ hash
301
+ end
302
+
303
+ # Outputs non-array value in the form of hash
304
+ # For object, use to_hash. Otherwise, just return the value
305
+ # @param [Object] value Any valid value
306
+ # @return [Hash] Returns the value in the form of hash
307
+ def _to_hash(value)
308
+ if value.is_a?(Array)
309
+ value.compact.map { |v| _to_hash(v) }
310
+ elsif value.is_a?(Hash)
311
+ {}.tap do |hash|
312
+ value.each { |k, v| hash[k] = _to_hash(v) }
313
+ end
314
+ elsif value.respond_to? :to_hash
315
+ value.to_hash
316
+ else
317
+ value
318
+ end
319
+ end
320
+ end
321
+ end
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #Payment Gateway API Specification.
3
+
4
+ #The documentation here is designed to provide all of the technical guidance required to consume and integrate with our APIs for payment processing. To learn more about our APIs please visit https://docs.firstdata.com/org/gateway.
5
+
6
+ The version of the OpenAPI document: 6.8.0.20190731.002
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OpenapiClient
16
+ class PaymentDeviceDisbursementTransactionAllOf
17
+ attr_accessor :payment_method
18
+
19
+ attr_accessor :disbursement
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'payment_method' => :'paymentMethod',
25
+ :'disbursement' => :'disbursement'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'payment_method' => :'PaymentDevicePaymentMethod',
33
+ :'disbursement' => :'Disbursement'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::PaymentDeviceDisbursementTransactionAllOf` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::PaymentDeviceDisbursementTransactionAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'payment_method')
53
+ self.payment_method = attributes[:'payment_method']
54
+ end
55
+
56
+ if attributes.key?(:'disbursement')
57
+ self.disbursement = attributes[:'disbursement']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ if @payment_method.nil?
66
+ invalid_properties.push('invalid value for "payment_method", payment_method cannot be nil.')
67
+ end
68
+
69
+ if @disbursement.nil?
70
+ invalid_properties.push('invalid value for "disbursement", disbursement cannot be nil.')
71
+ end
72
+
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @payment_method.nil?
80
+ return false if @disbursement.nil?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ payment_method == o.payment_method &&
90
+ disbursement == o.disbursement
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Integer] Hash code
101
+ def hash
102
+ [payment_method, disbursement].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def self.build_from_hash(attributes)
109
+ new.build_from_hash(attributes)
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.openapi_types.each_pair do |key, type|
118
+ if type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ DateTime.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ OpenapiClient.const_get(type).build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end