pcp-server-ruby-sdk 1.0.0 → 1.1.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 +10 -0
- data/api-definition.yaml +4737 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/checkout_api_client.rb +24 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_execution_api_client.rb +47 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_information_api_client.rb +27 -2
- data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +17 -5
- data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +198 -0
- data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +45 -41
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +43 -40
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +16 -33
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +185 -0
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +12 -6
- data/lib/PCP-server-Ruby-SDK/models/{payment_product320_specific_input.rb → pause_payment_request.rb} +13 -31
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/payee.rb +212 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +14 -14
- data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +39 -5
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +212 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +202 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +40 -25
- data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +222 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +232 -0
- data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +28 -24
- data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -25
- data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/refresh_type.rb +30 -0
- data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/status_value.rb +12 -10
- data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +3 -1
- data/lib/PCP-server-Ruby-SDK/transformer/apple_pay_transformer.rb +2 -2
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +24 -2
- data/package-lock.json +196 -243
- data/package.json +1 -1
- data/scripts.sh +7 -14
- data/spec/endpoints/checkout_api_client_spec.rb +51 -0
- data/spec/endpoints/payment_execution_api_client_spec.rb +102 -0
- data/spec/endpoints/payment_information_api_client_spec.rb +52 -0
- data/spec/transformer/apple_pay_transformer_spec.rb +1 -1
- data/spec/utils/server_meta_info_spec.rb +2 -2
- metadata +19 -7
@@ -22,13 +22,19 @@ module PCPServerSDK
|
|
22
22
|
|
23
23
|
attr_accessor :financing_payment_method_specific_input
|
24
24
|
|
25
|
+
attr_accessor :bank_payout_method_specific_input
|
26
|
+
|
25
27
|
attr_accessor :payment_channel
|
26
28
|
|
27
29
|
attr_accessor :references
|
28
30
|
|
29
|
-
attr_accessor :
|
31
|
+
attr_accessor :previous_payment
|
32
|
+
|
33
|
+
attr_accessor :creation_date_time
|
30
34
|
|
35
|
+
attr_accessor :last_updated
|
31
36
|
|
37
|
+
attr_accessor :events
|
32
38
|
|
33
39
|
class EnumAttributeValidator
|
34
40
|
attr_reader :datatype
|
@@ -62,8 +68,12 @@ module PCPServerSDK
|
|
62
68
|
:'redirect_payment_method_specific_input' => :'redirectPaymentMethodSpecificInput',
|
63
69
|
:'sepa_direct_debit_payment_method_specific_input' => :'sepaDirectDebitPaymentMethodSpecificInput',
|
64
70
|
:'financing_payment_method_specific_input' => :'financingPaymentMethodSpecificInput',
|
71
|
+
:'bank_payout_method_specific_input' => :'bankPayoutMethodSpecificInput',
|
65
72
|
:'payment_channel' => :'paymentChannel',
|
66
73
|
:'references' => :'references',
|
74
|
+
:'previous_payment' => :'previousPayment',
|
75
|
+
:'creation_date_time' => :'creationDateTime',
|
76
|
+
:'last_updated' => :'lastUpdated',
|
67
77
|
:'events' => :'events'
|
68
78
|
}
|
69
79
|
end
|
@@ -83,8 +93,12 @@ module PCPServerSDK
|
|
83
93
|
:'redirect_payment_method_specific_input' => :'RedirectPaymentMethodSpecificInput',
|
84
94
|
:'sepa_direct_debit_payment_method_specific_input' => :'SepaDirectDebitPaymentMethodSpecificInput',
|
85
95
|
:'financing_payment_method_specific_input' => :'FinancingPaymentMethodSpecificInput',
|
96
|
+
:'bank_payout_method_specific_input' => :'BankPayoutMethodSpecificInput',
|
86
97
|
:'payment_channel' => :'PaymentChannel',
|
87
98
|
:'references' => :'References',
|
99
|
+
:'previous_payment' => :'String',
|
100
|
+
:'creation_date_time' => :'Time',
|
101
|
+
:'last_updated' => :'Time',
|
88
102
|
:'events' => :'Array<PaymentEvent>'
|
89
103
|
}
|
90
104
|
end
|
@@ -138,6 +152,10 @@ module PCPServerSDK
|
|
138
152
|
self.financing_payment_method_specific_input = attributes[:'financing_payment_method_specific_input']
|
139
153
|
end
|
140
154
|
|
155
|
+
if attributes.key?(:'bank_payout_method_specific_input')
|
156
|
+
self.bank_payout_method_specific_input = attributes[:'bank_payout_method_specific_input']
|
157
|
+
end
|
158
|
+
|
141
159
|
if attributes.key?(:'payment_channel')
|
142
160
|
self.payment_channel = attributes[:'payment_channel']
|
143
161
|
end
|
@@ -146,6 +164,18 @@ module PCPServerSDK
|
|
146
164
|
self.references = attributes[:'references']
|
147
165
|
end
|
148
166
|
|
167
|
+
if attributes.key?(:'previous_payment')
|
168
|
+
self.previous_payment = attributes[:'previous_payment']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'creation_date_time')
|
172
|
+
self.creation_date_time = attributes[:'creation_date_time']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'last_updated')
|
176
|
+
self.last_updated = attributes[:'last_updated']
|
177
|
+
end
|
178
|
+
|
149
179
|
if attributes.key?(:'events')
|
150
180
|
if (value = attributes[:'events']).is_a?(Array)
|
151
181
|
self.events = value
|
@@ -154,7 +184,6 @@ module PCPServerSDK
|
|
154
184
|
end
|
155
185
|
|
156
186
|
# Checks equality by comparing each attribute.
|
157
|
-
# @param [Object] Object to be compared
|
158
187
|
def ==(o)
|
159
188
|
return true if self.equal?(o)
|
160
189
|
self.class == o.class &&
|
@@ -165,21 +194,26 @@ module PCPServerSDK
|
|
165
194
|
redirect_payment_method_specific_input == o.redirect_payment_method_specific_input &&
|
166
195
|
sepa_direct_debit_payment_method_specific_input == o.sepa_direct_debit_payment_method_specific_input &&
|
167
196
|
financing_payment_method_specific_input == o.financing_payment_method_specific_input &&
|
197
|
+
bank_payout_method_specific_input == o.bank_payout_method_specific_input &&
|
168
198
|
payment_channel == o.payment_channel &&
|
169
199
|
references == o.references &&
|
200
|
+
previous_payment == o.previous_payment &&
|
201
|
+
creation_date_time == o.creation_date_time &&
|
202
|
+
last_updated == o.last_updated &&
|
170
203
|
events == o.events
|
171
204
|
end
|
172
205
|
|
173
206
|
# @see the `==` method
|
174
|
-
# @param [Object] Object to be compared
|
175
207
|
def eql?(o)
|
176
208
|
self == o
|
177
209
|
end
|
178
210
|
|
179
211
|
# Calculates hash code according to all attributes.
|
180
|
-
# @return [Integer] Hash code
|
181
212
|
def hash
|
182
|
-
[payment_execution_id, payment_id, card_payment_method_specific_input, mobile_payment_method_specific_input,
|
213
|
+
[payment_execution_id, payment_id, card_payment_method_specific_input, mobile_payment_method_specific_input,
|
214
|
+
redirect_payment_method_specific_input, sepa_direct_debit_payment_method_specific_input,
|
215
|
+
financing_payment_method_specific_input, bank_payout_method_specific_input, payment_channel, references,
|
216
|
+
previous_payment, creation_date_time, last_updated, events].hash
|
183
217
|
end
|
184
218
|
|
185
219
|
# Builds the object from hash
|
@@ -0,0 +1,212 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# Request to initiate refund for a Payment Information of Checkout.
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class PaymentInformationRefundRequest
|
8
|
+
# Amount of money for the refund.
|
9
|
+
attr_accessor :amount_of_money
|
10
|
+
|
11
|
+
# Payment references.
|
12
|
+
attr_accessor :references
|
13
|
+
|
14
|
+
# Account holder of the bank account.
|
15
|
+
attr_accessor :account_holder
|
16
|
+
|
17
|
+
class EnumAttributeValidator
|
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
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
@@ -0,0 +1,202 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# PaymentInformationRefundResponse
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class PaymentInformationRefundResponse
|
8
|
+
# Payment details.
|
9
|
+
attr_accessor :payment
|
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
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
@@ -11,32 +11,37 @@ module PCPServerSDK
|
|
11
11
|
|
12
12
|
# Unique ID of the Commerce Case.
|
13
13
|
attr_accessor :checkout_id
|
14
|
-
|
14
|
+
|
15
15
|
# Unique identifier of the customer.
|
16
16
|
attr_accessor :merchant_customer_id
|
17
|
-
|
17
|
+
|
18
18
|
# Unique ID of the Payment Information.
|
19
19
|
attr_accessor :payment_information_id
|
20
|
-
|
20
|
+
|
21
21
|
attr_accessor :payment_channel
|
22
|
-
|
22
|
+
|
23
23
|
# Payment product identifier - please check see product documentation for a full overview of possible values.
|
24
24
|
attr_accessor :payment_product_id
|
25
|
-
|
25
|
+
|
26
26
|
# Unique identifier of the POS terminal of the payment transaction.
|
27
27
|
attr_accessor :terminal_id
|
28
|
-
|
28
|
+
|
29
29
|
# Unique ID that identifies a store location or transaction point and which refers to the contract number of the merchant accepting the card.
|
30
30
|
attr_accessor :card_acceptor_id
|
31
|
-
|
32
|
-
# Unique reference of the PaymentInformation. In case of card present transactions, the reference from the ECR or terminal will be used. It is always the reference for external transactions. (e.g. card present payments, cash payments or payments processed by other payment providers).
|
31
|
+
|
32
|
+
# Unique reference of the PaymentInformation. In case of card present transactions, the reference from the ECR or terminal will be used. It is always the reference for external transactions. (e.g. card present payments, cash payments or payments processed by other payment providers).
|
33
33
|
attr_accessor :merchant_reference
|
34
|
-
|
34
|
+
|
35
|
+
# The date and time when the payment was created.
|
36
|
+
attr_accessor :creation_date_time
|
37
|
+
|
38
|
+
# The date and time when the payment was last updated.
|
39
|
+
attr_accessor :last_updated
|
40
|
+
|
35
41
|
attr_accessor :card_payment_details
|
36
|
-
|
42
|
+
|
37
43
|
attr_accessor :events
|
38
|
-
|
39
|
-
|
44
|
+
|
40
45
|
class EnumAttributeValidator
|
41
46
|
attr_reader :datatype
|
42
47
|
attr_reader :allowable_values
|
@@ -58,7 +63,7 @@ module PCPServerSDK
|
|
58
63
|
!value || allowable_values.include?(value)
|
59
64
|
end
|
60
65
|
end
|
61
|
-
|
66
|
+
|
62
67
|
# Attribute mapping from ruby-style variable name to JSON key.
|
63
68
|
def self.attribute_map
|
64
69
|
{
|
@@ -71,16 +76,18 @@ module PCPServerSDK
|
|
71
76
|
:'terminal_id' => :'terminalId',
|
72
77
|
:'card_acceptor_id' => :'cardAcceptorId',
|
73
78
|
:'merchant_reference' => :'merchantReference',
|
79
|
+
:'creation_date_time' => :'creationDateTime',
|
80
|
+
:'last_updated' => :'lastUpdated',
|
74
81
|
:'card_payment_details' => :'cardPaymentDetails',
|
75
82
|
:'events' => :'events'
|
76
83
|
}
|
77
84
|
end
|
78
|
-
|
85
|
+
|
79
86
|
# Returns all the JSON keys this model knows about
|
80
87
|
def self.acceptable_attributes
|
81
88
|
attribute_map.values
|
82
89
|
end
|
83
|
-
|
90
|
+
|
84
91
|
# Attribute type mapping.
|
85
92
|
def self.openapi_types
|
86
93
|
{
|
@@ -93,17 +100,19 @@ module PCPServerSDK
|
|
93
100
|
:'terminal_id' => :'String',
|
94
101
|
:'card_acceptor_id' => :'String',
|
95
102
|
:'merchant_reference' => :'String',
|
103
|
+
:'creation_date_time' => :'Time',
|
104
|
+
:'last_updated' => :'Time',
|
96
105
|
:'card_payment_details' => :'CardPaymentDetails',
|
97
106
|
:'events' => :'Array<PaymentEvent>'
|
98
107
|
}
|
99
108
|
end
|
100
|
-
|
109
|
+
|
101
110
|
# List of attributes with nullable: true
|
102
111
|
def self.openapi_nullable
|
103
112
|
Set.new([
|
104
113
|
])
|
105
114
|
end
|
106
|
-
|
115
|
+
|
107
116
|
# Initializes the object
|
108
117
|
# @param [Hash] attributes Model attributes in the form of hash
|
109
118
|
def initialize(attributes = {})
|
@@ -155,6 +164,14 @@ module PCPServerSDK
|
|
155
164
|
self.merchant_reference = attributes[:'merchant_reference']
|
156
165
|
end
|
157
166
|
|
167
|
+
if attributes.key?(:'creation_date_time')
|
168
|
+
self.creation_date_time = attributes[:'creation_date_time']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'last_updated')
|
172
|
+
self.last_updated = attributes[:'last_updated']
|
173
|
+
end
|
174
|
+
|
158
175
|
if attributes.key?(:'card_payment_details')
|
159
176
|
self.card_payment_details = attributes[:'card_payment_details']
|
160
177
|
end
|
@@ -165,9 +182,8 @@ module PCPServerSDK
|
|
165
182
|
end
|
166
183
|
end
|
167
184
|
end
|
168
|
-
|
185
|
+
|
169
186
|
# Checks equality by comparing each attribute.
|
170
|
-
# @param [Object] Object to be compared
|
171
187
|
def ==(o)
|
172
188
|
return true if self.equal?(o)
|
173
189
|
self.class == o.class &&
|
@@ -180,22 +196,21 @@ module PCPServerSDK
|
|
180
196
|
terminal_id == o.terminal_id &&
|
181
197
|
card_acceptor_id == o.card_acceptor_id &&
|
182
198
|
merchant_reference == o.merchant_reference &&
|
199
|
+
creation_date_time == o.creation_date_time &&
|
200
|
+
last_updated == o.last_updated &&
|
183
201
|
card_payment_details == o.card_payment_details &&
|
184
202
|
events == o.events
|
185
203
|
end
|
186
|
-
|
204
|
+
|
187
205
|
# @see the `==` method
|
188
|
-
# @param [Object] Object to be compared
|
189
206
|
def eql?(o)
|
190
207
|
self == o
|
191
208
|
end
|
192
|
-
|
209
|
+
|
193
210
|
# Calculates hash code according to all attributes.
|
194
|
-
# @return [Integer] Hash code
|
195
211
|
def hash
|
196
|
-
[commerce_case_id, checkout_id, merchant_customer_id, payment_information_id, payment_channel, payment_product_id, terminal_id, card_acceptor_id, merchant_reference, card_payment_details, events].hash
|
212
|
+
[commerce_case_id, checkout_id, merchant_customer_id, payment_information_id, payment_channel, payment_product_id, terminal_id, card_acceptor_id, merchant_reference, creation_date_time, last_updated, card_payment_details, events].hash
|
197
213
|
end
|
198
|
-
|
199
214
|
# Builds the object from hash
|
200
215
|
# @param [Hash] attributes Model attributes in the form of hash
|
201
216
|
# @return [Object] Returns the model itself
|