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,4 +1,3 @@
|
|
1
|
-
|
2
1
|
require 'date'
|
3
2
|
require 'time'
|
4
3
|
|
@@ -6,17 +5,18 @@ require 'time'
|
|
6
5
|
module PCPServerSDK
|
7
6
|
module Models
|
8
7
|
class PayoutResponse
|
8
|
+
# Payout output details
|
9
9
|
attr_accessor :payout_output
|
10
10
|
|
11
|
+
# Status of the payout
|
11
12
|
attr_accessor :status
|
12
13
|
|
14
|
+
# Status category of the payout
|
13
15
|
attr_accessor :status_category
|
14
16
|
|
15
17
|
# Unique payment transaction identifier of the payment gateway.
|
16
18
|
attr_accessor :id
|
17
19
|
|
18
|
-
|
19
|
-
|
20
20
|
class EnumAttributeValidator
|
21
21
|
attr_reader :datatype
|
22
22
|
attr_reader :allowable_values
|
@@ -39,7 +39,7 @@ module PCPServerSDK
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
# Attribute mapping from
|
42
|
+
# Attribute mapping from Ruby-style variable name to JSON key.
|
43
43
|
def self.attribute_map
|
44
44
|
{
|
45
45
|
:'payout_output' => :'payoutOutput',
|
@@ -66,8 +66,7 @@ module PCPServerSDK
|
|
66
66
|
|
67
67
|
# List of attributes with nullable: true
|
68
68
|
def self.openapi_nullable
|
69
|
-
Set.new([
|
70
|
-
])
|
69
|
+
Set.new([])
|
71
70
|
end
|
72
71
|
|
73
72
|
# Initializes the object
|
@@ -77,7 +76,6 @@ module PCPServerSDK
|
|
77
76
|
fail ArgumentError, "The input argument (attributes) must be a hash in `PayoutResponse` initialize method"
|
78
77
|
end
|
79
78
|
|
80
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
81
79
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
80
|
if (!self.class.attribute_map.key?(k.to_sym))
|
83
81
|
fail ArgumentError, "`#{k}` is not a valid attribute in `PayoutResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
@@ -103,7 +101,6 @@ module PCPServerSDK
|
|
103
101
|
end
|
104
102
|
|
105
103
|
# Checks equality by comparing each attribute.
|
106
|
-
# @param [Object] Object to be compared
|
107
104
|
def ==(o)
|
108
105
|
return true if self.equal?(o)
|
109
106
|
self.class == o.class &&
|
@@ -114,13 +111,11 @@ module PCPServerSDK
|
|
114
111
|
end
|
115
112
|
|
116
113
|
# @see the `==` method
|
117
|
-
# @param [Object] Object to be compared
|
118
114
|
def eql?(o)
|
119
115
|
self == o
|
120
116
|
end
|
121
117
|
|
122
118
|
# Calculates hash code according to all attributes.
|
123
|
-
# @return [Integer] Hash code
|
124
119
|
def hash
|
125
120
|
[payout_output, status, status_category, id].hash
|
126
121
|
end
|
@@ -136,8 +131,6 @@ module PCPServerSDK
|
|
136
131
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
137
132
|
transformed_hash["#{key}"] = nil
|
138
133
|
elsif type =~ /\AArray<(.*)>/i
|
139
|
-
# check to ensure the input is an array given that the attribute
|
140
|
-
# is documented as an array but the input is not
|
141
134
|
if attributes[attribute_map[key]].is_a?(Array)
|
142
135
|
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
143
136
|
end
|
@@ -149,9 +142,6 @@ module PCPServerSDK
|
|
149
142
|
end
|
150
143
|
|
151
144
|
# Deserializes the data based on type
|
152
|
-
# @param string type Data type
|
153
|
-
# @param string value Value to be deserialized
|
154
|
-
# @return [Object] Deserialized data
|
155
145
|
def self._deserialize(type, value)
|
156
146
|
case type.to_sym
|
157
147
|
when :Time
|
@@ -171,7 +161,6 @@ module PCPServerSDK
|
|
171
161
|
false
|
172
162
|
end
|
173
163
|
when :Object
|
174
|
-
# generic object (usually a Hash), return directly
|
175
164
|
value
|
176
165
|
when /\AArray<(?<inner_type>.+)>\z/
|
177
166
|
inner_type = Regexp.last_match[:inner_type]
|
@@ -184,27 +173,23 @@ module PCPServerSDK
|
|
184
173
|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
174
|
end
|
186
175
|
end
|
187
|
-
else
|
188
|
-
# models (e.g. Pet) or oneOf
|
176
|
+
else
|
189
177
|
klass = PCPServerSDK::Models.const_get(type)
|
190
178
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
191
179
|
end
|
192
180
|
end
|
193
181
|
|
194
182
|
# Returns the string representation of the object
|
195
|
-
# @return [String] String presentation of the object
|
196
183
|
def to_s
|
197
184
|
to_hash.to_s
|
198
185
|
end
|
199
186
|
|
200
187
|
# to_body is an alias to to_hash (backward compatibility)
|
201
|
-
# @return [Hash] Returns the object in the form of hash
|
202
188
|
def to_body
|
203
189
|
to_hash
|
204
190
|
end
|
205
191
|
|
206
192
|
# Returns the object in the form of hash
|
207
|
-
# @return [Hash] Returns the object in the form of hash
|
208
193
|
def to_hash
|
209
194
|
hash = {}
|
210
195
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -213,16 +198,12 @@ module PCPServerSDK
|
|
213
198
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
214
199
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
215
200
|
end
|
216
|
-
|
217
201
|
hash[param] = _to_hash(value)
|
218
202
|
end
|
219
203
|
hash
|
220
204
|
end
|
221
205
|
|
222
206
|
# Outputs non-array value in the form of hash
|
223
|
-
# For object, use to_hash. Otherwise, just return the value
|
224
|
-
# @param [Object] value Any valid value
|
225
|
-
# @return [Hash] Returns the value in the form of hash
|
226
207
|
def _to_hash(value)
|
227
208
|
if value.is_a?(Array)
|
228
209
|
value.compact.map { |v| _to_hash(v) }
|
@@ -0,0 +1,192 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# Request to refresh the payment status of a specific payment.
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class RefreshPaymentRequest
|
8
|
+
# Type of refresh request
|
9
|
+
attr_accessor :refresh_type
|
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
|
+
:'refresh_type' => :'refreshType'
|
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
|
+
:'refresh_type' => :'RefreshType'
|
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 `RefreshPaymentRequest` 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 `RefreshPaymentRequest`. 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?(:'refresh_type')
|
72
|
+
self.refresh_type = attributes[:'refresh_type']
|
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
|
+
refresh_type == o.refresh_type
|
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
|
+
[refresh_type].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,30 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# The refreshType refers to the type of the payment status refresh.
|
5
|
+
# - PAYMENT_EVENTS = Refresh the payment status of the payment and return the events.
|
6
|
+
# This is a synchronization of the payment status with the payment platform.
|
7
|
+
# This can be used in case of any possible inconsistencies between the commerce platform and the payment platform.
|
8
|
+
# - PAYMENT_PROVIDER_DETAILS = Refresh the payment status of the payment and return the payment provider details.
|
9
|
+
# This is a synchronization of the payment with the external payment provider.
|
10
|
+
# The current use case is to update the customer status of a transaction using PAYONE Buy Now, Pay Later (BNPL) with the external provider Payla.
|
11
|
+
module PCPServerSDK
|
12
|
+
module Models
|
13
|
+
class RefreshType
|
14
|
+
PAYMENT_EVENTS = "PAYMENT_EVENTS".freeze
|
15
|
+
PAYMENT_PROVIDER_DETAILS = "PAYMENT_PROVIDER_DETAILS".freeze
|
16
|
+
|
17
|
+
def self.all_vars
|
18
|
+
@all_vars ||= [PAYMENT_EVENTS, PAYMENT_PROVIDER_DETAILS].freeze
|
19
|
+
end
|
20
|
+
|
21
|
+
# Builds the enum from string
|
22
|
+
# @param [String] value The enum value in the form of the string
|
23
|
+
# @return [String] The enum value
|
24
|
+
def self.build_from_hash(value)
|
25
|
+
return value if RefreshType.all_vars.include?(value)
|
26
|
+
raise "Invalid ENUM value #{value} for class #StatusValue"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,192 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# Object containing the specific input details for SEPA credit transfers excluding cross-border ones
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class SepaTransferPaymentProduct772SpecificInput
|
8
|
+
# Bank account information
|
9
|
+
attr_accessor :bank_account_information
|
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
|
+
:'bank_account_information' => :'bankAccountInformation'
|
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
|
+
:'bank_account_information' => :'BankAccountInformation'
|
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 `SepaTransferPaymentProduct772SpecificInput` 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 `SepaTransferPaymentProduct772SpecificInput`. 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?(:'bank_account_information')
|
72
|
+
self.bank_account_information = attributes[:'bank_account_information']
|
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
|
+
bank_account_information == o.bank_account_information
|
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
|
+
[bank_account_information].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
|
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
1
|
require 'date'
|
3
2
|
require 'time'
|
4
3
|
|
4
|
+
# Current high-level status of the payment in a human-readable form.
|
5
5
|
module PCPServerSDK
|
6
6
|
module Models
|
7
7
|
class StatusValue
|
@@ -9,6 +9,8 @@ module PCPServerSDK
|
|
9
9
|
CANCELLED = "CANCELLED".freeze
|
10
10
|
REJECTED = "REJECTED".freeze
|
11
11
|
REJECTED_CAPTURE = "REJECTED_CAPTURE".freeze
|
12
|
+
REJECTED_PAUSE = "REJECTED_PAUSE".freeze
|
13
|
+
REJECTED_UPDATE = "REJECTED_UPDATE".freeze
|
12
14
|
REDIRECTED = "REDIRECTED".freeze
|
13
15
|
PENDING_PAYMENT = "PENDING_PAYMENT".freeze
|
14
16
|
PENDING_COMPLETION = "PENDING_COMPLETION".freeze
|
@@ -28,22 +30,22 @@ module PCPServerSDK
|
|
28
30
|
ACCOUNT_DEBITED = "ACCOUNT_DEBITED".freeze
|
29
31
|
PAYOUT_REQUESTED = "PAYOUT_REQUESTED".freeze
|
30
32
|
REJECTED_CREDIT = "REJECTED_CREDIT".freeze
|
33
|
+
UPDATED = "UPDATED".freeze
|
31
34
|
|
32
35
|
def self.all_vars
|
33
|
-
@all_vars ||= [
|
36
|
+
@all_vars ||= [
|
37
|
+
CREATED, CANCELLED, REJECTED, REJECTED_CAPTURE, REJECTED_PAUSE, REJECTED_UPDATE,
|
38
|
+
REDIRECTED, PENDING_PAYMENT, PENDING_COMPLETION, PENDING_CAPTURE, AUTHORIZATION_REQUESTED,
|
39
|
+
CAPTURE_REQUESTED, CAPTURED, REVERSED, REFUND_REQUESTED, REFUNDED, REJECTED_REFUND,
|
40
|
+
CANCELLATION_REQUESTED, PAUSED, CHARGEBACKED, CHARGEBACK_REVERSED, ACCOUNT_CREDITED,
|
41
|
+
ACCOUNT_DEBITED, PAYOUT_REQUESTED, REJECTED_CREDIT, UPDATED
|
42
|
+
].freeze
|
34
43
|
end
|
35
44
|
|
36
45
|
# Builds the enum from string
|
37
|
-
# @param [String] The enum value in the form of the string
|
46
|
+
# @param [String] value The enum value in the form of the string
|
38
47
|
# @return [String] The enum value
|
39
48
|
def self.build_from_hash(value)
|
40
|
-
new.build_from_hash(value)
|
41
|
-
end
|
42
|
-
|
43
|
-
# Builds the enum from string
|
44
|
-
# @param [String] The enum value in the form of the string
|
45
|
-
# @return [String] The enum value
|
46
|
-
def build_from_hash(value)
|
47
49
|
return value if StatusValue.all_vars.include?(value)
|
48
50
|
raise "Invalid ENUM value #{value} for class #StatusValue"
|
49
51
|
end
|
@@ -15,7 +15,7 @@ module PCPServerSDK
|
|
15
15
|
:include_payment_product_id, :include_checkout_status,
|
16
16
|
:include_extended_checkout_status, :include_payment_channel,
|
17
17
|
:payment_reference, :payment_id, :first_name, :surname,
|
18
|
-
:email, :phone_number, :date_of_birth, :company_information
|
18
|
+
:email, :phone_number, :date_of_birth, :company_information, :terminal_id, :reporting_token
|
19
19
|
|
20
20
|
def initialize
|
21
21
|
@include_payment_product_id = []
|
@@ -58,6 +58,8 @@ module PCPServerSDK
|
|
58
58
|
query['phoneNumber'] = @phone_number if @phone_number
|
59
59
|
query['dateOfBirth'] = @date_of_birth if @date_of_birth
|
60
60
|
query['companyInformation'] = @company_information if @company_information
|
61
|
+
query['terminalId'] = @terminal_id if @terminal_id
|
62
|
+
query['reportingToken'] = @reporting_token if @reporting_token
|
61
63
|
|
62
64
|
query
|
63
65
|
end
|
@@ -8,7 +8,7 @@ require_relative '../models/applepay/apple_pay_payment_data_header'
|
|
8
8
|
require_relative '../models/applepay/apple_pay_payment_method'
|
9
9
|
require_relative '../models/mobile_payment_method_specific_input'
|
10
10
|
require_relative '../models/network'
|
11
|
-
require_relative '../models/
|
11
|
+
require_relative '../models/payment_product302_specific_input'
|
12
12
|
|
13
13
|
module PCPServerSDK
|
14
14
|
module Transformer
|
@@ -25,7 +25,7 @@ module PCPServerSDK
|
|
25
25
|
payment_product_id: 302,
|
26
26
|
public_key_hash: header.public_key_hash,
|
27
27
|
ephemeral_key: header.ephemeral_public_key,
|
28
|
-
payment_product302_specific_input: PCPServerSDK::Models::
|
28
|
+
payment_product302_specific_input: PCPServerSDK::Models::PaymentProduct302SpecificInput.new(
|
29
29
|
network: PCPServerSDK::Models::Network.from_string(payment_method.network.to_s),
|
30
30
|
token: PCPServerSDK::Models::ApplePaymentDataTokenInformation.new(
|
31
31
|
version: PCPServerSDK::Models::ApplePaymentTokenVersion.from_string(payment_data.version.to_s),
|