connect-sdk-ruby 2.13.0 → 2.14.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: 61e9fff492d85eff48736fa104cf91edeffd109bd9a5a035d04db076e822e21f
4
- data.tar.gz: 237f4cd283409d86a383988e1912ce082a8bfed72bbbce0568b0162afe699550
3
+ metadata.gz: 14f44856f93795c303784ff8b090d47a48351fe43c8ddb4cbb6a6a0834628d72
4
+ data.tar.gz: ff9a251e1cdb2fd53e67d74f96cc40ecbe161d9be7a998d03feaf6e305c5c490
5
5
  SHA512:
6
- metadata.gz: cce1aac68f75eaabadb3bf34aec3079306ae1598fe82a2f97ac7b88f92e77bb159b1f126fe29602f1185fa9186b5d1d3e447e72789c94a437aea10ef013896cd
7
- data.tar.gz: e736d979e10ac6877ba01784fc8516340f664a6b7a3a81f0df70a814c1cd3f08f92d475e811dd4f9ff340367f5fa5a38d53353aa0312967654972e89fa096f87
6
+ metadata.gz: 18cb534185d477d5009f849e87f87802e4877d5aa97c2c2139cf7282d16f7e2213f680d7c9893c9797364ab0d26b8a819b3ccce8effc0e9b07eba81e7db66af5
7
+ data.tar.gz: 752db6ff27d29118666bff3c748c350154eb3193cd90ed9864ec10eb6e08f1a364a42fd3bf3b5d9b1b184e7521924f058d70963f6951a860f875283136ef048f
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '2.13.0'
3
+ spec.version = '2.14.0'
4
4
  spec.authors = ['Ingenico ePayments']
5
5
  spec.email = ['github@epay.ingenico.com']
6
6
  spec.summary = %q{SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API}
