connect-sdk-ruby 4.3.0 → 4.5.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: 6eb70538d7cb572c35fca75c5d19fa3b7aa898aadf8303fed5f0b648e36ade87
4
- data.tar.gz: 709340e0e61f1a9421768407179b707321a2f883acadb97df052183798190aba
3
+ metadata.gz: dca4f933ae21eb8d75de43679c2050ea7e2ce28eaefd0a7382bd4d7165e35f80
4
+ data.tar.gz: ad89109f67fc5fb8f7708da59e284737bc90a930e46a21222ba6c20253622be9
5
5
  SHA512:
6
- metadata.gz: 8ab8e6993d9472abc575763089c3a037911b0b71858ef75f3799f96e8d6f3e2e9e004622945eb9827844ee86d259f614b9ebef985db95d1fe8479b1a55866560
7
- data.tar.gz: dfcba9e5ea4755debd7b92d54d28198b25719f58b68f043a93c2ac461b1c6cb73e6af2bee9a0e69c810a03ab9373ea9a930950e7a504b374718df79b4ea62f7f
6
+ metadata.gz: c5862d9fb8824427f8b442272559e6665029917f636dc0df538213bea43fdeaea1b85750ace45607c665a98ce350c76ba3238fdd49526b8616a6cafda41faf65
7
+ data.tar.gz: fd36486d0b09bbb8750ac64d40aa585405a2205f2135a7c44ede29895aa7968a43a7950419699a3e501f668ad0ed9eb59127a860f908fcb4ec49144e8d7d170f
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '4.3.0'
3
+ spec.version = '4.5.0'
4
4
  spec.authors = ['Worldline Global Collect']
5
5
  spec.email = ['github.connect@worldline.com']
6
6
  spec.summary = %q{SDK to communicate with the Worldline Global Collect platform using the Worldline Connect Server API}
@@ -0,0 +1,22 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://apireference.connect.worldline-solutions.com/
4
+ #
5
+ require 'worldline/connect/sdk/factory'
6
+
7
+
8
+ def example
9
+ get_client do |client|
10
+ response = client.v1.merchant('merchantId').payments.finalizecapture('paymentId')
11
+ end
12
+ end
13
+
14
+ def get_client
15
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
16
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
17
+ configuration_file_name = File.join(__FILE__, '..', '..', '..', 'example_configuration.yml')
18
+ yield client = Worldline::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
19
+ ensure
20
+ # Free networking resources when done
21
+ client.close unless client.nil?
22
+ end
@@ -14,7 +14,7 @@ module Worldline
14
14
  class MetadataProvider
15
15
  private
16
16
 
17
- SDK_VERSION = '4.3.0'.freeze
17
+ SDK_VERSION = '4.5.0'.freeze
18
18
  SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'.freeze
