connect-sdk-ruby 3.6.0 → 4.0.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: 892f5bc6ad046fec8c7163822d51502d722220d3b2518693bcd65c672db19f49
4
- data.tar.gz: ef519b813cf0fda42ac93cffc19e85bdadc848a7fb2c05d93c060626d8b9477e
3
+ metadata.gz: 5af5cfd7b014d29748dc1c247c6f0481276b8761ababe7dfc15ce0b2d157fd45
4
+ data.tar.gz: b9f6323e7e210ff871f591fb0ae4b7cac7c8a6190962f60116dca3f00420632c
5
5
  SHA512:
6
- metadata.gz: 18ab63c2199698d6a3f906439e9d92e556f58bd2869c45c840b378453900dc11c645f886084c5cb6d4a177f6676154308629ed282f740e88131980ee62ce1191
7
- data.tar.gz: f90b38f2f6c80fb66f6398964ba7934399ec5d3d5f9eb4708c48d1a5622efe471becbf10df3247212980d8a9061dedd1dabffa99d8b0cda9eca3d7a28dfcd9c5
6
+ metadata.gz: 369807ac3579c703879e70f6ef4e9646f521322306068a387bbeb87422c2326e0e2e527782be377f956c6d6b1ef243a149e0170435bb3c1ce9979ae5ce30b583
7
+ data.tar.gz: bf81a66f5c9c61694862b4625a74ccb445f88f3d51ccb3e3674b51fdc5480d3cd344882bce3a3577379cb24d9ad7ee5de7a3e47f7c3cff7a71f33e40a4c69162
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '3.6.0'
3
+ spec.version = '4.0.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,36 @@
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
+ require 'worldline/connect/sdk/v1/domain/amount_of_money'
7
+ require 'worldline/connect/sdk/v1/domain/create_dispute_request'
8
+
9
+ Domain = Worldline::Connect::SDK::V1::Domain
10
+
11
+ def example
12
+ get_client do |client|
13
+ amount_of_money = Domain::AmountOfMoney.new
14
+ amount_of_money.amount = 1234
15
+ amount_of_money.currency_code = 'USD'
16
+
17
+ body = Domain::CreateDisputeRequest.new
18
+ body.amount_of_money = amount_of_money
19
+ body.contact_person = 'Wile Coyote'
20
+ body.email_address = 'wile.e.coyote@acmelabs.com'
21
+ body.reply_to = 'r.runner@acmelabs.com'
22
+ body.request_message = 'This is the message from the merchant to GlobalCollect. It is a a freeform text field.'
23
+
24
+ response = client.v1.merchant('merchantId').captures.dispute('captureId', body)
25
+ end
26
+ end
27
+
28
+ def get_client
29
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
30
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
31
+ configuration_file_name = File.join(__FILE__, '..', '..', '..', 'example_configuration.yml')
32
+ yield client = Worldline::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
33
+ ensure
34
+ # Free networking resources when done
35
+ client.close unless client.nil?
36
+ end
@@ -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').captures.disputes('captureId')
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
@@ -3,11 +3,16 @@
3
3
  # https://apireference.connect.worldline-solutions.com/
4
4
  #
5
5
  require 'worldline/connect/sdk/factory'
6
+ require 'worldline/connect/sdk/v1/merchant/payments/get_payment_params'
6
7
 
8
+ Payments = Worldline::Connect::SDK::V1::Merchant::Payments
7
9
 
8
10
  def example
9
11
  get_client do |client|
10
- response = client.v1.merchant('merchantId').payments.get('paymentId')
12
+ query = Payments::GetPaymentParams.new
13
+ query.return_operations = true
14
+
15
+ response = client.v1.merchant('merchantId').payments.get('paymentId', query)
11
16
  end
12
17
  end
13
18
 
@@ -14,7 +14,7 @@ module Worldline
14
14
  class MetadataProvider
15
15
  private
16
16
 
17
- SDK_VERSION = '3.6.0'.freeze
17
+ SDK_VERSION = '4.0.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
@@ -11,6 +11,7 @@ module Worldline
11
11
  module SDK
12
12
  module V1
13
13
  module Domain
14
+ # @attr [String] capture_id
14
15
  # @attr [Worldline::Connect::SDK::V1::Domain::DisputeOutput] dispute_output
