pcp-server-ruby-sdk 1.8.0 → 1.10.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 +14 -0
- data/README.md +1 -1
- data/api-definition.yaml +5200 -5012
- data/lib/PCP-server-Ruby-SDK/endpoints/checkout_api_client.rb +3 -1
- data/lib/PCP-server-Ruby-SDK/endpoints/commerce_case_api_client.rb +5 -4
- data/lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb +25 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_execution_api_client.rb +26 -0
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +16 -4
- data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +2 -0
- data/lib/PCP-server-Ruby-SDK/models/commerce_cases_response.rb +18 -0
- data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +153 -0
- data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +180 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +9 -2
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +10 -1
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +183 -0
- data/lib/PCP-server-Ruby-SDK/models/required_field_validation.rb +108 -0
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +7 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/spec/endpoints/checkout_api_client_spec.rb +22 -0
- data/spec/endpoints/order_management_checkout_actions_api_client_spec.rb +51 -0
- data/spec/endpoints/payment_execution_api_client_spec.rb +52 -0
- data/spec/models/required_field_validation_spec.rb +551 -0
- metadata +14 -7
|
@@ -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
|
|
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::
|
|
58
|
-
# @return [
|
|
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
|
-
|
|
74
|
-
|
|
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
|
|
|
@@ -6,6 +6,7 @@ require_relative '../models/cancel_payment_response'
|
|
|
6
6
|
require_relative '../models/capture_payment_response'
|
|
7
7
|
require_relative '../models/complete_payment_response'
|
|
8
8
|
require_relative '../models/create_payment_response'
|
|
9
|
+
require_relative '../models/fund_split_response'
|
|
9
10
|
require_relative '../models/refund_payment_response'
|
|
10
11
|
module PCPServerSDK
|
|
11
12
|
module Endpoints
|
|
@@ -176,6 +177,31 @@ module PCPServerSDK
|
|
|
176
177
|
deserialize_json(response, PCPServerSDK::Models::PaymentExecution)
|
|
177
178
|
end
|
|
178
179
|
|
|
180
|
+
# Create a fund split for a payment event
|
|
181
|
+
# @param merchant_id [String] The merchant identifier
|
|
182
|
+
# @param commerce_case_id [String] The commerce case identifier
|
|
183
|
+
# @param checkout_id [String] The checkout identifier
|
|
184
|
+
# @param payment_execution_id [String] The payment execution identifier
|
|
185
|
+
# @param event_id [String] The payment event identifier
|
|
186
|
+
# @param payload [PCPServerSDK::Models::FundSplitRequest] The fund split request
|
|
187
|
+
# @return [PCPServerSDK::Models::FundSplitResponse] The fund split response
|
|
188
|
+
def create_fund_split(merchant_id, commerce_case_id, checkout_id, payment_execution_id, event_id, payload)
|
|
189
|
+
validate_ids(merchant_id, commerce_case_id, checkout_id)
|
|
190
|
+
raise TypeError, PAYMENT_EXECUTION_ID_REQUIRED_ERROR if payment_execution_id.nil? || payment_execution_id.empty?
|
|
191
|
+
raise TypeError, 'Event ID is required' if event_id.nil? || event_id.empty?
|
|
192
|
+
|
|
193
|
+
url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/payment-executions/#{payment_execution_id}/events/#{event_id}/fund-splits")
|
|
194
|
+
|
|
195
|
+
request_init = {
|
|
196
|
+
method: 'POST',
|
|
197
|
+
headers: { 'Content-Type' => 'application/json' },
|
|
198
|
+
body: JSON.generate(payload)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
response = make_api_call(url.to_s, request_init)
|
|
202
|
+
deserialize_json(response, PCPServerSDK::Models::FundSplitResponse)
|
|
203
|
+
end
|
|
204
|
+
|
|
179
205
|
|
|
180
206
|
private
|
|
181
207
|
|
|
@@ -6,6 +6,11 @@ module PCPServerSDK
|
|
|
6
6
|
class CancelPaymentRequest
|
|
7
7
|
attr_accessor :cancellation_reason
|
|
8
8
|
|
|
9
|
+
# Here you can specify the amount that you want to cancel (specified in cents, where single digit currencies
|
|
10
|
+
# are presumed to have 2 digits). The amount can be lower than the amount that was authorized, but not higher.
|
|
11
|
+
# If left empty, the remaining open amount will be cancelled.
|
|
12
|
+
attr_accessor :amount
|
|
13
|
+
|
|
9
14
|
class EnumAttributeValidator
|
|
10
15
|
attr_reader :datatype
|
|
11
16
|
attr_reader :allowable_values
|
|
@@ -31,7 +36,8 @@ module PCPServerSDK
|
|
|
31
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
37
|
def self.attribute_map
|
|
33
38
|
{
|
|
34
|
-
:'cancellation_reason' => :'cancellationReason'
|
|
39
|
+
:'cancellation_reason' => :'cancellationReason',
|
|
40
|
+
:'amount' => :'amount'
|
|
35
41
|
}
|
|
36
42
|
end
|
|
37
43
|
|
|
@@ -43,7 +49,8 @@ module PCPServerSDK
|
|
|
43
49
|
# Attribute type mapping.
|
|
44
50
|
def self.openapi_types
|
|
45
51
|
{
|
|
46
|
-
:'cancellation_reason' => :'CancellationReason'
|
|
52
|
+
:'cancellation_reason' => :'CancellationReason',
|
|
53
|
+
:'amount' => :'Integer'
|
|
47
54
|
}
|
|
48
55
|
end
|
|
49
56
|
|
|
@@ -71,6 +78,10 @@ module PCPServerSDK
|
|
|
71
78
|
if attributes.key?(:'cancellation_reason')
|
|
72
79
|
self.cancellation_reason = attributes[:'cancellation_reason']
|
|
73
80
|
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'amount')
|
|
83
|
+
self.amount = attributes[:'amount']
|
|
84
|
+
end
|
|
74
85
|
end
|
|
75
86
|
|
|
76
87
|
# Checks equality by comparing each attribute.
|
|
@@ -78,7 +89,8 @@ module PCPServerSDK
|
|
|
78
89
|
def ==(o)
|
|
79
90
|
return true if self.equal?(o)
|
|
80
91
|
self.class == o.class &&
|
|
81
|
-
cancellation_reason == o.cancellation_reason
|
|
92
|
+
cancellation_reason == o.cancellation_reason &&
|
|
93
|
+
amount == o.amount
|
|
82
94
|
end
|
|
83
95
|
|
|
84
96
|
# @see the `==` method
|
|
@@ -90,7 +102,7 @@ module PCPServerSDK
|
|
|
90
102
|
# Calculates hash code according to all attributes.
|
|
91
103
|
# @return [Integer] Hash code
|
|
92
104
|
def hash
|
|
93
|
-
[cancellation_reason].hash
|
|
105
|
+
[cancellation_reason, amount].hash
|
|
94
106
|
end
|
|
95
107
|
|
|
96
108
|
# Builds the object from hash
|
|
@@ -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,153 @@
|
|
|
1
|
+
|
|
2
|
+
require 'date'
|
|
3
|
+
require 'time'
|
|
4
|
+
|
|
5
|
+
module PCPServerSDK
|
|
6
|
+
module Models
|
|
7
|
+
class FundSplitRequest
|
|
8
|
+
attr_accessor :fund_split
|
|
9
|
+
|
|
10
|
+
def self.attribute_map
|
|
11
|
+
{
|
|
12
|
+
:'fund_split' => :'fundSplit'
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.acceptable_attributes
|
|
17
|
+
attribute_map.values
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.openapi_types
|
|
21
|
+
{
|
|
22
|
+
:'fund_split' => :'FundSplit'
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.openapi_nullable
|
|
27
|
+
Set.new([])
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def initialize(attributes = {})
|
|
31
|
+
if (!attributes.is_a?(Hash))
|
|
32
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FundSplitRequest` initialize method"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
36
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
37
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FundSplitRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
38
|
+
end
|
|
39
|
+
h[k.to_sym] = v
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if attributes.key?(:'fund_split')
|
|
43
|
+
self.fund_split = attributes[:'fund_split']
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def ==(o)
|
|
48
|
+
return true if self.equal?(o)
|
|
49
|
+
self.class == o.class &&
|
|
50
|
+
fund_split == o.fund_split
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def eql?(o)
|
|
54
|
+
self == o
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def hash
|
|
58
|
+
[fund_split].hash
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def self.build_from_hash(attributes)
|
|
62
|
+
return nil unless attributes.is_a?(Hash)
|
|
63
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
64
|
+
transformed_hash = {}
|
|
65
|
+
openapi_types.each_pair do |key, type|
|
|
66
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
67
|
+
transformed_hash["#{key}"] = nil
|
|
68
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
69
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
70
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
71
|
+
end
|
|
72
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
73
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
new(transformed_hash)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def self._deserialize(type, value)
|
|
80
|
+
case type.to_sym
|
|
81
|
+
when :Time
|
|
82
|
+
Time.parse(value)
|
|
83
|
+
when :Date
|
|
84
|
+
Date.parse(value)
|
|
85
|
+
when :String
|
|
86
|
+
value.to_s
|
|
87
|
+
when :Integer
|
|
88
|
+
value.to_i
|
|
89
|
+
when :Float
|
|
90
|
+
value.to_f
|
|
91
|
+
when :Boolean
|
|
92
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
93
|
+
true
|
|
94
|
+
else
|
|
95
|
+
false
|
|
96
|
+
end
|
|
97
|
+
when :Object
|
|
98
|
+
value
|
|
99
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
100
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
101
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
102
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
103
|
+
k_type = Regexp.last_match[:k_type]
|
|
104
|
+
v_type = Regexp.last_match[:v_type]
|
|
105
|
+
{}.tap do |hash|
|
|
106
|
+
value.each do |k, v|
|
|
107
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
else
|
|
111
|
+
klass = PCPServerSDK::Models.const_get(type)
|
|
112
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def to_s
|
|
117
|
+
to_hash.to_s
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def to_body
|
|
121
|
+
to_hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def to_hash
|
|
125
|
+
hash = {}
|
|
126
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
127
|
+
value = self.send(attr)
|
|
128
|
+
if value.nil?
|
|
129
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
130
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
hash[param] = _to_hash(value)
|
|
134
|
+
end
|
|
135
|
+
hash
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def _to_hash(value)
|
|
139
|
+
if value.is_a?(Array)
|
|
140
|
+
value.compact.map { |v| _to_hash(v) }
|
|
141
|
+
elsif value.is_a?(Hash)
|
|
142
|
+
{}.tap do |hash|
|
|
143
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
144
|
+
end
|
|
145
|
+
elsif value.respond_to? :to_hash
|
|
146
|
+
value.to_hash
|
|
147
|
+
else
|
|
148
|
+
value
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
|
|
2
|
+
require 'date'
|
|
3
|
+
require 'time'
|
|
4
|
+
|
|
5
|
+
module PCPServerSDK
|
|
6
|
+
module Models
|
|
7
|
+
class FundSplitResponse
|
|
8
|
+
attr_accessor :fund_split_id
|
|
9
|
+
|
|
10
|
+
attr_accessor :payment_execution_id
|
|
11
|
+
|
|
12
|
+
attr_accessor :event_id
|
|
13
|
+
|
|
14
|
+
attr_accessor :fund_split
|
|
15
|
+
|
|
16
|
+
def self.attribute_map
|
|
17
|
+
{
|
|
18
|
+
:'fund_split_id' => :'fundSplitId',
|
|
19
|
+
:'payment_execution_id' => :'paymentExecutionId',
|
|
20
|
+
:'event_id' => :'eventId',
|
|
21
|
+
:'fund_split' => :'fundSplit'
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.acceptable_attributes
|
|
26
|
+
attribute_map.values
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.openapi_types
|
|
30
|
+
{
|
|
31
|
+
:'fund_split_id' => :'String',
|
|
32
|
+
:'payment_execution_id' => :'String',
|
|
33
|
+
:'event_id' => :'String',
|
|
34
|
+
:'fund_split' => :'FundSplit'
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.openapi_nullable
|
|
39
|
+
Set.new([])
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def initialize(attributes = {})
|
|
43
|
+
if (!attributes.is_a?(Hash))
|
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FundSplitResponse` initialize method"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FundSplitResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
50
|
+
end
|
|
51
|
+
h[k.to_sym] = v
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if attributes.key?(:'fund_split_id')
|
|
55
|
+
self.fund_split_id = attributes[:'fund_split_id']
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
if attributes.key?(:'payment_execution_id')
|
|
59
|
+
self.payment_execution_id = attributes[:'payment_execution_id']
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
if attributes.key?(:'event_id')
|
|
63
|
+
self.event_id = attributes[:'event_id']
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'fund_split')
|
|
67
|
+
self.fund_split = attributes[:'fund_split']
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def ==(o)
|
|
72
|
+
return true if self.equal?(o)
|
|
73
|
+
self.class == o.class &&
|
|
74
|
+
fund_split_id == o.fund_split_id &&
|
|
75
|
+
payment_execution_id == o.payment_execution_id &&
|
|
76
|
+
event_id == o.event_id &&
|
|
77
|
+
fund_split == o.fund_split
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def eql?(o)
|
|
81
|
+
self == o
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def hash
|
|
85
|
+
[fund_split_id, payment_execution_id, event_id, fund_split].hash
|
|
86
|
+
end
|
|
87
|
+
|
|
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
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
97
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
98
|
+
end
|
|
99
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
100
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
new(transformed_hash)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def self._deserialize(type, value)
|
|
107
|
+
case type.to_sym
|
|
108
|
+
when :Time
|
|
109
|
+
Time.parse(value)
|
|
110
|
+
when :Date
|
|
111
|
+
Date.parse(value)
|
|
112
|
+
when :String
|
|
113
|
+
value.to_s
|
|
114
|
+
when :Integer
|
|
115
|
+
value.to_i
|
|
116
|
+
when :Float
|
|
117
|
+
value.to_f
|
|
118
|
+
when :Boolean
|
|
119
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
120
|
+
true
|
|
121
|
+
else
|
|
122
|
+
false
|
|
123
|
+
end
|
|
124
|
+
when :Object
|
|
125
|
+
value
|
|
126
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
127
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
128
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
129
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
130
|
+
k_type = Regexp.last_match[:k_type]
|
|
131
|
+
v_type = Regexp.last_match[:v_type]
|
|
132
|
+
{}.tap do |hash|
|
|
133
|
+
value.each do |k, v|
|
|
134
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
else
|
|
138
|
+
klass = PCPServerSDK::Models.const_get(type)
|
|
139
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def to_s
|
|
144
|
+
to_hash.to_s
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def to_body
|
|
148
|
+
to_hash
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def to_hash
|
|
152
|
+
hash = {}
|
|
153
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
154
|
+
value = self.send(attr)
|
|
155
|
+
if value.nil?
|
|
156
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
157
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
hash[param] = _to_hash(value)
|
|
161
|
+
end
|
|
162
|
+
hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def _to_hash(value)
|
|
166
|
+
if value.is_a?(Array)
|
|
167
|
+
value.compact.map { |v| _to_hash(v) }
|
|
168
|
+
elsif value.is_a?(Hash)
|
|
169
|
+
{}.tap do |hash|
|
|
170
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
171
|
+
end
|
|
172
|
+
elsif value.respond_to? :to_hash
|
|
173
|
+
value.to_hash
|
|
174
|
+
else
|
|
175
|
+
value
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
require 'date'
|
|
2
2
|
require 'time'
|
|
3
3
|
|
|
4
|
-
# Object that holds all reference properties
|
|
4
|
+
# Object that holds all reference properties that are linked to this refund transaction.
|
|
5
|
+
# Extends the standard PaymentReferences with an additional captureReference field to support
|
|
6
|
+
# scenarios where a Checkout may contain multiple partial captures from different sellers.
|
|
5
7
|
module PCPServerSDK
|
|
6
8
|
module Models
|
|
7
9
|
class PaymentReferencesForRefund
|
|
8
10
|
# Unique reference of the Commerce Case that is also returned for reporting and reconciliation purposes.
|
|
9
11
|
attr_accessor :merchant_reference
|
|
10
12
|
|
|
11
|
-
#
|
|
13
|
+
# Merchant-provided reference of the capture that this refund should be applied to.
|
|
14
|
+
# A single Checkout can contain multiple partial captures.
|
|
15
|
+
# By supplying the captureReference the merchant ensures the refund is allocated to the correct
|
|
16
|
+
# capture.
|
|
17
|
+
# This value must match the merchantReference that was provided in the PaymentReferences of the
|
|
18
|
+
# original capture request.
|
|
12
19
|
attr_accessor :capture_reference
|
|
13
20
|
|
|
14
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -23,6 +23,8 @@ module PCPServerSDK
|
|
|
23
23
|
|
|
24
24
|
attr_accessor :payment_product840_specific_input
|
|
25
25
|
|
|
26
|
+
attr_accessor :payment_product900_specific_input
|
|
27
|
+
|
|
26
28
|
attr_accessor :redirection_data
|
|
27
29
|
|
|
28
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -34,6 +36,7 @@ module PCPServerSDK
|
|
|
34
36
|
:'tokenize' => :'tokenize',
|
|
35
37
|
:'payment_product_id' => :'paymentProductId',
|
|
36
38
|
:'payment_product840_specific_input' => :'paymentProduct840SpecificInput',
|
|
39
|
+
:'payment_product900_specific_input' => :'paymentProduct900SpecificInput',
|
|
37
40
|
:'redirection_data' => :'redirectionData'
|
|
38
41
|
}
|
|
39
42
|
end
|
|
@@ -52,6 +55,7 @@ module PCPServerSDK
|
|
|
52
55
|
:'tokenize' => :'Boolean',
|
|
53
56
|
:'payment_product_id' => :'Integer',
|
|
54
57
|
:'payment_product840_specific_input' => :'RedirectPaymentProduct840SpecificInput',
|
|
58
|
+
:'payment_product900_specific_input' => :'RedirectPaymentProduct900SpecificInput',
|
|
55
59
|
:'redirection_data' => :'RedirectionData'
|
|
56
60
|
}
|
|
57
61
|
end
|
|
@@ -101,6 +105,10 @@ module PCPServerSDK
|
|
|
101
105
|
self.payment_product840_specific_input = attributes[:'payment_product840_specific_input']
|
|
102
106
|
end
|
|
103
107
|
|
|
108
|
+
if attributes.key?(:'payment_product900_specific_input')
|
|
109
|
+
self.payment_product900_specific_input = attributes[:'payment_product900_specific_input']
|
|
110
|
+
end
|
|
111
|
+
|
|
104
112
|
if attributes.key?(:'redirection_data')
|
|
105
113
|
self.redirection_data = attributes[:'redirection_data']
|
|
106
114
|
end
|
|
@@ -117,6 +125,7 @@ module PCPServerSDK
|
|
|
117
125
|
tokenize == o.tokenize &&
|
|
118
126
|
payment_product_id == o.payment_product_id &&
|
|
119
127
|
payment_product840_specific_input == o.payment_product840_specific_input &&
|
|
128
|
+
payment_product900_specific_input == o.payment_product900_specific_input &&
|
|
120
129
|
redirection_data == o.redirection_data
|
|
121
130
|
end
|
|
122
131
|
|
|
@@ -129,7 +138,7 @@ module PCPServerSDK
|
|
|
129
138
|
# Calculates hash code according to all attributes.
|
|
130
139
|
# @return [Integer] Hash code
|
|
131
140
|
def hash
|
|
132
|
-
[requires_approval, payment_processing_token, reporting_token, tokenize, payment_product_id, payment_product840_specific_input, redirection_data].hash
|
|
141
|
+
[requires_approval, payment_processing_token, reporting_token, tokenize, payment_product_id, payment_product840_specific_input, payment_product900_specific_input, redirection_data].hash
|
|
133
142
|
end
|
|
134
143
|
|
|
135
144
|
# Builds the object from hash
|