@@ -0,0 +1,22 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/factory'
6
+
7
+
8
+ def example
9
+ get_client do |client|
10
+ response = client.merchant('merchantId').payments.devicefingerprint('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 = Ingenico::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
@@ -182,6 +182,10 @@ module Ingenico::Connect::SDK
182
182
  elsif !request_body.nil?
183
183
  request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
184
184
  body = @marshaller.marshal(request_body)
185
+ else
186
+ # Set the content-type, even though there is no body, to prevent the httpClient from
187
+ # adding a content-type header after authentication has been generated.
188
+ request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
185
189
  end
186
190
 
187
191
  add_generic_headers('POST', uri, request_headers, context)
@@ -227,6 +231,10 @@ module Ingenico::Connect::SDK
227
231
  elsif !request_body.nil?
228
232
  request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
229
233
  body = @marshaller.marshal(request_body)
234
+ else
235
+ # Set the content-type, even though there is no body, to prevent the httpClient from
236
+ # adding a content-type header after authentication has been generated.
237
+ request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
230
238
  end
231
239
  add_generic_headers('POST', uri, request_headers, context)
232
240
 
@@ -274,6 +282,10 @@ module Ingenico::Connect::SDK
274
282
  elsif !request_body.nil?
275
283
  request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
276
284
  body = @marshaller.marshal(request_body)
285
+ else
286
+ # Set the content-type, even though there is no body, to prevent the httpClient from
287
+ # adding a content-type header after authentication has been generated.
288
+ request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
277
289
  end
278
290
  add_generic_headers('PUT', uri, request_headers, context)
279
291
 
@@ -318,6 +330,10 @@ module Ingenico::Connect::SDK
318
330
  elsif !request_body.nil?
319
331
  request_headers.push(RequestHeader.new('Content-Type', 'application/json'))
320
332
  body = @marshaller.marshal(request_body)
333
+ else
334
+ # Set the content-type, even though there is no body, to prevent the httpClient from
335
+ # adding a content-type header after authentication has been generated.
336
+ request_headers.push(RequestHeader.new('Content-Type', 'text/plain'))
321
337
  end
322
338
  add_generic_headers('PUT', uri, request_headers, context)
323
339
 
@@ -4,6 +4,7 @@
4
4
  #
5
5
  require 'ingenico/connect/sdk/data_object'
6
6
  require 'ingenico/connect/sdk/domain/definitions/airline_data'
7
+ require 'ingenico/connect/sdk/domain/payment/installments'
7
8
  require 'ingenico/connect/sdk/domain/payment/level3_summary_data'
8
9
  require 'ingenico/connect/sdk/domain/payment/loan_recipient'
9
10
  require 'ingenico/connect/sdk/domain/payment/order_type_information'
@@ -13,6 +14,7 @@ module Ingenico::Connect::SDK
13
14
  module Payment
14
15
 
15
16
  # @attr [Ingenico::Connect::SDK::Domain::Definitions::AirlineData] airline_data
17
+ # @attr [Ingenico::Connect::SDK::Domain::Payment::Installments] installments
16
18
  # @attr [Ingenico::Connect::SDK::Domain::Payment::Level3SummaryData] level3_summary_data
17
19
  # @attr [Ingenico::Connect::SDK::Domain::Payment::LoanRecipient] loan_recipient
18
20
  # @attr [Integer] number_of_installments
@@ -22,12 +24,16 @@ module Ingenico::Connect::SDK
22
24
 
23
25
  attr_accessor :airline_data
24
26
 
27
+ attr_accessor :installments
28
+
25
29
  #
26
30
  # @deprecated Use Order.shoppingCart.amountBreakdown instead
27
31
  attr_accessor :level3_summary_data
28
32
 
29
33
  attr_accessor :loan_recipient
30
34
 
35
+ #
36
+ # @deprecated Use installments.numberOfInstallments instead
31
37
  attr_accessor :number_of_installments
32
38
 
33
39
  attr_accessor :order_date
@@ -38,6 +44,7 @@ module Ingenico::Connect::SDK
38
44
  def to_h
39
45
  hash = super
40
46
  hash['airlineData'] = @airline_data.to_h unless @airline_data.nil?
47
+ hash['installments'] = @installments.to_h unless @installments.nil?
41
48
  hash['level3SummaryData'] = @level3_summary_data.to_h unless @level3_summary_data.nil?
42
49
  hash['loanRecipient'] = @loan_recipient.to_h unless @loan_recipient.nil?
43
50
  hash['numberOfInstallments'] = @number_of_installments unless @number_of_installments.nil?
@@ -52,6 +59,10 @@ module Ingenico::Connect::SDK
52
59
  raise TypeError, "value '%s' is not a Hash" % [hash['airlineData']] unless hash['airlineData'].is_a? Hash
53
60
  @airline_data = Ingenico::Connect::SDK::Domain::Definitions::AirlineData.new_from_hash(hash['airlineData'])
54
61
  end
62
+ if hash.has_key? 'installments'
63
+ raise TypeError, "value '%s' is not a Hash" % [hash['installments']] unless hash['installments'].is_a? Hash
64
+ @installments = Ingenico::Connect::SDK::Domain::Payment::Installments.new_from_hash(hash['installments'])
65
+ end
55
66
  if hash.has_key? 'level3SummaryData'
56
67
  raise TypeError, "value '%s' is not a Hash" % [hash['level3SummaryData']] unless hash['level3SummaryData'].is_a? Hash
57
68
  @level3_summary_data = Ingenico::Connect::SDK::Domain::Payment::Level3SummaryData.new_from_hash(hash['level3SummaryData'])
@@ -0,0 +1,39 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+
7
+ module Ingenico::Connect::SDK
8
+ module Domain
9
+ module Payment
10
+
11
+ # @attr [String] payment_id
12
+ # @attr [String] raw_device_fingerprint_output
13
+ class DeviceFingerprintDetails < Ingenico::Connect::SDK::DataObject
14
+
15
+ attr_accessor :payment_id
16
+
17
+ attr_accessor :raw_device_fingerprint_output
18
+
19
+ # @return (Hash)
20
+ def to_h
21
+ hash = super
22
+ hash['paymentId'] = @payment_id unless @payment_id.nil?
23
+ hash['rawDeviceFingerprintOutput'] = @raw_device_fingerprint_output unless @raw_device_fingerprint_output.nil?
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key? 'paymentId'
30
+ @payment_id = hash['paymentId']
31
+ end
32
+ if hash.has_key? 'rawDeviceFingerprintOutput'
33
+ @raw_device_fingerprint_output = hash['rawDeviceFingerprintOutput']
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,55 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+ require 'ingenico/connect/sdk/domain/definitions/amount_of_money'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Payment
11
+
12
+ # @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money_per_installment
13
+ # @attr [String] frequency_of_installments
14
+ # @attr [String] interest_rate
15
+ # @attr [Integer] number_of_installments
16
+ class Installments < Ingenico::Connect::SDK::DataObject
17
+
18
+ attr_accessor :amount_of_money_per_installment
19
+
20
+ attr_accessor :frequency_of_installments
21
+
22
+ attr_accessor :interest_rate
23
+
24
+ attr_accessor :number_of_installments
25
+
26
+ # @return (Hash)
27
+ def to_h
28
+ hash = super
29
+ hash['amountOfMoneyPerInstallment'] = @amount_of_money_per_installment.to_h unless @amount_of_money_per_installment.nil?
30
+ hash['frequencyOfInstallments'] = @frequency_of_installments unless @frequency_of_installments.nil?
31
+ hash['interestRate'] = @interest_rate unless @interest_rate.nil?
32
+ hash['numberOfInstallments'] = @number_of_installments unless @number_of_installments.nil?
33
+ hash
34
+ end
35
+
36
+ def from_hash(hash)
37
+ super
38
+ if hash.has_key? 'amountOfMoneyPerInstallment'
39
+ raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoneyPerInstallment']] unless hash['amountOfMoneyPerInstallment'].is_a? Hash
40
+ @amount_of_money_per_installment = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoneyPerInstallment'])
41
+ end
42
+ if hash.has_key? 'frequencyOfInstallments'
43
+ @frequency_of_installments = hash['frequencyOfInstallments']
44
+ end
45
+ if hash.has_key? 'interestRate'
46
+ @interest_rate = hash['interestRate']
47
+ end
48
+ if hash.has_key? 'numberOfInstallments'
49
+ @number_of_installments = hash['numberOfInstallments']
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -12,6 +12,7 @@ module Ingenico::Connect::SDK
12
12
  module Product
13
13
 
14
14
  # @attr [Array<Ingenico::Connect::SDK::Domain::Product::AccountOnFile>] accounts_on_file
15
+ # @attr [true/false] allows_installments
15
16
  # @attr [true/false] device_fingerprint_enabled
16
17
  # @attr [Ingenico::Connect::SDK::Domain::Product::PaymentProductDisplayHints] display_hints
17
18
  # @attr [Array<Ingenico::Connect::SDK::Domain::Product::PaymentProductField>] fields
@@ -20,6 +21,8 @@ module Ingenico::Connect::SDK
20
21
 
21
22
  attr_accessor :accounts_on_file
22
23
 
24
+ attr_accessor :allows_installments
25
+
23
26
  attr_accessor :device_fingerprint_enabled
24
27
 
25
28
  attr_accessor :display_hints
@@ -32,6 +35,7 @@ module Ingenico::Connect::SDK
32
35
  def to_h
33
36
  hash = super
34
37
  hash['accountsOnFile'] = @accounts_on_file.collect{|val| val.to_h} unless @accounts_on_file.nil?
38
+ hash['allowsInstallments'] = @allows_installments unless @allows_installments.nil?
35
39
  hash['deviceFingerprintEnabled'] = @device_fingerprint_enabled unless @device_fingerprint_enabled.nil?
36
40
  hash['displayHints'] = @display_hints.to_h unless @display_hints.nil?
37
41
  hash['fields'] = @fields.collect{|val| val.to_h} unless @fields.nil?
@@ -48,6 +52,9 @@ module Ingenico::Connect::SDK
48
52
  @accounts_on_file << Ingenico::Connect::SDK::Domain::Product::AccountOnFile.new_from_hash(e)
49
53
  end
50
54
  end
55
+ if hash.has_key? 'allowsInstallments'
56
+ @allows_installments = hash['allowsInstallments']
57
+ end
51
58
  if hash.has_key? 'deviceFingerprintEnabled'
52
59
  @device_fingerprint_enabled = hash['deviceFingerprintEnabled']
53
60
  end
@@ -13,6 +13,7 @@ require 'ingenico/connect/sdk/domain/payment/cancel_approval_payment_response'
13
13
  require 'ingenico/connect/sdk/domain/payment/cancel_payment_response'
14
14
  require 'ingenico/connect/sdk/domain/payment/complete_payment_response'
15
15
  require 'ingenico/connect/sdk/domain/payment/create_payment_response'
16
+ require 'ingenico/connect/sdk/domain/payment/device_fingerprint_details'
16
17
  require 'ingenico/connect/sdk/domain/payment/find_payments_response'
17
18
  require 'ingenico/connect/sdk/domain/payment/payment_approval_response'
18
19
  require 'ingenico/connect/sdk/domain/payment/payment_error_response'
@@ -527,6 +528,36 @@ module Ingenico::Connect::SDK
527
528
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
528
529
  raise create_exception(e.status_code, e.body, error_object, context)
529
530
  end
531
+
532
+ # Resource /!{merchantId}/payments/!{paymentId}/devicefingerprint - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/payments/devicefingerprint.html Get Device Fingerprint details}
533
+ # @param payment_id [String]
534
+ # @param context [Ingenico::Connect::SDK::CallContext]
535
+ # @return [Ingenico::Connect::SDK::Domain::Payment::DeviceFingerprintDetails]
536
+ # @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
537
+ # @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
538
+ # @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
539
+ # @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
540
+ # or there was a conflict (HTTP status code 404, 409 or 410)
541
+ # @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
542
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
543
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
544
+ # @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
545
+ def devicefingerprint(payment_id, context=nil)
546
+ path_context = {
547
+ 'paymentId'.freeze => payment_id,
548
+ }
549
+ uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/devicefingerprint', path_context)
550
+ return @communicator.get(
551
+ uri,
552
+ client_headers,
553
+ nil,
554
+ Ingenico::Connect::SDK::Domain::Payment::DeviceFingerprintDetails,
555
+ context)
556
+ rescue ResponseException => e
557
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
558
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
559
+ raise create_exception(e.status_code, e.body, error_object, context)
560
+ end
530
561
  end
531
562
  end
532
563
  end
@@ -7,7 +7,7 @@ module Ingenico::Connect::SDK
7
7
  #
8
8
  # @attr_reader [Array<Ingenico::Connect::SDK::RequestHeader>] meta_data_headers List of headers that should be used in all requests.
9
9
  class MetaDataProvider
10
- @@SDK_VERSION = '2.13.0'
10
+ @@SDK_VERSION = '2.14.0'
11
11
  @@SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'
12
12
  @@PROHIBITED_HEADERS = [@@SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key',
13
13
  'Date', 'Content-Type', 'Authorization'].sort!.freeze
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: 2.13.0
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ingenico ePayments
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-24 00:00:00.000000000 Z
11
+ date: 2020-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -153,6 +153,7 @@ files:
153
153
  - examples/merchant/payments/create_payment_example.rb
154
154
  - examples/merchant/payments/find_payments_example.rb
155
155
  - examples/merchant/payments/get_payment_captures_example.rb
156
+ - examples/merchant/payments/get_payment_device_fingerprint_details_example.rb
156
157
  - examples/merchant/payments/get_payment_disputes_example.rb
157
158
  - examples/merchant/payments/get_payment_example.rb
158
159
  - examples/merchant/payments/get_refunds_example.rb
@@ -351,6 +352,7 @@ files:
351
352
  - lib/ingenico/connect/sdk/domain/payment/customer_device.rb
352
353
  - lib/ingenico/connect/sdk/domain/payment/customer_payment_activity.rb
353
354
  - lib/ingenico/connect/sdk/domain/payment/decrypted_payment_data.rb
355
+ - lib/ingenico/connect/sdk/domain/payment/device_fingerprint_details.rb
354
356
  - lib/ingenico/connect/sdk/domain/payment/device_render_options.rb
355
357
  - lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input.rb
356
358
  - lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input_base.rb
@@ -361,6 +363,7 @@ files:
361
363
  - lib/ingenico/connect/sdk/domain/payment/find_payments_response.rb
362
364
  - lib/ingenico/connect/sdk/domain/payment/gift_card_purchase.rb
363
365
  - lib/ingenico/connect/sdk/domain/payment/hosted_checkout_specific_output.rb
366
+ - lib/ingenico/connect/sdk/domain/payment/installments.rb
364
367
  - lib/ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_input.rb
365
368
  - lib/ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_output.rb
366
369
  - lib/ingenico/connect/sdk/domain/payment/level3_summary_data.rb