connect-sdk-ruby 3.6.0 → 4.1.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: ddec1cc70a3487229c39cae19894ea745f1d3525c12c4bd9c722f649903ff709
4
+ data.tar.gz: 40d46a85757909cbf05dee0616f9687cc39f3beb007098206eb7bf1e25d3d10e
5
5
  SHA512:
6
- metadata.gz: 18ab63c2199698d6a3f906439e9d92e556f58bd2869c45c840b378453900dc11c645f886084c5cb6d4a177f6676154308629ed282f740e88131980ee62ce1191
7
- data.tar.gz: f90b38f2f6c80fb66f6398964ba7934399ec5d3d5f9eb4708c48d1a5622efe471becbf10df3247212980d8a9061dedd1dabffa99d8b0cda9eca3d7a28dfcd9c5
6
+ metadata.gz: 5aa6340689a9233239b4776150ee9bf3bc01de85b4922c43697a3e02691ce8b148093d815655a1349b2fc8af453eeaf26ae8753f2e000fdbfc33a059afb53734
7
+ data.tar.gz: 4e9bfaeedbbd8a595c74ff0916ace96906a9e6e1f39aabf2dee3f5dde6a4259fe6fb61d77452709a36fa683d9731d471df27443b1cb84a8bfad0e71e471ba416
@@ -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.1.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.1.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
@@ -10,6 +10,7 @@ module Worldline
10
10
  module SDK
11
11
  module V1
12
12
  module Domain
13
+ # @attr [true/false] is_final
13
14
  # @attr [true/false] is_refundable
14
15
  # @attr [true/false] is_retriable
15
16
  # @attr [Array<Worldline::Connect::SDK::V1::Domain::KeyValuePair>] provider_raw_output
@@ -17,6 +18,8 @@ module Worldline
17
18
  # @attr [String] status_code_change_date_time
18
19
  class CaptureStatusOutput < Worldline::Connect::SDK::Domain::DataObject
19
20
 
21
+ attr_accessor :is_final
22
+
20
23
  attr_accessor :is_refundable
21
24
 
22
25
  attr_accessor :is_retriable
@@ -30,6 +33,7 @@ module Worldline
30
33
  # @return (Hash)
31
34
  def to_h
32
35
  hash = super
36
+ hash['isFinal'] = @is_final unless @is_final.nil?
33
37
  hash['isRefundable'] = @is_refundable unless @is_refundable.nil?
34
38
  hash['isRetriable'] = @is_retriable unless @is_retriable.nil?
35
39
  hash['providerRawOutput'] = @provider_raw_output.collect{|val| val.to_h} unless @provider_raw_output.nil?
@@ -40,6 +44,9 @@ module Worldline
40
44
 
41
45
  def from_hash(hash)
42
46
  super
47
+ if hash.has_key? 'isFinal'
48
+ @is_final = hash['isFinal']
49
+ end
43
50
  if hash.has_key? 'isRefundable'
44
51
  @is_refundable = hash['isRefundable']
45
52
  end
@@ -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
@@ -8,7 +8,6 @@ require 'worldline/connect/sdk/v1/domain/bank_account_iban'
8
8
  require 'worldline/connect/sdk/v1/domain/fraud_results'
9
9
  require 'worldline/connect/sdk/v1/domain/payment_product3201_specific_output'
10
10
  require 'worldline/connect/sdk/v1/domain/payment_product806_specific_output'
11
- require 'worldline/connect/sdk/v1/domain/payment_product836_specific_output'
12
11
  require 'worldline/connect/sdk/v1/domain/payment_product840_specific_output'
13
12
  require 'worldline/connect/sdk/v1/domain/payment_product866_specific_output'
14
13
 
@@ -23,7 +22,6 @@ module Worldline
23
22
  # @attr [Worldline::Connect::SDK::V1::Domain::FraudResults] fraud_results
24
23
  # @attr [Worldline::Connect::SDK::V1::Domain::PaymentProduct3201SpecificOutput] payment_product3201_specific_output
25
24
  # @attr [Worldline::Connect::SDK::V1::Domain::PaymentProduct806SpecificOutput] payment_product806_specific_output
