pcp-server-ruby-sdk 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/api-definition.yaml +685 -667
  4. data/lib/PCP-server-Ruby-SDK/endpoints/checkout_api_client.rb +3 -1
  5. data/lib/PCP-server-Ruby-SDK/endpoints/commerce_case_api_client.rb +5 -4
  6. data/lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb +25 -0
  7. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +8 -0
  8. data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +2 -0
  9. data/lib/PCP-server-Ruby-SDK/models/commerce_cases_response.rb +18 -0
  10. data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +187 -0
  11. data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +2 -1
  12. data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +11 -1
  13. data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +11 -1
  14. data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +34 -4
  15. data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +198 -0
  16. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +4 -14
  17. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +4 -14
  18. data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +1 -1
  19. data/lib/PCP-server-Ruby-SDK/models/required_field_validation.rb +108 -0
  20. data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
  21. data/lib/PCP-server-Ruby-SDK.rb +6 -0
  22. data/package-lock.json +16 -2
  23. data/package.json +1 -1
  24. data/spec/endpoints/checkout_api_client_spec.rb +22 -0
  25. data/spec/endpoints/order_management_checkout_actions_api_client_spec.rb +51 -0
  26. data/spec/models/required_field_validation_spec.rb +551 -0
  27. metadata +14 -8
@@ -109,7 +109,7 @@ module PCPServerSDK
109
109
  # @param commerce_case_id [String] The commerce case identifier
110
110
  # @param checkout_id [String] The checkout identifier
111
111
  # @return [nil]
112
- def remove_checkout_request(merchant_id, commerce_case_id, checkout_id)
112
+ def delete_checkout_request(merchant_id, commerce_case_id, checkout_id)
113
113
  raise TypeError, MERCHANT_ID_REQUIRED_ERROR if merchant_id.nil? || merchant_id.empty?
114
114
  raise TypeError, COMMERCE_CASE_ID_REQUIRED_ERROR if commerce_case_id.nil? || commerce_case_id.empty?
115
115
  raise TypeError, CHECKOUT_ID_REQUIRED_ERROR if checkout_id.nil? || checkout_id.empty?
@@ -125,6 +125,8 @@ module PCPServerSDK
125
125
  nil
126
126
  end
127
127
 
128
+ alias remove_checkout_request delete_checkout_request
129
+
128
130
  # Complete a checkout
129
131
  # @param merchant_id [String] The merchant identifier
130
132
  # @param commerce_case_id [String] The commerce case identifier
@@ -3,6 +3,7 @@ require 'json'
3
3
  require 'uri'
4
4
  require_relative 'base_api_client'
5
5
  require_relative '../models/commerce_case_response'
6
+ require_relative '../models/commerce_cases_response'
6
7
  require_relative '../models/create_commerce_case_response'
7
8
  require_relative '../models/customer'
8
9
 
@@ -54,8 +55,8 @@ module PCPServerSDK
54
55
 
55
56
  # Get commerce cases
56
57
  # @param merchant_id [String] The merchant identifier
57
- # @param query_params [PCPServerSDK::Models::GetCommerceCasesQuery] The query parameters
58
- # @return [Array<PCPServerSDK::Models::CommerceCaseResponse>] The commerce cases
58
+ # @param query_params [PCPServerSDK::Queries::GetCommerceCasesQuery] The query parameters
59
+ # @return [PCPServerSDK::Models::CommerceCasesResponse] The commerce cases
59
60
  def get_commerce_cases_request(merchant_id, query_params = nil)
60
61
  raise TypeError, MERCHANT_ID_REQUIRED_ERROR if merchant_id.nil? || merchant_id.empty?
61
62
 
@@ -70,8 +71,8 @@ module PCPServerSDK
70
71
  headers: {}
71
72
  }
72
73
 
73
- request = make_api_call(url.to_s, request_init)
74
- request.map { |r| deserialize_json(r, PCPServerSDK::Models::CommerceCaseResponse) }
74
+ response = make_api_call(url.to_s, request_init)
75
+ deserialize_json(response, PCPServerSDK::Models::CommerceCasesResponse)
75
76
  end
