connect-sdk-ruby 2.28.0 → 2.30.2

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: 5992bcc131f53b3ccada88fbd47649cae3d3e2b7a2f4e962d03b720284ec867b
4
- data.tar.gz: 8176d72bdb8b2476334f1b4dee14ee5a3630aaf74d03832444bc4816dbaeb2eb
3
+ metadata.gz: 7db60897f47065c79b42b4f458baaa3eb9c346b66b50381bd795b6abb762fbe6
4
+ data.tar.gz: 2a43fcff7d2729aefd492f3ace41f6f67dab7157da8699ea38947c3fbc53b73d
5
5
  SHA512:
6
- metadata.gz: 339b9d17f342797147b0cb27b957a0365f1c65d695ef4d709863654a989cbabac407c74865ea129b2316c7972b468435ef4d53fd63d39dfb1f8b25a25aa09c66
7
- data.tar.gz: ed49a59d4903bdcffb408119dcb3e2448a0e13981c98a1dfa7ad42c3c3b0d15b8e1ee456305ed8577e51b3d404e4f625f790b747879316a3bc5ce4e7f7bec714
6
+ metadata.gz: 8e9114ffa747a472929b909730f60748f97fe1409acbcbb143b290e88b2999c34624bf630827e0f3ee7a6aa52368ab100bf944d11ab48c6b07891cacc42a434a
7
+ data.tar.gz: 1f9a4c4a0db466fd0ecea4fa718738b4c8c7df63e3890d95933ec8de4a853454f39aebc8ff8e9ed05fae107b90e310969183027d327743a8ccd950a79cbafa3b
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '2.28.0'
3
+ spec.version = '2.30.2'
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}
@@ -2,30 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/data_object'
5
+ require 'ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- # @attr [String] return_url
12
- class CashPaymentProduct1504SpecificInput < Ingenico::Connect::SDK::DataObject
13
-
14
- attr_accessor :return_url
15
-
16
- # @return (Hash)
17
- def to_h
18
- hash = super
19
- hash['returnUrl'] = @return_url unless @return_url.nil?
20
- hash
21
- end
22
-
23
- def from_hash(hash)
24
- super
25
- if hash.has_key? 'returnUrl'
26
- @return_url = hash['returnUrl']
27
- end
28
- end
11
+ class CashPaymentProduct1504SpecificInput < Ingenico::Connect::SDK::Domain::Payment::CashPaymentProductWithRedirectSpecificInputBase
29
12
  end
30
13
  end
31
14
  end
@@ -2,30 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/data_object'
5
+ require 'ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- # @attr [String] return_url
12
- class CashPaymentProduct1521SpecificInput < Ingenico::Connect::SDK::DataObject
13
-
14
- attr_accessor :return_url
15
-
16
- # @return (Hash)
17
- def to_h
18
- hash = super
19
- hash['returnUrl'] = @return_url unless @return_url.nil?
20
- hash
21
- end
22
-
23
- def from_hash(hash)
24
- super
25
- if hash.has_key? 'returnUrl'
26
- @return_url = hash['returnUrl']
27
- end
28
- end
11
+ class CashPaymentProduct1521SpecificInput < Ingenico::Connect::SDK::Domain::Payment::CashPaymentProductWithRedirectSpecificInputBase
29
12
  end
30
13
  end
31
14
  end
@@ -2,30 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/data_object'
5
+ require 'ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- # @attr [String] return_url
12
- class CashPaymentProduct1522SpecificInput < Ingenico::Connect::SDK::DataObject
13
-
14
- attr_accessor :return_url
15
-
16
- # @return (Hash)
17
- def to_h
18
- hash = super
19
- hash['returnUrl'] = @return_url unless @return_url.nil?
20
- hash
21
- end
22
-
23
- def from_hash(hash)
24
- super
25
- if hash.has_key? 'returnUrl'
26
- @return_url = hash['returnUrl']
27
- end
28
- end
11
+ class CashPaymentProduct1522SpecificInput < Ingenico::Connect::SDK::Domain::Payment::CashPaymentProductWithRedirectSpecificInputBase
29
12
  end
30
13
  end
31
14
  end