15
16
  # @attr [String] id
16
17
  # @attr [String] payment_id
@@ -18,6 +19,8 @@ module Worldline
18
19
  # @attr [Worldline::Connect::SDK::V1::Domain::DisputeStatusOutput] status_output
19
20
  class Dispute < Worldline::Connect::SDK::Domain::DataObject
20
21
 
22
+ attr_accessor :capture_id
23
+
21
24
  attr_accessor :dispute_output
22
25
 
23
26
  attr_accessor :id
@@ -31,6 +34,7 @@ module Worldline
31
34
  # @return (Hash)
32
35
  def to_h
33
36
  hash = super
37
+ hash['captureId'] = @capture_id unless @capture_id.nil?
34
38
  hash['disputeOutput'] = @dispute_output.to_h unless @dispute_output.nil?
35
39
  hash['id'] = @id unless @id.nil?
36
40
  hash['paymentId'] = @payment_id unless @payment_id.nil?
@@ -41,6 +45,9 @@ module Worldline
41
45
 
42
46
  def from_hash(hash)
43
47
  super
48
+ if hash.has_key? 'captureId'
49
+ @capture_id = hash['captureId']
50
+ end
44
51
  if hash.has_key? 'disputeOutput'
45
52
  raise TypeError, "value '%s' is not a Hash" % [hash['disputeOutput']] unless hash['disputeOutput'].is_a? Hash
46
53
  @dispute_output = Worldline::Connect::SDK::V1::Domain::DisputeOutput.new_from_hash(hash['disputeOutput'])
@@ -0,0 +1,65 @@
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
+ require 'worldline/connect/sdk/v1/domain/amount_of_money'
7
+
8
+ module Worldline
9
+ module Connect
10
+ module SDK
11
+ module V1
12
+ module Domain
13
+ # @attr [Worldline::Connect::SDK::V1::Domain::AmountOfMoney] amount_of_money
14
+ # @attr [String] id
15
+ # @attr [String] status
16
+ # @attr [String] timestamp
17
+ # @attr [String] type
18
+ class PaymentOperation < Worldline::Connect::SDK::Domain::DataObject
19
+
20
+ attr_accessor :amount_of_money
21
+
22
+ attr_accessor :id
23
+
24
+ attr_accessor :status
25
+
26
+ attr_accessor :timestamp
27
+
28
+ attr_accessor :type
29
+
30
+ # @return (Hash)
31
+ def to_h
32
+ hash = super
33
+ hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
34
+ hash['id'] = @id unless @id.nil?
35
+ hash['status'] = @status unless @status.nil?
36
+ hash['timestamp'] = @timestamp unless @timestamp.nil?
37
+ hash['type'] = @type unless @type.nil?
38
+ hash
39
+ end
40
+
41
+ def from_hash(hash)
42
+ super
43
+ if hash.has_key? 'amountOfMoney'
44
+ raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
45
+ @amount_of_money = Worldline::Connect::SDK::V1::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
46
+ end
47
+ if hash.has_key? 'id'
48
+ @id = hash['id']
49
+ end
50
+ if hash.has_key? 'status'
51
+ @status = hash['status']
52
+ end
53
+ if hash.has_key? 'timestamp'
54
+ @timestamp = hash['timestamp']
55
+ end
56
+ if hash.has_key? 'type'
57
+ @type = hash['type']
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -10,6 +10,7 @@ require 'worldline/connect/sdk/v1/domain/invoice_payment_method_specific_output'
10
10
  require 'worldline/connect/sdk/v1/domain/mobile_payment_method_specific_output'
11
11
  require 'worldline/connect/sdk/v1/domain/non_sepa_direct_debit_payment_method_specific_output'
12
12
  require 'worldline/connect/sdk/v1/domain/order_output'
13
+ require 'worldline/connect/sdk/v1/domain/payment_operation'
13
14
  require 'worldline/connect/sdk/v1/domain/redirect_payment_method_specific_output'
14
15
  require 'worldline/connect/sdk/v1/domain/sepa_direct_debit_payment_method_specific_output'
15
16
 
@@ -18,7 +19,11 @@ module Worldline
18
19
  module SDK
19
20
  module V1
20
21
  module Domain
