pcp-server-ruby-sdk 1.6.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 +12 -0
- data/api-definition.yaml +5012 -4842
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +2 -0
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +6 -0
- data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +0 -2
- data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +0 -4
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +8 -0
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +200 -0
- data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +187 -0
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +2 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +12 -4
- data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +272 -0
- data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +211 -0
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +1 -1
- data/lib/PCP-server-Ruby-SDK/models/{network.rb → mobile_payment_network.rb} +4 -4
- 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/order_request.rb +12 -4
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +5 -38
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +34 -4
- data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +15 -4
- data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +1 -1
- data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +209 -0
- 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_payment_response.rb +12 -4
- data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +14 -5
- data/lib/PCP-server-Ruby-SDK/models/return_request.rb +204 -191
- 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 +7 -1
- data/package-lock.json +16 -3
- data/package.json +1 -1
- data/scripts.sh +2 -2
- data/spec/transformer/apple_pay_transformer_spec.rb +1 -1
- metadata +13 -7
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
|
|
2
|
+
require 'date'
|
|
3
|
+
require 'time'
|
|
4
|
+
|
|
5
|
+
module PCPServerSDK
|
|
6
|
+
module Models
|
|
7
|
+
# Object containing details on the fund split for a payment.
|
|
8
|
+
class FundSplit
|
|
9
|
+
# Unique ID of the fund split (read-only).
|
|
10
|
+
attr_accessor :id
|
|
11
|
+
|
|
12
|
+
# Unique ID of the payment event associated with this fund split (read-only).
|
|
13
|
+
attr_accessor :payment_event_id
|
|
14
|
+
|
|
15
|
+
attr_accessor :fund_distributions
|
|
16
|
+
|
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
18
|
+
def self.attribute_map
|
|
19
|
+
{
|
|
20
|
+
:'id' => :'id',
|
|
21
|
+
:'payment_event_id' => :'paymentEventId',
|
|
22
|
+
:'fund_distributions' => :'fundDistributions'
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Returns all the JSON keys this model knows about
|
|
27
|
+
def self.acceptable_attributes
|
|
28
|
+
attribute_map.values
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Attribute type mapping.
|
|
32
|
+
def self.openapi_types
|
|
33
|
+
{
|
|
34
|
+
:'id' => :'String',
|
|
35
|
+
:'payment_event_id' => :'String',
|
|
36
|
+
:'fund_distributions' => :'Array<FundDistribution>'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# List of attributes with nullable: true
|
|
41
|
+
def self.openapi_nullable
|
|
42
|
+
Set.new([
|
|
43
|
+
])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Initializes the object
|
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
|
+
def initialize(attributes = {})
|
|
49
|
+
if (!attributes.is_a?(Hash))
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FundSplit` initialize method"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FundSplit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'id')
|
|
62
|
+
self.id = attributes[:'id']
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
if attributes.key?(:'payment_event_id')
|
|
66
|
+
self.payment_event_id = attributes[:'payment_event_id']
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if attributes.key?(:'fund_distributions')
|
|
70
|
+
if (value = attributes[:'fund_distributions']).is_a?(Array)
|
|
71
|
+
self.fund_distributions = value
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
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
|
+
id == o.id &&
|
|
82
|
+
payment_event_id == o.payment_event_id &&
|
|
83
|
+
fund_distributions == o.fund_distributions
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# @see the `==` method
|
|
87
|
+
# @param [Object] Object to be compared
|
|
88
|
+
def eql?(o)
|
|
89
|
+
self == o
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Calculates hash code according to all attributes.
|
|
93
|
+
# @return [Integer] Hash code
|
|
94
|
+
def hash
|
|
95
|
+
[id, payment_event_id, fund_distributions].hash
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Builds the object from hash
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
# @return [Object] Returns the model itself
|
|
101
|
+
def self.build_from_hash(attributes)
|
|
102
|
+
return nil unless attributes.is_a?(Hash)
|
|
103
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
104
|
+
transformed_hash = {}
|
|
105
|
+
openapi_types.each_pair do |key, type|
|
|
106
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
107
|
+
transformed_hash["#{key}"] = nil
|
|
108
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
109
|
+
# check to ensure the input is an array given that the attribute
|
|
110
|
+
# is documented as an array but the input is not
|
|
111
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
112
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
113
|
+
end
|
|
114
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
115
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
new(transformed_hash)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Deserializes the data based on type
|
|
122
|
+
# @param string type Data type
|
|
123
|
+
# @param string value Value to be deserialized
|
|
124
|
+
# @return [Object] Deserialized data
|
|
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
|
+
# generic object (usually a Hash), return directly
|
|
145
|
+
value
|
|
146
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
147
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
148
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
149
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
150
|
+
k_type = Regexp.last_match[:k_type]
|
|
151
|
+
v_type = Regexp.last_match[:v_type]
|
|
152
|
+
{}.tap do |hash|
|
|
153
|
+
value.each do |k, v|
|
|
154
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
else # model
|
|
158
|
+
# models (e.g. Pet) or oneOf
|
|
159
|
+
klass = PCPServerSDK::Models.const_get(type)
|
|
160
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Returns the string representation of the object
|
|
165
|
+
# @return [String] String presentation of the object
|
|
166
|
+
def to_s
|
|
167
|
+
to_hash.to_s
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
171
|
+
# @return [Hash] Returns the object in the form of hash
|
|
172
|
+
def to_body
|
|
173
|
+
to_hash
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Returns the object in the form of hash
|
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
|
178
|
+
def to_hash
|
|
179
|
+
hash = {}
|
|
180
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
181
|
+
value = self.send(attr)
|
|
182
|
+
if value.nil?
|
|
183
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
184
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
hash[param] = _to_hash(value)
|
|
188
|
+
end
|
|
189
|
+
hash
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Outputs non-array value in the form of hash
|
|
193
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
194
|
+
# @param [Object] value Any valid value
|
|
195
|
+
# @return [Hash] Returns the value in the form of hash
|
|
196
|
+
def _to_hash(value)
|
|
197
|
+
if value.is_a?(Array)
|
|
198
|
+
value.compact.map { |v| _to_hash(v) }
|
|
199
|
+
elsif value.is_a?(Hash)
|
|
200
|
+
{}.tap do |hash|
|
|
201
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
202
|
+
end
|
|
203
|
+
elsif value.respond_to? :to_hash
|
|
204
|
+
value.to_hash
|
|
205
|
+
else
|
|
206
|
+
value
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
end
|
|
@@ -26,6 +26,8 @@ module PCPServerSDK
|
|
|
26
26
|
|
|
27
27
|
attr_accessor :payment_product302_specific_input
|
|
28
28
|
|
|
29
|
+
attr_accessor :payment_product5002_specific_input
|
|
30
|
+
|
|
29
31
|
class EnumAttributeValidator
|
|
30
32
|
attr_reader :datatype
|
|
31
33
|
attr_reader :allowable_values
|
|
@@ -57,7 +59,8 @@ module PCPServerSDK
|
|
|
57
59
|
:'public_key_hash' => :'publicKeyHash',
|
|
58
60
|
:'ephemeral_key' => :'ephemeralKey',
|
|
59
61
|
:'three_d_secure' => :'threeDSecure',
|
|
60
|
-
:'payment_product302_specific_input' => :'paymentProduct302SpecificInput'
|
|
62
|
+
:'payment_product302_specific_input' => :'paymentProduct302SpecificInput',
|
|
63
|
+
:'payment_product5002_specific_input' => :'paymentProduct5002SpecificInput'
|
|
61
64
|
}
|
|
62
65
|
end
|
|
63
66
|
|
|
@@ -75,7 +78,8 @@ module PCPServerSDK
|
|
|
75
78
|
:'public_key_hash' => :'String',
|
|
76
79
|
:'ephemeral_key' => :'String',
|
|
77
80
|
:'three_d_secure' => :'MobilePaymentThreeDSecure',
|
|
78
|
-
:'payment_product302_specific_input' => :'PaymentProduct302SpecificInput'
|
|
81
|
+
:'payment_product302_specific_input' => :'PaymentProduct302SpecificInput',
|
|
82
|
+
:'payment_product5002_specific_input' => :'PaymentProduct5002SpecificInput'
|
|
79
83
|
}
|
|
80
84
|
end
|
|
81
85
|
|
|
@@ -126,6 +130,10 @@ module PCPServerSDK
|
|
|
126
130
|
if attributes.key?(:'payment_product302_specific_input')
|
|
127
131
|
self.payment_product302_specific_input = attributes[:'payment_product302_specific_input']
|
|
128
132
|
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'payment_product5002_specific_input')
|
|
135
|
+
self.payment_product5002_specific_input = attributes[:'payment_product5002_specific_input']
|
|
136
|
+
end
|
|
129
137
|
end
|
|
130
138
|
|
|
131
139
|
# Checks equality by comparing each attribute.
|
|
@@ -139,7 +147,8 @@ module PCPServerSDK
|
|
|
139
147
|
public_key_hash == o.public_key_hash &&
|
|
140
148
|
ephemeral_key == o.ephemeral_key &&
|
|
141
149
|
three_d_secure == o.three_d_secure &&
|
|
142
|
-
payment_product302_specific_input == o.payment_product302_specific_input
|
|
150
|
+
payment_product302_specific_input == o.payment_product302_specific_input &&
|
|
151
|
+
payment_product5002_specific_input == o.payment_product5002_specific_input
|
|
143
152
|
end
|
|
144
153
|
|
|
145
154
|
def eql?(o)
|
|
@@ -147,7 +156,7 @@ module PCPServerSDK
|
|
|
147
156
|
end
|
|
148
157
|
|
|
149
158
|
def hash
|
|
150
|
-
[payment_product_id, authorization_mode, encrypted_payment_data, public_key_hash, ephemeral_key, three_d_secure, payment_product302_specific_input].hash
|
|
159
|
+
[payment_product_id, authorization_mode, encrypted_payment_data, public_key_hash, ephemeral_key, three_d_secure, payment_product302_specific_input, payment_product5002_specific_input].hash
|
|
151
160
|
end
|
|
152
161
|
|
|
153
162
|
def self.build_from_hash(attributes)
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
module PCPServerSDK
|
|
3
3
|
module Models
|
|
4
|
-
class
|
|
5
|
-
VISA = 'VISA'.freeze
|
|
4
|
+
class MobilePaymentNetwork
|
|
6
5
|
MASTERCARD = 'MASTERCARD'.freeze
|
|
6
|
+
VISA = 'VISA'.freeze
|
|
7
7
|
AMEX = 'AMEX'.freeze
|
|
8
8
|
GIROCARD = 'GIROCARD'.freeze
|
|
9
9
|
DISCOVER = 'DISCOVER'.freeze
|
|
10
10
|
JCB = 'JCB'.freeze
|
|
11
11
|
|
|
12
12
|
def self.all_networks
|
|
13
|
-
[
|
|
13
|
+
[MASTERCARD, VISA, AMEX, GIROCARD, DISCOVER, JCB]
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def self.from_string(value)
|
|
17
17
|
network = all_networks.find { |net| net.casecmp(value).zero? }
|
|
18
|
-
raise TypeError, "'#{value}' can't represent a
|
|
18
|
+
raise TypeError, "'#{value}' can't represent a MobilePaymentNetwork" unless network
|
|
19
19
|
|
|
20
20
|
network
|
|
21
21
|
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
|
|
@@ -14,6 +14,7 @@ module PCPServerSDK
|
|
|
14
14
|
|
|
15
15
|
attr_accessor :payment_method_specific_input
|
|
16
16
|
|
|
17
|
+
attr_accessor :fund_split
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class EnumAttributeValidator
|
|
@@ -44,7 +45,8 @@ module PCPServerSDK
|
|
|
44
45
|
:'order_type' => :'orderType',
|
|
45
46
|
:'order_references' => :'orderReferences',
|
|
46
47
|
:'items' => :'items',
|
|
47
|
-
:'payment_method_specific_input' => :'paymentMethodSpecificInput'
|
|
48
|
+
:'payment_method_specific_input' => :'paymentMethodSpecificInput',
|
|
49
|
+
:'fund_split' => :'fundSplit'
|
|
48
50
|
}
|
|
49
51
|
end
|
|
50
52
|
|
|
@@ -59,7 +61,8 @@ module PCPServerSDK
|
|
|
59
61
|
:'order_type' => :'OrderType',
|
|
60
62
|
:'order_references' => :'References',
|
|
61
63
|
:'items' => :'Array<OrderItem>',
|
|
62
|
-
:'payment_method_specific_input' => :'PaymentMethodSpecificInput'
|
|
64
|
+
:'payment_method_specific_input' => :'PaymentMethodSpecificInput',
|
|
65
|
+
:'fund_split' => :'FundSplit'
|
|
63
66
|
}
|
|
64
67
|
end
|
|
65
68
|
|
|
@@ -101,6 +104,10 @@ module PCPServerSDK
|
|
|
101
104
|
if attributes.key?(:'payment_method_specific_input')
|
|
102
105
|
self.payment_method_specific_input = attributes[:'payment_method_specific_input']
|
|
103
106
|
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'fund_split')
|
|
109
|
+
self.fund_split = attributes[:'fund_split']
|
|
110
|
+
end
|
|
104
111
|
end
|
|
105
112
|
|
|
106
113
|
# Checks equality by comparing each attribute.
|
|
@@ -111,7 +118,8 @@ module PCPServerSDK
|
|
|
111
118
|
order_type == o.order_type &&
|
|
112
119
|
order_references == o.order_references &&
|
|
113
120
|
items == o.items &&
|
|
114
|
-
payment_method_specific_input == o.payment_method_specific_input
|
|
121
|
+
payment_method_specific_input == o.payment_method_specific_input &&
|
|
122
|
+
fund_split == o.fund_split
|
|
115
123
|
end
|
|
116
124
|
|
|
117
125
|
# @see the `==` method
|
|
@@ -123,7 +131,7 @@ module PCPServerSDK
|
|
|
123
131
|
# Calculates hash code according to all attributes.
|
|
124
132
|
# @return [Integer] Hash code
|
|
125
133
|
def hash
|
|
126
|
-
[order_type, order_references, items, payment_method_specific_input].hash
|
|
134
|
+
[order_type, order_references, items, payment_method_specific_input, fund_split].hash
|
|
127
135
|
end
|
|
128
136
|
|
|
129
137
|
# Builds the object from hash
|
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
require 'date'
|
|
2
2
|
require 'time'
|
|
3
3
|
|
|
4
|
-
# Request to
|
|
4
|
+
# Request to pause a specific payment.
|
|
5
5
|
module PCPServerSDK
|
|
6
6
|
module Models
|
|
7
7
|
class PausePaymentRequest
|
|
8
|
-
attr_accessor :refresh_type
|
|
9
|
-
|
|
10
|
-
class EnumAttributeValidator
|
|
11
|
-
attr_reader :datatype
|
|
12
|
-
attr_reader :allowable_values
|
|
13
|
-
|
|
14
|
-
def initialize(datatype, allowable_values)
|
|
15
|
-
@allowable_values = allowable_values.map do |value|
|
|
16
|
-
case datatype.to_s
|
|
17
|
-
when /Integer/i
|
|
18
|
-
value.to_i
|
|
19
|
-
when /Float/i
|
|
20
|
-
value.to_f
|
|
21
|
-
else
|
|
22
|
-
value
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def valid?(value)
|
|
28
|
-
!value || allowable_values.include?(value)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
8
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
9
|
def self.attribute_map
|
|
34
|
-
{
|
|
35
|
-
:'refresh_type' => :'refreshType'
|
|
36
|
-
}
|
|
10
|
+
{}
|
|
37
11
|
end
|
|
38
12
|
|
|
39
13
|
# Returns all the JSON keys this model knows about
|
|
@@ -43,9 +17,7 @@ module PCPServerSDK
|
|
|
43
17
|
|
|
44
18
|
# Attribute type mapping.
|
|
45
19
|
def self.openapi_types
|
|
46
|
-
{
|
|
47
|
-
:'refresh_type' => :'RefreshType'
|
|
48
|
-
}
|
|
20
|
+
{}
|
|
49
21
|
end
|
|
50
22
|
|
|
51
23
|
# List of attributes with nullable: true
|
|
@@ -66,18 +38,13 @@ module PCPServerSDK
|
|
|
66
38
|
end
|
|
67
39
|
h[k.to_sym] = v
|
|
68
40
|
}
|
|
69
|
-
|
|
70
|
-
if attributes.key?(:'refresh_type')
|
|
71
|
-
self.refresh_type = attributes[:'refresh_type']
|
|
72
|
-
end
|
|
73
41
|
end
|
|
74
42
|
|
|
75
43
|
# Checks equality by comparing each attribute.
|
|
76
44
|
# @param [Object] Object to be compared
|
|
77
45
|
def ==(o)
|
|
78
46
|
return true if self.equal?(o)
|
|
79
|
-
self.class == o.class
|
|
80
|
-
refresh_type == o.refresh_type
|
|
47
|
+
self.class == o.class
|
|
81
48
|
end
|
|
82
49
|
|
|
83
50
|
# @see the `==` method
|
|
@@ -89,7 +56,7 @@ module PCPServerSDK
|
|
|
89
56
|
# Calculates hash code according to all attributes.
|
|
90
57
|
# @return [Integer] Hash code
|
|
91
58
|
def hash
|
|
92
|
-
[
|
|
59
|
+
[].hash
|
|
93
60
|
end
|
|
94
61
|
|
|
95
62
|
# 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
|