connect-sdk-ruby 2.12.0 → 2.13.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: 6d4a9ae210b8ddace94c5f9cd9923c0b4d849b22be757f1b8ef61b0e384654b0
4
- data.tar.gz: b5355f9d6ceab565e22ecec60e5c72a723568a7b317950550232a3145bab551f
3
+ metadata.gz: 61e9fff492d85eff48736fa104cf91edeffd109bd9a5a035d04db076e822e21f
4
+ data.tar.gz: 237f4cd283409d86a383988e1912ce082a8bfed72bbbce0568b0162afe699550
5
5
  SHA512:
6
- metadata.gz: 552d365906484b677d884d0fcff637830045d961d55a717e77fc3b3f29761044ed5f9775207328232bdae987b6c2386572f29f15630d947e79a6ce37a51a0cbd
7
- data.tar.gz: a3b66c17876a63c9921483e8e7f918887477054d9689216bce45112353b1b41197c4a1c21e948e1bbbfacf84b6b50c700f53f7cb5b6e1266cecb75c7b5c8e2cc
6
+ metadata.gz: cce1aac68f75eaabadb3bf34aec3079306ae1598fe82a2f97ac7b88f92e77bb159b1f126fe29602f1185fa9186b5d1d3e447e72789c94a437aea10ef013896cd
7
+ data.tar.gz: e736d979e10ac6877ba01784fc8516340f664a6b7a3a81f0df70a814c1cd3f08f92d475e811dd4f9ff340367f5fa5a38d53353aa0312967654972e89fa096f87
data/README.md CHANGED
@@ -27,9 +27,9 @@ Note that the source code of the unit tests, integration tests and the examples
27
27
 
28
28
  ## Requirements
29
29
 
30
- Ruby 2.2 or higher is required. Ruby 2.1.10 is also supported but is not suggested because official support has ended and security maintenance will end soon.
30
+ Ruby 2.3 or higher is required.
31
31
  As for JRuby, version 9.0.0.0 and higher are supported.
32
- In addition, the following package is required:
32
+ In addition, the following packages are required:
33
33
 
