onlinepayments-sdk-ruby 4.6.0 → 4.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aca421c8e13469ff28adc187a2d0a4a977ccbfbb599a81152e7859d1ea15f35
4
- data.tar.gz: 78ae92a6402a664ddc6fcead2e73e22dad615f78be879b1c333eb8b84912d1bb
3
+ metadata.gz: 2b6f7ef1196935e346ae3819bf611ef3286a23877a19b2a7da09797a80e9d50b
4
+ data.tar.gz: 26dd065e0e3814782f51eeddae6f208fccda9e03f14b37f96233817d41f41c40
5
5
  SHA512:
6
- metadata.gz: c26cec00edabf6de1c30a7ef55120eb7862d16e1ed05e3e110803b7ac9cf98d5cdd200d6942f07b2b42f5fce36084f2fd5d96690fffd2e58e3e7faa00c7d51cc
7
- data.tar.gz: 227964ccf90457553d4ed8093a0c87a84b53ad01dc7b2922cb5e34fd698a12479e62fd6d7918a4e8eaf7c2731420a1ac988a60a15e183a4373a89bbec4d50b52
6
+ metadata.gz: e4d1f608ea8cf557524682b1a30aac24309929374abe984323381c8565c263d9b7e7e9b6eaae21a2c94e2b553144c4e5b4c8ecab6462120fa0fceed9756ad7f0
7
+ data.tar.gz: f18cdd9969d0a2b209751fcfe806524396dd8ef50ae7dea49c4ebc76ae8fe61dbc9d2132b23b33d63203748f5a45ab4f6e20d11a5235278f07cbcc5211b03893
@@ -0,0 +1,26 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+
6
+ module OnlinePayments::SDK
7
+ module Domain
8
+
9
+ # @attr [String] authorisation_code
10
+ class PaymentProduct5001SpecificOutput < OnlinePayments::SDK::DataObject
11
+ attr_accessor :authorisation_code
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['authorisationCode'] = @authorisation_code unless @authorisation_code.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @authorisation_code = hash['authorisationCode'] if hash.key? 'authorisationCode'
23
+ end
24
+ end
25
+ end
26
+ end
@@ -3,6 +3,7 @@
3
3
  #
4
4
  require 'onlinepayments/sdk/data_object'
5
5
  require 'onlinepayments/sdk/domain/fraud_results'
6
+ require 'onlinepayments/sdk/domain/payment_product5001_specific_output'
6
7
  require 'onlinepayments/sdk/domain/payment_product5402_specific_output'
7
8
  require 'onlinepayments/sdk/domain/payment_product5500_specific_output'
8
9
  require 'onlinepayments/sdk/domain/payment_product840_specific_output'
@@ -12,6 +13,7 @@ module OnlinePayments::SDK
12
13
 
13
14
  # @attr [OnlinePayments::SDK::Domain::FraudResults] fraud_results
14
15
  # @attr [String] payment_option
16
+ # @attr [OnlinePayments::SDK::Domain::PaymentProduct5001SpecificOutput] payment_product5001_specific_output
15
17
  # @attr [OnlinePayments::SDK::Domain::PaymentProduct5402SpecificOutput] payment_product5402_specific_output
16
18
  # @attr [OnlinePayments::SDK::Domain::PaymentProduct5500SpecificOutput] payment_product5500_specific_output
17
19
  # @attr [OnlinePayments::SDK::Domain::PaymentProduct840SpecificOutput] payment_product840_specific_output
@@ -20,6 +22,7 @@ module OnlinePayments::SDK
20
22
  class RedirectPaymentMethodSpecificOutput < OnlinePayments::SDK::DataObject
21
23
  attr_accessor :fraud_results
22
24
  attr_accessor :payment_option
25
+ attr_accessor :payment_product5001_specific_output
23
26
  attr_accessor :payment_product5402_specific_output
24
27
  attr_accessor :payment_product5500_specific_output
25
28
  attr_accessor :payment_product840_specific_output
@@ -31,6 +34,7 @@ module OnlinePayments::SDK
31
34
  hash = super
32
35
  hash['fraudResults'] = @fraud_results.to_h if @fraud_results
33
36
  hash['paymentOption'] = @payment_option unless @payment_option.nil?
37
+ hash['paymentProduct5001SpecificOutput'] = @payment_product5001_specific_output.to_h if @payment_product5001_specific_output
34
38
  hash['paymentProduct5402SpecificOutput'] = @payment_product5402_specific_output.to_h if @payment_product5402_specific_output
35
39
  hash['paymentProduct5500SpecificOutput'] = @payment_product5500_specific_output.to_h if @payment_product5500_specific_output
36
40
  hash['paymentProduct840SpecificOutput'] = @payment_product840_specific_output.to_h if @payment_product840_specific_output