22
+ # @attr [Integer] amount_capture_requested
23
+ # @attr [Integer] amount_captured
21
24
  # @attr [Integer] amount_paid
25
+ # @attr [Integer] amount_refund_requested
26
+ # @attr [Integer] amount_refunded
22
27
  # @attr [Integer] amount_reversed
23
28
  # @attr [Worldline::Connect::SDK::V1::Domain::BankTransferPaymentMethodSpecificOutput] bank_transfer_payment_method_specific_output
24
29
  # @attr [Worldline::Connect::SDK::V1::Domain::CardPaymentMethodSpecificOutput] card_payment_method_specific_output
@@ -27,14 +32,23 @@ module Worldline
27
32
  # @attr [Worldline::Connect::SDK::V1::Domain::EInvoicePaymentMethodSpecificOutput] e_invoice_payment_method_specific_output
28
33
  # @attr [Worldline::Connect::SDK::V1::Domain::InvoicePaymentMethodSpecificOutput] invoice_payment_method_specific_output
29
34
  # @attr [Worldline::Connect::SDK::V1::Domain::MobilePaymentMethodSpecificOutput] mobile_payment_method_specific_output
35
+ # @attr [Array<Worldline::Connect::SDK::V1::Domain::PaymentOperation>] operations
30
36
  # @attr [String] payment_method
31
37
  # @attr [Worldline::Connect::SDK::V1::Domain::RedirectPaymentMethodSpecificOutput] redirect_payment_method_specific_output
32
38
  # @attr [String] reversal_reason
33
39
  # @attr [Worldline::Connect::SDK::V1::Domain::SepaDirectDebitPaymentMethodSpecificOutput] sepa_direct_debit_payment_method_specific_output
34
40
  class PaymentOutput < Worldline::Connect::SDK::V1::Domain::OrderOutput
35
41
 
42
+ attr_accessor :amount_capture_requested
43
+
44
+ attr_accessor :amount_captured
45
+
36
46
  attr_accessor :amount_paid
37
47
 
48
+ attr_accessor :amount_refund_requested
49
+
50
+ attr_accessor :amount_refunded
51
+
38
52
  attr_accessor :amount_reversed
39
53
 
40
54
  attr_accessor :bank_transfer_payment_method_specific_output
@@ -51,6 +65,8 @@ module Worldline
51
65
 
52
66
  attr_accessor :mobile_payment_method_specific_output
53
67
 
68
+ attr_accessor :operations
69
+
54
70
  attr_accessor :payment_method
55
71
 
56
72
  attr_accessor :redirect_payment_method_specific_output
@@ -62,7 +78,11 @@ module Worldline
62
78
  # @return (Hash)
63
79
  def to_h
64
80
  hash = super
81
+ hash['amountCaptureRequested'] = @amount_capture_requested unless @amount_capture_requested.nil?
82
+ hash['amountCaptured'] = @amount_captured unless @amount_captured.nil?
65
83
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
84
+ hash['amountRefundRequested'] = @amount_refund_requested unless @amount_refund_requested.nil?
85
+ hash['amountRefunded'] = @amount_refunded unless @amount_refunded.nil?
66
86
  hash['amountReversed'] = @amount_reversed unless @amount_reversed.nil?
67
87
  hash['bankTransferPaymentMethodSpecificOutput'] = @bank_transfer_payment_method_specific_output.to_h unless @bank_transfer_payment_method_specific_output.nil?
68
88
  hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil?
@@ -71,6 +91,7 @@ module Worldline
71
91
  hash['eInvoicePaymentMethodSpecificOutput'] = @e_invoice_payment_method_specific_output.to_h unless @e_invoice_payment_method_specific_output.nil?
72
92
  hash['invoicePaymentMethodSpecificOutput'] = @invoice_payment_method_specific_output.to_h unless @invoice_payment_method_specific_output.nil?
73
93
  hash['mobilePaymentMethodSpecificOutput'] = @mobile_payment_method_specific_output.to_h unless @mobile_payment_method_specific_output.nil?
94
+ hash['operations'] = @operations.collect{|val| val.to_h} unless @operations.nil?
74
95
  hash['paymentMethod'] = @payment_method unless @payment_method.nil?
75
96
  hash['redirectPaymentMethodSpecificOutput'] = @redirect_payment_method_specific_output.to_h unless @redirect_payment_method_specific_output.nil?
