onlinepayments-sdk-ruby 4.6.0 → 4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aca421c8e13469ff28adc187a2d0a4a977ccbfbb599a81152e7859d1ea15f35
4
- data.tar.gz: 78ae92a6402a664ddc6fcead2e73e22dad615f78be879b1c333eb8b84912d1bb
3
+ metadata.gz: 3058e1bc5be34fcd5821976cbe1a3091e4eda958a0388c23743baae726e0a252
4
+ data.tar.gz: 614c6d7dd32e7e197ad9941ba8017918f0dcd6ba23db557a5c0e08323d4421df
5
5
  SHA512:
6
- metadata.gz: c26cec00edabf6de1c30a7ef55120eb7862d16e1ed05e3e110803b7ac9cf98d5cdd200d6942f07b2b42f5fce36084f2fd5d96690fffd2e58e3e7faa00c7d51cc
7
- data.tar.gz: 227964ccf90457553d4ed8093a0c87a84b53ad01dc7b2922cb5e34fd698a12479e62fd6d7918a4e8eaf7c2731420a1ac988a60a15e183a4373a89bbec4d50b52
6
+ metadata.gz: e566aa89af1e4987cb3e6ef2b77c9e668786c4396850d781f066426aac62247b3ba945676d889e6214a9286df1194c552223c773d62542e752e19c6c7d0d21bf
7
+ data.tar.gz: 43610a08ffcda453284db710ae40e84ace097f7878ac807c4df09c3ce28c6cf8817db3040ff92dcc986499410ff3c3c1c91d6b9fb67fbe745fced7ee29eac8ce
@@ -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.7.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.7.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-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -331,6 +331,9 @@ files:
331
331
  - lib/onlinepayments/sdk/domain/shopping_cart.rb
332
332
  - lib/onlinepayments/sdk/domain/shopping_cart_extension.rb
333
333
  - lib/onlinepayments/sdk/domain/show_form_data.rb
334
+ - lib/onlinepayments/sdk/domain/subsequent_card_payment_method_specific_input.rb
335
+ - lib/onlinepayments/sdk/domain/subsequent_payment_request.rb
336
+ - lib/onlinepayments/sdk/domain/subsequent_payment_response.rb
334
337
  - lib/onlinepayments/sdk/domain/surcharge.rb
335
338
  - lib/onlinepayments/sdk/domain/surcharge_calculation_card.rb
336
339
  - lib/onlinepayments/sdk/domain/surcharge_rate.rb