pcp-server-ruby-sdk 1.0.0 → 1.1.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 +10 -0
- data/api-definition.yaml +4737 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/checkout_api_client.rb +24 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_execution_api_client.rb +47 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_information_api_client.rb +27 -2
- data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +17 -5
- data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +198 -0
- data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +45 -41
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +43 -40
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +16 -33
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +185 -0
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +12 -6
- data/lib/PCP-server-Ruby-SDK/models/{payment_product320_specific_input.rb → pause_payment_request.rb} +13 -31
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/payee.rb +212 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +14 -14
- data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +39 -5
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +212 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +202 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +40 -25
- data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +222 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +232 -0
- data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +28 -24
- data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -25
- data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/refresh_type.rb +30 -0
- data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/status_value.rb +12 -10
- data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +3 -1
- 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 +24 -2
- data/package-lock.json +196 -243
- data/package.json +1 -1
- data/scripts.sh +7 -14
- data/spec/endpoints/checkout_api_client_spec.rb +51 -0
- data/spec/endpoints/payment_execution_api_client_spec.rb +102 -0
- data/spec/endpoints/payment_information_api_client_spec.rb +52 -0
- data/spec/transformer/apple_pay_transformer_spec.rb +1 -1
- data/spec/utils/server_meta_info_spec.rb +2 -2
- metadata +19 -7
@@ -1,16 +1,11 @@
|
|
1
|
-
|
2
1
|
require 'date'
|
3
2
|
require 'time'
|
4
3
|
|
5
|
-
#
|
4
|
+
# Request to refresh the payment status of a specific payment.
|
6
5
|
module PCPServerSDK
|
7
6
|
module Models
|
8
|
-
class
|
9
|
-
attr_accessor :
|
10
|
-
|
11
|
-
attr_accessor :token
|
12
|
-
|
13
|
-
|
7
|
+
class PausePaymentRequest
|
8
|
+
attr_accessor :refresh_type
|
14
9
|
|
15
10
|
class EnumAttributeValidator
|
16
11
|
attr_reader :datatype
|
@@ -37,8 +32,7 @@ module PCPServerSDK
|
|
37
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
38
33
|
def self.attribute_map
|
39
34
|
{
|
40
|
-
:'
|
41
|
-
:'token' => :'token'
|
35
|
+
:'refresh_type' => :'refreshType'
|
42
36
|
}
|
43
37
|
end
|
44
38
|
|
@@ -50,38 +44,31 @@ module PCPServerSDK
|
|
50
44
|
# Attribute type mapping.
|
51
45
|
def self.openapi_types
|
52
46
|
{
|
53
|
-
:'
|
54
|
-
:'token' => :'ApplePaymentDataTokenInformation'
|
47
|
+
:'refresh_type' => :'RefreshType'
|
55
48
|
}
|
56
49
|
end
|
57
50
|
|
58
51
|
# List of attributes with nullable: true
|
59
52
|
def self.openapi_nullable
|
60
|
-
Set.new([
|
61
|
-
])
|
53
|
+
Set.new([])
|
62
54
|
end
|
63
55
|
|
64
56
|
# Initializes the object
|
65
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
66
58
|
def initialize(attributes = {})
|
67
59
|
if (!attributes.is_a?(Hash))
|
68
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PausePaymentRequest` initialize method"
|
69
61
|
end
|
70
62
|
|
71
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
72
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
73
64
|
if (!self.class.attribute_map.key?(k.to_sym))
|
74
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PausePaymentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
75
66
|
end
|
76
67
|
h[k.to_sym] = v
|
77
68
|
}
|
78
69
|
|
79
|
-
if attributes.key?(:'
|
80
|
-
self.
|
81
|
-
end
|
82
|
-
|
83
|
-
if attributes.key?(:'token')
|
84
|
-
self.token = attributes[:'token']
|
70
|
+
if attributes.key?(:'refresh_type')
|
71
|
+
self.refresh_type = attributes[:'refresh_type']
|
85
72
|
end
|
86
73
|
end
|
87
74
|
|
@@ -90,8 +77,7 @@ module PCPServerSDK
|
|
90
77
|
def ==(o)
|
91
78
|
return true if self.equal?(o)
|
92
79
|
self.class == o.class &&
|
93
|
-
|
94
|
-
token == o.token
|
80
|
+
refresh_type == o.refresh_type
|
95
81
|
end
|
96
82
|
|
97
83
|
# @see the `==` method
|
@@ -103,7 +89,7 @@ module PCPServerSDK
|
|
103
89
|
# Calculates hash code according to all attributes.
|
104
90
|
# @return [Integer] Hash code
|
105
91
|
def hash
|
106
|
-
[
|
92
|
+
[refresh_type].hash
|
107
93
|
end
|
108
94
|
|
109
95
|
# Builds the object from hash
|
@@ -117,8 +103,6 @@ module PCPServerSDK
|
|
117
103
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
104
|
transformed_hash["#{key}"] = nil
|
119
105
|
elsif type =~ /\AArray<(.*)>/i
|
120
|
-
# check to ensure the input is an array given that the attribute
|
121
|
-
# is documented as an array but the input is not
|
122
106
|
if attributes[attribute_map[key]].is_a?(Array)
|
123
107
|
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
124
108
|
end
|
@@ -152,7 +136,6 @@ module PCPServerSDK
|
|
152
136
|
false
|
153
137
|
end
|
154
138
|
when :Object
|
155
|
-
# generic object (usually a Hash), return directly
|
156
139
|
value
|
157
140
|
when /\AArray<(?<inner_type>.+)>\z/
|
158
141
|
inner_type = Regexp.last_match[:inner_type]
|
@@ -165,8 +148,7 @@ module PCPServerSDK
|
|
165
148
|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
149
|
end
|
167
150
|
end
|
168
|
-
else
|
169
|
-
# models (e.g. Pet) or oneOf
|
151
|
+
else
|
170
152
|
klass = PCPServerSDK::Models.const_get(type)
|
171
153
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
154
|
end
|
@@ -0,0 +1,192 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# Response for pausing a payment execution.
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class PausePaymentResponse
|
8
|
+
# Status of the paused payment.
|
9
|
+
attr_accessor :status
|
10
|
+
|
11
|
+
class EnumAttributeValidator
|
12
|
+
attr_reader :datatype
|
13
|
+
attr_reader :allowable_values
|
14
|
+
|
15
|
+
def initialize(datatype, allowable_values)
|
16
|
+
@allowable_values = allowable_values.map do |value|
|
17
|
+
case datatype.to_s
|
18
|
+
when /Integer/i
|
19
|
+
value.to_i
|
20
|
+
when /Float/i
|
21
|
+
value.to_f
|
22
|
+
else
|
23
|
+
value
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def valid?(value)
|
29
|
+
!value || allowable_values.include?(value)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'status' => :'status'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'status' => :'StatusValue'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# List of attributes with nullable: true
|
53
|
+
def self.openapi_nullable
|
54
|
+
Set.new([])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PausePaymentResponse` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
65
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PausePaymentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
67
|
+
end
|
68
|
+
h[k.to_sym] = v
|
69
|
+
}
|
70
|
+
|
71
|
+
if attributes.key?(:'status')
|
72
|
+
self.status = attributes[:'status']
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Checks equality by comparing each attribute.
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
status == o.status
|
81
|
+
end
|
82
|
+
|
83
|
+
# @see the `==` method
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
def hash
|
90
|
+
[status].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def self.build_from_hash(attributes)
|
97
|
+
return nil unless attributes.is_a?(Hash)
|
98
|
+
attributes = attributes.transform_keys(&:to_sym)
|
99
|
+
transformed_hash = {}
|
100
|
+
openapi_types.each_pair do |key, type|
|
101
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
102
|
+
transformed_hash["#{key}"] = nil
|
103
|
+
elsif type =~ /\AArray<(.*)>/i
|
104
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
105
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
106
|
+
end
|
107
|
+
elsif !attributes[attribute_map[key]].nil?
|
108
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
109
|
+
end
|
110
|
+
end
|
111
|
+
new(transformed_hash)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
def self._deserialize(type, value)
|
116
|
+
case type.to_sym
|
117
|
+
when :Time
|
118
|
+
Time.parse(value)
|
119
|
+
when :Date
|
120
|
+
Date.parse(value)
|
121
|
+
when :String
|
122
|
+
value.to_s
|
123
|
+
when :Integer
|
124
|
+
value.to_i
|
125
|
+
when :Float
|
126
|
+
value.to_f
|
127
|
+
when :Boolean
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
|
+
true
|
130
|
+
else
|
131
|
+
false
|
132
|
+
end
|
133
|
+
when :Object
|
134
|
+
value
|
135
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
136
|
+
inner_type = Regexp.last_match[:inner_type]
|
137
|
+
value.map { |v| _deserialize(inner_type, v) }
|
138
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
139
|
+
k_type = Regexp.last_match[:k_type]
|
140
|
+
v_type = Regexp.last_match[:v_type]
|
141
|
+
{}.tap do |hash|
|
142
|
+
value.each do |k, v|
|
143
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
else
|
147
|
+
klass = PCPServerSDK::Models.const_get(type)
|
148
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# Returns the string representation 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
|
+
def to_body
|
159
|
+
to_hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the object in the form of hash
|
163
|
+
def to_hash
|
164
|
+
hash = {}
|
165
|
+
self.class.attribute_map.each_pair do |attr, param|
|
166
|
+
value = self.send(attr)
|
167
|
+
if value.nil?
|
168
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
169
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
170
|
+
end
|
171
|
+
hash[param] = _to_hash(value)
|
172
|
+
end
|
173
|
+
hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Outputs non-array value in the form of hash
|
177
|
+
def _to_hash(value)
|
178
|
+
if value.is_a?(Array)
|
179
|
+
value.compact.map { |v| _to_hash(v) }
|
180
|
+
elsif value.is_a?(Hash)
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
183
|
+
end
|
184
|
+
elsif value.respond_to? :to_hash
|
185
|
+
value.to_hash
|
186
|
+
else
|
187
|
+
value
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
@@ -0,0 +1,212 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# Payee bank account details as part of the payment instructions
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class Payee
|
8
|
+
# IBAN of the payee's or beneficiary's bank account.
|
9
|
+
attr_accessor :iban
|
10
|
+
|
11
|
+
# Bank Identification Code
|
12
|
+
attr_accessor :bic
|
13
|
+
|
14
|
+
# Name of the payee
|
15
|
+
attr_accessor :name
|
16
|
+
|
17
|
+
class EnumAttributeValidator
|
18
|
+
attr_reader :datatype
|
19
|
+
attr_reader :allowable_values
|
20
|
+
|
21
|
+
def initialize(datatype, allowable_values)
|
22
|
+
@allowable_values = allowable_values.map do |value|
|
23
|
+
case datatype.to_s
|
24
|
+
when /Integer/i
|
25
|
+
value.to_i
|
26
|
+
when /Float/i
|
27
|
+
value.to_f
|
28
|
+
else
|
29
|
+
value
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def valid?(value)
|
35
|
+
!value || allowable_values.include?(value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'iban' => :'iban',
|
43
|
+
:'bic' => :'bic',
|
44
|
+
:'name' => :'name'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.openapi_types
|
55
|
+
{
|
56
|
+
:'iban' => :'String',
|
57
|
+
:'bic' => :'String',
|
58
|
+
:'name' => :'String'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# List of attributes with nullable: true
|
63
|
+
def self.openapi_nullable
|
64
|
+
Set.new([])
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
if (!attributes.is_a?(Hash))
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Payee` initialize method"
|
72
|
+
end
|
73
|
+
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Payee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
77
|
+
end
|
78
|
+
h[k.to_sym] = v
|
79
|
+
}
|
80
|
+
|
81
|
+
if attributes.key?(:'iban')
|
82
|
+
self.iban = attributes[:'iban']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'bic')
|
86
|
+
self.bic = attributes[:'bic']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'name')
|
90
|
+
self.name = attributes[:'name']
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# Checks equality by comparing each attribute.
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
iban == o.iban &&
|
99
|
+
bic == o.bic &&
|
100
|
+
name == o.name
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
def eql?(o)
|
105
|
+
self == o
|
106
|
+
end
|
107
|
+
|
108
|
+
# Calculates hash code according to all attributes.
|
109
|
+
def hash
|
110
|
+
[iban, bic, name].hash
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def self.build_from_hash(attributes)
|
117
|
+
return nil unless attributes.is_a?(Hash)
|
118
|
+
attributes = attributes.transform_keys(&:to_sym)
|
119
|
+
transformed_hash = {}
|
120
|
+
openapi_types.each_pair do |key, type|
|
121
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
122
|
+
transformed_hash["#{key}"] = nil
|
123
|
+
elsif type =~ /\AArray<(.*)>/i
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
126
|
+
end
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
129
|
+
end
|
130
|
+
end
|
131
|
+
new(transformed_hash)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
def self._deserialize(type, value)
|
136
|
+
case type.to_sym
|
137
|
+
when :Time
|
138
|
+
Time.parse(value)
|
139
|
+
when :Date
|
140
|
+
Date.parse(value)
|
141
|
+
when :String
|
142
|
+
value.to_s
|
143
|
+
when :Integer
|
144
|
+
value.to_i
|
145
|
+
when :Float
|
146
|
+
value.to_f
|
147
|
+
when :Boolean
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
149
|
+
true
|
150
|
+
else
|
151
|
+
false
|
152
|
+
end
|
153
|
+
when :Object
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else
|
167
|
+
klass = PCPServerSDK::Models.const_get(type)
|
168
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the string representation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
def to_body
|
179
|
+
to_hash
|
180
|
+
end
|
181
|
+
|
182
|
+
# Returns the object in the form of hash
|
183
|
+
def to_hash
|
184
|
+
hash = {}
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
186
|
+
value = self.send(attr)
|
187
|
+
if value.nil?
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
190
|
+
end
|
191
|
+
hash[param] = _to_hash(value)
|
192
|
+
end
|
193
|
+
hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Outputs non-array value in the form of hash
|
197
|
+
def _to_hash(value)
|
198
|
+
if value.is_a?(Array)
|
199
|
+
value.compact.map { |v| _to_hash(v) }
|
200
|
+
elsif value.is_a?(Hash)
|
201
|
+
{}.tap do |hash|
|
202
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
203
|
+
end
|
204
|
+
elsif value.respond_to? :to_hash
|
205
|
+
value.to_hash
|
206
|
+
else
|
207
|
+
value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
require 'date'
|
3
2
|
require 'time'
|
4
3
|
|
@@ -14,10 +13,10 @@ module PCPServerSDK
|
|
14
13
|
|
15
14
|
attr_accessor :cancellation_reason
|
16
15
|
|
17
|
-
# Reason of the Refund (e.g. communicated by or to the
|
16
|
+
# Reason of the Refund (e.g. communicated by or to the customer).
|
18
17
|
attr_accessor :return_reason
|
19
18
|
|
20
|
-
|
19
|
+
attr_accessor :payment_instructions
|
21
20
|
|
22
21
|
class EnumAttributeValidator
|
23
22
|
attr_reader :datatype
|
@@ -48,7 +47,8 @@ module PCPServerSDK
|
|
48
47
|
:'amount_of_money' => :'amountOfMoney',
|
49
48
|
:'payment_status' => :'paymentStatus',
|
50
49
|
:'cancellation_reason' => :'cancellationReason',
|
51
|
-
:'return_reason' => :'returnReason'
|
50
|
+
:'return_reason' => :'returnReason',
|
51
|
+
:'payment_instructions' => :'paymentInstructions'
|
52
52
|
}
|
53
53
|
end
|
54
54
|
|
@@ -64,14 +64,14 @@ module PCPServerSDK
|
|
64
64
|
:'amount_of_money' => :'AmountOfMoney',
|
65
65
|
:'payment_status' => :'StatusValue',
|
66
66
|
:'cancellation_reason' => :'CancellationReason',
|
67
|
-
:'return_reason' => :'String'
|
67
|
+
:'return_reason' => :'String',
|
68
|
+
:'payment_instructions' => :'PaymentInstructions'
|
68
69
|
}
|
69
70
|
end
|
70
71
|
|
71
72
|
# List of attributes with nullable: true
|
72
73
|
def self.openapi_nullable
|
73
|
-
Set.new([
|
74
|
-
])
|
74
|
+
Set.new([])
|
75
75
|
end
|
76
76
|
|
77
77
|
# Initializes the object
|
@@ -108,10 +108,13 @@ module PCPServerSDK
|
|
108
108
|
if attributes.key?(:'return_reason')
|
109
109
|
self.return_reason = attributes[:'return_reason']
|
110
110
|
end
|
111
|
+
|
112
|
+
if attributes.key?(:'payment_instructions')
|
113
|
+
self.payment_instructions = attributes[:'payment_instructions']
|
114
|
+
end
|
111
115
|
end
|
112
116
|
|
113
117
|
# Checks equality by comparing each attribute.
|
114
|
-
# @param [Object] Object to be compared
|
115
118
|
def ==(o)
|
116
119
|
return true if self.equal?(o)
|
117
120
|
self.class == o.class &&
|
@@ -119,19 +122,16 @@ module PCPServerSDK
|
|
119
122
|
amount_of_money == o.amount_of_money &&
|
120
123
|
payment_status == o.payment_status &&
|
121
124
|
cancellation_reason == o.cancellation_reason &&
|
122
|
-
return_reason == o.return_reason
|
125
|
+
return_reason == o.return_reason &&
|
126
|
+
payment_instructions == o.payment_instructions
|
123
127
|
end
|
124
128
|
|
125
|
-
# @see the `==` method
|
126
|
-
# @param [Object] Object to be compared
|
127
129
|
def eql?(o)
|
128
130
|
self == o
|
129
131
|
end
|
130
132
|
|
131
|
-
# Calculates hash code according to all attributes.
|
132
|
-
# @return [Integer] Hash code
|
133
133
|
def hash
|
134
|
-
[type, amount_of_money, payment_status, cancellation_reason, return_reason].hash
|
134
|
+
[type, amount_of_money, payment_status, cancellation_reason, return_reason, payment_instructions].hash
|
135
135
|
end
|
136
136
|
|
137
137
|
# Builds the object from hash
|