76
97
  hash['reversalReason'] = @reversal_reason unless @reversal_reason.nil?
@@ -80,9 +101,21 @@ module Worldline
80
101
 
81
102
  def from_hash(hash)
82
103
  super
104
+ if hash.has_key? 'amountCaptureRequested'
105
+ @amount_capture_requested = hash['amountCaptureRequested']
106
+ end
107
+ if hash.has_key? 'amountCaptured'
108
+ @amount_captured = hash['amountCaptured']
109
+ end
83
110
  if hash.has_key? 'amountPaid'
84
111
  @amount_paid = hash['amountPaid']
85
112
  end
113
+ if hash.has_key? 'amountRefundRequested'
114
+ @amount_refund_requested = hash['amountRefundRequested']
115
+ end
116
+ if hash.has_key? 'amountRefunded'
117
+ @amount_refunded = hash['amountRefunded']
118
+ end
86
119
  if hash.has_key? 'amountReversed'
87
120
  @amount_reversed = hash['amountReversed']
88
121
  end
@@ -114,6 +147,13 @@ module Worldline
114
147
  raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificOutput']] unless hash['mobilePaymentMethodSpecificOutput'].is_a? Hash
115
148
  @mobile_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::MobilePaymentMethodSpecificOutput.new_from_hash(hash['mobilePaymentMethodSpecificOutput'])
116
149
  end
150
+ if hash.has_key? 'operations'
151
+ raise TypeError, "value '%s' is not an Array" % [hash['operations']] unless hash['operations'].is_a? Array
152
+ @operations = []
153
+ hash['operations'].each do |e|
154
+ @operations << Worldline::Connect::SDK::V1::Domain::PaymentOperation.new_from_hash(e)
155
+ end
156
+ end
117
157
  if hash.has_key? 'paymentMethod'
118
158
  @payment_method = hash['paymentMethod']
119
159
  end
@@ -3,6 +3,7 @@
3
3
  # https://apireference.connect.worldline-solutions.com/
4
4
  #
5
5
  require 'worldline/connect/sdk/domain/data_object'
6
+ require 'worldline/connect/sdk/v1/domain/capture_response'
6
7
  require 'worldline/connect/sdk/v1/domain/dispute_response'
7
8
  require 'worldline/connect/sdk/v1/domain/payment_response'
8
9
  require 'worldline/connect/sdk/v1/domain/payout_response'
@@ -15,6 +16,7 @@ module Worldline
15
16
  module V1
16
17
  module Domain
17
18
  # @attr [String] api_version
19
+ # @attr [Worldline::Connect::SDK::V1::Domain::CaptureResponse] capture
18
20
  # @attr [String] created
19
21
  # @attr [Worldline::Connect::SDK::V1::Domain::DisputeResponse] dispute
20
22
  # @attr [String] id
@@ -28,6 +30,8 @@ module Worldline
28
30
 
29
31
  attr_accessor :api_version
30
32
 
33
+ attr_accessor :capture
34
+
31
35
  attr_accessor :created
32
36
 
33
37
  attr_accessor :dispute
@@ -50,6 +54,7 @@ module Worldline
50
54
  def to_h
51
55
  hash = super
52
56
  hash['apiVersion'] = @api_version unless @api_version.nil?
57
+ hash['capture'] = @capture.to_h unless @capture.nil?
53
58
  hash['created'] = @created unless @created.nil?
54
59
  hash['dispute'] = @dispute.to_h unless @dispute.nil?
55
60
  hash['id'] = @id unless @id.nil?
@@ -67,6 +72,10 @@ module Worldline
67
72
  if hash.has_key? 'apiVersion'
68
73
  @api_version = hash['apiVersion']
69
74
  end
75
+ if hash.has_key? 'capture'
76
+ raise TypeError, "value '%s' is not a Hash" % [hash['capture']] unless hash['capture'].is_a? Hash
77
+ @capture = Worldline::Connect::SDK::V1::Domain::CaptureResponse.new_from_hash(hash['capture'])
78
+ end
70
79
  if hash.has_key? 'created'
71
80
  @created = hash['created']
72
81
  end
