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,218 +1,12 @@
|
|
|
1
|
+
require_relative 'model_base'
|
|
1
2
|
|
|
2
|
-
require 'date'
|
|
3
|
-
require 'time'
|
|
4
|
-
|
|
5
|
-
# The amount of the paymentSpecificInput might differ from the Checkout amount in case of partial payments but cannot be higher. Additionally, the total amount of the provided shopping cart cannot exceed the Checkout amount. If a different currency is provided than in the Checkout, the payment execution will be declined. Provided details of the customer and shipping from the Checkout will be automatically loaded and used in the Payment Execution request. The ShoppingCart might differ from the one provided in the Checkout (e.g., for partial payments) and might be required by the payment provider (e.g., BNPL). If the ShoppingCart elements differ from the data provided in the Checkout, the existing data will not be overwritten.
|
|
6
3
|
module PCPServerSDK
|
|
7
4
|
module Models
|
|
8
|
-
class PaymentExecutionSpecificInput
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
attr_accessor :payment_references
|
|
14
|
-
|
|
15
|
-
attr_accessor :fund_split
|
|
16
|
-
|
|
17
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
18
|
-
def self.attribute_map
|
|
19
|
-
{
|
|
20
|
-
:'amount_of_money' => :'amountOfMoney',
|
|
21
|
-
:'shopping_cart' => :'shoppingCart',
|
|
22
|
-
:'payment_references' => :'paymentReferences',
|
|
23
|
-
:'fund_split' => :'fundSplit'
|
|
24
|
-
}
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# Returns all the JSON keys this model knows about
|
|
28
|
-
def self.acceptable_attributes
|
|
29
|
-
attribute_map.values
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Attribute type mapping.
|
|
33
|
-
def self.openapi_types
|
|
34
|
-
{
|
|
35
|
-
:'amount_of_money' => :'AmountOfMoney',
|
|
36
|
-
:'shopping_cart' => :'ShoppingCartInput',
|
|
37
|
-
:'payment_references' => :'References',
|
|
38
|
-
:'fund_split' => :'FundSplit'
|
|
39
|
-
}
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# List of attributes with nullable: true
|
|
43
|
-
def self.openapi_nullable
|
|
44
|
-
Set.new([
|
|
45
|
-
])
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# Initializes the object
|
|
49
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
50
|
-
def initialize(attributes = {})
|
|
51
|
-
if (!attributes.is_a?(Hash))
|
|
52
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentExecutionSpecificInput` initialize method"
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
56
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
57
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
58
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentExecutionSpecificInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
59
|
-
end
|
|
60
|
-
h[k.to_sym] = v
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if attributes.key?(:'amount_of_money')
|
|
64
|
-
self.amount_of_money = attributes[:'amount_of_money']
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
if attributes.key?(:'shopping_cart')
|
|
68
|
-
self.shopping_cart = attributes[:'shopping_cart']
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
if attributes.key?(:'payment_references')
|
|
72
|
-
self.payment_references = attributes[:'payment_references']
|
|
73
|
-
else
|
|
74
|
-
self.payment_references = nil
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
if attributes.key?(:'fund_split')
|
|
78
|
-
self.fund_split = attributes[:'fund_split']
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
# Checks equality by comparing each attribute.
|
|
83
|
-
# @param [Object] Object to be compared
|
|
84
|
-
def ==(o)
|
|
85
|
-
return true if self.equal?(o)
|
|
86
|
-
self.class == o.class &&
|
|
87
|
-
amount_of_money == o.amount_of_money &&
|
|
88
|
-
shopping_cart == o.shopping_cart &&
|
|
89
|
-
payment_references == o.payment_references &&
|
|
90
|
-
fund_split == o.fund_split
|
|
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
|
-
[amount_of_money, shopping_cart, payment_references, fund_split].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
|
-
return nil unless attributes.is_a?(Hash)
|
|
110
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
111
|
-
transformed_hash = {}
|
|
112
|
-
openapi_types.each_pair do |key, type|
|
|
113
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
114
|
-
transformed_hash["#{key}"] = nil
|
|
115
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
116
|
-
# check to ensure the input is an array given that the attribute
|
|
117
|
-
# is documented as an array but the input is not
|
|
118
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
119
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
120
|
-
end
|
|
121
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
122
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
new(transformed_hash)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
# Deserializes the data based on type
|
|
129
|
-
# @param string type Data type
|
|
130
|
-
# @param string value Value to be deserialized
|
|
131
|
-
# @return [Object] Deserialized data
|
|
132
|
-
def self._deserialize(type, value)
|
|
133
|
-
case type.to_sym
|
|
134
|
-
when :Time
|
|
135
|
-
Time.parse(value)
|
|
136
|
-
when :Date
|
|
137
|
-
Date.parse(value)
|
|
138
|
-
when :String
|
|
139
|
-
value.to_s
|
|
140
|
-
when :Integer
|
|
141
|
-
value.to_i
|
|
142
|
-
when :Float
|
|
143
|
-
value.to_f
|
|
144
|
-
when :Boolean
|
|
145
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
146
|
-
true
|
|
147
|
-
else
|
|
148
|
-
false
|
|
149
|
-
end
|
|
150
|
-
when :Object
|
|
151
|
-
# generic object (usually a Hash), return directly
|
|
152
|
-
value
|
|
153
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
154
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
155
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
156
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
157
|
-
k_type = Regexp.last_match[:k_type]
|
|
158
|
-
v_type = Regexp.last_match[:v_type]
|
|
159
|
-
{}.tap do |hash|
|
|
160
|
-
value.each do |k, v|
|
|
161
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
162
|
-
end
|
|
163
|
-
end
|
|
164
|
-
else # model
|
|
165
|
-
# models (e.g. Pet) or oneOf
|
|
166
|
-
klass = PCPServerSDK::Models.const_get(type)
|
|
167
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
# Returns the string representation of the object
|
|
172
|
-
# @return [String] String presentation of the object
|
|
173
|
-
def to_s
|
|
174
|
-
to_hash.to_s
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
178
|
-
# @return [Hash] Returns the object in the form of hash
|
|
179
|
-
def to_body
|
|
180
|
-
to_hash
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
# Returns the object in the form of hash
|
|
184
|
-
# @return [Hash] Returns the object in the form of hash
|
|
185
|
-
def to_hash
|
|
186
|
-
hash = {}
|
|
187
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
188
|
-
value = self.send(attr)
|
|
189
|
-
if value.nil?
|
|
190
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
191
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
hash[param] = _to_hash(value)
|
|
195
|
-
end
|
|
196
|
-
hash
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
# Outputs non-array value in the form of hash
|
|
200
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
201
|
-
# @param [Object] value Any valid value
|
|
202
|
-
# @return [Hash] Returns the value in the form of hash
|
|
203
|
-
def _to_hash(value)
|
|
204
|
-
if value.is_a?(Array)
|
|
205
|
-
value.compact.map { |v| _to_hash(v) }
|
|
206
|
-
elsif value.is_a?(Hash)
|
|
207
|
-
{}.tap do |hash|
|
|
208
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
209
|
-
end
|
|
210
|
-
elsif value.respond_to? :to_hash
|
|
211
|
-
value.to_hash
|
|
212
|
-
else
|
|
213
|
-
value
|
|
214
|
-
end
|
|
215
|
-
end
|
|
5
|
+
class PaymentExecutionSpecificInput < ModelBase
|
|
6
|
+
attribute :amount_of_money, :amountOfMoney, :AmountOfMoney
|
|
7
|
+
attribute :shopping_cart, :shoppingCart, :ShoppingCartInput
|
|
8
|
+
attribute :payment_references, :paymentReferences, :References
|
|
9
|
+
attribute :fund_split, :fundSplit, :FundSplit
|
|
216
10
|
end
|
|
217
11
|
end
|
|
218
12
|
end
|
|
@@ -1,212 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
require 'time'
|
|
1
|
+
require_relative 'model_base'
|
|
3
2
|
|
|
4
|
-
# Request to initiate refund for a Payment Information of Checkout.
|
|
5
3
|
module PCPServerSDK
|
|
6
4
|
module Models
|
|
7
|
-
class PaymentInformationRefundRequest
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Payment references.
|
|
12
|
-
attr_accessor :references
|
|
13
|
-
|
|
5
|
+
class PaymentInformationRefundRequest < ModelBase
|
|
6
|
+
attribute :amount_of_money, :amountOfMoney, :PositiveAmountOfMoney
|
|
7
|
+
attribute :references, :references, :PaymentReferences
|
|
14
8
|
# Account holder of the bank account.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
attr_reader :datatype
|
|
19
|
-
attr_reader :allowable_values
|
|
20
|
-
|
|
21
|
-
def initialize(datatype, allowable_values)
|
|
22
|
-
@allowable_values = allowable_values.map do |value|
|
|
23
|
-
case datatype.to_s
|
|
24
|
-
when /Integer/i
|
|
25
|
-
value.to_i
|
|
26
|
-
when /Float/i
|
|
27
|
-
value.to_f
|
|
28
|
-
else
|
|
29
|
-
value
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def valid?(value)
|
|
35
|
-
!value || allowable_values.include?(value)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
-
def self.attribute_map
|
|
41
|
-
{
|
|
42
|
-
:'amount_of_money' => :'amountOfMoney',
|
|
43
|
-
:'references' => :'references',
|
|
44
|
-
:'account_holder' => :'accountHolder'
|
|
45
|
-
}
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# Returns all the JSON keys this model knows about
|
|
49
|
-
def self.acceptable_attributes
|
|
50
|
-
attribute_map.values
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
# Attribute type mapping.
|
|
54
|
-
def self.openapi_types
|
|
55
|
-
{
|
|
56
|
-
:'amount_of_money' => :'PositiveAmountOfMoney',
|
|
57
|
-
:'references' => :'PaymentReferences',
|
|
58
|
-
:'account_holder' => :'String'
|
|
59
|
-
}
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# List of attributes with nullable: true
|
|
63
|
-
def self.openapi_nullable
|
|
64
|
-
Set.new([])
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# Initializes the object
|
|
68
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
-
def initialize(attributes = {})
|
|
70
|
-
if (!attributes.is_a?(Hash))
|
|
71
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentInformationRefundRequest` initialize method"
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
76
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentInformationRefundRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
77
|
-
end
|
|
78
|
-
h[k.to_sym] = v
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if attributes.key?(:'amount_of_money')
|
|
82
|
-
self.amount_of_money = attributes[:'amount_of_money']
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
if attributes.key?(:'references')
|
|
86
|
-
self.references = attributes[:'references']
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
if attributes.key?(:'account_holder')
|
|
90
|
-
self.account_holder = attributes[:'account_holder']
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
# Checks equality by comparing each attribute.
|
|
95
|
-
def ==(o)
|
|
96
|
-
return true if self.equal?(o)
|
|
97
|
-
self.class == o.class &&
|
|
98
|
-
amount_of_money == o.amount_of_money &&
|
|
99
|
-
references == o.references &&
|
|
100
|
-
account_holder == o.account_holder
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
# @see the `==` method
|
|
104
|
-
def eql?(o)
|
|
105
|
-
self == o
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
# Calculates hash code according to all attributes.
|
|
109
|
-
def hash
|
|
110
|
-
[amount_of_money, references, account_holder].hash
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
# Builds the object from hash
|
|
114
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
115
|
-
# @return [Object] Returns the model itself
|
|
116
|
-
def self.build_from_hash(attributes)
|
|
117
|
-
return nil unless attributes.is_a?(Hash)
|
|
118
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
119
|
-
transformed_hash = {}
|
|
120
|
-
openapi_types.each_pair do |key, type|
|
|
121
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
122
|
-
transformed_hash["#{key}"] = nil
|
|
123
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
124
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
125
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
126
|
-
end
|
|
127
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
128
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
|
-
new(transformed_hash)
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
# Deserializes the data based on type
|
|
135
|
-
def self._deserialize(type, value)
|
|
136
|
-
case type.to_sym
|
|
137
|
-
when :Time
|
|
138
|
-
Time.parse(value)
|
|
139
|
-
when :Date
|
|
140
|
-
Date.parse(value)
|
|
141
|
-
when :String
|
|
142
|
-
value.to_s
|
|
143
|
-
when :Integer
|
|
144
|
-
value.to_i
|
|
145
|
-
when :Float
|
|
146
|
-
value.to_f
|
|
147
|
-
when :Boolean
|
|
148
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
149
|
-
true
|
|
150
|
-
else
|
|
151
|
-
false
|
|
152
|
-
end
|
|
153
|
-
when :Object
|
|
154
|
-
value
|
|
155
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
156
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
157
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
158
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
159
|
-
k_type = Regexp.last_match[:k_type]
|
|
160
|
-
v_type = Regexp.last_match[:v_type]
|
|
161
|
-
{}.tap do |hash|
|
|
162
|
-
value.each do |k, v|
|
|
163
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
else
|
|
167
|
-
klass = PCPServerSDK::Models.const_get(type)
|
|
168
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
169
|
-
end
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Returns the string representation of the object
|
|
173
|
-
def to_s
|
|
174
|
-
to_hash.to_s
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
178
|
-
def to_body
|
|
179
|
-
to_hash
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
# Returns the object in the form of hash
|
|
183
|
-
def to_hash
|
|
184
|
-
hash = {}
|
|
185
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
186
|
-
value = self.send(attr)
|
|
187
|
-
if value.nil?
|
|
188
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
189
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
190
|
-
end
|
|
191
|
-
hash[param] = _to_hash(value)
|
|
192
|
-
end
|
|
193
|
-
hash
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
# Outputs non-array value in the form of hash
|
|
197
|
-
def _to_hash(value)
|
|
198
|
-
if value.is_a?(Array)
|
|
199
|
-
value.compact.map { |v| _to_hash(v) }
|
|
200
|
-
elsif value.is_a?(Hash)
|
|
201
|
-
{}.tap do |hash|
|
|
202
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
203
|
-
end
|
|
204
|
-
elsif value.respond_to? :to_hash
|
|
205
|
-
value.to_hash
|
|
206
|
-
else
|
|
207
|
-
value
|
|
208
|
-
end
|
|
209
|
-
end
|
|
9
|
+
# Does not necessarily have to be the customer (e.g. joint accounts).
|
|
10
|
+
# The name of the account holder is required for payment methods that will use a credit transfer for the refund (e.g. girocard, SEPA Direct Debit)
|
|
11
|
+
attribute :account_holder, :accountHolder, :String
|
|
210
12
|
end
|
|
211
13
|
end
|
|
212
14
|
end
|
|
@@ -1,202 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
require 'time'
|
|
1
|
+
require_relative 'model_base'
|
|
3
2
|
|
|
4
|
-
# PaymentInformationRefundResponse
|
|
5
3
|
module PCPServerSDK
|
|
6
4
|
module Models
|
|
7
|
-
class PaymentInformationRefundResponse
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Reference to the paymentExecution.
|
|
12
|
-
attr_accessor :payment_execution_id
|
|
13
|
-
|
|
14
|
-
class EnumAttributeValidator
|
|
15
|
-
attr_reader :datatype
|
|
16
|
-
attr_reader :allowable_values
|
|
17
|
-
|
|
18
|
-
def initialize(datatype, allowable_values)
|
|
19
|
-
@allowable_values = allowable_values.map do |value|
|
|
20
|
-
case datatype.to_s
|
|
21
|
-
when /Integer/i
|
|
22
|
-
value.to_i
|
|
23
|
-
when /Float/i
|
|
24
|
-
value.to_f
|
|
25
|
-
else
|
|
26
|
-
value
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def valid?(value)
|
|
32
|
-
!value || allowable_values.include?(value)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
-
def self.attribute_map
|
|
38
|
-
{
|
|
39
|
-
:'payment' => :'payment',
|
|
40
|
-
:'payment_execution_id' => :'paymentExecutionId'
|
|
41
|
-
}
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# Returns all the JSON keys this model knows about
|
|
45
|
-
def self.acceptable_attributes
|
|
46
|
-
attribute_map.values
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# Attribute type mapping.
|
|
50
|
-
def self.openapi_types
|
|
51
|
-
{
|
|
52
|
-
:'payment' => :'PayoutResponse',
|
|
53
|
-
:'payment_execution_id' => :'String'
|
|
54
|
-
}
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
# List of attributes with nullable: true
|
|
58
|
-
def self.openapi_nullable
|
|
59
|
-
Set.new([])
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Initializes the object
|
|
63
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
-
def initialize(attributes = {})
|
|
65
|
-
if (!attributes.is_a?(Hash))
|
|
66
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentInformationRefundResponse` initialize method"
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentInformationRefundResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
72
|
-
end
|
|
73
|
-
h[k.to_sym] = v
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if attributes.key?(:'payment')
|
|
77
|
-
self.payment = attributes[:'payment']
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
if attributes.key?(:'payment_execution_id')
|
|
81
|
-
self.payment_execution_id = attributes[:'payment_execution_id']
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# Checks equality by comparing each attribute.
|
|
86
|
-
def ==(o)
|
|
87
|
-
return true if self.equal?(o)
|
|
88
|
-
self.class == o.class &&
|
|
89
|
-
payment == o.payment &&
|
|
90
|
-
payment_execution_id == o.payment_execution_id
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# @see the `==` method
|
|
94
|
-
def eql?(o)
|
|
95
|
-
self == o
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
# Calculates hash code according to all attributes.
|
|
99
|
-
def hash
|
|
100
|
-
[payment, payment_execution_id].hash
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
# Builds the object from hash
|
|
104
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
-
# @return [Object] Returns the model itself
|
|
106
|
-
def self.build_from_hash(attributes)
|
|
107
|
-
return nil unless attributes.is_a?(Hash)
|
|
108
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
109
|
-
transformed_hash = {}
|
|
110
|
-
openapi_types.each_pair do |key, type|
|
|
111
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
112
|
-
transformed_hash["#{key}"] = nil
|
|
113
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
114
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
115
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
116
|
-
end
|
|
117
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
118
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
new(transformed_hash)
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
# Deserializes the data based on type
|
|
125
|
-
def self._deserialize(type, value)
|
|
126
|
-
case type.to_sym
|
|
127
|
-
when :Time
|
|
128
|
-
Time.parse(value)
|
|
129
|
-
when :Date
|
|
130
|
-
Date.parse(value)
|
|
131
|
-
when :String
|
|
132
|
-
value.to_s
|
|
133
|
-
when :Integer
|
|
134
|
-
value.to_i
|
|
135
|
-
when :Float
|
|
136
|
-
value.to_f
|
|
137
|
-
when :Boolean
|
|
138
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
139
|
-
true
|
|
140
|
-
else
|
|
141
|
-
false
|
|
142
|
-
end
|
|
143
|
-
when :Object
|
|
144
|
-
value
|
|
145
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
146
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
147
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
148
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
149
|
-
k_type = Regexp.last_match[:k_type]
|
|
150
|
-
v_type = Regexp.last_match[:v_type]
|
|
151
|
-
{}.tap do |hash|
|
|
152
|
-
value.each do |k, v|
|
|
153
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
|
-
else
|
|
157
|
-
klass = PCPServerSDK::Models.const_get(type)
|
|
158
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Returns the string representation of the object
|
|
163
|
-
def to_s
|
|
164
|
-
to_hash.to_s
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
168
|
-
def to_body
|
|
169
|
-
to_hash
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Returns the object in the form of hash
|
|
173
|
-
def to_hash
|
|
174
|
-
hash = {}
|
|
175
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
176
|
-
value = self.send(attr)
|
|
177
|
-
if value.nil?
|
|
178
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
179
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
180
|
-
end
|
|
181
|
-
hash[param] = _to_hash(value)
|
|
182
|
-
end
|
|
183
|
-
hash
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# Outputs non-array value in the form of hash
|
|
187
|
-
def _to_hash(value)
|
|
188
|
-
if value.is_a?(Array)
|
|
189
|
-
value.compact.map { |v| _to_hash(v) }
|
|
190
|
-
elsif value.is_a?(Hash)
|
|
191
|
-
{}.tap do |hash|
|
|
192
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
193
|
-
end
|
|
194
|
-
elsif value.respond_to? :to_hash
|
|
195
|
-
value.to_hash
|
|
196
|
-
else
|
|
197
|
-
value
|
|
198
|
-
end
|
|
199
|
-
end
|
|
5
|
+
class PaymentInformationRefundResponse < ModelBase
|
|
6
|
+
attribute :payment, :payment, :PayoutResponse
|
|
7
|
+
# reference to the paymentExecution.
|
|
8
|
+
attribute :payment_execution_id, :paymentExecutionId, :String
|
|
200
9
|
end
|
|
201
10
|
end
|
|
202
11
|
end
|