@@ -2,30 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/data_object'
5
+ require 'ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- # @attr [String] return_url
12
- class CashPaymentProduct1523SpecificInput < Ingenico::Connect::SDK::DataObject
13
-
14
- attr_accessor :return_url
15
-
16
- # @return (Hash)
17
- def to_h
18
- hash = super
19
- hash['returnUrl'] = @return_url unless @return_url.nil?
20
- hash
21
- end
22
-
23
- def from_hash(hash)
24
- super
25
- if hash.has_key? 'returnUrl'
26
- @return_url = hash['returnUrl']
27
- end
28
- end
11
+ class CashPaymentProduct1523SpecificInput < Ingenico::Connect::SDK::Domain::Payment::CashPaymentProductWithRedirectSpecificInputBase
29
12
  end
30
13
  end
31
14
  end
@@ -2,30 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/data_object'
5
+ require 'ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- # @attr [String] return_url
12
- class CashPaymentProduct1524SpecificInput < Ingenico::Connect::SDK::DataObject
13
-
14
- attr_accessor :return_url
15
-
16
- # @return (Hash)
17
- def to_h
18
- hash = super
19
- hash['returnUrl'] = @return_url unless @return_url.nil?
20
- hash
21
- end
22
-
23
- def from_hash(hash)
24
- super
25
- if hash.has_key? 'returnUrl'
26
- @return_url = hash['returnUrl']
27
- end
28
- end
11
+ class CashPaymentProduct1524SpecificInput < Ingenico::Connect::SDK::Domain::Payment::CashPaymentProductWithRedirectSpecificInputBase
29
12
  end
30
13
  end
31
14
  end
@@ -2,30 +2,13 @@
2
2
  # This class was auto-generated from the API references found at
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
- require 'ingenico/connect/sdk/data_object'
5
+ require 'ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base'
6
6
 
7
7
  module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
- # @attr [String] return_url
12
- class CashPaymentProduct1526SpecificInput < Ingenico::Connect::SDK::DataObject
13
-
14
- attr_accessor :return_url
15
-
16
- # @return (Hash)
17
- def to_h
18
- hash = super
19
- hash['returnUrl'] = @return_url unless @return_url.nil?
20
- hash
21
- end
22
-
23
- def from_hash(hash)
24
- super
25
- if hash.has_key? 'returnUrl'
26
- @return_url = hash['returnUrl']
27
- end
28
- end
11
+ class CashPaymentProduct1526SpecificInput < Ingenico::Connect::SDK::Domain::Payment::CashPaymentProductWithRedirectSpecificInputBase
29
12
  end
30
13
  end
31
14
  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 Payment
10
+
11
+ # @attr [String] return_url
12
+ class CashPaymentProductWithRedirectSpecificInputBase < Ingenico::Connect::SDK::DataObject
13
+
14
+ attr_accessor :return_url
15
+
16
+ # @return (Hash)
17
+ def to_h
18
+ hash = super
19
+ hash['returnUrl'] = @return_url unless @return_url.nil?
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ if hash.has_key? 'returnUrl'
26
+ @return_url = hash['returnUrl']
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -11,6 +11,7 @@ module Ingenico::Connect::SDK
11
11
 
12
12
  # @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money_per_installment
13
13
  # @attr [String] frequency_of_installments
14
+ # @attr [Integer] installment_plan_code
14
15
  # @attr [String] interest_rate
15
16
  # @attr [Integer] number_of_installments
16
17
  class Installments < Ingenico::Connect::SDK::DataObject
@@ -19,6 +20,8 @@ module Ingenico::Connect::SDK
19
20
 
20
21
  attr_accessor :frequency_of_installments
21
22
 
23
+ attr_accessor :installment_plan_code
24
+
22
25
  attr_accessor :interest_rate
23
26
 
24
27
  attr_accessor :number_of_installments
@@ -28,6 +31,7 @@ module Ingenico::Connect::SDK
28
31
  hash = super
29
32
  hash['amountOfMoneyPerInstallment'] = @amount_of_money_per_installment.to_h unless @amount_of_money_per_installment.nil?
30
33
  hash['frequencyOfInstallments'] = @frequency_of_installments unless @frequency_of_installments.nil?
