pcp-server-ruby-sdk 1.5.0 → 1.7.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/Gemfile +1 -0
  4. data/api-definition.yaml +169 -18
  5. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +2 -0
  6. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +6 -0
  7. data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +0 -2
  8. data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +0 -4
  9. data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +13 -4
  10. data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +13 -4
  11. data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +13 -4
  12. data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +13 -4
  13. data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +13 -4
  14. data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +200 -0
  15. data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +2 -0
  16. data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +13 -4
  17. data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +12 -4
  18. data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +272 -0
  19. data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +211 -0
  20. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -4
  21. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +1 -1
  22. data/lib/PCP-server-Ruby-SDK/models/{network.rb → mobile_payment_network.rb} +4 -4
  23. data/lib/PCP-server-Ruby-SDK/models/order_request.rb +12 -4
  24. data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +5 -38
  25. data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +15 -4
  26. data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +13 -4
  27. data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +1 -1
  28. data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +209 -0
  29. data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +12 -4
  30. data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +13 -4
  31. data/lib/PCP-server-Ruby-SDK/models/return_request.rb +204 -191
  32. data/lib/PCP-server-Ruby-SDK/transformer/apple_pay_transformer.rb +2 -2
  33. data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
  34. data/lib/PCP-server-Ruby-SDK.rb +5 -1
  35. data/package-lock.json +17 -18
  36. data/package.json +1 -1
  37. data/scripts.sh +2 -2
  38. data/spec/transformer/apple_pay_transformer_spec.rb +1 -1
  39. metadata +11 -7
