pcp-server-ruby-sdk 1.12.0 → 1.13.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/api-definition.yaml +323 -41
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb +37 -0
- data/lib/PCP-server-Ruby-SDK/models/address.rb +9 -237
- data/lib/PCP-server-Ruby-SDK/models/address_personal.rb +10 -246
- data/lib/PCP-server-Ruby-SDK/models/amount_of_money.rb +4 -195
- data/lib/PCP-server-Ruby-SDK/models/api_error.rb +27 -232
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +6 -194
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +8 -229
- data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +11 -207
- data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +4 -187
- data/lib/PCP-server-Ruby-SDK/models/cancel_item.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +6 -222
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb +4 -190
- data/lib/PCP-server-Ruby-SDK/models/cancel_request.rb +6 -224
- data/lib/PCP-server-Ruby-SDK/models/cancel_response.rb +4 -190
- data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +9 -214
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +14 -253
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +7 -239
- data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +29 -184
- data/lib/PCP-server-Ruby-SDK/models/card_info.rb +3 -182
- data/lib/PCP-server-Ruby-SDK/models/card_payment_details.rb +8 -210
- data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb +32 -307
- data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +12 -186
- data/lib/PCP-server-Ruby-SDK/models/cart_item_data.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +5 -198
- data/lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb +5 -184
- data/lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb +4 -213
- data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +5 -200
- data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +5 -200
- data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/checkout_references.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/checkout_response.rb +15 -319
- data/lib/PCP-server-Ruby-SDK/models/checkouts_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/company_information.rb +3 -182
- data/lib/PCP-server-Ruby-SDK/models/complete_financing_payment_method_specific_input.rb +12 -202
- data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +3 -181
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +7 -226
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +6 -209
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_response.rb +5 -199
- data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/contact_details.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/create_checkout_request.rb +13 -240
- data/lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb +16 -307
- data/lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb +7 -219
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +11 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +7 -218
- data/lib/PCP-server-Ruby-SDK/models/customer.rb +28 -260
- data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +10 -44
- data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +8 -209
- data/lib/PCP-server-Ruby-SDK/models/deliver_item.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +10 -246
- data/lib/PCP-server-Ruby-SDK/models/deliver_response.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/delivery_information.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/error_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_input.rb +15 -203
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +10 -196
- data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +12 -263
- data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +5 -205
- data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +3 -147
- data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +10 -174
- data/lib/PCP-server-Ruby-SDK/models/installment_option.rb +13 -273
- data/lib/PCP-server-Ruby-SDK/models/link_information.rb +4 -196
- data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +16 -194
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -246
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +7 -219
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +3 -179
- data/lib/PCP-server-Ruby-SDK/models/model_base.rb +147 -0
- data/lib/PCP-server-Ruby-SDK/models/order.rb +7 -221
- data/lib/PCP-server-Ruby-SDK/models/order_item.rb +6 -197
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +29 -305
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +5 -326
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +5 -326
- data/lib/PCP-server-Ruby-SDK/models/order_request.rb +7 -244
- data/lib/PCP-server-Ruby-SDK/models/order_response.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/patch_checkout_request.rb +8 -228
- data/lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +2 -165
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/payee.rb +6 -204
- data/lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +19 -274
- data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +29 -335
- data/lib/PCP-server-Ruby-SDK/models/payment_execution_request.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +6 -212
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +7 -205
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +5 -196
- data/lib/PCP-server-Ruby-SDK/models/payment_information_request.rb +10 -249
- data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +30 -314
- data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +8 -214
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb +9 -261
- data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb +9 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_output.rb +11 -255
- data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +11 -225
- data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb +6 -197
- data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_output.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/payment_product3392_specific_input.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +7 -203
- data/lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +5 -209
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_data.rb +11 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_references.rb +6 -184
- data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +12 -197
- data/lib/PCP-server-Ruby-SDK/models/payment_response.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/payment_status_output.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +5 -205
- data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -215
- data/lib/PCP-server-Ruby-SDK/models/personal_information.rb +11 -227
- data/lib/PCP-server-Ruby-SDK/models/personal_name.rb +5 -201
- data/lib/PCP-server-Ruby-SDK/models/positive_amount_of_money.rb +4 -196
- data/lib/PCP-server-Ruby-SDK/models/processing_mandate_information.rb +9 -254
- data/lib/PCP-server-Ruby-SDK/models/redirect_data.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -249
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +6 -211
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +6 -205
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +12 -177
- data/lib/PCP-server-Ruby-SDK/models/redirection_data.rb +11 -186
- data/lib/PCP-server-Ruby-SDK/models/references.rb +47 -205
- data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/refund_error_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/refund_output.rb +8 -211
- data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +7 -242
- data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/return_information.rb +4 -194
- data/lib/PCP-server-Ruby-SDK/models/return_item.rb +6 -196
- data/lib/PCP-server-Ruby-SDK/models/return_request.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/return_response.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_input.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_output.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/shipping.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/shipping_address.rb +14 -0
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb +9 -0
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/status_output.rb +21 -264
- data/lib/PCP-server-Ruby-SDK/models/three_d_secure_results.rb +6 -226
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +18 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/scripts/convert_models_to_model_base.rb +128 -0
- data/spec/endpoints/payment_intent_api_client_spec.rb +43 -0
- data/spec/models/api_definition_conformance_spec.rb +88 -0
- data/spec/models/model_base_spec.rb +87 -0
- data/spec/models/payment_intent_models_spec.rb +25 -0
- data/spec/models/required_field_validation_spec.rb +5 -5
- metadata +35 -11
- data/lib/PCP-server-Ruby-SDK/models/action_type.rb +0 -34
- data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +0 -52
- data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +0 -30
|
@@ -1,227 +1,15 @@
|
|
|
1
|
+
require_relative 'model_base'
|
|
1
2
|
|
|
2
|
-
require 'date'
|
|
3
|
-
require 'time'
|
|
4
3
|
module PCPServerSDK
|
|
5
4
|
module Models
|
|
6
|
-
|
|
7
|
-
class CreateCommerceCaseResponse
|
|
5
|
+
class CreateCommerceCaseResponse < ModelBase
|
|
8
6
|
# Unique ID of the Commerce Case. It can used to add additional Checkouts to the Commerce Case.
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
attribute :commerce_case_id, :commerceCaseId, :String
|
|
11
8
|
# Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
attr_accessor :checkout
|
|
17
|
-
|
|
18
|
-
# Creation date and time of the Checkout in RFC3339 format. It can either be provided in the request or otherwise will be automatically set to the time when the request CreateCommerceCase was received. Response values will always be in UTC time, but when providing this field in the requests, the time offset can have different formats. Accepted formats are: * YYYY-MM-DD'T'HH:mm:ss'Z' * YYYY-MM-DD'T'HH:mm:ss+XX:XX * YYYY-MM-DD'T'HH:mm:ss-XX:XX * YYYY-MM-DD'T'HH:mm'Z' * YYYY-MM-DD'T'HH:mm+XX:XX * YYYY-MM-DD'T'HH:mm-XX:XX All other formats may be ignored by the system.
|
|
19
|
-
attr_accessor :creation_date_time
|
|
20
|
-
|
|
21
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
-
def self.attribute_map
|
|
23
|
-
{
|
|
24
|
-
:'commerce_case_id' => :'commerceCaseId',
|
|
25
|
-
:'merchant_reference' => :'merchantReference',
|
|
26
|
-
:'customer' => :'customer',
|
|
27
|
-
:'checkout' => :'checkout',
|
|
28
|
-
:'creation_date_time' => :'creationDateTime'
|
|
29
|
-
}
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Returns all the JSON keys this model knows about
|
|
33
|
-
def self.acceptable_attributes
|
|
34
|
-
attribute_map.values
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# Attribute type mapping.
|
|
38
|
-
def self.openapi_types
|
|
39
|
-
{
|
|
40
|
-
:'commerce_case_id' => :'String',
|
|
41
|
-
:'merchant_reference' => :'String',
|
|
42
|
-
:'customer' => :'Customer',
|
|
43
|
-
:'checkout' => :'CreateCheckoutResponse',
|
|
44
|
-
:'creation_date_time' => :'Time'
|
|
45
|
-
}
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# List of attributes with nullable: true
|
|
49
|
-
def self.openapi_nullable
|
|
50
|
-
Set.new([
|
|
51
|
-
])
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Initializes the object
|
|
55
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
-
def initialize(attributes = {})
|
|
57
|
-
if (!attributes.is_a?(Hash))
|
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `CreateCommerceCaseResponse` initialize method"
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
63
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `CreateCommerceCaseResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
65
|
-
end
|
|
66
|
-
h[k.to_sym] = v
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if attributes.key?(:'commerce_case_id')
|
|
70
|
-
self.commerce_case_id = attributes[:'commerce_case_id']
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
if attributes.key?(:'merchant_reference')
|
|
74
|
-
self.merchant_reference = attributes[:'merchant_reference']
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
if attributes.key?(:'customer')
|
|
78
|
-
self.customer = attributes[:'customer']
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
if attributes.key?(:'checkout')
|
|
82
|
-
self.checkout = attributes[:'checkout']
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
if attributes.key?(:'creation_date_time')
|
|
86
|
-
self.creation_date_time = attributes[:'creation_date_time']
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# Checks equality by comparing each attribute.
|
|
91
|
-
# @param [Object] Object to be compared
|
|
92
|
-
def ==(o)
|
|
93
|
-
return true if self.equal?(o)
|
|
94
|
-
self.class == o.class &&
|
|
95
|
-
commerce_case_id == o.commerce_case_id &&
|
|
96
|
-
merchant_reference == o.merchant_reference &&
|
|
97
|
-
customer == o.customer &&
|
|
98
|
-
checkout == o.checkout &&
|
|
99
|
-
creation_date_time == o.creation_date_time
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
# @see the `==` method
|
|
103
|
-
# @param [Object] Object to be compared
|
|
104
|
-
def eql?(o)
|
|
105
|
-
self == o
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
# Calculates hash code according to all attributes.
|
|
109
|
-
# @return [Integer] Hash code
|
|
110
|
-
def hash
|
|
111
|
-
[commerce_case_id, merchant_reference, customer, checkout, creation_date_time].hash
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
# Builds the object from hash
|
|
115
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
116
|
-
# @return [Object] Returns the model itself
|
|
117
|
-
def self.build_from_hash(attributes)
|
|
118
|
-
return nil unless attributes.is_a?(Hash)
|
|
119
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
120
|
-
transformed_hash = {}
|
|
121
|
-
openapi_types.each_pair do |key, type|
|
|
122
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
123
|
-
transformed_hash["#{key}"] = nil
|
|
124
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
125
|
-
# check to ensure the input is an array given that the attribute
|
|
126
|
-
# is documented as an array but the input is not
|
|
127
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
128
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
129
|
-
end
|
|
130
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
131
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
new(transformed_hash)
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
# Deserializes the data based on type
|
|
138
|
-
# @param string type Data type
|
|
139
|
-
# @param string value Value to be deserialized
|
|
140
|
-
# @return [Object] Deserialized data
|
|
141
|
-
def self._deserialize(type, value)
|
|
142
|
-
case type.to_sym
|
|
143
|
-
when :Time
|
|
144
|
-
Time.parse(value)
|
|
145
|
-
when :Date
|
|
146
|
-
Date.parse(value)
|
|
147
|
-
when :String
|
|
148
|
-
value.to_s
|
|
149
|
-
when :Integer
|
|
150
|
-
value.to_i
|
|
151
|
-
when :Float
|
|
152
|
-
value.to_f
|
|
153
|
-
when :Boolean
|
|
154
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
155
|
-
true
|
|
156
|
-
else
|
|
157
|
-
false
|
|
158
|
-
end
|
|
159
|
-
when :Object
|
|
160
|
-
# generic object (usually a Hash), return directly
|
|
161
|
-
value
|
|
162
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
163
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
164
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
165
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
166
|
-
k_type = Regexp.last_match[:k_type]
|
|
167
|
-
v_type = Regexp.last_match[:v_type]
|
|
168
|
-
{}.tap do |hash|
|
|
169
|
-
value.each do |k, v|
|
|
170
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
171
|
-
end
|
|
172
|
-
end
|
|
173
|
-
else # model
|
|
174
|
-
# models (e.g. Pet) or oneOf
|
|
175
|
-
klass = PCPServerSDK::Models.const_get(type)
|
|
176
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
# Returns the string representation of the object
|
|
181
|
-
# @return [String] String presentation of the object
|
|
182
|
-
def to_s
|
|
183
|
-
to_hash.to_s
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
187
|
-
# @return [Hash] Returns the object in the form of hash
|
|
188
|
-
def to_body
|
|
189
|
-
to_hash
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# Returns the object in the form of hash
|
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
|
194
|
-
def to_hash
|
|
195
|
-
hash = {}
|
|
196
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
197
|
-
value = self.send(attr)
|
|
198
|
-
if value.nil?
|
|
199
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
200
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
hash[param] = _to_hash(value)
|
|
204
|
-
end
|
|
205
|
-
hash
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
# Outputs non-array value in the form of hash
|
|
209
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
210
|
-
# @param [Object] value Any valid value
|
|
211
|
-
# @return [Hash] Returns the value in the form of hash
|
|
212
|
-
def _to_hash(value)
|
|
213
|
-
if value.is_a?(Array)
|
|
214
|
-
value.compact.map { |v| _to_hash(v) }
|
|
215
|
-
elsif value.is_a?(Hash)
|
|
216
|
-
{}.tap do |hash|
|
|
217
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
218
|
-
end
|
|
219
|
-
elsif value.respond_to? :to_hash
|
|
220
|
-
value.to_hash
|
|
221
|
-
else
|
|
222
|
-
value
|
|
223
|
-
end
|
|
224
|
-
end
|
|
9
|
+
attribute :merchant_reference, :merchantReference, :String
|
|
10
|
+
attribute :customer, :customer, :Customer
|
|
11
|
+
attribute :checkout, :checkout, :CreateCheckoutResponse
|
|
12
|
+
attribute :creation_date_time, :creationDateTime, :Time
|
|
225
13
|
end
|
|
226
14
|
end
|
|
227
15
|
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require_relative 'model_base'
|
|
2
|
+
|
|
3
|
+
module PCPServerSDK
|
|
4
|
+
module Models
|
|
5
|
+
class CreatePaymentIntent < ModelBase
|
|
6
|
+
attribute :amount_of_money, :amountOfMoney, :AmountOfMoney
|
|
7
|
+
attribute :references, :references, :PaymentReferences
|
|
8
|
+
attribute :shopping_cart, :shoppingCart, :ShoppingCartData
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require_relative 'create_payment_intent'
|
|
2
|
+
|
|
3
|
+
module PCPServerSDK
|
|
4
|
+
module Models
|
|
5
|
+
class CreatePaymentIntentRequest < CreatePaymentIntent
|
|
6
|
+
attribute :payment_method_specific_input, :paymentMethodSpecificInput, :PaymentMethodSpecificInputForIntent
|
|
7
|
+
|
|
8
|
+
def self.openapi_all_of
|
|
9
|
+
[:CreatePaymentIntent]
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
require_relative 'model_base'
|
|
2
|
+
|
|
3
|
+
module PCPServerSDK
|
|
4
|
+
module Models
|
|
5
|
+
class CreatePaymentIntentResponse < ModelBase
|
|
6
|
+
attribute :shopping_cart, :shoppingCart, :ShoppingCartData
|
|
7
|
+
attribute :payment_intent_output, :paymentIntentOutput, :PaymentIntentOutput
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -1,225 +1,14 @@
|
|
|
1
|
+
require_relative 'model_base'
|
|
1
2
|
|
|
2
|
-
require 'date'
|
|
3
|
-
require 'time'
|
|
4
3
|
module PCPServerSDK
|
|
5
4
|
module Models
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
attr_accessor :payment
|
|
13
|
-
|
|
5
|
+
class CreatePaymentResponse < ModelBase
|
|
6
|
+
attribute :creation_output, :creationOutput, :PaymentCreationOutput
|
|
7
|
+
attribute :merchant_action, :merchantAction, :MerchantAction
|
|
8
|
+
attribute :payment, :payment, :PaymentResponse
|
|
9
|
+
attribute :fund_split, :fundSplit, :FundSplit
|
|
14
10
|
# reference to the paymentExecution.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
attr_accessor :fund_split
|
|
18
|
-
|
|
19
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
20
|
-
def self.attribute_map
|
|
21
|
-
{
|
|
22
|
-
:'creation_output' => :'creationOutput',
|
|
23
|
-
:'merchant_action' => :'merchantAction',
|
|
24
|
-
:'payment' => :'payment',
|
|
25
|
-
:'payment_execution_id' => :'paymentExecutionId',
|
|
26
|
-
:'fund_split' => :'fundSplit'
|
|
27
|
-
}
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Returns all the JSON keys this model knows about
|
|
31
|
-
def self.acceptable_attributes
|
|
32
|
-
attribute_map.values
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Attribute type mapping.
|
|
36
|
-
def self.openapi_types
|
|
37
|
-
{
|
|
38
|
-
:'creation_output' => :'PaymentCreationOutput',
|
|
39
|
-
:'merchant_action' => :'MerchantAction',
|
|
40
|
-
:'payment' => :'PaymentResponse',
|
|
41
|
-
:'payment_execution_id' => :'String',
|
|
42
|
-
:'fund_split' => :'FundSplit'
|
|
43
|
-
}
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# List of attributes with nullable: true
|
|
47
|
-
def self.openapi_nullable
|
|
48
|
-
Set.new([
|
|
49
|
-
])
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# Initializes the object
|
|
53
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
|
-
def initialize(attributes = {})
|
|
55
|
-
if (!attributes.is_a?(Hash))
|
|
56
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `CreatePaymentResponse` initialize method"
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `CreatePaymentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
63
|
-
end
|
|
64
|
-
h[k.to_sym] = v
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if attributes.key?(:'creation_output')
|
|
68
|
-
self.creation_output = attributes[:'creation_output']
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
if attributes.key?(:'merchant_action')
|
|
72
|
-
self.merchant_action = attributes[:'merchant_action']
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
if attributes.key?(:'payment')
|
|
76
|
-
self.payment = attributes[:'payment']
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
if attributes.key?(:'payment_execution_id')
|
|
80
|
-
self.payment_execution_id = attributes[:'payment_execution_id']
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
if attributes.key?(:'fund_split')
|
|
84
|
-
self.fund_split = attributes[:'fund_split']
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
# Checks equality by comparing each attribute.
|
|
89
|
-
# @param [Object] Object to be compared
|
|
90
|
-
def ==(o)
|
|
91
|
-
return true if self.equal?(o)
|
|
92
|
-
self.class == o.class &&
|
|
93
|
-
creation_output == o.creation_output &&
|
|
94
|
-
merchant_action == o.merchant_action &&
|
|
95
|
-
payment == o.payment &&
|
|
96
|
-
payment_execution_id == o.payment_execution_id &&
|
|
97
|
-
fund_split == o.fund_split
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
# @see the `==` method
|
|
101
|
-
# @param [Object] Object to be compared
|
|
102
|
-
def eql?(o)
|
|
103
|
-
self == o
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
# Calculates hash code according to all attributes.
|
|
107
|
-
# @return [Integer] Hash code
|
|
108
|
-
def hash
|
|
109
|
-
[creation_output, merchant_action, payment, payment_execution_id, fund_split].hash
|
|
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 self.build_from_hash(attributes)
|
|
116
|
-
return nil unless attributes.is_a?(Hash)
|
|
117
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
118
|
-
transformed_hash = {}
|
|
119
|
-
openapi_types.each_pair do |key, type|
|
|
120
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
121
|
-
transformed_hash["#{key}"] = nil
|
|
122
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
123
|
-
# check to ensure the input is an array given that the attribute
|
|
124
|
-
# is documented as an array but the input is not
|
|
125
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
126
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
127
|
-
end
|
|
128
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
129
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
new(transformed_hash)
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
# Deserializes the data based on type
|
|
136
|
-
# @param string type Data type
|
|
137
|
-
# @param string value Value to be deserialized
|
|
138
|
-
# @return [Object] Deserialized data
|
|
139
|
-
def self._deserialize(type, value)
|
|
140
|
-
case type.to_sym
|
|
141
|
-
when :Time
|
|
142
|
-
Time.parse(value)
|
|
143
|
-
when :Date
|
|
144
|
-
Date.parse(value)
|
|
145
|
-
when :String
|
|
146
|
-
value.to_s
|
|
147
|
-
when :Integer
|
|
148
|
-
value.to_i
|
|
149
|
-
when :Float
|
|
150
|
-
value.to_f
|
|
151
|
-
when :Boolean
|
|
152
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
153
|
-
true
|
|
154
|
-
else
|
|
155
|
-
false
|
|
156
|
-
end
|
|
157
|
-
when :Object
|
|
158
|
-
# generic object (usually a Hash), return directly
|
|
159
|
-
value
|
|
160
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
161
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
162
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
163
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
164
|
-
k_type = Regexp.last_match[:k_type]
|
|
165
|
-
v_type = Regexp.last_match[:v_type]
|
|
166
|
-
{}.tap do |hash|
|
|
167
|
-
value.each do |k, v|
|
|
168
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
169
|
-
end
|
|
170
|
-
end
|
|
171
|
-
else # model
|
|
172
|
-
# models (e.g. Pet) or oneOf
|
|
173
|
-
klass = PCPServerSDK::Models.const_get(type)
|
|
174
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
# Returns the string representation of the object
|
|
179
|
-
# @return [String] String presentation of the object
|
|
180
|
-
def to_s
|
|
181
|
-
to_hash.to_s
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
185
|
-
# @return [Hash] Returns the object in the form of hash
|
|
186
|
-
def to_body
|
|
187
|
-
to_hash
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
# Returns the object in the form of hash
|
|
191
|
-
# @return [Hash] Returns the object in the form of hash
|
|
192
|
-
def to_hash
|
|
193
|
-
hash = {}
|
|
194
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
195
|
-
value = self.send(attr)
|
|
196
|
-
if value.nil?
|
|
197
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
198
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
hash[param] = _to_hash(value)
|
|
202
|
-
end
|
|
203
|
-
hash
|
|
204
|
-
end
|
|
205
|
-
|
|
206
|
-
# Outputs non-array value in the form of hash
|
|
207
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
208
|
-
# @param [Object] value Any valid value
|
|
209
|
-
# @return [Hash] Returns the value in the form of hash
|
|
210
|
-
def _to_hash(value)
|
|
211
|
-
if value.is_a?(Array)
|
|
212
|
-
value.compact.map { |v| _to_hash(v) }
|
|
213
|
-
elsif value.is_a?(Hash)
|
|
214
|
-
{}.tap do |hash|
|
|
215
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
216
|
-
end
|
|
217
|
-
elsif value.respond_to? :to_hash
|
|
218
|
-
value.to_hash
|
|
219
|
-
else
|
|
220
|
-
value
|
|
221
|
-
end
|
|
222
|
-
end
|
|
11
|
+
attribute :payment_execution_id, :paymentExecutionId, :String
|
|
223
12
|
end
|
|
224
13
|
end
|
|
225
14
|
end
|