pcp-server-ruby-sdk 1.0.0 → 1.2.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 +28 -0
- data/README.md +9 -3
- data/api-definition.yaml +4803 -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/action_type.rb +34 -0
- data/lib/PCP-server-Ruby-SDK/models/api_error.rb +1 -1
- data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +52 -0
- 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/business_relation.rb +30 -0
- data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +45 -41
- data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +3 -2
- data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +5 -2
- data/lib/PCP-server-Ruby-SDK/models/customer.rb +21 -6
- data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +51 -0
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +43 -40
- data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +3 -2
- 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/recurring_payment_sequence_indicator.rb +30 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +14 -4
- 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 +174 -245
- 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 +24 -7
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
1
|
require 'date'
|
3
2
|
require 'time'
|
3
|
+
|
4
4
|
module PCPServerSDK
|
5
5
|
module Models
|
6
|
-
# Object containing Capture details.
|
6
|
+
# Object containing Capture details.
|
7
7
|
class CaptureOutput
|
8
8
|
attr_accessor :amount_of_money
|
9
9
|
|
@@ -15,17 +15,20 @@ module PCPServerSDK
|
|
15
15
|
# Payment method identifier used by our payment engine.
|
16
16
|
attr_accessor :payment_method
|
17
17
|
|
18
|
+
attr_accessor :payment_instructions
|
19
|
+
|
18
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
21
|
def self.attribute_map
|
20
22
|
{
|
21
23
|
:'amount_of_money' => :'amountOfMoney',
|
22
24
|
:'merchant_parameters' => :'merchantParameters',
|
23
25
|
:'references' => :'references',
|
24
|
-
:'payment_method' => :'paymentMethod'
|
26
|
+
:'payment_method' => :'paymentMethod',
|
27
|
+
:'payment_instructions' => :'paymentInstructions'
|
25
28
|
}
|
26
29
|
end
|
27
30
|
|
28
|
-
# Returns all the JSON keys this model knows about
|
31
|
+
# Returns all the JSON keys this model knows about.
|
29
32
|
def self.acceptable_attributes
|
30
33
|
attribute_map.values
|
31
34
|
end
|
@@ -36,24 +39,24 @@ module PCPServerSDK
|
|
36
39
|
:'amount_of_money' => :'AmountOfMoney',
|
37
40
|
:'merchant_parameters' => :'String',
|
38
41
|
:'references' => :'PaymentReferences',
|
39
|
-
:'payment_method' => :'String'
|
42
|
+
:'payment_method' => :'String',
|
43
|
+
:'payment_instructions' => :'PaymentInstructions'
|
40
44
|
}
|
41
45
|
end
|
42
46
|
|
43
|
-
# List of attributes with nullable: true
|
47
|
+
# List of attributes with nullable: true.
|
44
48
|
def self.openapi_nullable
|
45
|
-
Set.new([
|
46
|
-
])
|
49
|
+
Set.new([])
|
47
50
|
end
|
48
51
|
|
49
|
-
# Initializes the object
|
50
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
# Initializes the object.
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash.
|
51
54
|
def initialize(attributes = {})
|
52
55
|
if (!attributes.is_a?(Hash))
|
53
56
|
fail ArgumentError, "The input argument (attributes) must be a hash in `CaptureOutput` initialize method"
|
54
57
|
end
|
55
58
|
|
56
|
-
#
|
59
|
+
# Check to see if the attribute exists and convert string to symbol for hash key.
|
57
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
61
|
if (!self.class.attribute_map.key?(k.to_sym))
|
59
62
|
fail ArgumentError, "`#{k}` is not a valid attribute in `CaptureOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
@@ -76,34 +79,39 @@ module PCPServerSDK
|
|
76
79
|
if attributes.key?(:'payment_method')
|
77
80
|
self.payment_method = attributes[:'payment_method']
|
78
81
|
end
|
82
|
+
|
83
|
+
if attributes.key?(:'payment_instructions')
|
84
|
+
self.payment_instructions = attributes[:'payment_instructions']
|
85
|
+
end
|
79
86
|
end
|
80
87
|
|
81
88
|
# Checks equality by comparing each attribute.
|
82
|
-
# @param [Object] Object to be compared
|
89
|
+
# @param [Object] Object to be compared.
|
83
90
|
def ==(o)
|
84
91
|
return true if self.equal?(o)
|
85
92
|
self.class == o.class &&
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
93
|
+
amount_of_money == o.amount_of_money &&
|
94
|
+
merchant_parameters == o.merchant_parameters &&
|
95
|
+
references == o.references &&
|
96
|
+
payment_method == o.payment_method &&
|
97
|
+
payment_instructions == o.payment_instructions
|
90
98
|
end
|
91
99
|
|
92
|
-
# @see the `==` method
|
93
|
-
# @param [Object] Object to be compared
|
100
|
+
# @see the `==` method.
|
101
|
+
# @param [Object] Object to be compared.
|
94
102
|
def eql?(o)
|
95
103
|
self == o
|
96
104
|
end
|
97
105
|
|
98
106
|
# Calculates hash code according to all attributes.
|
99
|
-
# @return [Integer] Hash code
|
107
|
+
# @return [Integer] Hash code.
|
100
108
|
def hash
|
101
|
-
[amount_of_money, merchant_parameters, references, payment_method].hash
|
109
|
+
[amount_of_money, merchant_parameters, references, payment_method, payment_instructions].hash
|
102
110
|
end
|
103
111
|
|
104
|
-
# Builds the object from hash
|
105
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
-
# @return [Object] Returns the model itself
|
112
|
+
# Builds the object from hash.
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash.
|
114
|
+
# @return [Object] Returns the model itself.
|
107
115
|
def self.build_from_hash(attributes)
|
108
116
|
return nil unless attributes.is_a?(Hash)
|
109
117
|
attributes = attributes.transform_keys(&:to_sym)
|
@@ -112,8 +120,6 @@ module PCPServerSDK
|
|
112
120
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
113
121
|
transformed_hash["#{key}"] = nil
|
114
122
|
elsif type =~ /\AArray<(.*)>/i
|
115
|
-
# check to ensure the input is an array given that the attribute
|
116
|
-
# is documented as an array but the input is not
|
117
123
|
if attributes[attribute_map[key]].is_a?(Array)
|
118
124
|
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
119
125
|
end
|
@@ -124,10 +130,10 @@ module PCPServerSDK
|
|
124
130
|
new(transformed_hash)
|
125
131
|
end
|
126
132
|
|
127
|
-
# Deserializes the data based on type
|
128
|
-
# @param string type Data type
|
129
|
-
# @param string value Value to be deserialized
|
130
|
-
# @return [Object] Deserialized data
|
133
|
+
# Deserializes the data based on type.
|
134
|
+
# @param string type Data type.
|
135
|
+
# @param string value Value to be deserialized.
|
136
|
+
# @return [Object] Deserialized data.
|
131
137
|
def self._deserialize(type, value)
|
132
138
|
case type.to_sym
|
133
139
|
when :Time
|
@@ -147,7 +153,6 @@ module PCPServerSDK
|
|
147
153
|
false
|
148
154
|
end
|
149
155
|
when :Object
|
150
|
-
# generic object (usually a Hash), return directly
|
151
156
|
value
|
152
157
|
when /\AArray<(?<inner_type>.+)>\z/
|
153
158
|
inner_type = Regexp.last_match[:inner_type]
|
@@ -161,26 +166,25 @@ module PCPServerSDK
|
|
161
166
|
end
|
162
167
|
end
|
163
168
|
else # model
|
164
|
-
# models (e.g. Pet) or oneOf
|
165
169
|
klass = PCPServerSDK::Models.const_get(type)
|
166
170
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
167
171
|
end
|
168
172
|
end
|
169
173
|
|
170
|
-
# Returns the string representation of the object
|
171
|
-
# @return [String] String presentation of the object
|
174
|
+
# Returns the string representation of the object.
|
175
|
+
# @return [String] String presentation of the object.
|
172
176
|
def to_s
|
173
177
|
to_hash.to_s
|
174
178
|
end
|
175
179
|
|
176
|
-
# to_body is an alias to to_hash (backward compatibility)
|
177
|
-
# @return [Hash] Returns the object in the form of hash
|
180
|
+
# to_body is an alias to to_hash (backward compatibility).
|
181
|
+
# @return [Hash] Returns the object in the form of hash.
|
178
182
|
def to_body
|
179
183
|
to_hash
|
180
184
|
end
|
181
185
|
|
182
|
-
# Returns the object in the form of hash
|
183
|
-
# @return [Hash] Returns the object in the form of hash
|
186
|
+
# Returns the object in the form of hash.
|
187
|
+
# @return [Hash] Returns the object in the form of hash.
|
184
188
|
def to_hash
|
185
189
|
hash = {}
|
186
190
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -195,10 +199,10 @@ module PCPServerSDK
|
|
195
199
|
hash
|
196
200
|
end
|
197
201
|
|
198
|
-
# Outputs non-array value in the form of hash
|
199
|
-
# For object, use to_hash. Otherwise, just return the value
|
200
|
-
# @param [Object] value Any valid value
|
201
|
-
# @return [Hash] Returns the value in the form of hash
|
202
|
+
# Outputs non-array value in the form of hash.
|
203
|
+
# For object, use to_hash. Otherwise, just return the value.
|
204
|
+
# @param [Object] value Any valid value.
|
205
|
+
# @return [Hash] Returns the value in the form of hash.
|
202
206
|
def _to_hash(value)
|
203
207
|
if value.is_a?(Array)
|
204
208
|
value.compact.map { |v| _to_hash(v) }
|
@@ -5,7 +5,8 @@ module PCPServerSDK
|
|
5
5
|
module Models
|
6
6
|
# Fraud results contained in the CardFraudResults object.
|
7
7
|
class CardFraudResults
|
8
|
-
#
|
8
|
+
# Result of the Address Verification Service checks.
|
9
|
+
# @return [AvsResult]
|
9
10
|
attr_accessor :avs_result
|
10
11
|
|
11
12
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -23,7 +24,7 @@ module PCPServerSDK
|
|
23
24
|
# Attribute type mapping.
|
24
25
|
def self.openapi_types
|
25
26
|
{
|
26
|
-
:'avs_result' => :'
|
27
|
+
:'avs_result' => :'AvsResult'
|
27
28
|
}
|
28
29
|
end
|
29
30
|
|
@@ -5,7 +5,10 @@ module PCPServerSDK
|
|
5
5
|
module Models
|
6
6
|
# Object containing data related to recurring.
|
7
7
|
class CardRecurrenceDetails
|
8
|
-
#
|
8
|
+
# Indicates whether this transaction is the first or a subsequent transaction in a series of recurring transactions.
|
9
|
+
# Note: For any first of a recurring the system will automatically create a token as you will need to use a token for any subsequent recurring transactions.
|
10
|
+
# In case a token already exists this is indicated in the response with a value of False for the isNewToken property in the response.
|
11
|
+
# @return [RecurringPaymentSequenceIndicator]
|
9
12
|
attr_accessor :recurring_payment_sequence_indicator
|
10
13
|
|
11
14
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -23,7 +26,7 @@ module PCPServerSDK
|
|
23
26
|
# Attribute type mapping.
|
24
27
|
def self.openapi_types
|
25
28
|
{
|
26
|
-
:'recurring_payment_sequence_indicator' => :'
|
29
|
+
:'recurring_payment_sequence_indicator' => :'RecurringPaymentSequenceIndicator'
|
27
30
|
}
|
28
31
|
end
|
29
32
|
|
@@ -17,7 +17,12 @@ module PCPServerSDK
|
|
17
17
|
# Fiscal registration number of the customer or the tax registration number of the company for a business customer. Please find below specifics per country: * Brazil - Consumer (CPF) with a length of 11 digits * Brazil - Company (CNPJ) with a length of 14 digits * Denmark - Consumer (CPR-nummer or personnummer) with a length of 10 digits * Finland - Consumer (Finnish: henkilötunnus (abbreviated as HETU), Swedish: personbeteckning) with a length of 11 characters * Norway - Consumer (fødselsnummer) with a length of 11 digits * Sweden - Consumer (personnummer) with a length of 10 or 12 digits
|
18
18
|
attr_accessor :fiscal_number
|
19
19
|
|
20
|
-
# Business relation to the customer.
|
20
|
+
# Business relation to the customer.
|
21
|
+
# Mandatory for the following payment methods:
|
22
|
+
# * 3390 - PAYONE Secured Invoice
|
23
|
+
# * 3391 - PAYONE Secured Installment
|
24
|
+
# * 3392 - PAYONE Secured Direct Debit
|
25
|
+
# @return [BusinessRelation]
|
21
26
|
attr_accessor :business_relation
|
22
27
|
|
23
28
|
# The locale that the customer should be addressed in (for 3rd parties). Note: Only the language code is supported.
|
@@ -25,6 +30,9 @@ module PCPServerSDK
|
|
25
30
|
|
26
31
|
attr_accessor :personal_information
|
27
32
|
|
33
|
+
# Object containing data related to the account the customer has with you.
|
34
|
+
attr_accessor :account
|
35
|
+
|
28
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
37
|
def self.attribute_map
|
30
38
|
{
|
@@ -35,7 +43,8 @@ module PCPServerSDK
|
|
35
43
|
:'fiscal_number' => :'fiscalNumber',
|
36
44
|
:'business_relation' => :'businessRelation',
|
37
45
|
:'locale' => :'locale',
|
38
|
-
:'personal_information' => :'personalInformation'
|
46
|
+
:'personal_information' => :'personalInformation',
|
47
|
+
:'account' => :'account'
|
39
48
|
}
|
40
49
|
end
|
41
50
|
|
@@ -52,9 +61,10 @@ module PCPServerSDK
|
|
52
61
|
:'billing_address' => :'Address',
|
53
62
|
:'contact_details' => :'ContactDetails',
|
54
63
|
:'fiscal_number' => :'String',
|
55
|
-
:'business_relation' => :'
|
64
|
+
:'business_relation' => :'BusinessRelation',
|
56
65
|
:'locale' => :'String',
|
57
|
-
:'personal_information' => :'PersonalInformation'
|
66
|
+
:'personal_information' => :'PersonalInformation',
|
67
|
+
:'account' => :'CustomerAccount'
|
58
68
|
}
|
59
69
|
end
|
60
70
|
|
@@ -110,6 +120,10 @@ module PCPServerSDK
|
|
110
120
|
if attributes.key?(:'personal_information')
|
111
121
|
self.personal_information = attributes[:'personal_information']
|
112
122
|
end
|
123
|
+
|
124
|
+
if attributes.key?(:'account')
|
125
|
+
self.account = attributes[:'account']
|
126
|
+
end
|
113
127
|
end
|
114
128
|
|
115
129
|
# Checks equality by comparing each attribute.
|
@@ -124,7 +138,8 @@ module PCPServerSDK
|
|
124
138
|
fiscal_number == o.fiscal_number &&
|
125
139
|
business_relation == o.business_relation &&
|
126
140
|
locale == o.locale &&
|
127
|
-
personal_information == o.personal_information
|
141
|
+
personal_information == o.personal_information &&
|
142
|
+
account == o.account
|
128
143
|
end
|
129
144
|
|
130
145
|
# @see the `==` method
|
@@ -136,7 +151,7 @@ module PCPServerSDK
|
|
136
151
|
# Calculates hash code according to all attributes.
|
137
152
|
# @return [Integer] Hash code
|
138
153
|
def hash
|
139
|
-
[company_information, merchant_customer_id, billing_address, contact_details, fiscal_number, business_relation, locale, personal_information].hash
|
154
|
+
[company_information, merchant_customer_id, billing_address, contact_details, fiscal_number, business_relation, locale, personal_information, account].hash
|
140
155
|
end
|
141
156
|
|
142
157
|
# Builds the object from hash
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
module PCPServerSDK
|
5
|
+
module Models
|
6
|
+
# Object containing data related to the account the customer has with you.
|
7
|
+
class CustomerAccount
|
8
|
+
# Creation date and time of the customer account in ISO 8601 format (UTC).
|
9
|
+
attr_accessor :create_date
|
10
|
+
|
11
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
12
|
+
def self.attribute_map
|
13
|
+
{
|
14
|
+
:'create_date' => :'createDate'
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
# Returns all the JSON keys this model knows about
|
19
|
+
def self.acceptable_attributes
|
20
|
+
attribute_map.values
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.openapi_types
|
25
|
+
{
|
26
|
+
:'create_date' => :'Time'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Initializes the object
|
31
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
32
|
+
def initialize(attributes = {})
|
33
|
+
if (!attributes.is_a?(Hash))
|
34
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `CustomerAccount` initialize method"
|
35
|
+
end
|
36
|
+
|
37
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
38
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
39
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
40
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `CustomerAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
41
|
+
end
|
42
|
+
h[k.to_sym] = v
|
43
|
+
}
|
44
|
+
|
45
|
+
if attributes.key?(:'create_date')
|
46
|
+
self.create_date = attributes[:'create_date']
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -1,25 +1,27 @@
|
|
1
|
-
|
2
1
|
require 'date'
|
3
2
|
require 'time'
|
4
3
|
|
5
|
-
# Object containing the specific output details for financing payment methods (Buy Now Pay Later)
|
6
4
|
module PCPServerSDK
|
7
5
|
module Models
|
6
|
+
# Object containing the specific output details for financing payment methods (Buy Now Pay Later).
|
8
7
|
class FinancingPaymentMethodSpecificOutput
|
9
|
-
# Payment product identifier
|
8
|
+
# Payment product identifier.
|
10
9
|
attr_accessor :payment_product_id
|
11
10
|
|
12
11
|
attr_accessor :payment_product3391_specific_output
|
13
12
|
|
13
|
+
attr_accessor :payment_instructions
|
14
|
+
|
14
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
15
16
|
def self.attribute_map
|
16
17
|
{
|
17
18
|
:'payment_product_id' => :'paymentProductId',
|
18
|
-
:'payment_product3391_specific_output' => :'paymentProduct3391SpecificOutput'
|
19
|
+
:'payment_product3391_specific_output' => :'paymentProduct3391SpecificOutput',
|
20
|
+
:'payment_instructions' => :'paymentInstructions'
|
19
21
|
}
|
20
22
|
end
|
21
23
|
|
22
|
-
# Returns all the JSON keys this model knows about
|
24
|
+
# Returns all the JSON keys this model knows about.
|
23
25
|
def self.acceptable_attributes
|
24
26
|
attribute_map.values
|
25
27
|
end
|
@@ -28,24 +30,24 @@ module PCPServerSDK
|
|
28
30
|
def self.openapi_types
|
29
31
|
{
|
30
32
|
:'payment_product_id' => :'Integer',
|
31
|
-
:'payment_product3391_specific_output' => :'PaymentProduct3391SpecificOutput'
|
33
|
+
:'payment_product3391_specific_output' => :'PaymentProduct3391SpecificOutput',
|
34
|
+
:'payment_instructions' => :'PaymentInstructions'
|
32
35
|
}
|
33
36
|
end
|
34
37
|
|
35
|
-
# List of attributes with nullable: true
|
38
|
+
# List of attributes with nullable: true.
|
36
39
|
def self.openapi_nullable
|
37
|
-
Set.new([
|
38
|
-
])
|
40
|
+
Set.new([])
|
39
41
|
end
|
40
42
|
|
41
|
-
# Initializes the object
|
42
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
# Initializes the object.
|
44
|
+
# @param [Hash] attributes Model attributes in the form of hash.
|
43
45
|
def initialize(attributes = {})
|
44
46
|
if (!attributes.is_a?(Hash))
|
45
47
|
fail ArgumentError, "The input argument (attributes) must be a hash in `FinancingPaymentMethodSpecificOutput` initialize method"
|
46
48
|
end
|
47
49
|
|
48
|
-
#
|
50
|
+
# Check to see if the attribute exists and convert string to symbol for hash key.
|
49
51
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
52
|
if (!self.class.attribute_map.key?(k.to_sym))
|
51
53
|
fail ArgumentError, "`#{k}` is not a valid attribute in `FinancingPaymentMethodSpecificOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
@@ -60,32 +62,37 @@ module PCPServerSDK
|
|
60
62
|
if attributes.key?(:'payment_product3391_specific_output')
|
61
63
|
self.payment_product3391_specific_output = attributes[:'payment_product3391_specific_output']
|
62
64
|
end
|
65
|
+
|
66
|
+
if attributes.key?(:'payment_instructions')
|
67
|
+
self.payment_instructions = attributes[:'payment_instructions']
|
68
|
+
end
|
63
69
|
end
|
64
70
|
|
65
71
|
# Checks equality by comparing each attribute.
|
66
|
-
# @param [Object] Object to be compared
|
72
|
+
# @param [Object] Object to be compared.
|
67
73
|
def ==(o)
|
68
74
|
return true if self.equal?(o)
|
69
75
|
self.class == o.class &&
|
70
|
-
|
71
|
-
|
76
|
+
payment_product_id == o.payment_product_id &&
|
77
|
+
payment_product3391_specific_output == o.payment_product3391_specific_output &&
|
78
|
+
payment_instructions == o.payment_instructions
|
72
79
|
end
|
73
80
|
|
74
|
-
# @see the `==` method
|
75
|
-
# @param [Object] Object to be compared
|
81
|
+
# @see the `==` method.
|
82
|
+
# @param [Object] Object to be compared.
|
76
83
|
def eql?(o)
|
77
84
|
self == o
|
78
85
|
end
|
79
86
|
|
80
87
|
# Calculates hash code according to all attributes.
|
81
|
-
# @return [Integer] Hash code
|
88
|
+
# @return [Integer] Hash code.
|
82
89
|
def hash
|
83
|
-
[payment_product_id, payment_product3391_specific_output].hash
|
90
|
+
[payment_product_id, payment_product3391_specific_output, payment_instructions].hash
|
84
91
|
end
|
85
92
|
|
86
|
-
# Builds the object from hash
|
87
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
-
# @return [Object] Returns the model itself
|
93
|
+
# Builds the object from hash.
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash.
|
95
|
+
# @return [Object] Returns the model itself.
|
89
96
|
def self.build_from_hash(attributes)
|
90
97
|
return nil unless attributes.is_a?(Hash)
|
91
98
|
attributes = attributes.transform_keys(&:to_sym)
|
@@ -94,8 +101,6 @@ module PCPServerSDK
|
|
94
101
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
95
102
|
transformed_hash["#{key}"] = nil
|
96
103
|
elsif type =~ /\AArray<(.*)>/i
|
97
|
-
# check to ensure the input is an array given that the attribute
|
98
|
-
# is documented as an array but the input is not
|
99
104
|
if attributes[attribute_map[key]].is_a?(Array)
|
100
105
|
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
101
106
|
end
|
@@ -106,10 +111,10 @@ module PCPServerSDK
|
|
106
111
|
new(transformed_hash)
|
107
112
|
end
|
108
113
|
|
109
|
-
# Deserializes the data based on type
|
110
|
-
# @param string type Data type
|
111
|
-
# @param string value Value to be deserialized
|
112
|
-
# @return [Object] Deserialized data
|
114
|
+
# Deserializes the data based on type.
|
115
|
+
# @param string type Data type.
|
116
|
+
# @param string value Value to be deserialized.
|
117
|
+
# @return [Object] Deserialized data.
|
113
118
|
def self._deserialize(type, value)
|
114
119
|
case type.to_sym
|
115
120
|
when :Time
|
@@ -129,7 +134,6 @@ module PCPServerSDK
|
|
129
134
|
false
|
130
135
|
end
|
131
136
|
when :Object
|
132
|
-
# generic object (usually a Hash), return directly
|
133
137
|
value
|
134
138
|
when /\AArray<(?<inner_type>.+)>\z/
|
135
139
|
inner_type = Regexp.last_match[:inner_type]
|
@@ -143,26 +147,25 @@ module PCPServerSDK
|
|
143
147
|
end
|
144
148
|
end
|
145
149
|
else # model
|
146
|
-
# models (e.g. Pet) or oneOf
|
147
150
|
klass = PCPServerSDK::Models.const_get(type)
|
148
151
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
149
152
|
end
|
150
153
|
end
|
151
154
|
|
152
|
-
# Returns the string representation of the object
|
153
|
-
# @return [String] String presentation of the object
|
155
|
+
# Returns the string representation of the object.
|
156
|
+
# @return [String] String presentation of the object.
|
154
157
|
def to_s
|
155
158
|
to_hash.to_s
|
156
159
|
end
|
157
160
|
|
158
|
-
# to_body is an alias to to_hash (backward compatibility)
|
159
|
-
# @return [Hash] Returns the object in the form of hash
|
161
|
+
# to_body is an alias to to_hash (backward compatibility).
|
162
|
+
# @return [Hash] Returns the object in the form of hash.
|
160
163
|
def to_body
|
161
164
|
to_hash
|
162
165
|
end
|
163
166
|
|
164
|
-
# Returns the object in the form of hash
|
165
|
-
# @return [Hash] Returns the object in the form of hash
|
167
|
+
# Returns the object in the form of hash.
|
168
|
+
# @return [Hash] Returns the object in the form of hash.
|
166
169
|
def to_hash
|
167
170
|
hash = {}
|
168
171
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -177,10 +180,10 @@ module PCPServerSDK
|
|
177
180
|
hash
|
178
181
|
end
|
179
182
|
|
180
|
-
# Outputs non-array value in the form of hash
|
181
|
-
# For object, use to_hash. Otherwise, just return the value
|
182
|
-
# @param [Object] value Any valid value
|
183
|
-
# @return [Hash] Returns the value in the form of hash
|
183
|
+
# Outputs non-array value in the form of hash.
|
184
|
+
# For object, use to_hash. Otherwise, just return the value.
|
185
|
+
# @param [Object] value Any valid value.
|
186
|
+
# @return [Hash] Returns the value in the form of hash.
|
184
187
|
def _to_hash(value)
|
185
188
|
if value.is_a?(Array)
|
186
189
|
value.compact.map { |v| _to_hash(v) }
|
@@ -6,7 +6,8 @@ require 'time'
|
|
6
6
|
module PCPServerSDK
|
7
7
|
module Models
|
8
8
|
class MerchantAction
|
9
|
-
# Action merchants needs to take in the online payment process.
|
9
|
+
# Action merchants needs to take in the online payment process.
|
10
|
+
# @return [ActionType]
|
10
11
|
attr_accessor :action_type
|
11
12
|
|
12
13
|
attr_accessor :redirect_data
|
@@ -27,7 +28,7 @@ module PCPServerSDK
|
|
27
28
|
# Attribute type mapping.
|
28
29
|
def self.openapi_types
|
29
30
|
{
|
30
|
-
:'action_type' => :'
|
31
|
+
:'action_type' => :'ActionType',
|
31
32
|
:'redirect_data' => :'RedirectData'
|
32
33
|
}
|
33
34
|
end
|