@@ -46,6 +50,10 @@ module OnlinePayments::SDK
46
50
  @fraud_results = OnlinePayments::SDK::Domain::FraudResults.new_from_hash(hash['fraudResults'])
47
51
  end
48
52
  @payment_option = hash['paymentOption'] if hash.key? 'paymentOption'
53
+ if hash.key? 'paymentProduct5001SpecificOutput'
54
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct5001SpecificOutput']] unless hash['paymentProduct5001SpecificOutput'].is_a? Hash
55
+ @payment_product5001_specific_output = OnlinePayments::SDK::Domain::PaymentProduct5001SpecificOutput.new_from_hash(hash['paymentProduct5001SpecificOutput'])
56
+ end
49
57
  if hash.key? 'paymentProduct5402SpecificOutput'
50
58
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct5402SpecificOutput']] unless hash['paymentProduct5402SpecificOutput'].is_a? Hash
51
59
  @payment_product5402_specific_output = OnlinePayments::SDK::Domain::PaymentProduct5402SpecificOutput.new_from_hash(hash['paymentProduct5402SpecificOutput'])
@@ -0,0 +1,42 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+
6
+ module OnlinePayments::SDK
7
+ module Domain
8
+
9
+ # @attr [String] authorization_mode
10
+ # @attr [String] scheme_reference_data
11
+ # @attr [String] subsequent_type
12
+ # @attr [String] token
13
+ # @attr [String] transaction_channel
14
+ class SubsequentCardPaymentMethodSpecificInput < OnlinePayments::SDK::DataObject
15
+ attr_accessor :authorization_mode
16
+ attr_accessor :scheme_reference_data
17
+ attr_accessor :subsequent_type
18
+ attr_accessor :token
19
+ attr_accessor :transaction_channel
20
+
21
+ # @return (Hash)
22
+ def to_h
23
+ hash = super
24
+ hash['authorizationMode'] = @authorization_mode unless @authorization_mode.nil?
25
+ hash['schemeReferenceData'] = @scheme_reference_data unless @scheme_reference_data.nil?
26
+ hash['subsequentType'] = @subsequent_type unless @subsequent_type.nil?
27
+ hash['token'] = @token unless @token.nil?
28
+ hash['transactionChannel'] = @transaction_channel unless @transaction_channel.nil?
29
+ hash
30
+ end
31
+
32
+ def from_hash(hash)
33
+ super
34
+ @authorization_mode = hash['authorizationMode'] if hash.key? 'authorizationMode'
35
+ @scheme_reference_data = hash['schemeReferenceData'] if hash.key? 'schemeReferenceData'
36
+ @subsequent_type = hash['subsequentType'] if hash.key? 'subsequentType'
37
+ @token = hash['token'] if hash.key? 'token'
38
+ @transaction_channel = hash['transactionChannel'] if hash.key? 'transactionChannel'
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,38 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+ require 'onlinepayments/sdk/domain/order'
6
+ require 'onlinepayments/sdk/domain/subsequent_card_payment_method_specific_input'
7
+
8
+ module OnlinePayments::SDK
9
+ module Domain
10
+
11
+ # @attr [OnlinePayments::SDK::Domain::Order] order
12
+ # @attr [OnlinePayments::SDK::Domain::SubsequentCardPaymentMethodSpecificInput] subsequentcard_payment_method_specific_input
13
+ class SubsequentPaymentRequest < OnlinePayments::SDK::DataObject
14
+ attr_accessor :order
15
+ attr_accessor :subsequentcard_payment_method_specific_input
16
+
17
+ # @return (Hash)
18
+ def to_h
19
+ hash = super
20
+ hash['order'] = @order.to_h if @order
21
+ hash['subsequentcardPaymentMethodSpecificInput'] = @subsequentcard_payment_method_specific_input.to_h if @subsequentcard_payment_method_specific_input
22
+ hash
23
+ end
24
+
25
+ def from_hash(hash)
26
+ super
27
+ if hash.key? 'order'
28
+ raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
29
+ @order = OnlinePayments::SDK::Domain::Order.new_from_hash(hash['order'])
30
+ end
31
+ if hash.key? 'subsequentcardPaymentMethodSpecificInput'
32
+ raise TypeError, "value '%s' is not a Hash" % [hash['subsequentcardPaymentMethodSpecificInput']] unless hash['subsequentcardPaymentMethodSpecificInput'].is_a? Hash
33
+ @subsequentcard_payment_method_specific_input = OnlinePayments::SDK::Domain::SubsequentCardPaymentMethodSpecificInput.new_from_hash(hash['subsequentcardPaymentMethodSpecificInput'])
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,30 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+ require 'onlinepayments/sdk/domain/payment_response'
6
+
7
+ module OnlinePayments::SDK
8
+ module Domain
9
+
10
+ # @attr [OnlinePayments::SDK::Domain::PaymentResponse] payment
11
+ class SubsequentPaymentResponse < OnlinePayments::SDK::DataObject
12
+ attr_accessor :payment
13
+
14
+ # @return (Hash)
15
+ def to_h
16
+ hash = super
17
+ hash['payment'] = @payment.to_h if @payment
18
+ hash
19
+ end
20
+
21
+ def from_hash(hash)
22
+ super
23
+ if hash.key? 'payment'
24
+ raise TypeError, "value '%s' is not a Hash" % [hash['payment']] unless hash['payment'].is_a? Hash
25
+ @payment = OnlinePayments::SDK::Domain::PaymentResponse.new_from_hash(hash['payment'])
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -20,6 +20,8 @@ require 'onlinepayments/sdk/domain/refund_error_response'
20
20
  require 'onlinepayments/sdk/domain/refund_request'