34
+ hash['installmentPlanCode'] = @installment_plan_code unless @installment_plan_code.nil?
31
35
  hash['interestRate'] = @interest_rate unless @interest_rate.nil?
32
36
  hash['numberOfInstallments'] = @number_of_installments unless @number_of_installments.nil?
33
37
  hash
@@ -42,6 +46,9 @@ module Ingenico::Connect::SDK
42
46
  if hash.has_key? 'frequencyOfInstallments'
43
47
  @frequency_of_installments = hash['frequencyOfInstallments']
44
48
  end
49
+ if hash.has_key? 'installmentPlanCode'
50
+ @installment_plan_code = hash['installmentPlanCode']
51
+ end
45
52
  if hash.has_key? 'interestRate'
46
53
  @interest_rate = hash['interestRate']
47
54
  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.28.0'
10
+ @@SDK_VERSION = '2.30.2'
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
@@ -10,6 +10,7 @@ require 'ingenico/connect/sdk/domain/payment/order'
10
10
  require 'ingenico/connect/sdk/domain/payment/redirect_payment_product809_specific_input'
11
11
  require 'ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input'
12
12
  require 'ingenico/connect/sdk/call_context'
13
+ require 'ingenico/connect/sdk/declined_payment_exception'
13
14
 
14
15
  describe 'Idempotence with the server' do
15
16
 
@@ -41,17 +42,31 @@ describe 'Idempotence with the server' do
41
42
  context = Ingenico::Connect::SDK::CallContext.new(idempotence_key)
42
43
 
43
44
  Integration.init_client(false) do |client|
44
- response = client.merchant(Integration::MERCHANT_ID).payments.create(body, context)
45
- payment_id = response.payment.id
45
+ def do_create_payment(client, body, context)
46
+ # For this test it doesn't matter if the response is successful or declined,
47
+ # as long as idempotence is handled correctly
48
+ begin
49
+ client.merchant(Integration::MERCHANT_ID).payments.create(body, context)
50
+ rescue Ingenico::Connect::SDK::DeclinedPaymentException => ex
51
+ ex.payment_result
52
+ end
53
+ end
54
+
55
+ result = do_create_payment(client, body, context)
56
+ payment_id = result.payment.id
57
+ status = result.payment.status
46
58
 
47
59
  expect(payment_id).to_not be_nil
60
+ expect(status).to_not be_nil
48
61
  expect(context.idempotence_key).to eq(idempotence_key)
49
62
  expect(context.idempotence_request_timestamp).to be_nil
50
63
 
51
- response_2 = client.merchant(Integration::MERCHANT_ID).payments.create(body, context)
52
- payment_id2 = response_2.payment.id
64
+ result_2 = do_create_payment(client, body, context)
65
+ payment_id2 = result_2.payment.id
66
+ status2 = result_2.payment.status
53
67
 
54
- expect(payment_id).to eq(payment_id2)
68
+ expect(payment_id2).to eq(payment_id)
69
+ expect(status2).to eq(status)
55
70
  expect(context.idempotence_key).to eq(idempotence_key)
56
71
  expect(context.idempotence_request_timestamp).to_not be_nil
57
72
  end
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.28.0
4
+ version: 2.30.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ingenico ePayments
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-06 00:00:00.000000000 Z
11
+ date: 2022-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -344,6 +344,7 @@ files:
344
344
  - lib/ingenico/connect/sdk/domain/payment/cash_payment_product1523_specific_input.rb
345
345
  - lib/ingenico/connect/sdk/domain/payment/cash_payment_product1524_specific_input.rb
346
346
  - lib/ingenico/connect/sdk/domain/payment/cash_payment_product1526_specific_input.rb
347
+ - lib/ingenico/connect/sdk/domain/payment/cash_payment_product_with_redirect_specific_input_base.rb
347
348
  - lib/ingenico/connect/sdk/domain/payment/complete_payment_card_payment_method_specific_input.rb
348
349
  - lib/ingenico/connect/sdk/domain/payment/complete_payment_request.rb
349
350
  - lib/ingenico/connect/sdk/domain/payment/complete_payment_response.rb