76
77
 
77
78
  # Update a commerce case
@@ -4,6 +4,7 @@ require 'uri'
4
4
  require_relative 'base_api_client'
5
5
  require_relative '../models/cancel_response'
6
6
  require_relative '../models/deliver_response'
7
+ require_relative '../models/complete_payment_response'
7
8
  require_relative '../models/order_response'
8
9
  require_relative '../models/return_response'
9
10
  module PCPServerSDK
@@ -22,6 +23,7 @@ module PCPServerSDK
22
23
  # @return [PCPServerSDK::Models::OrderResponse] The order response
23
24
  def create_order(merchant_id, commerce_case_id, checkout_id, payload)
24
25
  validate_ids(merchant_id, commerce_case_id, checkout_id)
26
+ raise TypeError, PAYLOAD_REQUIRED_ERROR if payload.nil?
25
27
 
26
28
  url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/order")
27
29
 
@@ -35,6 +37,28 @@ module PCPServerSDK
35
37
  deserialize_json(response, PCPServerSDK::Models::OrderResponse)
36
38
  end
37
39
 
40
+ # Complete an order
41
+ # @param merchant_id [String] The merchant identifier
42
+ # @param commerce_case_id [String] The commerce case identifier
43
+ # @param checkout_id [String] The checkout identifier
44
+ # @param payload [PCPServerSDK::Models::CompleteOrderRequest] The complete order request
45
+ # @return [PCPServerSDK::Models::CompletePaymentResponse] The complete payment response
46
+ def complete_order(merchant_id, commerce_case_id, checkout_id, payload)
47
+ validate_ids(merchant_id, commerce_case_id, checkout_id)
48
+ raise TypeError, PAYLOAD_REQUIRED_ERROR if payload.nil?
49
+
50
+ url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/complete-order")
51
+
52
+ request_init = {
53
+ method: 'POST',
54
+ headers: { 'Content-Type' => 'application/json' },
55
+ body: JSON.generate(payload)
56
+ }
57
+
58
+ response = make_api_call(url.to_s, request_init)
59
+ deserialize_json(response, PCPServerSDK::Models::CompletePaymentResponse)
60
+ end
61
+
38
62
  # Deliver an order
39
63
  # @param merchant_id [String] The merchant identifier
40
64
  # @param commerce_case_id [String] The commerce case identifier
@@ -43,6 +67,7 @@ module PCPServerSDK
43
67
  # @return [PCPServerSDK::Models::DeliverResponse] The deliver response
44
68
  def deliver_order(merchant_id, commerce_case_id, checkout_id, payload)
45
69
  validate_ids(merchant_id, commerce_case_id, checkout_id)
70
+ raise TypeError, PAYLOAD_REQUIRED_ERROR if payload.nil?
46
71
 
47
72
  url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/deliver")
48
73
 
@@ -73,6 +73,14 @@ module PCPServerSDK
73
73
  end
74
74
  end
75
75
 
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ cancellation_reason == o.cancellation_reason
82
+ end
83
+
76
84
  # @see the `==` method
77
85
  # @param [Object] Object to be compared
78
86
  def eql?(o)
@@ -56,6 +56,8 @@ module PCPServerSDK
56
56
 
57
57
  if attributes.key?(:'supplier_id')
58
58
  self.supplier_id = attributes[:'supplier_id']
59
+ else
60
+ self.supplier_id = nil
59
61
  end
60
62
 
61
63
  if attributes.key?(:'order_reference')