34
34
  * [httpclient](https://github.com/nahi/httpclient) 2.8 or higher
35
35
  * [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) 1.0 or higher
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '2.12.0'
3
+ spec.version = '2.13.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,33 @@
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
+ require 'ingenico/connect/sdk/domain/product/create_payment_product_session_request'
7
+ require 'ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_input'
8
+
9
+ Product = Ingenico::Connect::SDK::Domain::Product
10
+
11
+ def example
12
+ get_client do |client|
13
+ payment_product_session302_specific_input = Product::MobilePaymentProductSession302SpecificInput.new
14
+ payment_product_session302_specific_input.display_name = 'Ingenico'
15
+ payment_product_session302_specific_input.domain_name = 'pay1.secured-by-ingenico.com'
16
+ payment_product_session302_specific_input.validation_url = 'https://apple-pay-gateway-cert.apple.com/paymentservices/startSession'
17
+
18
+ body = Product::CreatePaymentProductSessionRequest.new
19
+ body.payment_product_session302_specific_input = payment_product_session302_specific_input
20
+
21
+ response = client.merchant('merchantId').products.sessions(302, body)
22
+ end
23
+ end
24
+
25
+ def get_client
26
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
27
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
28
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
29
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
30
+ ensure
31
+ # Free networking resources when done
32
+ client.close unless client.nil?
33
+ end
@@ -3,26 +3,35 @@
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
5
  require 'ingenico/connect/sdk/domain/definitions/abstract_payment_method_specific_input'
6
+ require 'ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product302_specific_input_hosted_checkout'
6
7
  require 'ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product320_specific_input_hosted_checkout'
7
8
 
8
9
  module Ingenico::Connect::SDK
9
10
  module Domain
10
11
  module Hostedcheckout
11
12
 
13
+ # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct302SpecificInputHostedCheckout] payment_product302_specific_input
12
14
  # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct320SpecificInputHostedCheckout] payment_product320_specific_input
13
15
  class MobilePaymentMethodSpecificInputHostedCheckout < Ingenico::Connect::SDK::Domain::Definitions::AbstractPaymentMethodSpecificInput
14
16
 
17
+ attr_accessor :payment_product302_specific_input
18
+
15
19
  attr_accessor :payment_product320_specific_input
16
20
 
17
21
  # @return (Hash)
18
22
  def to_h
19
23
  hash = super
24
+ hash['paymentProduct302SpecificInput'] = @payment_product302_specific_input.to_h unless @payment_product302_specific_input.nil?
20
25
  hash['paymentProduct320SpecificInput'] = @payment_product320_specific_input.to_h unless @payment_product320_specific_input.nil?
21
26
  hash
22
27
  end
23
28
 
24
29
  def from_hash(hash)
25
30
  super
31
+ if hash.has_key? 'paymentProduct302SpecificInput'
32
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct302SpecificInput']] unless hash['paymentProduct302SpecificInput'].is_a? Hash
33
+ @payment_product302_specific_input = Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct302SpecificInputHostedCheckout.new_from_hash(hash['paymentProduct302SpecificInput'])
34
+ end
26
35
  if hash.has_key? 'paymentProduct320SpecificInput'
27
36
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct320SpecificInput']] unless hash['paymentProduct320SpecificInput'].is_a? Hash
28
37
  @payment_product320_specific_input = Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct320SpecificInputHostedCheckout.new_from_hash(hash['paymentProduct320SpecificInput'])
@@ -0,0 +1,32 @@
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 Hostedcheckout
10
+
11
+ # @attr [String] business_name
12
+ class MobilePaymentProduct302SpecificInputHostedCheckout < Ingenico::Connect::SDK::DataObject
13
+
14
+ attr_accessor :business_name
15
+
16
+ # @return (Hash)
17
+ def to_h
18
+ hash = super
19
+ hash['businessName'] = @business_name unless @business_name.nil?
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ if hash.has_key? 'businessName'
26
+ @business_name = hash['businessName']
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
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/product/mobile_payment_product_session302_specific_input'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Product
11
+
12
+ # @attr [Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificInput] payment_product_session302_specific_input
13
+ class CreatePaymentProductSessionRequest < Ingenico::Connect::SDK::DataObject
14
+
15
+ attr_accessor :payment_product_session302_specific_input
16
+
17
+ # @return (Hash)
18
+ def to_h
19
+ hash = super
20
+ hash['paymentProductSession302SpecificInput'] = @payment_product_session302_specific_input.to_h unless @payment_product_session302_specific_input.nil?
21
+ hash
22
+ end
23
+
24
+ def from_hash(hash)
25
+ super
26
+ if hash.has_key? 'paymentProductSession302SpecificInput'
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductSession302SpecificInput']] unless hash['paymentProductSession302SpecificInput'].is_a? Hash
28
+ @payment_product_session302_specific_input = Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificInput.new_from_hash(hash['paymentProductSession302SpecificInput'])
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
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/product/mobile_payment_product_session302_specific_output'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Product
11
+
12
+ # @attr [Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificOutput] payment_product_session302_specific_output
13
+ class CreatePaymentProductSessionResponse < Ingenico::Connect::SDK::DataObject
14
+
15
+ attr_accessor :payment_product_session302_specific_output
16
+
17
+ # @return (Hash)
18
+ def to_h
19
+ hash = super
20
+ hash['paymentProductSession302SpecificOutput'] = @payment_product_session302_specific_output.to_h unless @payment_product_session302_specific_output.nil?
21
+ hash
22
+ end
23
+
24
+ def from_hash(hash)
25
+ super
26
+ if hash.has_key? 'paymentProductSession302SpecificOutput'
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductSession302SpecificOutput']] unless hash['paymentProductSession302SpecificOutput'].is_a? Hash
28
+ @payment_product_session302_specific_output = Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificOutput.new_from_hash(hash['paymentProductSession302SpecificOutput'])
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,46 @@
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 Product
10
+
11
+ # @attr [String] display_name
12
+ # @attr [String] domain_name
13
+ # @attr [String] validation_url
14
+ class MobilePaymentProductSession302SpecificInput < Ingenico::Connect::SDK::DataObject
15
+
16
+ attr_accessor :display_name
17
+
18
+ attr_accessor :domain_name
19
+
20
+ attr_accessor :validation_url
21
+
22
+ # @return (Hash)
23
+ def to_h
24
+ hash = super
25
+ hash['displayName'] = @display_name unless @display_name.nil?
26
+ hash['domainName'] = @domain_name unless @domain_name.nil?
27
+ hash['validationUrl'] = @validation_url unless @validation_url.nil?
28
+ hash
29
+ end
30
+
31
+ def from_hash(hash)
32
+ super
33
+ if hash.has_key? 'displayName'
34
+ @display_name = hash['displayName']
35
+ end
36
+ if hash.has_key? 'domainName'
37
+ @domain_name = hash['domainName']
38
+ end
39
+ if hash.has_key? 'validationUrl'
40
+ @validation_url = hash['validationUrl']
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,32 @@
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 Product
10
+
11
+ # @attr [String] session_object
12
+ class MobilePaymentProductSession302SpecificOutput < Ingenico::Connect::SDK::DataObject
13
+
14
+ attr_accessor :session_object
15
+
16
+ # @return (Hash)
17
+ def to_h
18
+ hash = super
19
+ hash['sessionObject'] = @session_object unless @session_object.nil?
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ if hash.has_key? 'sessionObject'
26
+ @session_object = hash['sessionObject']
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -5,6 +5,7 @@
5
5
  require 'ingenico/connect/sdk/api_resource'
6
6
  require 'ingenico/connect/sdk/response_exception'
7
7
  require 'ingenico/connect/sdk/domain/errors/error_response'
8
+ require 'ingenico/connect/sdk/domain/product/create_payment_product_session_response'
8
9
  require 'ingenico/connect/sdk/domain/product/device_fingerprint_response'
9
10
  require 'ingenico/connect/sdk/domain/product/directory'
10
11
  require 'ingenico/connect/sdk/domain/product/get_customer_details_response'
@@ -208,6 +209,38 @@ module Ingenico::Connect::SDK
208
209
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
209
210
  raise create_exception(e.status_code, e.body, error_object, context)
210
211
  end
212
+
213
+ # Resource /!{merchantId}/products/!{paymentProductId}/sessions - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/products/sessions.html Create session for payment product}
214
+ # @param payment_product_id [Integer]
215
+ # @param body [Ingenico::Connect::SDK::Domain::Product::CreatePaymentProductSessionRequest]
216
+ # @param context [Ingenico::Connect::SDK::CallContext]
217
+ # @return [Ingenico::Connect::SDK::Domain::Product::CreatePaymentProductSessionResponse]
218
+ # @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
219
+ # @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
220
+ # @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
221
+ # @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
222
+ # or there was a conflict (HTTP status code 404, 409 or 410)
223
+ # @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
224
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
225
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
226
+ # @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error
227
+ def sessions(payment_product_id, body, context=nil)
228
+ path_context = {
229
+ 'paymentProductId'.freeze => payment_product_id.to_s,
230
+ }
231
+ uri = instantiate_uri('/v1/{merchantId}/products/{paymentProductId}/sessions', path_context)
232
+ return @communicator.post(
233
+ uri,
234
+ client_headers,
235
+ nil,
236
+ body,
237
+ Ingenico::Connect::SDK::Domain::Product::CreatePaymentProductSessionResponse,
238
+ context)
239
+ rescue ResponseException => e
240
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
241
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
242
+ raise create_exception(e.status_code, e.body, error_object, context)
243
+ end
211
244
  end
212
245
  end
213
246
  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.12.0'
10
+ @@SDK_VERSION = '2.13.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.12.0
4
+ version: 2.13.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-06-15 00:00:00.000000000 Z
11
+ date: 2020-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -169,6 +169,7 @@ files:
169
169
  - examples/merchant/productgroups/get_device_fingerprint_for_groups_example.rb
170
170
  - examples/merchant/productgroups/get_payment_product_group_example.rb
171
171
  - examples/merchant/productgroups/get_payment_product_groups_example.rb
172
+ - examples/merchant/products/create_payment_product_session_example.rb
172
173
  - examples/merchant/products/get_customer_details_example.rb
173
174
  - examples/merchant/products/get_device_fingerprint_example.rb
174
175
  - examples/merchant/products/get_directory_example.rb
@@ -271,6 +272,7 @@ files:
271
272
  - lib/ingenico/connect/sdk/domain/hostedcheckout/get_hosted_checkout_response.rb
272
273
  - lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb
273
274
  - lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_method_specific_input_hosted_checkout.rb
275
+ - lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product302_specific_input_hosted_checkout.rb
274
276
  - lib/ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product320_specific_input_hosted_checkout.rb
275
277
  - lib/ingenico/connect/sdk/domain/hostedcheckout/payment_product_filters_hosted_checkout.rb
276
278
  - lib/ingenico/connect/sdk/domain/hostedmandatemanagement/create_hosted_mandate_management_request.rb
@@ -462,6 +464,8 @@ files:
462
464
  - lib/ingenico/connect/sdk/domain/product/account_on_file_display_hints.rb
463
465
  - lib/ingenico/connect/sdk/domain/product/authentication_indicator.rb
464
466
  - lib/ingenico/connect/sdk/domain/product/boleto_bancario_requiredness_validator.rb
467
+ - lib/ingenico/connect/sdk/domain/product/create_payment_product_session_request.rb
468
+ - lib/ingenico/connect/sdk/domain/product/create_payment_product_session_response.rb
465
469
  - lib/ingenico/connect/sdk/domain/product/device_fingerprint_request.rb
466
470
  - lib/ingenico/connect/sdk/domain/product/device_fingerprint_response.rb
467
471
  - lib/ingenico/connect/sdk/domain/product/directory.rb
@@ -472,6 +476,8 @@ files:
472
476
  - lib/ingenico/connect/sdk/domain/product/get_customer_details_response.rb
473
477
  - lib/ingenico/connect/sdk/domain/product/label_template_element.rb
474
478
  - lib/ingenico/connect/sdk/domain/product/length_validator.rb
479
+ - lib/ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_input.rb
480
+ - lib/ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_output.rb
475
481
  - lib/ingenico/connect/sdk/domain/product/payment_product.rb
476
482
  - lib/ingenico/connect/sdk/domain/product/payment_product302_specific_data.rb
477
483
  - lib/ingenico/connect/sdk/domain/product/payment_product320_specific_data.rb
@@ -716,8 +722,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
716
722
  - !ruby/object:Gem::Version
717
723
  version: '0'
718
724
  requirements: []
719
- rubyforge_project:
720
- rubygems_version: 2.7.6
725
+ rubygems_version: 3.0.3
721
726
  signing_key:
722
727
  specification_version: 4
723
728
  summary: SDK to communicate with the Ingenico ePayments platform using the Ingenico