@@ -6,6 +6,8 @@ require 'worldline/connect/sdk/api_resource'
6
6
  require 'worldline/connect/sdk/communication/response_exception'
7
7
  require 'worldline/connect/sdk/v1/exception_factory'
8
8
  require 'worldline/connect/sdk/v1/domain/capture_response'
9
+ require 'worldline/connect/sdk/v1/domain/dispute_response'
10
+ require 'worldline/connect/sdk/v1/domain/disputes_response'
9
11
  require 'worldline/connect/sdk/v1/domain/error_response'
10
12
  require 'worldline/connect/sdk/v1/domain/refund_error_response'
11
13
  require 'worldline/connect/sdk/v1/domain/refund_response'
@@ -89,6 +91,70 @@ module Worldline
89
91
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
90
92
  raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
91
93
  end
94
+
95
+ # Resource /!{merchantId}/captures/!{captureId}/disputes - {https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/ruby/captures/disputes.html Get disputes}
96
+ #
97
+ # @param capture_id [String]
98
+ # @param context [Worldline::Connect::SDK::CallContext, nil]
99
+ # @return [Worldline::Connect::SDK::V1::Domain::DisputesResponse]
100
+ # @raise [Worldline::Connect::SDK::V1::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
101
+ # @raise [Worldline::Connect::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
102
+ # @raise [Worldline::Connect::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
103
+ # @raise [Worldline::Connect::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
104
+ # or there was a conflict (HTTP status code 404, 409 or 410)
105
+ # @raise [Worldline::Connect::SDK::V1::PlatformException] if something went wrong at the Worldline Global Collect platform,
106
+ # the Worldline Global Collect platform was unable to process a message from a downstream partner/acquirer,
107
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
108
+ # @raise [Worldline::Connect::SDK::V1::ApiException] if the Worldline Global Collect platform returned any other error
109
+ def disputes(capture_id, context = nil)
110
+ path_context = {
111
+ 'captureId'.freeze => capture_id,
112
+ }
113
+ uri = instantiate_uri('/v1/{merchantId}/captures/{captureId}/disputes', path_context)
114
+ @communicator.get(
115
+ uri,
116
+ client_headers,
117
+ nil,
118
+ Worldline::Connect::SDK::V1::Domain::DisputesResponse,
119
+ context)
120
+ rescue ResponseException => e
121
+ error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse
122
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
123
+ raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
124
+ end
125
+
126
+ # Resource /!{merchantId}/captures/!{captureId}/dispute - {https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/ruby/captures/dispute.html Create dispute}
127
+ #
128
+ # @param capture_id [String]
129
+ # @param body [Worldline::Connect::SDK::V1::Domain::CreateDisputeRequest]
130
+ # @param context [Worldline::Connect::SDK::CallContext, nil]
131
+ # @return [Worldline::Connect::SDK::V1::Domain::DisputeResponse]
132
+ # @raise [Worldline::Connect::SDK::V1::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
133
+ # @raise [Worldline::Connect::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
134
+ # @raise [Worldline::Connect::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
135
+ # @raise [Worldline::Connect::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
136
+ # or there was a conflict (HTTP status code 404, 409 or 410)
137
+ # @raise [Worldline::Connect::SDK::V1::PlatformException] if something went wrong at the Worldline Global Collect platform,
138
+ # the Worldline Global Collect platform was unable to process a message from a downstream partner/acquirer,
139
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
140
+ # @raise [Worldline::Connect::SDK::V1::ApiException] if the Worldline Global Collect platform returned any other error
141
+ def dispute(capture_id, body, context = nil)
142
+ path_context = {
143
+ 'captureId'.freeze => capture_id,
144
+ }
145
+ uri = instantiate_uri('/v1/{merchantId}/captures/{captureId}/dispute', path_context)
146
+ @communicator.post(
147
+ uri,
148
+ client_headers,
149
+ nil,
150
+ body,
151
+ Worldline::Connect::SDK::V1::Domain::DisputeResponse,
152
+ context)
153
+ rescue ResponseException => e
154
+ error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse
155
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
156
+ raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
157
+ end
92
158
  end
93
159
  end
94
160
  end