@@ -0,0 +1,18 @@
1
+ require_relative 'commerce_case_response'
2
+
3
+ module PCPServerSDK
4
+ module Models
5
+ # Top-level response for listing Commerce Cases.
6
+ class CommerceCasesResponse < Array
7
+ def self.build_from_hash(attributes)
8
+ return new unless attributes.is_a?(Array)
9
+
10
+ new.concat(attributes.map { |item| PCPServerSDK::Models::CommerceCaseResponse.build_from_hash(item) })
11
+ end
12
+
13
+ def to_body
14
+ map { |item| item.respond_to?(:to_body) ? item.to_body : item }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,187 @@
1
+ require 'date'
2
+ require 'time'
3
+
4
+ # Request to complete an order.
5
+ module PCPServerSDK
6
+ module Models
7
+ class CompleteOrderRequest
8
+ attr_accessor :complete_payment_method_specific_input
9
+
10
+ # Attribute mapping from ruby-style variable name to JSON key.
11
+ def self.attribute_map
12
+ {
13
+ :'complete_payment_method_specific_input' => :'completePaymentMethodSpecificInput'
14
+ }
15
+ end
16
+
17
+ # Returns all the JSON keys this model knows about
18
+ def self.acceptable_attributes
19
+ attribute_map.values
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.openapi_types
24
+ {
25
+ :'complete_payment_method_specific_input' => :'CompletePaymentMethodSpecificInput'
26
+ }
27
+ end
28
+
29
+ # List of attributes with nullable: true
30
+ def self.openapi_nullable
31
+ Set.new([])
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ if (!attributes.is_a?(Hash))
38
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CompleteOrderRequest` initialize method"
39
+ end
40
+
41
+ # check to see if the attribute exists and convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h|
43
+ if (!self.class.attribute_map.key?(k.to_sym))
44
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CompleteOrderRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
45
+ end
46
+ h[k.to_sym] = v
47
+ }
48
+
49
+ if attributes.key?(:'complete_payment_method_specific_input')
50
+ self.complete_payment_method_specific_input = attributes[:'complete_payment_method_specific_input']
51
+ end
52
+ end
53
+
54
+ # Checks equality by comparing each attribute.
55
+ # @param [Object] Object to be compared
56
+ def ==(o)
57
+ return true if self.equal?(o)
58
+ self.class == o.class &&
59
+ complete_payment_method_specific_input == o.complete_payment_method_specific_input
60
+ end
61
+
62
+ # @see the `==` method
63
+ # @param [Object] Object to be compared
64
+ def eql?(o)
65
+ self == o
66
+ end
67
+
68
+ # Calculates hash code according to all attributes.
69
+ # @return [Integer] Hash code
70
+ def hash
71
+ [complete_payment_method_specific_input].hash
72
+ end
73
+
74
+ # Builds the object from hash
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ # @return [Object] Returns the model itself
77
+ def self.build_from_hash(attributes)
78
+ return nil unless attributes.is_a?(Hash)
79
+ attributes = attributes.transform_keys(&:to_sym)
80
+ transformed_hash = {}
81
+ openapi_types.each_pair do |key, type|
82
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
83
+ transformed_hash["#{key}"] = nil
84
+ elsif type =~ /\AArray<(.*)>/i
85
+ # check to ensure the input is an array given that the attribute
86
+ # is documented as an array but the input is not
87
+ if attributes[attribute_map[key]].is_a?(Array)
88
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
89
+ end
90
+ elsif !attributes[attribute_map[key]].nil?
91
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
92
+ end
93
+ end
94
+ new(transformed_hash)
95
+ end
96
+
97
+ # Deserializes the data based on type
98
+ # @param string type Data type
99
+ # @param string value Value to be deserialized
100
+ # @return [Object] Deserialized data
101
+ def self._deserialize(type, value)
102
+ case type.to_sym
103
+ when :Time
104
+ Time.parse(value)
105
+ when :Date
106
+ Date.parse(value)
107
+ when :String
108
+ value.to_s
109
+ when :Integer
110
+ value.to_i
111
+ when :Float
112
+ value.to_f
113
+ when :Boolean
114
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
115
+ true
116
+ else
117
+ false
118
+ end
119
+ when :Object
120
+ # generic object (usually a Hash), return directly
121
+ value
122
+ when /\AArray<(?<inner_type>.+)>\z/
123
+ inner_type = Regexp.last_match[:inner_type]
124
+ value.map { |v| _deserialize(inner_type, v) }
125
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
126
+ k_type = Regexp.last_match[:k_type]
127
+ v_type = Regexp.last_match[:v_type]
128
+ {}.tap do |hash|
129
+ value.each do |k, v|
130
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
131
+ end
132
+ end
133
+ else # model
134
+ # models (e.g. Pet) or oneOf
135
+ klass = PCPServerSDK::Models.const_get(type)
136
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
137
+ end
138
+ end
139
+
140
+ # Returns the string representation of the object
141
+ # @return [String] String presentation of the object
142
+ def to_s
143
+ to_hash.to_s
144
+ end
145
+
146
+ # to_body is an alias to to_hash (backward compatibility)
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_body
149
+ to_hash
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ if value.nil?
159
+ is_nullable = self.class.openapi_nullable.include?(attr)
160
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
161
+ end
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map { |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+ end
186
+ end
187
+ end
@@ -169,6 +169,7 @@ module PCPServerSDK
169
169
  product_type == o.product_type &&
170
170
  quantity == o.quantity &&
171
171
  tax_amount == o.tax_amount &&
172
+ tax_amount_per_unit == o.tax_amount_per_unit &&
172
173
  product_url == o.product_url &&
173
174
  product_image_url == o.product_image_url &&
174
175
  product_category_path == o.product_category_path &&
@@ -184,7 +185,7 @@ module PCPServerSDK
184
185
  # Calculates hash code according to all attributes.
185
186
  # @return [Integer] Hash code
186
187
  def hash
187
- [product_code, product_price, product_type, quantity, tax_amount, product_url, product_image_url, product_category_path, merchant_shop_delivery_reference].hash
188
+ [product_code, product_price, product_type, quantity, tax_amount, tax_amount_per_unit, product_url, product_image_url, product_category_path, merchant_shop_delivery_reference].hash
188
189
  end
189
190
 
190
191
  # Builds the object from hash
@@ -25,6 +25,9 @@ module PCPServerSDK
25
25
  # Tax on the line item, with the last two digits implied as decimal places
26
26
  attr_accessor :tax_amount
27
27
 
28
+ # Indicates if the taxAmount is to be interpreted as the tax amount per unit rather than for the entire line item.
29
+ attr_accessor :tax_amount_per_unit
30
+
28
31
  # URL of the product in shop. Used for PAYONE Buy Now, Pay Later (BNPL).
29
32
  attr_accessor :product_url
30
33
 
@@ -71,6 +74,7 @@ module PCPServerSDK
71
74
  :'product_type' => :'productType',
72
75
  :'quantity' => :'quantity',
73
76
  :'tax_amount' => :'taxAmount',
77
+ :'tax_amount_per_unit' => :'taxAmountPerUnit',
74
78
  :'product_url' => :'productUrl',
75
79
  :'product_image_url' => :'productImageUrl',
76
80
  :'product_category_path' => :'productCategoryPath',
@@ -93,6 +97,7 @@ module PCPServerSDK
93
97
  :'product_type' => :'ProductType',
94
98
  :'quantity' => :'Integer',
95
99
  :'tax_amount' => :'Integer',
100
+ :'tax_amount_per_unit' => :'Boolean',
96
101
  :'product_url' => :'String',
97
102
  :'product_image_url' => :'String',
98
103
  :'product_category_path' => :'String',
@@ -163,6 +168,10 @@ module PCPServerSDK
163
168
  self.tax_amount = attributes[:'tax_amount']
164
169
  end
165
170
 
171
+ if attributes.key?(:'tax_amount_per_unit')
172
+ self.tax_amount_per_unit = attributes[:'tax_amount_per_unit']
173
+ end
174
+
166
175
  if attributes.key?(:'product_url')
167
176
  self.product_url = attributes[:'product_url']
168
177
  end
@@ -192,6 +201,7 @@ module PCPServerSDK
192
201
  product_type == o.product_type &&
193
202
  quantity == o.quantity &&
194
203
  tax_amount == o.tax_amount &&
204
+ tax_amount_per_unit == o.tax_amount_per_unit &&
195
205
  product_url == o.product_url &&
196
206
  product_image_url == o.product_image_url &&
197
207
  product_category_path == o.product_category_path &&
@@ -207,7 +217,7 @@ module PCPServerSDK
207
217
  # Calculates hash code according to all attributes.
208
218
  # @return [Integer] Hash code
209
219
  def hash
210
- [id, status, product_code, product_price, product_type, quantity, tax_amount, product_url, product_image_url, product_category_path, merchant_shop_delivery_reference].hash
220
+ [id, status, product_code, product_price, product_type, quantity, tax_amount, tax_amount_per_unit, product_url, product_image_url, product_category_path, merchant_shop_delivery_reference].hash
211
221
  end
212
222
 
213
223
  # Builds the object from hash
@@ -25,6 +25,9 @@ module PCPServerSDK
25
25
  # Tax on the line item, with the last two digits implied as decimal places
26
26
  attr_accessor :tax_amount
27
27
 
28
+ # Indicates if the taxAmount is to be interpreted as the tax amount per unit rather than for the entire line item.
29
+ attr_accessor :tax_amount_per_unit
30
+
28
31
  # URL of the product in shop. Used for PAYONE Buy Now, Pay Later (BNPL).
29
32
  attr_accessor :product_url
30
33
 
@@ -71,6 +74,7 @@ module PCPServerSDK
71
74
  :'product_type' => :'productType',
72
75
  :'quantity' => :'quantity',
73
76
  :'tax_amount' => :'taxAmount',
77
+ :'tax_amount_per_unit' => :'taxAmountPerUnit',
74
78
  :'product_url' => :'productUrl',
75
79
  :'product_image_url' => :'productImageUrl',
76
80
  :'product_category_path' => :'productCategoryPath',
@@ -93,6 +97,7 @@ module PCPServerSDK
93
97
  :'product_type' => :'ProductType',
94
98
  :'quantity' => :'Integer',
95
99
  :'tax_amount' => :'Integer',
100
+ :'tax_amount_per_unit' => :'Boolean',
96
101
  :'product_url' => :'String',
97
102
  :'product_image_url' => :'String',
98
103
  :'product_category_path' => :'String',
@@ -163,6 +168,10 @@ module PCPServerSDK
163
168
  self.tax_amount = attributes[:'tax_amount']
164
169
  end
165
170
 
171
+ if attributes.key?(:'tax_amount_per_unit')
172
+ self.tax_amount_per_unit = attributes[:'tax_amount_per_unit']
173
+ end
174
+
166
175
  if attributes.key?(:'product_url')
167
176
  self.product_url = attributes[:'product_url']
168
177
  end
@@ -192,6 +201,7 @@ module PCPServerSDK
192
201
  product_type == o.product_type &&
193
202
  quantity == o.quantity &&
194
203
  tax_amount == o.tax_amount &&
204
+ tax_amount_per_unit == o.tax_amount_per_unit &&
195
205
  product_url == o.product_url &&
196
206
  product_image_url == o.product_image_url &&
197
207
  product_category_path == o.product_category_path &&
@@ -207,7 +217,7 @@ module PCPServerSDK
207
217
  # Calculates hash code according to all attributes.
208
218
  # @return [Integer] Hash code
209
219
  def hash
210
- [id, status, product_code, product_price, product_type, quantity, tax_amount, product_url, product_image_url, product_category_path, merchant_shop_delivery_reference].hash
220
+ [id, status, product_code, product_price, product_type, quantity, tax_amount, tax_amount_per_unit, product_url, product_image_url, product_category_path, merchant_shop_delivery_reference].hash
211
221
  end
212
222
 
213
223
  # Builds the object from hash
@@ -5,6 +5,9 @@ require 'time'
5
5
  module PCPServerSDK
6
6
  module Models
7
7
  class PaymentEvent
8
+ # Unique identifier of the payment event.
9
+ attr_accessor :payment_event_id
10
+
8
11
  attr_accessor :type
9
12
 
10
13
  attr_accessor :amount_of_money
@@ -18,6 +21,12 @@ module PCPServerSDK
18
21
 
19
22
  attr_accessor :payment_instructions
20
23
 
24
+ # The date and time the payment event was created. Format: YYYY-MM-DDThh:mm:ss+TZD
25
+ attr_accessor :creation_date_time
26
+
27
+ # Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes.
28
+ attr_accessor :merchant_reference
29
+
21
30
  class EnumAttributeValidator
22
31
  attr_reader :datatype
23
32
  attr_reader :allowable_values
@@ -43,12 +52,15 @@ module PCPServerSDK
43
52
  # Attribute mapping from ruby-style variable name to JSON key.
44
53
  def self.attribute_map
45
54
  {
55
+ :'payment_event_id' => :'paymentEventId',
46
56
  :'type' => :'type',
47
57
  :'amount_of_money' => :'amountOfMoney',
48
58
  :'payment_status' => :'paymentStatus',
49
59
  :'cancellation_reason' => :'cancellationReason',
50
60
  :'return_reason' => :'returnReason',
51
- :'payment_instructions' => :'paymentInstructions'
61
+ :'payment_instructions' => :'paymentInstructions',
62
+ :'creation_date_time' => :'creationDateTime',
63
+ :'merchant_reference' => :'merchantReference'
52
64
  }
53
65
  end
54
66
 
@@ -60,12 +72,15 @@ module PCPServerSDK
60
72
  # Attribute type mapping.
61
73
  def self.openapi_types
62
74
  {
75
+ :'payment_event_id' => :'String',
63
76
  :'type' => :'PaymentType',
64
77
  :'amount_of_money' => :'AmountOfMoney',
65
78
  :'payment_status' => :'StatusValue',
66
79
  :'cancellation_reason' => :'CancellationReason',
67
80
  :'return_reason' => :'String',
68
- :'payment_instructions' => :'PaymentInstructions'
81
+ :'payment_instructions' => :'PaymentInstructions',
82
+ :'creation_date_time' => :'Time',
83
+ :'merchant_reference' => :'String'
69
84
  }
70
85
  end
71
86
 
@@ -89,6 +104,10 @@ module PCPServerSDK
89
104
  h[k.to_sym] = v
90
105
  }
91
106
 
107
+ if attributes.key?(:'payment_event_id')
108
+ self.payment_event_id = attributes[:'payment_event_id']
109
+ end
110
+
92
111
  if attributes.key?(:'type')
93
112
  self.type = attributes[:'type']
94
113
  end
@@ -112,18 +131,29 @@ module PCPServerSDK
112
131
  if attributes.key?(:'payment_instructions')
113
132
  self.payment_instructions = attributes[:'payment_instructions']
114
133
  end
134
+
135
+ if attributes.key?(:'creation_date_time')
136
+ self.creation_date_time = attributes[:'creation_date_time']
137
+ end
138
+
139
+ if attributes.key?(:'merchant_reference')
140
+ self.merchant_reference = attributes[:'merchant_reference']
141
+ end
115
142
  end
116
143
 
117
144
  # Checks equality by comparing each attribute.
118
145
  def ==(o)
119
146
  return true if self.equal?(o)
120
147
  self.class == o.class &&
148
+ payment_event_id == o.payment_event_id &&
121
149
  type == o.type &&
122
150
  amount_of_money == o.amount_of_money &&
123
151
  payment_status == o.payment_status &&
124
152
  cancellation_reason == o.cancellation_reason &&
125
153
  return_reason == o.return_reason &&
126
- payment_instructions == o.payment_instructions
154
+ payment_instructions == o.payment_instructions &&
155
+ creation_date_time == o.creation_date_time &&
156
+ merchant_reference == o.merchant_reference
127
157
  end
128
158
 
129
159
  def eql?(o)
@@ -131,7 +161,7 @@ module PCPServerSDK
131
161
  end
132
162
 
133
163
  def hash
134
- [type, amount_of_money, payment_status, cancellation_reason, return_reason, payment_instructions].hash
164
+ [payment_event_id, type, amount_of_money, payment_status, cancellation_reason, return_reason, payment_instructions, creation_date_time, merchant_reference].hash
135
165
  end
136
166
 
137
167
  # Builds the object from hash