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
|
@@ -36,6 +36,8 @@ module PCPServerSDK
|
|
|
36
36
|
|
|
37
37
|
attr_accessor :events
|
|
38
38
|
|
|
39
|
+
attr_accessor :fund_splits
|
|
40
|
+
|
|
39
41
|
class EnumAttributeValidator
|
|
40
42
|
attr_reader :datatype
|
|
41
43
|
attr_reader :allowable_values
|
|
@@ -74,7 +76,8 @@ module PCPServerSDK
|
|
|
74
76
|
:'previous_payment' => :'previousPayment',
|
|
75
77
|
:'creation_date_time' => :'creationDateTime',
|
|
76
78
|
:'last_updated' => :'lastUpdated',
|
|
77
|
-
:'events' => :'events'
|
|
79
|
+
:'events' => :'events',
|
|
80
|
+
:'fund_splits' => :'fundSplits'
|
|
78
81
|
}
|
|
79
82
|
end
|
|
80
83
|
|
|
@@ -99,7 +102,8 @@ module PCPServerSDK
|
|
|
99
102
|
:'previous_payment' => :'String',
|
|
100
103
|
:'creation_date_time' => :'Time',
|
|
101
104
|
:'last_updated' => :'Time',
|
|
102
|
-
:'events' => :'Array<PaymentEvent>'
|
|
105
|
+
:'events' => :'Array<PaymentEvent>',
|
|
106
|
+
:'fund_splits' => :'Array<FundSplit>'
|
|
103
107
|
}
|
|
104
108
|
end
|
|
105
109
|
|
|
@@ -181,6 +185,12 @@ module PCPServerSDK
|
|
|
181
185
|
self.events = value
|
|
182
186
|
end
|
|
183
187
|
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'fund_splits')
|
|
190
|
+
if (value = attributes[:'fund_splits']).is_a?(Array)
|
|
191
|
+
self.fund_splits = value
|
|
192
|
+
end
|
|
193
|
+
end
|
|
184
194
|
end
|
|
185
195
|
|
|
186
196
|
# Checks equality by comparing each attribute.
|
|
@@ -200,7 +210,8 @@ module PCPServerSDK
|
|
|
200
210
|
previous_payment == o.previous_payment &&
|
|
201
211
|
creation_date_time == o.creation_date_time &&
|
|
202
212
|
last_updated == o.last_updated &&
|
|
203
|
-
events == o.events
|
|
213
|
+
events == o.events &&
|
|
214
|
+
fund_splits == o.fund_splits
|
|
204
215
|
end
|
|
205
216
|
|
|
206
217
|
# @see the `==` method
|
|
@@ -213,7 +224,7 @@ module PCPServerSDK
|
|
|
213
224
|
[payment_execution_id, payment_id, card_payment_method_specific_input, mobile_payment_method_specific_input,
|
|
214
225
|
redirect_payment_method_specific_input, sepa_direct_debit_payment_method_specific_input,
|
|
215
226
|
financing_payment_method_specific_input, bank_payout_method_specific_input, payment_channel, references,
|
|
216
|
-
previous_payment, creation_date_time, last_updated, events].hash
|
|
227
|
+
previous_payment, creation_date_time, last_updated, events, fund_splits].hash
|
|
217
228
|
end
|
|
218
229
|
|
|
219
230
|
# Builds the object from hash
|
|
@@ -12,12 +12,15 @@ module PCPServerSDK
|
|
|
12
12
|
|
|
13
13
|
attr_accessor :payment_references
|
|
14
14
|
|
|
15
|
+
attr_accessor :fund_split
|
|
16
|
+
|
|
15
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
16
18
|
def self.attribute_map
|
|
17
19
|
{
|
|
18
20
|
:'amount_of_money' => :'amountOfMoney',
|
|
19
21
|
:'shopping_cart' => :'shoppingCart',
|
|
20
|
-
:'payment_references' => :'paymentReferences'
|
|
22
|
+
:'payment_references' => :'paymentReferences',
|
|
23
|
+
:'fund_split' => :'fundSplit'
|
|
21
24
|
}
|
|
22
25
|
end
|
|
23
26
|
|
|
@@ -31,7 +34,8 @@ module PCPServerSDK
|
|
|
31
34
|
{
|
|
32
35
|
:'amount_of_money' => :'AmountOfMoney',
|
|
33
36
|
:'shopping_cart' => :'ShoppingCartInput',
|
|
34
|
-
:'payment_references' => :'References'
|
|
37
|
+
:'payment_references' => :'References',
|
|
38
|
+
:'fund_split' => :'FundSplit'
|
|
35
39
|
}
|
|
36
40
|
end
|
|
37
41
|
|
|
@@ -69,6 +73,10 @@ module PCPServerSDK
|
|
|
69
73
|
else
|
|
70
74
|
self.payment_references = nil
|
|
71
75
|
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'fund_split')
|
|
78
|
+
self.fund_split = attributes[:'fund_split']
|
|
79
|
+
end
|
|
72
80
|
end
|
|
73
81
|
|
|
74
82
|
# Checks equality by comparing each attribute.
|
|
@@ -78,7 +86,8 @@ module PCPServerSDK
|
|
|
78
86
|
self.class == o.class &&
|
|
79
87
|
amount_of_money == o.amount_of_money &&
|
|
80
88
|
shopping_cart == o.shopping_cart &&
|
|
81
|
-
payment_references == o.payment_references
|
|
89
|
+
payment_references == o.payment_references &&
|
|
90
|
+
fund_split == o.fund_split
|
|
82
91
|
end
|
|
83
92
|
|
|
84
93
|
# @see the `==` method
|
|
@@ -90,7 +99,7 @@ module PCPServerSDK
|
|
|
90
99
|
# Calculates hash code according to all attributes.
|
|
91
100
|
# @return [Integer] Hash code
|
|
92
101
|
def hash
|
|
93
|
-
[amount_of_money, shopping_cart, payment_references].hash
|
|
102
|
+
[amount_of_money, shopping_cart, payment_references, fund_split].hash
|
|
94
103
|
end
|
|
95
104
|
|
|
96
105
|
# Builds the object from hash
|
|
@@ -62,7 +62,7 @@ module PCPServerSDK
|
|
|
62
62
|
def self.openapi_types
|
|
63
63
|
{
|
|
64
64
|
:'integration_type' => :'String',
|
|
65
|
-
:'network' => :'
|
|
65
|
+
:'network' => :'MobilePaymentNetwork',
|
|
66
66
|
:'token' => :'ApplePaymentDataTokenInformation',
|
|
67
67
|
:'domain_name' => :'String',
|
|
68
68
|
:'display_name' => :'String'
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
|
|
2
|
+
require 'date'
|
|
3
|
+
require 'time'
|
|
4
|
+
|
|
5
|
+
module PCPServerSDK
|
|
6
|
+
module Models
|
|
7
|
+
# Object containing Click To Pay (product 5002) specific input details.
|
|
8
|
+
class PaymentProduct5002SpecificInput
|
|
9
|
+
attr_accessor :network
|
|
10
|
+
|
|
11
|
+
# The encrypted payment data for Click To Pay transactions.
|
|
12
|
+
attr_accessor :payment_checkout_data
|
|
13
|
+
|
|
14
|
+
# The SRC DPA ID for Click To Pay transactions.
|
|
15
|
+
attr_accessor :src_dpa_id
|
|
16
|
+
|
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
18
|
+
def self.attribute_map
|
|
19
|
+
{
|
|
20
|
+
:'network' => :'network',
|
|
21
|
+
:'payment_checkout_data' => :'paymentCheckoutData',
|
|
22
|
+
:'src_dpa_id' => :'srcDpaId'
|
|
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
|
+
:'network' => :'MobilePaymentNetwork',
|
|
35
|
+
:'payment_checkout_data' => :'String',
|
|
36
|
+
:'src_dpa_id' => :'String'
|
|
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 `PaymentProduct5002SpecificInput` 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 `PaymentProduct5002SpecificInput`. 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?(:'network')
|
|
62
|
+
self.network = attributes[:'network']
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
if attributes.key?(:'payment_checkout_data')
|
|
66
|
+
self.payment_checkout_data = attributes[:'payment_checkout_data']
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if attributes.key?(:'src_dpa_id')
|
|
70
|
+
self.src_dpa_id = attributes[:'src_dpa_id']
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Checks equality by comparing each attribute.
|
|
75
|
+
# @param [Object] Object to be compared
|
|
76
|
+
def ==(o)
|
|
77
|
+
return true if self.equal?(o)
|
|
78
|
+
self.class == o.class &&
|
|
79
|
+
network == o.network &&
|
|
80
|
+
payment_checkout_data == o.payment_checkout_data &&
|
|
81
|
+
src_dpa_id == o.src_dpa_id
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# @see the `==` method
|
|
85
|
+
# @param [Object] Object to be compared
|
|
86
|
+
def eql?(o)
|
|
87
|
+
self == o
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Calculates hash code according to all attributes.
|
|
91
|
+
# @return [Integer] Hash code
|
|
92
|
+
def hash
|
|
93
|
+
[network, payment_checkout_data, src_dpa_id].hash
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Builds the object from hash
|
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
98
|
+
# @return [Object] Returns the model itself
|
|
99
|
+
def self.build_from_hash(attributes)
|
|
100
|
+
return nil unless attributes.is_a?(Hash)
|
|
101
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
102
|
+
transformed_hash = {}
|
|
103
|
+
openapi_types.each_pair do |key, type|
|
|
104
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
105
|
+
transformed_hash["#{key}"] = nil
|
|
106
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
107
|
+
# check to ensure the input is an array given that the attribute
|
|
108
|
+
# is documented as an array but the input is not
|
|
109
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
110
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
111
|
+
end
|
|
112
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
113
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
new(transformed_hash)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Deserializes the data based on type
|
|
120
|
+
# @param string type Data type
|
|
121
|
+
# @param string value Value to be deserialized
|
|
122
|
+
# @return [Object] Deserialized data
|
|
123
|
+
def self._deserialize(type, value)
|
|
124
|
+
case type.to_sym
|
|
125
|
+
when :Time
|
|
126
|
+
Time.parse(value)
|
|
127
|
+
when :Date
|
|
128
|
+
Date.parse(value)
|
|
129
|
+
when :String
|
|
130
|
+
value.to_s
|
|
131
|
+
when :Integer
|
|
132
|
+
value.to_i
|
|
133
|
+
when :Float
|
|
134
|
+
value.to_f
|
|
135
|
+
when :Boolean
|
|
136
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
137
|
+
true
|
|
138
|
+
else
|
|
139
|
+
false
|
|
140
|
+
end
|
|
141
|
+
when :Object
|
|
142
|
+
# generic object (usually a Hash), return directly
|
|
143
|
+
value
|
|
144
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
145
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
146
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
147
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
148
|
+
k_type = Regexp.last_match[:k_type]
|
|
149
|
+
v_type = Regexp.last_match[:v_type]
|
|
150
|
+
{}.tap do |hash|
|
|
151
|
+
value.each do |k, v|
|
|
152
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
else # model
|
|
156
|
+
# models (e.g. Pet) or oneOf
|
|
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
|
+
# @return [String] String presentation of the object
|
|
164
|
+
def to_s
|
|
165
|
+
to_hash.to_s
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
|
170
|
+
def to_body
|
|
171
|
+
to_hash
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the object in the form of hash
|
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
|
176
|
+
def to_hash
|
|
177
|
+
hash = {}
|
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
179
|
+
value = self.send(attr)
|
|
180
|
+
if value.nil?
|
|
181
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
182
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
hash[param] = _to_hash(value)
|
|
186
|
+
end
|
|
187
|
+
hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Outputs non-array value in the form of hash
|
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
192
|
+
# @param [Object] value Any valid value
|
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
|
194
|
+
def _to_hash(value)
|
|
195
|
+
if value.is_a?(Array)
|
|
196
|
+
value.compact.map { |v| _to_hash(v) }
|
|
197
|
+
elsif value.is_a?(Hash)
|
|
198
|
+
{}.tap do |hash|
|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
200
|
+
end
|
|
201
|
+
elsif value.respond_to? :to_hash
|
|
202
|
+
value.to_hash
|
|
203
|
+
else
|
|
204
|
+
value
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
@@ -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
|
|
@@ -17,17 +17,13 @@ module PCPServerSDK
|
|
|
17
17
|
# Token to identify the card in the reporting.
|
|
18
18
|
attr_accessor :reporting_token
|
|
19
19
|
|
|
20
|
-
# Indicates whether the PayPal JavaScript SDK flow was used for the redirect payment.
|
|
21
|
-
attr_accessor :java_script_sdk_flow
|
|
22
|
-
|
|
23
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
21
|
def self.attribute_map
|
|
25
22
|
{
|
|
26
23
|
:'payment_product_id' => :'paymentProductId',
|
|
27
24
|
:'payment_product840_specific_output' => :'paymentProduct840SpecificOutput',
|
|
28
25
|
:'payment_processing_token' => :'paymentProcessingToken',
|
|
29
|
-
:'reporting_token' => :'reportingToken'
|
|
30
|
-
:'java_script_sdk_flow' => :'javaScriptSdkFlow'
|
|
26
|
+
:'reporting_token' => :'reportingToken'
|
|
31
27
|
}
|
|
32
28
|
end
|
|
33
29
|
|
|
@@ -42,8 +38,7 @@ module PCPServerSDK
|
|
|
42
38
|
:'payment_product_id' => :'Integer',
|
|
43
39
|
:'payment_product840_specific_output' => :'PaymentProduct840SpecificOutput',
|
|
44
40
|
:'payment_processing_token' => :'String',
|
|
45
|
-
:'reporting_token' => :'String'
|
|
46
|
-
:'java_script_sdk_flow' => :'Boolean'
|
|
41
|
+
:'reporting_token' => :'String'
|
|
47
42
|
}
|
|
48
43
|
end
|
|
49
44
|
|
|
@@ -83,10 +78,6 @@ module PCPServerSDK
|
|
|
83
78
|
if attributes.key?(:'reporting_token')
|
|
84
79
|
self.reporting_token = attributes[:'reporting_token']
|
|
85
80
|
end
|
|
86
|
-
|
|
87
|
-
if attributes.key?(:'java_script_sdk_flow')
|
|
88
|
-
self.java_script_sdk_flow = attributes[:'java_script_sdk_flow']
|
|
89
|
-
end
|
|
90
81
|
end
|
|
91
82
|
|
|
92
83
|
# Checks equality by comparing each attribute.
|
|
@@ -97,8 +88,7 @@ module PCPServerSDK
|
|
|
97
88
|
payment_product_id == o.payment_product_id &&
|
|
98
89
|
payment_product840_specific_output == o.payment_product840_specific_output &&
|
|
99
90
|
payment_processing_token == o.payment_processing_token &&
|
|
100
|
-
reporting_token == o.reporting_token
|
|
101
|
-
java_script_sdk_flow == o.java_script_sdk_flow
|
|
91
|
+
reporting_token == o.reporting_token
|
|
102
92
|
end
|
|
103
93
|
|
|
104
94
|
# @see the `==` method
|
|
@@ -110,7 +100,7 @@ module PCPServerSDK
|
|
|
110
100
|
# Calculates hash code according to all attributes.
|
|
111
101
|
# @return [Integer] Hash code
|
|
112
102
|
def hash
|
|
113
|
-
[payment_product_id, payment_product840_specific_output, payment_processing_token, reporting_token
|
|
103
|
+
[payment_product_id, payment_product840_specific_output, payment_processing_token, reporting_token].hash
|
|
114
104
|
end
|
|
115
105
|
|
|
116
106
|
# Builds the object from hash
|