@@ -0,0 +1,209 @@
1
+
2
+ require 'date'
3
+ require 'time'
4
+
5
+ module PCPServerSDK
6
+ module Models
7
+ # Object containing Click To Pay (product 5002) specific input details.
8
+ class PaymentProduct5002SpecificInput
9
+ attr_accessor :network
10
+
11
+ # The encrypted payment data for Click To Pay transactions.
12
+ attr_accessor :payment_checkout_data
13
+
14
+ # The SRC DPA ID for Click To Pay transactions.
15
+ attr_accessor :src_dpa_id
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'network' => :'network',
21
+ :'payment_checkout_data' => :'paymentCheckoutData',
22
+ :'src_dpa_id' => :'srcDpaId'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'network' => :'MobilePaymentNetwork',
35
+ :'payment_checkout_data' => :'String',
36
+ :'src_dpa_id' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentProduct5002SpecificInput` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentProduct5002SpecificInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'network')
62
+ self.network = attributes[:'network']
63
+ end
64
+
65
+ if attributes.key?(:'payment_checkout_data')
66
+ self.payment_checkout_data = attributes[:'payment_checkout_data']
67
+ end
68
+
69
+ if attributes.key?(:'src_dpa_id')
70
+ self.src_dpa_id = attributes[:'src_dpa_id']
71
+ end
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ network == o.network &&
80
+ payment_checkout_data == o.payment_checkout_data &&
81
+ src_dpa_id == o.src_dpa_id
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [network, payment_checkout_data, src_dpa_id].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+ attributes = attributes.transform_keys(&:to_sym)
102
+ transformed_hash = {}
103
+ openapi_types.each_pair do |key, type|
104
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
105
+ transformed_hash["#{key}"] = nil
106
+ elsif type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[attribute_map[key]].is_a?(Array)
110
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
111
+ end
112
+ elsif !attributes[attribute_map[key]].nil?
113
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
114
+ end
115
+ end
116
+ new(transformed_hash)
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def self._deserialize(type, value)
124
+ case type.to_sym
125
+ when :Time
126
+ Time.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :Boolean
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ # models (e.g. Pet) or oneOf
157
+ klass = PCPServerSDK::Models.const_get(type)
158
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
209
+ end
@@ -15,6 +15,7 @@ module PCPServerSDK
15
15
  # Unique payment transaction identifier of the payment gateway.
16
16
  attr_accessor :id
17
17
 
18
+ attr_accessor :fund_split
18
19
 
19
20
 
20
21
  class EnumAttributeValidator
@@ -45,7 +46,8 @@ module PCPServerSDK
45
46
  :'refund_output' => :'refundOutput',
46
47
  :'status' => :'status',
47
48
  :'status_output' => :'statusOutput',
48
- :'id' => :'id'
49
+ :'id' => :'id',
50
+ :'fund_split' => :'fundSplit'
49
51
  }
50
52
  end
51
53
 
@@ -60,7 +62,8 @@ module PCPServerSDK
60
62
  :'refund_output' => :'RefundOutput',
61
63
  :'status' => :'StatusValue',
62
64
  :'status_output' => :'PaymentStatusOutput',
63
- :'id' => :'String'
65
+ :'id' => :'String',
66
+ :'fund_split' => :'FundSplit'
64
67
  }
65
68
  end
66
69
 
@@ -100,6 +103,10 @@ module PCPServerSDK
100
103
  if attributes.key?(:'id')
101
104
  self.id = attributes[:'id']
102
105
  end
106
+
107
+ if attributes.key?(:'fund_split')
108
+ self.fund_split = attributes[:'fund_split']
109
+ end
103
110
  end
104
111
 
105
112
  # Checks equality by comparing each attribute.
@@ -110,7 +117,8 @@ module PCPServerSDK
110
117
  refund_output == o.refund_output &&
111
118
  status == o.status &&
112
119
  status_output == o.status_output &&
113
- id == o.id
120
+ id == o.id &&
121
+ fund_split == o.fund_split
114
122
  end
115
123
 
116
124
  # @see the `==` method
@@ -122,7 +130,7 @@ module PCPServerSDK
122
130
  # Calculates hash code according to all attributes.
123
131
  # @return [Integer] Hash code
124
132
  def hash
125
- [refund_output, status, status_output, id].hash
133
+ [refund_output, status, status_output, id, fund_split].hash
126
134
  end
127
135
 
128
136
  # Builds the object from hash
@@ -12,12 +12,15 @@ module PCPServerSDK
12
12
 
13
13
  attr_accessor :_return
14
14
 
15
+ attr_accessor :fund_split
16
+
15
17
  # Attribute mapping from ruby-style variable name to JSON key.
16
18
  def self.attribute_map
17
19
  {
18
20
  :'amount_of_money' => :'amountOfMoney',
19
21
  :'references' => :'references',
20
- :'_return' => :'return'
22
+ :'_return' => :'return',
23
+ :'fund_split' => :'fundSplit'
21
24
  }
22
25
  end
23
26
 
@@ -31,7 +34,8 @@ module PCPServerSDK
31
34
  {
32
35
  :'amount_of_money' => :'PositiveAmountOfMoney',
33
36
  :'references' => :'PaymentReferences',
34
- :'_return' => :'ReturnInformation'
37
+ :'_return' => :'ReturnInformation',
38
+ :'fund_split' => :'FundSplit'
35
39
  }
36
40
  end
37
41
 
@@ -67,6 +71,10 @@ module PCPServerSDK
67
71
  if attributes.key?(:'_return')
68
72
  self._return = attributes[:'_return']
69
73
  end
74
+
75
+ if attributes.key?(:'fund_split')
76
+ self.fund_split = attributes[:'fund_split']
77
+ end
70
78
  end
71
79
 
72
80
  # Checks equality by comparing each attribute.
@@ -76,7 +84,8 @@ module PCPServerSDK
76
84
  self.class == o.class &&
77
85
  amount_of_money == o.amount_of_money &&
78
86
  references == o.references &&
79
- _return == o._return
87
+ _return == o._return &&
88
+ fund_split == o.fund_split
80
89
  end
81
90
 
82
91
  # @see the `==` method
@@ -88,7 +97,7 @@ module PCPServerSDK
88
97
  # Calculates hash code according to all attributes.
89
98
  # @return [Integer] Hash code
90
99
  def hash
91
- [amount_of_money, references, _return].hash
100
+ [amount_of_money, references, _return, fund_split].hash
92
101
  end
93
102
 
94
103
  # Builds the object from hash