26
- # @attr [Worldline::Connect::SDK::V1::Domain::PaymentProduct836SpecificOutput] payment_product836_specific_output
27
25
  # @attr [Worldline::Connect::SDK::V1::Domain::PaymentProduct840SpecificOutput] payment_product840_specific_output
28
26
  # @attr [Worldline::Connect::SDK::V1::Domain::PaymentProduct866SpecificOutput] payment_product866_specific_output
29
27
  # @attr [String] token
@@ -41,8 +39,6 @@ module Worldline
41
39
 
42
40
  attr_accessor :payment_product806_specific_output
43
41
 
44
- attr_accessor :payment_product836_specific_output
45
-
46
42
  attr_accessor :payment_product840_specific_output
47
43
 
48
44
  attr_accessor :payment_product866_specific_output
@@ -58,7 +54,6 @@ module Worldline
58
54
  hash['fraudResults'] = @fraud_results.to_h unless @fraud_results.nil?
59
55
  hash['paymentProduct3201SpecificOutput'] = @payment_product3201_specific_output.to_h unless @payment_product3201_specific_output.nil?
60
56
  hash['paymentProduct806SpecificOutput'] = @payment_product806_specific_output.to_h unless @payment_product806_specific_output.nil?
61
- hash['paymentProduct836SpecificOutput'] = @payment_product836_specific_output.to_h unless @payment_product836_specific_output.nil?
62
57
  hash['paymentProduct840SpecificOutput'] = @payment_product840_specific_output.to_h unless @payment_product840_specific_output.nil?
63
58
  hash['paymentProduct866SpecificOutput'] = @payment_product866_specific_output.to_h unless @payment_product866_specific_output.nil?
64
59
  hash['token'] = @token unless @token.nil?
@@ -90,10 +85,6 @@ module Worldline
90
85
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct806SpecificOutput']] unless hash['paymentProduct806SpecificOutput'].is_a? Hash
91
86
  @payment_product806_specific_output = Worldline::Connect::SDK::V1::Domain::PaymentProduct806SpecificOutput.new_from_hash(hash['paymentProduct806SpecificOutput'])
92
87
  end
93
- if hash.has_key? 'paymentProduct836SpecificOutput'
94
- raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct836SpecificOutput']] unless hash['paymentProduct836SpecificOutput'].is_a? Hash
95
- @payment_product836_specific_output = Worldline::Connect::SDK::V1::Domain::PaymentProduct836SpecificOutput.new_from_hash(hash['paymentProduct836SpecificOutput'])
96
- end
97
88
  if hash.has_key? 'paymentProduct840SpecificOutput'
98
89
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct840SpecificOutput']] unless hash['paymentProduct840SpecificOutput'].is_a? Hash
99
90
  @payment_product840_specific_output = Worldline::Connect::SDK::V1::Domain::PaymentProduct840SpecificOutput.new_from_hash(hash['paymentProduct840SpecificOutput'])
@@ -9,20 +9,27 @@ module Worldline
9
9
  module SDK
10
10
  module V1
11
11
  module Domain
12
+ # @attr [String] descriptor
12
13
  # @attr [String] merchant_reference
13
14
  class RefundReferences < Worldline::Connect::SDK::Domain::DataObject
14
15
 
16
+ attr_accessor :descriptor
17
+
15
18
  attr_accessor :merchant_reference
16
19
 
17
20
  # @return (Hash)
18
21
  def to_h
19
22
  hash = super
23
+ hash['descriptor'] = @descriptor unless @descriptor.nil?
20
24
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
21
25
  hash
22
26
  end
23
27
 
24
28
  def from_hash(hash)
25
29
  super
30
+ if hash.has_key? 'descriptor'
31
+ @descriptor = hash['descriptor']
32
+ end
26
33
  if hash.has_key? 'merchantReference'
27
34
  @merchant_reference = hash['merchantReference']
28
35
  end
@@ -17,6 +17,7 @@ module Worldline
17
17
  # @attr [Worldline::Connect::SDK::V1::Domain::BankRefundMethodSpecificInput] bank_refund_method_specific_input