@@ -0,0 +1,33 @@
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/communication/param_request'
6
+ require 'worldline/connect/sdk/communication/request_param'
7
+
8
+ module Worldline
9
+ module Connect
10
+ module SDK
11
+ module V1
12
+ module Merchant
13
+ module Payments
14
+ # Query parameters for {https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/ruby/payments/get.html Get payment}
15
+ #
16
+ # @attr [true/false] return_operations
17
+ class GetPaymentParams < Worldline::Connect::SDK::Communication::ParamRequest
18
+
19
+ attr_accessor :return_operations
20
+
21
+ # @return [Array<Worldline::Connect::SDK::Communication::RequestParam>] representing the attributes of this class
22
+ def to_request_parameters
23
+ result = []
24
+ result << RequestParam.new('returnOperations', @return_operations.to_s) unless @return_operations.nil?
25
+ result
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -101,6 +101,7 @@ module Worldline
101
101
  # Resource /!{merchantId}/payments/!{paymentId} - {https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/ruby/payments/get.html Get payment}
102
102
  #
103
103
  # @param payment_id [String]
104
+ # @param query [Worldline::Connect::SDK::V1::Merchant::Payments::GetPaymentParams]
104
105
  # @param context [Worldline::Connect::SDK::CallContext, nil]
105
106
  # @return [Worldline::Connect::SDK::V1::Domain::PaymentResponse]
106
107
  # @raise [Worldline::Connect::SDK::V1::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
@@ -112,7 +113,7 @@ module Worldline
112
113
  # the Worldline Global Collect platform was unable to process a message from a downstream partner/acquirer,
113
114
  # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
114
115
  # @raise [Worldline::Connect::SDK::V1::ApiException] if the Worldline Global Collect platform returned any other error
115
- def get(payment_id, context = nil)
116
+ def get(payment_id, query, context = nil)
116
117
  path_context = {
117
118
  'paymentId'.freeze => payment_id,
118
119
  }
@@ -120,7 +121,7 @@ module Worldline
120
121
  @communicator.get(
121
122
  uri,
122
123
  client_headers,
123
- nil,
124
+ query,
124
125
  Worldline::Connect::SDK::V1::Domain::PaymentResponse,
125
126
  context)
126
127
  rescue ResponseException => e
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: 3.6.0
4
+ version: 4.0.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: 2025-08-11 00:00:00.000000000 Z
11
+ date: 2025-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -142,7 +142,9 @@ files:
142
142
  - Rakefile
143
143
  - connect-sdk-ruby.gemspec
144
144
  - examples/example_configuration.yml
145
+ - examples/v1/merchant/captures/create_capture_dispute_example.rb
145
146
  - examples/v1/merchant/captures/create_refund_capture_example.rb
147
+ - examples/v1/merchant/captures/get_capture_disputes_example.rb
146
148
  - examples/v1/merchant/captures/get_capture_example.rb
147
149
  - examples/v1/merchant/disputes/cancel_dispute_example.rb
148
150
  - examples/v1/merchant/disputes/get_dispute_example.rb
@@ -518,6 +520,7 @@ files:
518
520
  - lib/worldline/connect/sdk/v1/domain/payment_creation_output.rb
519
521
  - lib/worldline/connect/sdk/v1/domain/payment_creation_references.rb
520
522
  - lib/worldline/connect/sdk/v1/domain/payment_error_response.rb
523
+ - lib/worldline/connect/sdk/v1/domain/payment_operation.rb
521
524
  - lib/worldline/connect/sdk/v1/domain/payment_output.rb
522
525
  - lib/worldline/connect/sdk/v1/domain/payment_product.rb
523
526
  - lib/worldline/connect/sdk/v1/domain/payment_product302_specific_data.rb
@@ -674,6 +677,7 @@ files:
674
677
  - lib/worldline/connect/sdk/v1/merchant/merchant_client.rb
675
678
  - lib/worldline/connect/sdk/v1/merchant/payments.rb
676
679
  - lib/worldline/connect/sdk/v1/merchant/payments/find_payments_params.rb
680
+ - lib/worldline/connect/sdk/v1/merchant/payments/get_payment_params.rb
677
681
  - lib/worldline/connect/sdk/v1/merchant/payments/payments_client.rb
678
682
  - lib/worldline/connect/sdk/v1/merchant/payouts.rb
679
683
  - lib/worldline/connect/sdk/v1/merchant/payouts/find_payouts_params.rb