connect-sdk-ruby 4.4.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 +4 -4
- data/connect-sdk-ruby.gemspec +1 -1
- data/examples/v1/merchant/payments/finalize_capture_example.rb +22 -0
- data/lib/worldline/connect/sdk/communication/metadata_provider.rb +1 -1
- data/lib/worldline/connect/sdk/v1/domain/cash_payment_method_specific_input.rb +18 -0
- data/lib/worldline/connect/sdk/v1/domain/cash_payment_product1502_specific_input.rb +18 -0
- data/lib/worldline/connect/sdk/v1/domain/cash_payment_product1525_specific_input.rb +18 -0
- data/lib/worldline/connect/sdk/v1/merchant/payments/payments_client.rb +32 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dca4f933ae21eb8d75de43679c2050ea7e2ce28eaefd0a7382bd4d7165e35f80
|
|
4
|
+
data.tar.gz: ad89109f67fc5fb8f7708da59e284737bc90a930e46a21222ba6c20253622be9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5862d9fb8824427f8b442272559e6665029917f636dc0df538213bea43fdeaea1b85750ace45607c665a98ce350c76ba3238fdd49526b8616a6cafda41faf65
|
|
7
|
+
data.tar.gz: fd36486d0b09bbb8750ac64d40aa585405a2205f2135a7c44ede29895aa7968a43a7950419699a3e501f668ad0ed9eb59127a860f908fcb4ec49144e8d7d170f
|
data/connect-sdk-ruby.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |spec|
|
|
2
2
|
spec.name = 'connect-sdk-ruby'
|
|
3
|
-
spec.version = '4.
|
|
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.
|
|
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
|
|
@@ -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
|
|
@@ -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.
|
|
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-03-
|
|
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,6 +365,7 @@ 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
|