connect-sdk-ruby 1.22.0 → 1.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 842ad98aeb38bf84bf8d98cb729ef376dc348c550d87ac6761665ff4a8dc112b
4
- data.tar.gz: 9cdcb0612d726f67703a89af0531849b2244e9629d5d86f58b317cfdf0a894ca
3
+ metadata.gz: 683a41961601e3d9f122c7cba1e98ee3da897425fd7a11238679ca08385c4575
4
+ data.tar.gz: a90404dc3d37afb897ff6bc0dab79088a39a57cc92c81563bc8e907bd3b2bdfd
5
5
  SHA512:
6
- metadata.gz: c7c506fa4b3a7b861b5cb058f1b1cd1a826624bad69048e238871af54023619fec4d3cc5c26bcc085b38bf7cdf89cb195dad9f5b43c6ab1860004e37bf1a0371
7
- data.tar.gz: 5732708f4833696a1272421991f6afc27a64dd4860fac899dfed6946fd5af9b4f06f6f239efa529d85ae8f87fb1f2cfd4f9f995d7c56bccc55067b37903a02f2
6
+ metadata.gz: e5e6e97d691da7fc6f707365d6e1f5c183f87d76eaf8ea116f793f0dfdad36712a97c78640ad5b756ccd72b1d9ce73ba59706a07d313f9c8a321ff964cbc83a6
7
+ data.tar.gz: 342cba317af63fc9aa28eccc5b81d7febce0c2a9601f62402703760c36705a3b1c72ddd514f899a1104008dfbf90e4cf210808c8c4ade1ac5cb9368fedf35b9f
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Introduction
4
4
 
