pcp-server-ruby-sdk 1.7.0 → 1.8.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 +6 -0
- data/api-definition.yaml +5012 -4993
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +8 -0
- data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +187 -0
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +2 -1
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +11 -1
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +11 -1
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +34 -4
- data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +198 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +4 -14
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +4 -14
- data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +1 -1
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +2 -0
- data/package-lock.json +16 -2
- data/package.json +1 -1
- metadata +10 -8
|
@@ -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)
|
|
@@ -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
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
require 'date'
|
|
2
|
+
require 'time'
|
|
3
|
+
|
|
4
|
+
# Object that holds all reference properties for a refund that are linked to this transaction.
|
|
5
|
+
module PCPServerSDK
|
|
6
|
+
module Models
|
|
7
|
+
class PaymentReferencesForRefund
|
|
8
|
+
# Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes.
|
|
9
|
+
attr_accessor :merchant_reference
|
|
10
|
+
|
|
11
|
+
# Reference to the capture to be refunded.
|
|
12
|
+
attr_accessor :capture_reference
|
|
13
|
+
|
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
15
|
+
def self.attribute_map
|
|
16
|
+
{
|
|
17
|
+
:'merchant_reference' => :'merchantReference',
|
|
18
|
+
:'capture_reference' => :'captureReference'
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Returns all the JSON keys this model knows about
|
|
23
|
+
def self.acceptable_attributes
|
|
24
|
+
attribute_map.values
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Attribute type mapping.
|
|
28
|
+
def self.openapi_types
|
|
29
|
+
{
|
|
30
|
+
:'merchant_reference' => :'String',
|
|
31
|
+
:'capture_reference' => :'String'
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# List of attributes with nullable: true
|
|
36
|
+
def self.openapi_nullable
|
|
37
|
+
Set.new([])
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Initializes the object
|
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
42
|
+
def initialize(attributes = {})
|
|
43
|
+
if (!attributes.is_a?(Hash))
|
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentReferencesForRefund` initialize method"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentReferencesForRefund`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
51
|
+
end
|
|
52
|
+
h[k.to_sym] = v
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if attributes.key?(:'merchant_reference')
|
|
56
|
+
self.merchant_reference = attributes[:'merchant_reference']
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
if attributes.key?(:'capture_reference')
|
|
60
|
+
self.capture_reference = attributes[:'capture_reference']
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Checks equality by comparing each attribute.
|
|
65
|
+
# @param [Object] Object to be compared
|
|
66
|
+
def ==(o)
|
|
67
|
+
return true if self.equal?(o)
|
|
68
|
+
self.class == o.class &&
|
|
69
|
+
merchant_reference == o.merchant_reference &&
|
|
70
|
+
capture_reference == o.capture_reference
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# @see the `==` method
|
|
74
|
+
# @param [Object] Object to be compared
|
|
75
|
+
def eql?(o)
|
|
76
|
+
self == o
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Calculates hash code according to all attributes.
|
|
80
|
+
# @return [Integer] Hash code
|
|
81
|
+
def hash
|
|
82
|
+
[merchant_reference, capture_reference].hash
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Builds the object from hash
|
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
87
|
+
# @return [Object] Returns the model itself
|
|
88
|
+
def self.build_from_hash(attributes)
|
|
89
|
+
return nil unless attributes.is_a?(Hash)
|
|
90
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
91
|
+
transformed_hash = {}
|
|
92
|
+
openapi_types.each_pair do |key, type|
|
|
93
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
94
|
+
transformed_hash["#{key}"] = nil
|
|
95
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
96
|
+
# check to ensure the input is an array given that the attribute
|
|
97
|
+
# is documented as an array but the input is not
|
|
98
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
99
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
100
|
+
end
|
|
101
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
102
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
new(transformed_hash)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Deserializes the data based on type
|
|
109
|
+
# @param string type Data type
|
|
110
|
+
# @param string value Value to be deserialized
|
|
111
|
+
# @return [Object] Deserialized data
|
|
112
|
+
def self._deserialize(type, value)
|
|
113
|
+
case type.to_sym
|
|
114
|
+
when :Time
|
|
115
|
+
Time.parse(value)
|
|
116
|
+
when :Date
|
|
117
|
+
Date.parse(value)
|
|
118
|
+
when :String
|
|
119
|
+
value.to_s
|
|
120
|
+
when :Integer
|
|
121
|
+
value.to_i
|
|
122
|
+
when :Float
|
|
123
|
+
value.to_f
|
|
124
|
+
when :Boolean
|
|
125
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
126
|
+
true
|
|
127
|
+
else
|
|
128
|
+
false
|
|
129
|
+
end
|
|
130
|
+
when :Object
|
|
131
|
+
# generic object (usually a Hash), return directly
|
|
132
|
+
value
|
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
136
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
|
139
|
+
{}.tap do |hash|
|
|
140
|
+
value.each do |k, v|
|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
else # model
|
|
145
|
+
# models (e.g. Pet) or oneOf
|
|
146
|
+
klass = PCPServerSDK::Models.const_get(type)
|
|
147
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Returns the string representation of the object
|
|
152
|
+
# @return [String] String presentation of the object
|
|
153
|
+
def to_s
|
|
154
|
+
to_hash.to_s
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
|
159
|
+
def to_body
|
|
160
|
+
to_hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Returns the object in the form of hash
|
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
|
165
|
+
def to_hash
|
|
166
|
+
hash = {}
|
|
167
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
168
|
+
value = self.send(attr)
|
|
169
|
+
if value.nil?
|
|
170
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
171
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
hash[param] = _to_hash(value)
|
|
175
|
+
end
|
|
176
|
+
hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Outputs non-array value in the form of hash
|
|
180
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
181
|
+
# @param [Object] value Any valid value
|
|
182
|
+
# @return [Hash] Returns the value in the form of hash
|
|
183
|
+
def _to_hash(value)
|
|
184
|
+
if value.is_a?(Array)
|
|
185
|
+
value.compact.map { |v| _to_hash(v) }
|
|
186
|
+
elsif value.is_a?(Hash)
|
|
187
|
+
{}.tap do |hash|
|
|
188
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
189
|
+
end
|
|
190
|
+
elsif value.respond_to? :to_hash
|
|
191
|
+
value.to_hash
|
|
192
|
+
else
|
|
193
|
+
value
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
@@ -25,9 +25,6 @@ module PCPServerSDK
|
|
|
25
25
|
|
|
26
26
|
attr_accessor :redirection_data
|
|
27
27
|
|
|
28
|
-
# Indicates whether the PayPal JavaScript SDK flow is used on the redirect level.
|
|
29
|
-
attr_accessor :java_script_sdk_flow
|
|
30
|
-
|
|
31
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
29
|
def self.attribute_map
|
|
33
30
|
{
|
|
@@ -37,8 +34,7 @@ module PCPServerSDK
|
|
|
37
34
|
:'tokenize' => :'tokenize',
|
|
38
35
|
:'payment_product_id' => :'paymentProductId',
|
|
39
36
|
:'payment_product840_specific_input' => :'paymentProduct840SpecificInput',
|
|
40
|
-
:'redirection_data' => :'redirectionData'
|
|
41
|
-
:'java_script_sdk_flow' => :'javaScriptSdkFlow'
|
|
37
|
+
:'redirection_data' => :'redirectionData'
|
|
42
38
|
}
|
|
43
39
|
end
|
|
44
40
|
|
|
@@ -56,8 +52,7 @@ module PCPServerSDK
|
|
|
56
52
|
:'tokenize' => :'Boolean',
|
|
57
53
|
:'payment_product_id' => :'Integer',
|
|
58
54
|
:'payment_product840_specific_input' => :'RedirectPaymentProduct840SpecificInput',
|
|
59
|
-
:'redirection_data' => :'RedirectionData'
|
|
60
|
-
:'java_script_sdk_flow' => :'Boolean'
|
|
55
|
+
:'redirection_data' => :'RedirectionData'
|
|
61
56
|
}
|
|
62
57
|
end
|
|
63
58
|
|
|
@@ -109,10 +104,6 @@ module PCPServerSDK
|
|
|
109
104
|
if attributes.key?(:'redirection_data')
|
|
110
105
|
self.redirection_data = attributes[:'redirection_data']
|
|
111
106
|
end
|
|
112
|
-
|
|
113
|
-
if attributes.key?(:'java_script_sdk_flow')
|
|
114
|
-
self.java_script_sdk_flow = attributes[:'java_script_sdk_flow']
|
|
115
|
-
end
|
|
116
107
|
end
|
|
117
108
|
|
|
118
109
|
# Checks equality by comparing each attribute.
|
|
@@ -126,8 +117,7 @@ module PCPServerSDK
|
|
|
126
117
|
tokenize == o.tokenize &&
|
|
127
118
|
payment_product_id == o.payment_product_id &&
|
|
128
119
|
payment_product840_specific_input == o.payment_product840_specific_input &&
|
|
129
|
-
redirection_data == o.redirection_data
|
|
130
|
-
java_script_sdk_flow == o.java_script_sdk_flow
|
|
120
|
+
redirection_data == o.redirection_data
|
|
131
121
|
end
|
|
132
122
|
|
|
133
123
|
# @see the `==` method
|
|
@@ -139,7 +129,7 @@ module PCPServerSDK
|
|
|
139
129
|
# Calculates hash code according to all attributes.
|
|
140
130
|
# @return [Integer] Hash code
|
|
141
131
|
def hash
|
|
142
|
-
[requires_approval, payment_processing_token, reporting_token, tokenize, payment_product_id, payment_product840_specific_input, redirection_data
|
|
132
|
+
[requires_approval, payment_processing_token, reporting_token, tokenize, payment_product_id, payment_product840_specific_input, redirection_data].hash
|
|
143
133
|
end
|
|
144
134
|
|
|
145
135
|
# Builds the object from hash
|