19
19
  PROHIBITED_HEADERS = [SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key','Date', 'Content-Type', 'Authorization'].sort!.freeze
20
20
  CHARSET = 'utf-8'.freeze
@@ -51,10 +51,8 @@ module Worldline
51
51
  # If this Response does not contain a header with the given name, return _nil_ instead
52
52
  def self.get_disposition_filename(headers)
53
53
  header_value = get_header_value(headers, "Content-Disposition")
54
- unless header_value.nil?
55
- if header_value =~ /(?:^|;)\s*filename\s*=\s*(.*?)\s*(?:;|$)i/
56
- return trim_quotes($2)
57
- end
54
+ if !header_value.nil? && header_value =~ /(?:^|;)\s*filename\s*=\s*(.*?)\s*(?:;|$)i/
55
+ return trim_quotes($2)
58
56
  end
59
57
 
60
58
  return nil
@@ -65,11 +63,9 @@ module Worldline
65
63
  # Trims the single or double quotes at the beginning and end of parameter _filename_ if they exist
66
64
  # If they don't exist, it returns the original _filename_ instead
67
65
  def trim_quotes(filename)
68
- unless filename.length < 2
69
- if (filename.chars.first == '\'' && filename.chars.last == '\"') ||
70
- (filename.chars.first == '"' && filename.chars.last == '"')
71
- return filename[1...-1]
72
- end
66
+ if filename.length >= 2 &&
67
+ (filename.chars.first == '\'' && filename.chars.last == '\'') || (filename.chars.first == '"' && filename.chars.last == '"')
68
+ return filename[1...-1]
73
69
  end
74
70
  filename
75
71
  end
@@ -3,6 +3,7 @@
3
3
  # https://apireference.connect.worldline-solutions.com/
4
4
  #
5
5
  require 'worldline/connect/sdk/v1/domain/abstract_cash_payment_method_specific_input'
6
+ require 'worldline/connect/sdk/v1/domain/cash_payment_product1502_specific_input'
6
7
  require 'worldline/connect/sdk/v1/domain/cash_payment_product1503_specific_input'
7
8
  require 'worldline/connect/sdk/v1/domain/cash_payment_product1504_specific_input'
8
9
  require 'worldline/connect/sdk/v1/domain/cash_payment_product1506_specific_input'
@@ -11,6 +12,7 @@ require 'worldline/connect/sdk/v1/domain/cash_payment_product1521_specific_input
11
12
  require 'worldline/connect/sdk/v1/domain/cash_payment_product1522_specific_input'
12
13
  require 'worldline/connect/sdk/v1/domain/cash_payment_product1523_specific_input'
13
14
  require 'worldline/connect/sdk/v1/domain/cash_payment_product1524_specific_input'
15
+ require 'worldline/connect/sdk/v1/domain/cash_payment_product1525_specific_input'
14
16
  require 'worldline/connect/sdk/v1/domain/cash_payment_product1526_specific_input'
15
17
 
16
18
  module Worldline
@@ -18,6 +20,7 @@ module Worldline
18
20
  module SDK
19
21
  module V1
20
22
  module Domain
23
+ # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1502SpecificInput] payment_product1502_specific_input
21
24
  # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1503SpecificInput] payment_product1503_specific_input
22
25
  # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1504SpecificInput] payment_product1504_specific_input
23
26
  # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1506SpecificInput] payment_product1506_specific_input
@@ -26,9 +29,12 @@ module Worldline
26
29
  # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1522SpecificInput] payment_product1522_specific_input
27
30
  # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1523SpecificInput] payment_product1523_specific_input
28
31
  # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1524SpecificInput] payment_product1524_specific_input
32
+ # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1525SpecificInput] payment_product1525_specific_input
29
33
  # @attr [Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1526SpecificInput] payment_product1526_specific_input
30
34
  class CashPaymentMethodSpecificInput < Worldline::Connect::SDK::V1::Domain::AbstractCashPaymentMethodSpecificInput
31
35
 
36
+ attr_accessor :payment_product1502_specific_input
37
+
32
38
  # @deprecated No replacement
33
39
  attr_accessor :payment_product1503_specific_input
34
40
 
@@ -46,11 +52,14 @@ module Worldline
46
52
 
47
53
  attr_accessor :payment_product1524_specific_input
48
54
 
55
+ attr_accessor :payment_product1525_specific_input
56
+
49
57
  attr_accessor :payment_product1526_specific_input
50
58
 
51
59
  # @return (Hash)
52
60
  def to_h
53
61
  hash = super
62
+ hash['paymentProduct1502SpecificInput'] = @payment_product1502_specific_input.to_h unless @payment_product1502_specific_input.nil?
54
63
  hash['paymentProduct1503SpecificInput'] = @payment_product1503_specific_input.to_h unless @payment_product1503_specific_input.nil?
55
64
  hash['paymentProduct1504SpecificInput'] = @payment_product1504_specific_input.to_h unless @payment_product1504_specific_input.nil?
56
65
  hash['paymentProduct1506SpecificInput'] = @payment_product1506_specific_input.to_h unless @payment_product1506_specific_input.nil?
@@ -59,12 +68,17 @@ module Worldline
59
68
  hash['paymentProduct1522SpecificInput'] = @payment_product1522_specific_input.to_h unless @payment_product1522_specific_input.nil?
60
69
  hash['paymentProduct1523SpecificInput'] = @payment_product1523_specific_input.to_h unless @payment_product1523_specific_input.nil?
61
70
  hash['paymentProduct1524SpecificInput'] = @payment_product1524_specific_input.to_h unless @payment_product1524_specific_input.nil?
71
+ hash['paymentProduct1525SpecificInput'] = @payment_product1525_specific_input.to_h unless @payment_product1525_specific_input.nil?
62
72
  hash['paymentProduct1526SpecificInput'] = @payment_product1526_specific_input.to_h unless @payment_product1526_specific_input.nil?
63
73
  hash
64
74
  end
65
75
 
66
76
  def from_hash(hash)
67
77
  super
78
+ if hash.has_key? 'paymentProduct1502SpecificInput'
79
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct1502SpecificInput']] unless hash['paymentProduct1502SpecificInput'].is_a? Hash
80
+ @payment_product1502_specific_input = Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1502SpecificInput.new_from_hash(hash['paymentProduct1502SpecificInput'])
81
+ end
68
82
  if hash.has_key? 'paymentProduct1503SpecificInput'
69
83
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct1503SpecificInput']] unless hash['paymentProduct1503SpecificInput'].is_a? Hash
70
84
  @payment_product1503_specific_input = Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1503SpecificInput.new_from_hash(hash['paymentProduct1503SpecificInput'])
@@ -97,6 +111,10 @@ module Worldline
97
111
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct1524SpecificInput']] unless hash['paymentProduct1524SpecificInput'].is_a? Hash
98
112
  @payment_product1524_specific_input = Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1524SpecificInput.new_from_hash(hash['paymentProduct1524SpecificInput'])
99
113
  end
114
+ if hash.has_key? 'paymentProduct1525SpecificInput'
115
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct1525SpecificInput']] unless hash['paymentProduct1525SpecificInput'].is_a? Hash
116
+ @payment_product1525_specific_input = Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1525SpecificInput.new_from_hash(hash['paymentProduct1525SpecificInput'])
117
+ end
100
118
  if hash.has_key? 'paymentProduct1526SpecificInput'
101
119
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct1526SpecificInput']] unless hash['paymentProduct1526SpecificInput'].is_a? Hash
102
120
  @payment_product1526_specific_input = Worldline::Connect::SDK::V1::Domain::CashPaymentProduct1526SpecificInput.new_from_hash(hash['paymentProduct1526SpecificInput'])
@@ -0,0 +1,18 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://apireference.connect.worldline-solutions.com/
4
+ #
5
+ require 'worldline/connect/sdk/v1/domain/cash_payment_product_with_redirect_specific_input_base'
6
+
7
+ module Worldline
8
+ module Connect
9
+ module SDK
10
+ module V1
11
+ module Domain
12
+ class CashPaymentProduct1502SpecificInput < Worldline::Connect::SDK::V1::Domain::CashPaymentProductWithRedirectSpecificInputBase
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://apireference.connect.worldline-solutions.com/
4
+ #
5
+ require 'worldline/connect/sdk/v1/domain/cash_payment_product_with_redirect_specific_input_base'
6
+
7
+ module Worldline
8
+ module Connect
9
+ module SDK
10
+ module V1
11
+ module Domain
12
+ class CashPaymentProduct1525SpecificInput < Worldline::Connect::SDK::V1::Domain::CashPaymentProductWithRedirectSpecificInputBase
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -5,16 +5,20 @@
5
5
  require 'worldline/connect/sdk/domain/data_object'
6
6
  require 'worldline/connect/sdk/v1/domain/click_to_pay_configuration_mastercard'
7
7
  require 'worldline/connect/sdk/v1/domain/click_to_pay_configuration_visa'
8
+ require 'worldline/connect/sdk/v1/domain/click_to_pay_display_hints'
8
9
 
9
10
  module Worldline
10
11
  module Connect
11
12
  module SDK
12
13
  module V1
13
14
  module Domain
15
+ # @attr [Worldline::Connect::SDK::V1::Domain::ClickToPayDisplayHints] display_hints
14
16
  # @attr [Worldline::Connect::SDK::V1::Domain::ClickToPayConfigurationMastercard] mastercard
15
17
  # @attr [Worldline::Connect::SDK::V1::Domain::ClickToPayConfigurationVisa] visa
16
18
  class ClickToPayConfiguration < Worldline::Connect::SDK::Domain::DataObject
17
19
 
20
+ attr_accessor :display_hints
21
+
18
22
  attr_accessor :mastercard
19
23
 
20
24
  attr_accessor :visa
@@ -22,6 +26,7 @@ module Worldline
22
26
  # @return (Hash)
23
27
  def to_h
24
28
  hash = super
29
+ hash['displayHints'] = @display_hints.to_h unless @display_hints.nil?
25
30
  hash['mastercard'] = @mastercard.to_h unless @mastercard.nil?
26
31
  hash['visa'] = @visa.to_h unless @visa.nil?
27
32
  hash
@@ -29,6 +34,10 @@ module Worldline
29
34
 
30
35
  def from_hash(hash)
31
36
  super
37
+ if hash.has_key? 'displayHints'
38
+ raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash
39
+ @display_hints = Worldline::Connect::SDK::V1::Domain::ClickToPayDisplayHints.new_from_hash(hash['displayHints'])
40
+ end
32
41
  if hash.has_key? 'mastercard'
33
42
  raise TypeError, "value '%s' is not a Hash" % [hash['mastercard']] unless hash['mastercard'].is_a? Hash
34
43
  @mastercard = Worldline::Connect::SDK::V1::Domain::ClickToPayConfigurationMastercard.new_from_hash(hash['mastercard'])
@@ -0,0 +1,35 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://apireference.connect.worldline-solutions.com/
4
+ #
5
+ require 'worldline/connect/sdk/domain/data_object'
6
+
7
+ module Worldline
8
+ module Connect
9
+ module SDK
10
+ module V1
11
+ module Domain
12
+ # @attr [String] logo
13
+ class ClickToPayDisplayHints < Worldline::Connect::SDK::Domain::DataObject
14
+
15
+ attr_accessor :logo
16
+
17
+ # @return (Hash)
18
+ def to_h
19
+ hash = super
20
+ hash['logo'] = @logo unless @logo.nil?
21
+ hash
22
+ end
23
+
24
+ def from_hash(hash)
25
+ super
26
+ if hash.has_key? 'logo'
27
+ @logo = hash['logo']
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -325,6 +325,38 @@ module Worldline
325
325
  raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
326
326
  end
327
327
 
328
+ # Resource /!{merchantId}/payments/!{paymentId}/finalizecapture - {https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/ruby/payments/finalizecapture.html Finalize capture}
329
+ #
330
+ # @param payment_id [String]
331
+ # @param context [Worldline::Connect::SDK::CallContext, nil]
332
+ # @return [Worldline::Connect::SDK::V1::Domain::PaymentResponse]
333
+ # @raise [Worldline::Connect::SDK::V1::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
334
+ # @raise [Worldline::Connect::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
335
+ # @raise [Worldline::Connect::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
336
+ # @raise [Worldline::Connect::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
337
+ # or there was a conflict (HTTP status code 404, 409 or 410)
338
+ # @raise [Worldline::Connect::SDK::V1::PlatformException] if something went wrong at the Worldline Global Collect platform,
339
+ # the Worldline Global Collect platform was unable to process a message from a downstream partner/acquirer,
340
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
341
+ # @raise [Worldline::Connect::SDK::V1::ApiException] if the Worldline Global Collect platform returned any other error
342
+ def finalizecapture(payment_id, context = nil)
343
+ path_context = {
344
+ 'paymentId'.freeze => payment_id,
345
+ }
346
+ uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/finalizecapture', path_context)
347
+ @communicator.post(
348
+ uri,
349
+ client_headers,
350
+ nil,
351
+ nil,
352
+ Worldline::Connect::SDK::V1::Domain::PaymentResponse,
353
+ context)
354
+ rescue ResponseException => e
355
+ error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse
356
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
357
+ raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
358
+ end
359
+
328
360
  # Resource /!{merchantId}/payments/!{paymentId}/cancelapproval - {https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/ruby/payments/cancelapproval.html Undo capture payment}
329
361
  #
330
362
  # @param payment_id [String]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connect-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Worldline Global Collect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-11 00:00:00.000000000 Z
11
+ date: 2026-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -170,6 +170,7 @@ files:
170
170
  - examples/v1/merchant/payments/complete_payment_example.rb
171
171
  - examples/v1/merchant/payments/create_payment_dispute_example.rb
172
172
  - examples/v1/merchant/payments/create_payment_example.rb
173
+ - examples/v1/merchant/payments/finalize_capture_example.rb
173
174
  - examples/v1/merchant/payments/find_payments_example.rb
174
175
  - examples/v1/merchant/payments/get_payment_captures_example.rb
175
176
  - examples/v1/merchant/payments/get_payment_device_fingerprint_details_example.rb
@@ -355,6 +356,7 @@ files:
355
356
  - lib/worldline/connect/sdk/v1/domain/cash_payment_method_specific_input.rb
356
357
  - lib/worldline/connect/sdk/v1/domain/cash_payment_method_specific_input_base.rb
357
358
  - lib/worldline/connect/sdk/v1/domain/cash_payment_method_specific_output.rb
359
+ - lib/worldline/connect/sdk/v1/domain/cash_payment_product1502_specific_input.rb
358
360
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product1503_specific_input.rb
359
361
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product1504_specific_input.rb
360
362
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product1506_specific_input.rb
@@ -363,11 +365,13 @@ files:
363
365
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product1522_specific_input.rb
364
366
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product1523_specific_input.rb
365
367
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product1524_specific_input.rb
368
+ - lib/worldline/connect/sdk/v1/domain/cash_payment_product1525_specific_input.rb
366
369
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product1526_specific_input.rb
367
370
  - lib/worldline/connect/sdk/v1/domain/cash_payment_product_with_redirect_specific_input_base.rb
368
371
  - lib/worldline/connect/sdk/v1/domain/click_to_pay_configuration.rb
369
372
  - lib/worldline/connect/sdk/v1/domain/click_to_pay_configuration_mastercard.rb
370
373
  - lib/worldline/connect/sdk/v1/domain/click_to_pay_configuration_visa.rb
374
+ - lib/worldline/connect/sdk/v1/domain/click_to_pay_display_hints.rb
371
375
  - lib/worldline/connect/sdk/v1/domain/click_to_pay_scheme_configuration_base.rb
372
376
  - lib/worldline/connect/sdk/v1/domain/company_information.rb
373
377
  - lib/worldline/connect/sdk/v1/domain/complete_payment_card_payment_method_specific_input.rb