5
- The Ruby SDK helps you to communicate with the [Ingenico Connect](http://www.ingenico.com/epayments) Server API. Its primary features are:
5
+ The Ruby SDK helps you to communicate with the [Ingenico Connect](https://epayments.developer-ingenico.com/) Server API. Its primary features are:
6
6
 
7
7
  * convenient Ruby library for the API calls and responses
8
8
  * marshalls Ruby request objects to HTTP requests
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '1.22.0'
3
+ spec.version = '1.23.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().refunds('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
@@ -25,6 +25,9 @@ module Ingenico::Connect::SDK
25
25
  # String
26
26
  attr_accessor :payment_status_category
27
27
 
28
+ # true/false
29
+ attr_accessor :tokenization_succeeded
30
+
28
31
  # String
29
32
  attr_accessor :tokens
30
33
 
@@ -34,6 +37,7 @@ module Ingenico::Connect::SDK
34
37
  add_to_hash(hash, 'payment', @payment)
35
38
  add_to_hash(hash, 'paymentCreationReferences', @payment_creation_references)
36
39
  add_to_hash(hash, 'paymentStatusCategory', @payment_status_category)
40
+ add_to_hash(hash, 'tokenizationSucceeded', @tokenization_succeeded)
37
41
  add_to_hash(hash, 'tokens', @tokens)
38
42
  hash
39
43
  end
@@ -61,6 +65,9 @@ module Ingenico::Connect::SDK
61
65
  if hash.has_key?('paymentStatusCategory')
62
66
  @payment_status_category = hash['paymentStatusCategory']
63
67
  end
68
+ if hash.has_key?('tokenizationSucceeded')
69
+ @tokenization_succeeded = hash['tokenizationSucceeded']
70
+ end
64
71
  if hash.has_key?('tokens')
65
72
  @tokens = hash['tokens']
66
73
  end
@@ -16,10 +16,14 @@ module Ingenico::Connect::SDK
16
16
  # String
17
17
  attr_accessor :token
18
18
 
19
+ # true/false
20
+ attr_accessor :tokenization_succeeded
21
+
19
22
  def to_h
20
23
  hash = super
21
24
  add_to_hash(hash, 'isNewToken', @is_new_token)
22
25
  add_to_hash(hash, 'token', @token)
26
+ add_to_hash(hash, 'tokenizationSucceeded', @tokenization_succeeded)
23
27
  hash
24
28
  end
25
29
 
@@ -31,6 +35,9 @@ module Ingenico::Connect::SDK
31
35
  if hash.has_key?('token')
32
36
  @token = hash['token']
33
37
  end
38
+ if hash.has_key?('tokenizationSucceeded')
39
+ @tokenization_succeeded = hash['tokenizationSucceeded']
40
+ end
34
41
  end
35
42
  end
36
43
  end
@@ -11,6 +11,8 @@ module Ingenico::Connect::SDK
11
11
  class RedirectPaymentProduct840SpecificInput < Ingenico::Connect::SDK::DataObject
12
12
 
13
13
  # String
14
+ #
15
+ # Deprecated; use order.references.descriptor instead.
14
16
  attr_accessor :custom
15
17
 
16
18
  # true/false
@@ -0,0 +1,38 @@
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/refund/refund_result'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Refund
11
+
12
+ class RefundsResponse < Ingenico::Connect::SDK::DataObject
13
+
14
+ # Array of {Ingenico::Connect::SDK::Domain::Refund::RefundResult}
15
+ attr_accessor :refunds
16
+
17
+ def to_h
18
+ hash = super
19
+ add_to_hash(hash, 'refunds', @refunds)
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ if hash.has_key?('refunds')
26
+ if !(hash['refunds'].is_a? Array)
27
+ raise TypeError, "value '%s' is not an Array" % [hash['refunds']]
28
+ end
29
+ @refunds = []
30
+ hash['refunds'].each do |e|
31
+ @refunds << Ingenico::Connect::SDK::Domain::Refund::RefundResult.new_from_hash(e)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -18,6 +18,7 @@ require 'ingenico/connect/sdk/domain/payment/payment_response'
18
18
  require 'ingenico/connect/sdk/domain/payment/third_party_status_response'
19
19
  require 'ingenico/connect/sdk/domain/refund/refund_error_response'
20
20
  require 'ingenico/connect/sdk/domain/refund/refund_response'
21
+ require 'ingenico/connect/sdk/domain/refund/refunds_response'
21
22
  require 'ingenico/connect/sdk/domain/token/create_token_response'
22
23
 
23
24
  module Ingenico::Connect::SDK
@@ -435,6 +436,38 @@ module Ingenico::Connect::SDK
435
436
  raise create_exception(e.status_code, e.body, error_object, context)
436
437
  end
437
438
 
439
+ # Resource /{{merchantId}}/payments/{{paymentId}}/refunds
440
+ #
441
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/payments/refunds.html Get refunds of payment}
442
+ # payment_id:: String
443
+ # context:: {Ingenico::Connect::SDK::CallContext}
444
+ # Returns:: {Ingenico::Connect::SDK::Domain::Refund::RefundsResponse}
445
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
446
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
447
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
448
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
449
+ # or there was a conflict (HTTP status code 404, 409 or 410)
450
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
451
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
452
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
453
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
454
+ def refunds(payment_id, context=nil)
455
+ path_context = {
456
+ 'paymentId' => payment_id,
457
+ }
458
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/payments/{paymentId}/refunds', path_context)
459
+ return @communicator.get(
460
+ uri,
461
+ client_headers,
462
+ nil,
463
+ Ingenico::Connect::SDK::Domain::Refund::RefundsResponse,
464
+ context)
465
+ rescue ResponseException => e
466
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
467
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
468
+ raise create_exception(e.status_code, e.body, error_object, context)
469
+ end
470
+
438
471
  # Resource /{{merchantId}}/payments/{{paymentId}}/cancel
439
472
  #
440
473
  # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/payments/cancel.html Cancel payment}
@@ -5,7 +5,7 @@ module Ingenico::Connect::SDK
5
5
 
6
6
  # Manages metadata about the server using the SDK
7
7
  class MetaDataProvider
8
- @@SDK_VERSION = '1.22.0'
8
+ @@SDK_VERSION = '1.23.0'
9
9
  @@SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'
10
10
  @@PROHIBITED_HEADERS = [@@SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key',
11
11
  '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: 1.22.0
4
+ version: 1.23.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: 2018-07-12 00:00:00.000000000 Z
11
+ date: 2018-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -142,6 +142,7 @@ files:
142
142
  - examples/merchant/payments/find_payments_example.rb
143
143
  - examples/merchant/payments/get_payment_captures_example.rb
144
144
  - examples/merchant/payments/get_payment_example.rb
145
+ - examples/merchant/payments/get_refunds_example.rb
145
146
  - examples/merchant/payments/get_third_party_status_example.rb
146
147
  - examples/merchant/payments/process_challenged_payment_example.rb
147
148
  - examples/merchant/payments/refund_payment_example.rb
@@ -431,6 +432,7 @@ files:
431
432
  - lib/ingenico/connect/sdk/domain/refund/refund_request.rb
432
433
  - lib/ingenico/connect/sdk/domain/refund/refund_response.rb
433
434
  - lib/ingenico/connect/sdk/domain/refund/refund_result.rb
435
+ - lib/ingenico/connect/sdk/domain/refund/refunds_response.rb
434
436
  - lib/ingenico/connect/sdk/domain/riskassessments/contact_details_risk_assessment.rb
435
437
  - lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb
436
438
  - lib/ingenico/connect/sdk/domain/riskassessments/order_risk_assessment.rb