18
18
  # @attr [Worldline::Connect::SDK::V1::Domain::RefundCustomer] customer
19
19
  # @attr [String] refund_date
20
+ # @attr [String] refund_reason
20
21
  # @attr [Worldline::Connect::SDK::V1::Domain::RefundReferences] refund_references
21
22
  class RefundRequest < Worldline::Connect::SDK::Domain::DataObject
22
23
 
@@ -28,6 +29,8 @@ module Worldline
28
29
 
29
30
  attr_accessor :refund_date
30
31
 
32
+ attr_accessor :refund_reason
33
+
31
34
  attr_accessor :refund_references
32
35
 
33
36
  # @return (Hash)
@@ -37,6 +40,7 @@ module Worldline
37
40
  hash['bankRefundMethodSpecificInput'] = @bank_refund_method_specific_input.to_h unless @bank_refund_method_specific_input.nil?
38
41
  hash['customer'] = @customer.to_h unless @customer.nil?
39
42
  hash['refundDate'] = @refund_date unless @refund_date.nil?
43
+ hash['refundReason'] = @refund_reason unless @refund_reason.nil?
40
44
  hash['refundReferences'] = @refund_references.to_h unless @refund_references.nil?
41
45
  hash
42
46
  end
@@ -58,6 +62,9 @@ module Worldline
58
62
  if hash.has_key? 'refundDate'
59
63
  @refund_date = hash['refundDate']
60
64
  end
65
+ if hash.has_key? 'refundReason'
66
+ @refund_reason = hash['refundReason']
67
+ end
61
68
  if hash.has_key? 'refundReferences'
62
69
  raise TypeError, "value '%s' is not a Hash" % [hash['refundReferences']] unless hash['refundReferences'].is_a? Hash
63
70
  @refund_references = Worldline::Connect::SDK::V1::Domain::RefundReferences.new_from_hash(hash['refundReferences'])
@@ -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.1.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-12-12 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
@@ -525,7 +528,6 @@ files:
525
528
  - lib/worldline/connect/sdk/v1/domain/payment_product320_specific_data.rb
526
529
  - lib/worldline/connect/sdk/v1/domain/payment_product771_specific_output.rb
527
530
  - lib/worldline/connect/sdk/v1/domain/payment_product806_specific_output.rb
528
- - lib/worldline/connect/sdk/v1/domain/payment_product836_specific_output.rb
529
531
  - lib/worldline/connect/sdk/v1/domain/payment_product840_customer_account.rb
530
532
  - lib/worldline/connect/sdk/v1/domain/payment_product840_specific_output.rb
531
533
  - lib/worldline/connect/sdk/v1/domain/payment_product863_specific_data.rb
@@ -674,6 +676,7 @@ files:
674
676
  - lib/worldline/connect/sdk/v1/merchant/merchant_client.rb
675
677
  - lib/worldline/connect/sdk/v1/merchant/payments.rb
676
678
  - lib/worldline/connect/sdk/v1/merchant/payments/find_payments_params.rb
679
+ - lib/worldline/connect/sdk/v1/merchant/payments/get_payment_params.rb
677
680
  - lib/worldline/connect/sdk/v1/merchant/payments/payments_client.rb
678
681
  - lib/worldline/connect/sdk/v1/merchant/payouts.rb
679
682
  - lib/worldline/connect/sdk/v1/merchant/payouts/find_payouts_params.rb
@@ -1,35 +0,0 @@
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] security_indicator
13
- class PaymentProduct836SpecificOutput < Worldline::Connect::SDK::Domain::DataObject
14
-
15
- attr_accessor :security_indicator
16
-
17
- # @return (Hash)
18
- def to_h
19
- hash = super
20
- hash['securityIndicator'] = @security_indicator unless @security_indicator.nil?
21
- hash
22
- end
23
-
24
- def from_hash(hash)
25
- super
26
- if hash.has_key? 'securityIndicator'
27
- @security_indicator = hash['securityIndicator']
28
- end
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end