pcp-server-ruby-sdk 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/api-definition.yaml +693 -40
  5. data/lib/PCP-server-Ruby-SDK/endpoints/pay_by_link_api_client.rb +33 -0
  6. data/lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb +37 -0
  7. data/lib/PCP-server-Ruby-SDK/models/address.rb +9 -237
  8. data/lib/PCP-server-Ruby-SDK/models/address_personal.rb +10 -246
  9. data/lib/PCP-server-Ruby-SDK/models/amount_of_money.rb +4 -195
  10. data/lib/PCP-server-Ruby-SDK/models/api_error.rb +27 -232
  11. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +6 -194
  12. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +8 -229
  13. data/lib/PCP-server-Ruby-SDK/models/authentication_token.rb +6 -183
  14. data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +11 -207
  15. data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +4 -187
  16. data/lib/PCP-server-Ruby-SDK/models/cancel_item.rb +6 -195
  17. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +6 -222
  18. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb +4 -190
  19. data/lib/PCP-server-Ruby-SDK/models/cancel_request.rb +6 -224
  20. data/lib/PCP-server-Ruby-SDK/models/cancel_response.rb +4 -190
  21. data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +9 -214
  22. data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +14 -253
  23. data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +7 -239
  24. data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +29 -184
  25. data/lib/PCP-server-Ruby-SDK/models/card_info.rb +3 -182
  26. data/lib/PCP-server-Ruby-SDK/models/card_payment_details.rb +8 -210
  27. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb +32 -307
  28. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb +6 -210
  29. data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +12 -186
  30. data/lib/PCP-server-Ruby-SDK/models/cart_item_data.rb +10 -0
  31. data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +5 -198
  32. data/lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb +5 -184
  33. data/lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb +4 -213
  34. data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +5 -200
  35. data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +5 -200
  36. data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +6 -195
  37. data/lib/PCP-server-Ruby-SDK/models/checkout_references.rb +4 -192
  38. data/lib/PCP-server-Ruby-SDK/models/checkout_response.rb +15 -319
  39. data/lib/PCP-server-Ruby-SDK/models/checkouts_response.rb +4 -193
  40. data/lib/PCP-server-Ruby-SDK/models/company_information.rb +3 -182
  41. data/lib/PCP-server-Ruby-SDK/models/complete_financing_payment_method_specific_input.rb +12 -202
  42. data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +3 -181
  43. data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +4 -191
  44. data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +7 -226
  45. data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +6 -209
  46. data/lib/PCP-server-Ruby-SDK/models/complete_payment_response.rb +5 -199
  47. data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +4 -192
  48. data/lib/PCP-server-Ruby-SDK/models/contact_details.rb +4 -191
  49. data/lib/PCP-server-Ruby-SDK/models/create_checkout_request.rb +13 -240
  50. data/lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb +16 -307
  51. data/lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb +7 -219
  52. data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_request.rb +12 -0
  53. data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_response.rb +13 -0
  54. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +11 -0
  55. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb +13 -0
  56. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb +10 -0
  57. data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +7 -218
  58. data/lib/PCP-server-Ruby-SDK/models/customer.rb +28 -260
  59. data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +10 -44
  60. data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +8 -209
  61. data/lib/PCP-server-Ruby-SDK/models/deliver_item.rb +6 -195
  62. data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +10 -246
  63. data/lib/PCP-server-Ruby-SDK/models/deliver_response.rb +4 -191
  64. data/lib/PCP-server-Ruby-SDK/models/delivery_information.rb +3 -185
  65. data/lib/PCP-server-Ruby-SDK/models/error_response.rb +4 -193
  66. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_input.rb +15 -203
  67. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +10 -196
  68. data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +12 -263
  69. data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +5 -205
  70. data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +3 -147
  71. data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +10 -174
  72. data/lib/PCP-server-Ruby-SDK/models/installment_option.rb +13 -273
  73. data/lib/PCP-server-Ruby-SDK/models/link_information.rb +4 -196
  74. data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +16 -194
  75. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -246
  76. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +7 -219
  77. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +3 -179
  78. data/lib/PCP-server-Ruby-SDK/models/model_base.rb +147 -0
  79. data/lib/PCP-server-Ruby-SDK/models/order.rb +7 -221
  80. data/lib/PCP-server-Ruby-SDK/models/order_item.rb +6 -197
  81. data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +29 -305
  82. data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +5 -326
  83. data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +5 -326
  84. data/lib/PCP-server-Ruby-SDK/models/order_request.rb +7 -244
  85. data/lib/PCP-server-Ruby-SDK/models/order_response.rb +4 -192
  86. data/lib/PCP-server-Ruby-SDK/models/patch_checkout_request.rb +8 -228
  87. data/lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb +3 -183
  88. data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +2 -165
  89. data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +3 -186
  90. data/lib/PCP-server-Ruby-SDK/models/pay_link_status_value.rb +20 -0
  91. data/lib/PCP-server-Ruby-SDK/models/payee.rb +6 -204
  92. data/lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb +3 -183
  93. data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +19 -274
  94. data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +29 -335
  95. data/lib/PCP-server-Ruby-SDK/models/payment_execution_request.rb +4 -191
  96. data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +6 -212
  97. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +7 -205
  98. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +5 -196
  99. data/lib/PCP-server-Ruby-SDK/models/payment_information_request.rb +10 -249
  100. data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +34 -314
  101. data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +8 -214
  102. data/lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb +13 -0
  103. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb +13 -0
  104. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb +12 -0
  105. data/lib/PCP-server-Ruby-SDK/models/payment_link_order.rb +10 -0
  106. data/lib/PCP-server-Ruby-SDK/models/payment_link_specific_input.rb +19 -0
  107. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb +9 -261
  108. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb +9 -0
  109. data/lib/PCP-server-Ruby-SDK/models/payment_output.rb +11 -255
  110. data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +11 -225
  111. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb +6 -197
  112. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_output.rb +3 -185
  113. data/lib/PCP-server-Ruby-SDK/models/payment_product3392_specific_input.rb +3 -185
  114. data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +7 -203
  115. data/lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb +3 -183
  116. data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb +6 -210
  117. data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account_for_intent.rb +12 -0
  118. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +6 -211
  119. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +12 -0
  120. data/lib/PCP-server-Ruby-SDK/models/payment_references.rb +6 -184
  121. data/lib/PCP-server-Ruby-SDK/models/payment_references_for_payment_intent.rb +11 -0
  122. data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +12 -197
  123. data/lib/PCP-server-Ruby-SDK/models/payment_response.rb +6 -234
  124. data/lib/PCP-server-Ruby-SDK/models/payment_status_output.rb +6 -234
  125. data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +5 -205
  126. data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -215
  127. data/lib/PCP-server-Ruby-SDK/models/personal_information.rb +11 -227
  128. data/lib/PCP-server-Ruby-SDK/models/personal_name.rb +5 -201
  129. data/lib/PCP-server-Ruby-SDK/models/positive_amount_of_money.rb +4 -196
  130. data/lib/PCP-server-Ruby-SDK/models/processing_mandate_information.rb +9 -254
  131. data/lib/PCP-server-Ruby-SDK/models/redirect_data.rb +3 -183
  132. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -249
  133. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb +12 -0
  134. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +6 -211
  135. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb +12 -0
  136. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb +10 -0
  137. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +6 -205
  138. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb +10 -0
  139. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +12 -177
  140. data/lib/PCP-server-Ruby-SDK/models/redirection_data.rb +11 -186
  141. data/lib/PCP-server-Ruby-SDK/models/references.rb +47 -205
  142. data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +3 -186
  143. data/lib/PCP-server-Ruby-SDK/models/refund_error_response.rb +4 -193
  144. data/lib/PCP-server-Ruby-SDK/models/refund_output.rb +8 -211
  145. data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +7 -242
  146. data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +6 -210
  147. data/lib/PCP-server-Ruby-SDK/models/return_information.rb +4 -194
  148. data/lib/PCP-server-Ruby-SDK/models/return_item.rb +6 -196
  149. data/lib/PCP-server-Ruby-SDK/models/return_request.rb +6 -234
  150. data/lib/PCP-server-Ruby-SDK/models/return_response.rb +4 -191
  151. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_input.rb +4 -193
  152. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_output.rb +4 -193
  153. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb +4 -192
  154. data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +3 -186
  155. data/lib/PCP-server-Ruby-SDK/models/shipping.rb +3 -183
  156. data/lib/PCP-server-Ruby-SDK/models/shipping_address.rb +14 -0
  157. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb +9 -0
  158. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb +3 -185
  159. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb +3 -185
  160. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb +3 -185
  161. data/lib/PCP-server-Ruby-SDK/models/status_output.rb +21 -264
  162. data/lib/PCP-server-Ruby-SDK/models/three_d_secure_results.rb +6 -226
  163. data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +5 -1
  164. data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
  165. data/lib/PCP-server-Ruby-SDK.rb +25 -0
  166. data/package-lock.json +2 -2
  167. data/package.json +1 -1
  168. data/scripts/convert_models_to_model_base.rb +128 -0
  169. data/spec/endpoints/pay_by_link_api_client_spec.rb +38 -0
  170. data/spec/endpoints/payment_information_api_client_spec.rb +9 -2
  171. data/spec/endpoints/payment_intent_api_client_spec.rb +45 -0
  172. data/spec/models/api_definition_conformance_spec.rb +88 -0
  173. data/spec/models/model_base_spec.rb +87 -0
  174. data/spec/models/pay_by_link_models_spec.rb +50 -0
  175. data/spec/models/payment_intent_models_spec.rb +51 -0
  176. data/spec/models/required_field_validation_spec.rb +5 -5
  177. data/spec/queries/get_checkouts_query_spec.rb +15 -0
  178. metadata +45 -10
  179. data/lib/PCP-server-Ruby-SDK/models/action_type.rb +0 -34
  180. data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +0 -52
  181. data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +0 -30