21
21
  require 'onlinepayments/sdk/domain/refund_response'
22
22
  require 'onlinepayments/sdk/domain/refunds_response'
23
+ require 'onlinepayments/sdk/domain/subsequent_payment_request'
24
+ require 'onlinepayments/sdk/domain/subsequent_payment_response'
23
25
 
24
26
  module OnlinePayments::SDK
25
27
  module Merchant
@@ -160,6 +162,39 @@ module OnlinePayments::SDK
160
162
  raise create_exception(e.status_code, e.body, error_object, context)
161
163
  end
162
164
 
165
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/subsequent
166
+ # @param payment_id [String]
167
+ # @param body [OnlinePayments::SDK::Domain::SubsequentPaymentRequest]
168
+ # @param context [OnlinePayments::SDK::CallContext]
169
+ # @return [OnlinePayments::SDK::Domain::SubsequentPaymentResponse]
170
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
171
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
172
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
173
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
174
+ # or there was a conflict (HTTP status code 404, 409 or 410)
175
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
176
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
177
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
178
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
179
+ def subsequent_payment(payment_id, body, context = nil)
180
+ path_context = {
181
+ 'paymentId'.freeze => payment_id,
182
+ }
183
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/subsequent', path_context)
184
+ @communicator.post(
185
+ uri,
186
+ client_headers,
187
+ nil,
188
+ body,
189
+ OnlinePayments::SDK::Domain::SubsequentPaymentResponse,
190
+ context
191
+ )
192
+ rescue ResponseException => e
193
+ error_type = OnlinePayments::SDK::Domain::PaymentErrorResponse
194
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
195
+ raise create_exception(e.status_code, e.body, error_object, context)
196
+ end
197
+
163
198
  # Resource /v2/!{merchantId}/payments/!{paymentId}/refund
164
199
  # @param payment_id [String]
165
200
  # @param body [OnlinePayments::SDK::Domain::RefundRequest]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'onlinepayments-sdk-ruby'
3
- spec.version = '4.6.0'
3
+ spec.version = '4.8.0'
4
4
  spec.authors = ['Worldline Direct support team']
5
5
  spec.email = ['82139942+worldline-direct-support-team@users.noreply.github.com']
6
6
  spec.summary = %q{SDK to communicate with the Online Payments platform using the Online Payments Server API}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlinepayments-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Worldline Direct support team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2023-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -267,6 +267,7 @@ files:
267
267
  - lib/onlinepayments/sdk/domain/payment_product130_specific_three_d_secure.rb
268
268
  - lib/onlinepayments/sdk/domain/payment_product302_specific_data.rb
269
269
  - lib/onlinepayments/sdk/domain/payment_product320_specific_data.rb
270
+ - lib/onlinepayments/sdk/domain/payment_product5001_specific_output.rb
270
271
  - lib/onlinepayments/sdk/domain/payment_product5100_specific_input.rb
271
272
  - lib/onlinepayments/sdk/domain/payment_product5402_specific_output.rb
272
273
  - lib/onlinepayments/sdk/domain/payment_product5404.rb
@@ -331,6 +332,9 @@ files:
331
332
  - lib/onlinepayments/sdk/domain/shopping_cart.rb
332
333
  - lib/onlinepayments/sdk/domain/shopping_cart_extension.rb
333
334
  - lib/onlinepayments/sdk/domain/show_form_data.rb
335
+ - lib/onlinepayments/sdk/domain/subsequent_card_payment_method_specific_input.rb
336
+ - lib/onlinepayments/sdk/domain/subsequent_payment_request.rb
337
+ - lib/onlinepayments/sdk/domain/subsequent_payment_response.rb
334
338
  - lib/onlinepayments/sdk/domain/surcharge.rb
335
339
  - lib/onlinepayments/sdk/domain/surcharge_calculation_card.rb
336
340
  - lib/onlinepayments/sdk/domain/surcharge_rate.rb