@@ -1,343 +1,37 @@
1
+ require_relative 'model_base'
1
2
 
2
- require 'date'
3
- require 'time'
4
-
5
- # Object contains information of the payment with a specific payment method.
6
3
  module PCPServerSDK
7
4
  module Models
8
- class PaymentExecution
5
+ class PaymentExecution < ModelBase
9
6
  # Unique ID of paymentExecution.
10
- attr_accessor :payment_execution_id
11
-
7
+ attribute :payment_execution_id, :paymentExecutionId, :String
12
8
  # Unique payment transaction identifier of the payment gateway.
13
- attr_accessor :payment_id
14
-
15
- attr_accessor :card_payment_method_specific_input
16
-
17
- attr_accessor :mobile_payment_method_specific_input
18
-
19
- attr_accessor :redirect_payment_method_specific_input
20
-
21
- attr_accessor :sepa_direct_debit_payment_method_specific_input
22
-
23
- attr_accessor :financing_payment_method_specific_input
24
-
25
- attr_accessor :bank_payout_method_specific_input
26
-
27
- attr_accessor :payment_channel
28
-
29
- attr_accessor :references
30
-
31
- attr_accessor :previous_payment
32
-
33
- attr_accessor :creation_date_time
34
-
35
- attr_accessor :last_updated
36
-
37
- attr_accessor :events
38
-
39
- attr_accessor :fund_splits
40
-
41
- class EnumAttributeValidator
42
- attr_reader :datatype
43
- attr_reader :allowable_values
44
-
45
- def initialize(datatype, allowable_values)
46
- @allowable_values = allowable_values.map do |value|
47
- case datatype.to_s
48
- when /Integer/i
49
- value.to_i
50
- when /Float/i
51
- value.to_f
52
- else
53
- value
54
- end
55
- end
56
- end
57
-
58
- def valid?(value)
59
- !value || allowable_values.include?(value)
60
- end
61
- end
62
-
63
- # Attribute mapping from ruby-style variable name to JSON key.
64
- def self.attribute_map
65
- {
66
- :'payment_execution_id' => :'paymentExecutionId',
67
- :'payment_id' => :'paymentId',
68
- :'card_payment_method_specific_input' => :'cardPaymentMethodSpecificInput',
69
- :'mobile_payment_method_specific_input' => :'mobilePaymentMethodSpecificInput',
70
- :'redirect_payment_method_specific_input' => :'redirectPaymentMethodSpecificInput',
71
- :'sepa_direct_debit_payment_method_specific_input' => :'sepaDirectDebitPaymentMethodSpecificInput',
72
- :'financing_payment_method_specific_input' => :'financingPaymentMethodSpecificInput',
73
- :'bank_payout_method_specific_input' => :'bankPayoutMethodSpecificInput',
74
- :'payment_channel' => :'paymentChannel',
75
- :'references' => :'references',
76
- :'previous_payment' => :'previousPayment',
77
- :'creation_date_time' => :'creationDateTime',
78
- :'last_updated' => :'lastUpdated',
79
- :'events' => :'events',
80
- :'fund_splits' => :'fundSplits'
81
- }
82
- end
83
-
84
- # Returns all the JSON keys this model knows about
85
- def self.acceptable_attributes
86
- attribute_map.values
87
- end
88
-
89
- # Attribute type mapping.
90
- def self.openapi_types
91
- {
92
- :'payment_execution_id' => :'String',
93
- :'payment_id' => :'String',
94
- :'card_payment_method_specific_input' => :'CardPaymentMethodSpecificInput',
95
- :'mobile_payment_method_specific_input' => :'MobilePaymentMethodSpecificInput',
96
- :'redirect_payment_method_specific_input' => :'RedirectPaymentMethodSpecificInput',
97
- :'sepa_direct_debit_payment_method_specific_input' => :'SepaDirectDebitPaymentMethodSpecificInput',
98
- :'financing_payment_method_specific_input' => :'FinancingPaymentMethodSpecificInput',
99
- :'bank_payout_method_specific_input' => :'BankPayoutMethodSpecificInput',
100
- :'payment_channel' => :'PaymentChannel',
101
- :'references' => :'References',
102
- :'previous_payment' => :'String',
103
- :'creation_date_time' => :'Time',
104
- :'last_updated' => :'Time',
105
- :'events' => :'Array<PaymentEvent>',
106
- :'fund_splits' => :'Array<FundSplit>'
107
- }
108
- end
109
-
110
- # List of attributes with nullable: true
111
- def self.openapi_nullable
112
- Set.new([
113
- ])
114
- end
115
-
116
- # Initializes the object
117
- # @param [Hash] attributes Model attributes in the form of hash
118
- def initialize(attributes = {})
119
- if (!attributes.is_a?(Hash))
120
- fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentExecution` initialize method"
121
- end
122
-
123
- # check to see if the attribute exists and convert string to symbol for hash key
124
- attributes = attributes.each_with_object({}) { |(k, v), h|
125
- if (!self.class.attribute_map.key?(k.to_sym))
126
- fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentExecution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
127
- end
128
- h[k.to_sym] = v
129
- }
130
-
131
- if attributes.key?(:'payment_execution_id')
132
- self.payment_execution_id = attributes[:'payment_execution_id']
133
- end
134
-
135
- if attributes.key?(:'payment_id')
136
- self.payment_id = attributes[:'payment_id']
137
- end
138
-
139
- if attributes.key?(:'card_payment_method_specific_input')
140
- self.card_payment_method_specific_input = attributes[:'card_payment_method_specific_input']
141
- end
142
-
143
- if attributes.key?(:'mobile_payment_method_specific_input')
144
- self.mobile_payment_method_specific_input = attributes[:'mobile_payment_method_specific_input']
145
- end
146
-
147
- if attributes.key?(:'redirect_payment_method_specific_input')
148
- self.redirect_payment_method_specific_input = attributes[:'redirect_payment_method_specific_input']
149
- end
150
-
151
- if attributes.key?(:'sepa_direct_debit_payment_method_specific_input')
152
- self.sepa_direct_debit_payment_method_specific_input = attributes[:'sepa_direct_debit_payment_method_specific_input']
153
- end
154
-
155
- if attributes.key?(:'financing_payment_method_specific_input')
156
- self.financing_payment_method_specific_input = attributes[:'financing_payment_method_specific_input']
157
- end
158
-
159
- if attributes.key?(:'bank_payout_method_specific_input')
160
- self.bank_payout_method_specific_input = attributes[:'bank_payout_method_specific_input']
161
- end
162
-
163
- if attributes.key?(:'payment_channel')
164
- self.payment_channel = attributes[:'payment_channel']
165
- end
166
-
167
- if attributes.key?(:'references')
168
- self.references = attributes[:'references']
169
- end
170
-
171
- if attributes.key?(:'previous_payment')
172
- self.previous_payment = attributes[:'previous_payment']
173
- end
174
-
175
- if attributes.key?(:'creation_date_time')
176
- self.creation_date_time = attributes[:'creation_date_time']
177
- end
178
-
179
- if attributes.key?(:'last_updated')
180
- self.last_updated = attributes[:'last_updated']
181
- end
182
-
183
- if attributes.key?(:'events')
184
- if (value = attributes[:'events']).is_a?(Array)
185
- self.events = value
186
- end
187
- end
188
-
189
- if attributes.key?(:'fund_splits')
190
- if (value = attributes[:'fund_splits']).is_a?(Array)
191
- self.fund_splits = value
192
- end
193
- end
194
- end
195
-
196
- # Checks equality by comparing each attribute.
197
- def ==(o)
198
- return true if self.equal?(o)
199
- self.class == o.class &&
200
- payment_execution_id == o.payment_execution_id &&
201
- payment_id == o.payment_id &&
202
- card_payment_method_specific_input == o.card_payment_method_specific_input &&
203
- mobile_payment_method_specific_input == o.mobile_payment_method_specific_input &&
204
- redirect_payment_method_specific_input == o.redirect_payment_method_specific_input &&
205
- sepa_direct_debit_payment_method_specific_input == o.sepa_direct_debit_payment_method_specific_input &&
206
- financing_payment_method_specific_input == o.financing_payment_method_specific_input &&
207
- bank_payout_method_specific_input == o.bank_payout_method_specific_input &&
208
- payment_channel == o.payment_channel &&
209
- references == o.references &&
210
- previous_payment == o.previous_payment &&
211
- creation_date_time == o.creation_date_time &&
212
- last_updated == o.last_updated &&
213
- events == o.events &&
214
- fund_splits == o.fund_splits
215
- end
216
-
217
- # @see the `==` method
218
- def eql?(o)
219
- self == o
220
- end
221
-
222
- # Calculates hash code according to all attributes.
223
- def hash
224
- [payment_execution_id, payment_id, card_payment_method_specific_input, mobile_payment_method_specific_input,
225
- redirect_payment_method_specific_input, sepa_direct_debit_payment_method_specific_input,
226
- financing_payment_method_specific_input, bank_payout_method_specific_input, payment_channel, references,
227
- previous_payment, creation_date_time, last_updated, events, fund_splits].hash
228
- end
229
-
230
- # Builds the object from hash
231
- # @param [Hash] attributes Model attributes in the form of hash
232
- # @return [Object] Returns the model itself
233
- def self.build_from_hash(attributes)
234
- return nil unless attributes.is_a?(Hash)
235
- attributes = attributes.transform_keys(&:to_sym)
236
- transformed_hash = {}
237
- openapi_types.each_pair do |key, type|
238
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
239
- transformed_hash["#{key}"] = nil
240
- elsif type =~ /\AArray<(.*)>/i
241
- # check to ensure the input is an array given that the attribute
242
- # is documented as an array but the input is not
243
- if attributes[attribute_map[key]].is_a?(Array)
244
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
245
- end
246
- elsif !attributes[attribute_map[key]].nil?
247
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
248
- end
249
- end
250
- new(transformed_hash)
251
- end
252
-
253
- # Deserializes the data based on type
254
- # @param string type Data type
255
- # @param string value Value to be deserialized
256
- # @return [Object] Deserialized data
257
- def self._deserialize(type, value)
258
- case type.to_sym
259
- when :Time
260
- Time.parse(value)
261
- when :Date
262
- Date.parse(value)
263
- when :String
264
- value.to_s
265
- when :Integer
266
- value.to_i
267
- when :Float
268
- value.to_f
269
- when :Boolean
270
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
271
- true
272
- else
273
- false
274
- end
275
- when :Object
276
- # generic object (usually a Hash), return directly
277
- value
278
- when /\AArray<(?<inner_type>.+)>\z/
279
- inner_type = Regexp.last_match[:inner_type]
280
- value.map { |v| _deserialize(inner_type, v) }
281
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
282
- k_type = Regexp.last_match[:k_type]
283
- v_type = Regexp.last_match[:v_type]
284
- {}.tap do |hash|
285
- value.each do |k, v|
286
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
- end
288
- end
289
- else # model
290
- # models (e.g. Pet) or oneOf
291
- klass = PCPServerSDK::Models.const_get(type)
292
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
293
- end
294
- end
295
-
296
- # Returns the string representation of the object
297
- # @return [String] String presentation of the object
298
- def to_s
299
- to_hash.to_s
300
- end
301
-
302
- # to_body is an alias to to_hash (backward compatibility)
303
- # @return [Hash] Returns the object in the form of hash
304
- def to_body
305
- to_hash
306
- end
307
-
308
- # Returns the object in the form of hash
309
- # @return [Hash] Returns the object in the form of hash
310
- def to_hash
311
- hash = {}
312
- self.class.attribute_map.each_pair do |attr, param|
313
- value = self.send(attr)
314
- if value.nil?
315
- is_nullable = self.class.openapi_nullable.include?(attr)
316
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
- end
318
-
319
- hash[param] = _to_hash(value)
320
- end
321
- hash
322
- end
323
-
324
- # Outputs non-array value in the form of hash
325
- # For object, use to_hash. Otherwise, just return the value
326
- # @param [Object] value Any valid value
327
- # @return [Hash] Returns the value in the form of hash
328
- def _to_hash(value)
329
- if value.is_a?(Array)
330
- value.compact.map { |v| _to_hash(v) }
331
- elsif value.is_a?(Hash)
332
- {}.tap do |hash|
333
- value.each { |k, v| hash[k] = _to_hash(v) }
334
- end
335
- elsif value.respond_to? :to_hash
336
- value.to_hash
337
- else
338
- value
339
- end
340
- end
9
+ attribute :payment_id, :paymentId, :String
10
+ attribute :card_payment_method_specific_input, :cardPaymentMethodSpecificInput, :CardPaymentMethodSpecificInput
11
+ attribute :mobile_payment_method_specific_input, :mobilePaymentMethodSpecificInput, :MobilePaymentMethodSpecificInput
12
+ attribute :redirect_payment_method_specific_input, :redirectPaymentMethodSpecificInput, :RedirectPaymentMethodSpecificInput
13
+ attribute :sepa_direct_debit_payment_method_specific_input, :sepaDirectDebitPaymentMethodSpecificInput, :SepaDirectDebitPaymentMethodSpecificInput
14
+ attribute :financing_payment_method_specific_input, :financingPaymentMethodSpecificInput, :FinancingPaymentMethodSpecificInput
15
+ attribute :bank_payout_method_specific_input, :bankPayoutMethodSpecificInput, :BankPayoutMethodSpecificInput
16
+ attribute :payment_channel, :paymentChannel, :PaymentChannel
17
+ attribute :references, :references, :References
18
+ attribute :previous_payment, :previousPayment, :String
19
+ # The date and time when the payment was created.
20
+ #
21
+ # Format will be in one of the following formats:
22
+ # * YYYY-MM-DD'T'HH:mm:ss'Z'
23
+ # * YYYY-MM-DD'T'HH:mm:ss+XX:XX
24
+ # * YYYY-MM-DD'T'HH:mm:ss-XX:XX
25
+ attribute :creation_date_time, :creationDateTime, :Time
26
+ # The date and time when the payment was last updated.
27
+ #
28
+ # Format will be in one of the following formats:
29
+ # * YYYY-MM-DD'T'HH:mm:ss'Z'
30
+ # * YYYY-MM-DD'T'HH:mm:ss+XX:XX
31
+ # * YYYY-MM-DD'T'HH:mm:ss-XX:XX
32
+ attribute :last_updated, :lastUpdated, :Time
33
+ attribute :events, :events, "Array<PaymentEvent>"
34
+ attribute :fund_splits, :fundSplits, "Array<FundSplit>"
341
35
  end
342
36
  end
343
37
  end
@@ -1,197 +1,10 @@
1
+ require_relative 'model_base'
1
2
 
2
- require 'date'
3
- require 'time'
4
3
  module PCPServerSDK
5
4
  module Models
6
- # Request to trigger a payment for a respective Checkout providing the input for a specific payment method. The data from the Commerce case and the Checkout will not be loaded automatically and there is no validation between the data input in place. Depending on the payment method, information of the customer and / or the shopping cart might be required. For more details regarding payment method specific input please check the documentation.
7
- class PaymentExecutionRequest
8
- attr_accessor :payment_method_specific_input
9
-
10
- attr_accessor :payment_execution_specific_input
11
-
12
- # Attribute mapping from ruby-style variable name to JSON key.
13
- def self.attribute_map
14
- {
15
- :'payment_method_specific_input' => :'paymentMethodSpecificInput',
16
- :'payment_execution_specific_input' => :'paymentExecutionSpecificInput'
17
- }
18
- end
19
-
20
- # Returns all the JSON keys this model knows about
21
- def self.acceptable_attributes
22
- attribute_map.values
23
- end
24
-
25
- # Attribute type mapping.
26
- def self.openapi_types
27
- {
28
- :'payment_method_specific_input' => :'PaymentMethodSpecificInput',
29
- :'payment_execution_specific_input' => :'PaymentExecutionSpecificInput'
30
- }
31
- end
32
-
33
- # List of attributes with nullable: true
34
- def self.openapi_nullable
35
- Set.new([
36
- ])
37
- end
38
-
39
- # Initializes the object
40
- # @param [Hash] attributes Model attributes in the form of hash
41
- def initialize(attributes = {})
42
- if (!attributes.is_a?(Hash))
43
- fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentExecutionRequest` initialize method"
44
- end
45
-
46
- # check to see if the attribute exists and convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}) { |(k, v), h|
48
- if (!self.class.attribute_map.key?(k.to_sym))
49
- fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentExecutionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
- end
51
- h[k.to_sym] = v
52
- }
53
-
54
- if attributes.key?(:'payment_method_specific_input')
55
- self.payment_method_specific_input = attributes[:'payment_method_specific_input']
56
- end
57
-
58
- if attributes.key?(:'payment_execution_specific_input')
59
- self.payment_execution_specific_input = attributes[:'payment_execution_specific_input']
60
- end
61
- end
62
-
63
- # Checks equality by comparing each attribute.
64
- # @param [Object] Object to be compared
65
- def ==(o)
66
- return true if self.equal?(o)
67
- self.class == o.class &&
68
- payment_method_specific_input == o.payment_method_specific_input &&
69
- payment_execution_specific_input == o.payment_execution_specific_input
70
- end
71
-
72
- # @see the `==` method
73
- # @param [Object] Object to be compared
74
- def eql?(o)
75
- self == o
76
- end
77
-
78
- # Calculates hash code according to all attributes.
79
- # @return [Integer] Hash code
80
- def hash
81
- [payment_method_specific_input, payment_execution_specific_input].hash
82
- end
83
-
84
- # Builds the object from hash
85
- # @param [Hash] attributes Model attributes in the form of hash
86
- # @return [Object] Returns the model itself
87
- def self.build_from_hash(attributes)
88
- return nil unless attributes.is_a?(Hash)
89
- attributes = attributes.transform_keys(&:to_sym)
90
- transformed_hash = {}
91
- openapi_types.each_pair do |key, type|
92
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
93
- transformed_hash["#{key}"] = nil
94
- elsif type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the attribute
96
- # is documented as an array but the input is not
97
- if attributes[attribute_map[key]].is_a?(Array)
98
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
99
- end
100
- elsif !attributes[attribute_map[key]].nil?
101
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
102
- end
103
- end
104
- new(transformed_hash)
105
- end
106
-
107
- # Deserializes the data based on type
108
- # @param string type Data type
109
- # @param string value Value to be deserialized
110
- # @return [Object] Deserialized data
111
- def self._deserialize(type, value)
112
- case type.to_sym
113
- when :Time
114
- Time.parse(value)
115
- when :Date
116
- Date.parse(value)
117
- when :String
118
- value.to_s
119
- when :Integer
120
- value.to_i
121
- when :Float
122
- value.to_f
123
- when :Boolean
124
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
125
- true
126
- else
127
- false
128
- end
129
- when :Object
130
- # generic object (usually a Hash), return directly
131
- value
132
- when /\AArray<(?<inner_type>.+)>\z/
133
- inner_type = Regexp.last_match[:inner_type]
134
- value.map { |v| _deserialize(inner_type, v) }
135
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
136
- k_type = Regexp.last_match[:k_type]
137
- v_type = Regexp.last_match[:v_type]
138
- {}.tap do |hash|
139
- value.each do |k, v|
140
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
141
- end
142
- end
143
- else # model
144
- # models (e.g. Pet) or oneOf
145
- klass = PCPServerSDK::Models.const_get(type)
146
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
147
- end
148
- end
149
-
150
- # Returns the string representation of the object
151
- # @return [String] String presentation of the object
152
- def to_s
153
- to_hash.to_s
154
- end
155
-
156
- # to_body is an alias to to_hash (backward compatibility)
157
- # @return [Hash] Returns the object in the form of hash
158
- def to_body
159
- to_hash
160
- end
161
-
162
- # Returns the object in the form of hash
163
- # @return [Hash] Returns the object in the form of hash
164
- def to_hash
165
- hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
167
- value = self.send(attr)
168
- if value.nil?
169
- is_nullable = self.class.openapi_nullable.include?(attr)
170
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
171
- end
172
-
173
- hash[param] = _to_hash(value)
174
- end
175
- hash
176
- end
177
-
178
- # Outputs non-array value in the form of hash
179
- # For object, use to_hash. Otherwise, just return the value
180
- # @param [Object] value Any valid value
181
- # @return [Hash] Returns the value in the form of hash
182
- def _to_hash(value)
183
- if value.is_a?(Array)
184
- value.compact.map { |v| _to_hash(v) }
185
- elsif value.is_a?(Hash)
186
- {}.tap do |hash|
187
- value.each { |k, v| hash[k] = _to_hash(v) }
188
- end
189
- elsif value.respond_to? :to_hash
190
- value.to_hash
191
- else
192
- value
193
- end
194
- end
5
+ class PaymentExecutionRequest < ModelBase
6
+ attribute :payment_method_specific_input, :paymentMethodSpecificInput, :PaymentMethodSpecificInput
7
+ attribute :payment_execution_specific_input, :paymentExecutionSpecificInput, :PaymentExecutionSpecificInput
195
8
  end
196
9
  end
197
10
  end