connect-sdk-ruby 2.20.0 → 2.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/connect-sdk-ruby.gemspec +1 -1
  3. data/examples/merchant/example_configuration.yml +1 -1
  4. data/examples/merchant/payouts/create_payout_example.rb +17 -13
  5. data/lib/ingenico/connect/sdk/api_resource.rb +2 -2
  6. data/lib/ingenico/connect/sdk/domain/payment/device_render_options.rb +13 -0
  7. data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input.rb +9 -0
  8. data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product4101_specific_input.rb +46 -0
  9. data/lib/ingenico/connect/sdk/domain/payment/sdk_data_input.rb +2 -0
  10. data/lib/ingenico/connect/sdk/domain/payout/bank_transfer_payout_method_specific_input.rb +2 -0
  11. data/lib/ingenico/connect/sdk/domain/payout/card_payout_method_specific_input.rb +9 -0
  12. data/lib/ingenico/connect/sdk/domain/payout/create_payout_request.rb +14 -1
  13. data/lib/ingenico/connect/sdk/domain/payout/payout_details.rb +52 -0
  14. data/lib/ingenico/connect/sdk/domain/payout/payout_recipient.rb +46 -0
  15. data/lib/ingenico/connect/sdk/factory.rb +15 -15
  16. data/lib/ingenico/connect/sdk/meta_data_provider.rb +1 -1
  17. data/lib/ingenico/connect/sdk/modules.rb +1 -1
  18. data/spec/fixtures/resources/properties.proxy.yml +3 -3
  19. data/spec/fixtures/resources/properties.yml +1 -1
  20. data/spec/integration/sdk_proxy_spec.rb +3 -2
  21. data/spec/integration_setup.rb +1 -1
  22. data/spec/lib/communicator_configuration_spec.rb +20 -20
  23. data/spec/lib/communicator_spec.rb +4 -4
  24. data/spec/lib/defaultimpl/default_connection_idempotence_spec.rb +7 -8
  25. data/spec/lib/defaultimpl/default_connection_logger_spec.rb +17 -17
  26. data/spec/lib/factory_spec.rb +1 -1
  27. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2a34ca95673080d6be07e44c049abfc08e0436f8f8df370676ba08c75157008
4
- data.tar.gz: 8257aea5a5c2935f1fdd07f092baa0383e994269d6a21afba1d8fe34ec93faa7
3
+ metadata.gz: 043d7b426f2d6ab34d0f1949f364643320c32fc7763f152521cff4a250607f80
4
+ data.tar.gz: f2a43f28b020e313336fe55417d20927e583009541f654d4e1936983b2aad571
5
5
  SHA512:
6
- metadata.gz: 69f0cf8d8a1278a3eaab0421d3d2244562339582790451a5ea93e70cad66e3a45902a468fb14220353844b81df5b79ed6cc53f0d9bf7bf98c424055e4d739163
7
- data.tar.gz: f0d158fdaa6d8d73a9725500bce1ed3248c86506ea62109e9538250acc1d6439207680fc45e36e0264d27a3049f77f53658036718482bb3a71d30d7e409b9c14
6
+ metadata.gz: 17d3926d57355cf9824fea6a8e7f4477509d7ee002ec3ecfcd041a243eb7b4352a91d4accebdce7bd5c23cbe0acddeda591a7bffbef3ecb7e060215f695f1b59
7
+ data.tar.gz: d3dfb9d09d2b05df6239d9077ab75aeaa80908064c5e2aa05dbbd02ebbba25c179b9c28a6082fe595f76a4ab6198e6478dad30cc46b87723beee0cb79e95aef4
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '2.20.0'
3
+ spec.version = '2.24.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}
@@ -1,5 +1,5 @@
1
1
  --- # YAML settings used in testing the SDK
2
- connect.api.endpoint.host: api-sandbox.globalcollect.com
2
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
3
3
  connect.api.authorizationType: v1HMAC
4
4
  connect.api.connectTimeout: -1
5
5
  connect.api.socketTimeout: -1
@@ -14,6 +14,7 @@ require 'ingenico/connect/sdk/domain/payment/personal_name'
14
14
  require 'ingenico/connect/sdk/domain/payout/bank_transfer_payout_method_specific_input'
15
15
  require 'ingenico/connect/sdk/domain/payout/create_payout_request'
16
16
  require 'ingenico/connect/sdk/domain/payout/payout_customer'
17
+ require 'ingenico/connect/sdk/domain/payout/payout_details'
17
18
  require 'ingenico/connect/sdk/domain/payout/payout_references'
18
19
 
19
20
  Definitions = Ingenico::Connect::SDK::Domain::Definitions
@@ -22,14 +23,20 @@ Payout = Ingenico::Connect::SDK::Domain::Payout
22
23
 
23
24
  def example
24
25
  get_client do |client|
25
- amount_of_money = Definitions::AmountOfMoney.new
26
- amount_of_money.amount = 2345
27
- amount_of_money.currency_code = 'EUR'
28
-
29
26
  bank_account_iban = Definitions::BankAccountIban.new
30
27
  bank_account_iban.account_holder_name = 'Wile E. Coyote'
31
28
  bank_account_iban.iban = 'IT60X0542811101000000123456'
32
29
 
30
+ bank_transfer_payout_method_specific_input = Payout::BankTransferPayoutMethodSpecificInput.new
31
+ bank_transfer_payout_method_specific_input.bank_account_iban = bank_account_iban
32
+ bank_transfer_payout_method_specific_input.payout_date = '20150102'
33
+ bank_transfer_payout_method_specific_input.payout_text = 'Payout Acme'
34
+ bank_transfer_payout_method_specific_input.swift_code = 'swift'
35
+
36
+ amount_of_money = Definitions::AmountOfMoney.new
37
+ amount_of_money.amount = 2345
38
+ amount_of_money.currency_code = 'EUR'
39
+
33
40
  address = Definitions::Address.new
34
41
  address.city = 'Burbank'
35
42
  address.country_code = 'US'
@@ -56,20 +63,17 @@ def example
56
63
  customer.contact_details = contact_details
57
64
  customer.name = name
58
65
 
59
- bank_transfer_payout_method_specific_input = Payout::BankTransferPayoutMethodSpecificInput.new
60
- bank_transfer_payout_method_specific_input.bank_account_iban = bank_account_iban
61
- bank_transfer_payout_method_specific_input.customer = customer
62
- bank_transfer_payout_method_specific_input.payout_date = '20150102'
63
- bank_transfer_payout_method_specific_input.payout_text = 'Payout Acme'
64
- bank_transfer_payout_method_specific_input.swift_code = 'swift'
65
-
66
66
  references = Payout::PayoutReferences.new
67
67
  references.merchant_reference = 'AcmeOrder001'
68
68
 
69
+ payout_details = Payout::PayoutDetails.new
70
+ payout_details.amount_of_money = amount_of_money
71
+ payout_details.customer = customer
72
+ payout_details.references = references
73
+
69
74
  body = Payout::CreatePayoutRequest.new
70
- body.amount_of_money = amount_of_money
71
75
  body.bank_transfer_payout_method_specific_input = bank_transfer_payout_method_specific_input
72
- body.references = references
76
+ body.payout_details = payout_details
73
77
 
74
78
  begin
75
79
  response = client.merchant('merchantId').payouts.create(body)
@@ -15,10 +15,10 @@ module Ingenico::Connect::SDK
15
15
  # If a parent class is given its communicator will be used for communication.
16
16
  # @param path_context [Hash] hash that contains substitutions for generic locations in the URL path.
17
17
  # This hash will be used to instantiate a concrete URL used to access specific resources.
18
- # For example in the URL https://api-sandbox.globalcollect.com/!{version}/!{merchantId}/payments
18
+ # For example in the URL https://eu.sandbox.api-ingenico.com/!{version}/!{merchantId}/payments
19
19
  # !{version} and !{merchantId} can be instantiated using the hash
20
20
  # !{'version' => 'v1', 'merchantId' => '1234'}. The final URL in this case will be
21
- # https://api-sandbox.globalcollect.com/v1/1234/payments.
21
+ # https://eu.sandbox.api-ingenico.com/v1/1234/payments.
22
22
  # @param client_meta_info [String] JSON string containing the meta data for the client.
23
23
  def initialize(arg, path_context, client_meta_info=false)
24
24
  if client_meta_info == false
@@ -10,17 +10,23 @@ module Ingenico::Connect::SDK
10
10
 
11
11
  # @attr [String] sdk_interface
12
12
  # @attr [String] sdk_ui_type
13
+ # @attr [Array<String>] sdk_ui_types
13
14
  class DeviceRenderOptions < Ingenico::Connect::SDK::DataObject
14
15
 
15
16
  attr_accessor :sdk_interface
16
17
 
18
+ #
19
+ # @deprecated Use deviceRenderOptions.sdkUiTypes instead
17
20
  attr_accessor :sdk_ui_type
18
21
 
22
+ attr_accessor :sdk_ui_types
23
+
19
24
  # @return (Hash)
20
25
  def to_h
21
26
  hash = super
22
27
  hash['sdkInterface'] = @sdk_interface unless @sdk_interface.nil?
23
28
  hash['sdkUiType'] = @sdk_ui_type unless @sdk_ui_type.nil?
29
+ hash['sdkUiTypes'] = @sdk_ui_types unless @sdk_ui_types.nil?
24
30
  hash
25
31
  end
26
32
 
@@ -32,6 +38,13 @@ module Ingenico::Connect::SDK
32
38
  if hash.has_key? 'sdkUiType'
33
39
  @sdk_ui_type = hash['sdkUiType']
34
40
  end
41
+ if hash.has_key? 'sdkUiTypes'
42
+ raise TypeError, "value '%s' is not an Array" % [hash['sdkUiTypes']] unless hash['sdkUiTypes'].is_a? Array
43
+ @sdk_ui_types = []
44
+ hash['sdkUiTypes'].each do |e|
45
+ @sdk_ui_types << e
46
+ end
47
+ end
35
48
  end
36
49
  end
37
50
  end
@@ -3,6 +3,7 @@
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
5
  require 'ingenico/connect/sdk/domain/payment/abstract_redirect_payment_method_specific_input'
6
+ require 'ingenico/connect/sdk/domain/payment/redirect_payment_product4101_specific_input'
6
7
  require 'ingenico/connect/sdk/domain/payment/redirect_payment_product809_specific_input'
7
8
  require 'ingenico/connect/sdk/domain/payment/redirect_payment_product816_specific_input'
8
9
  require 'ingenico/connect/sdk/domain/payment/redirect_payment_product840_specific_input'
@@ -17,6 +18,7 @@ module Ingenico::Connect::SDK
17
18
  module Payment
18
19
 
19
20
  # @attr [true/false] is_recurring
21
+ # @attr [Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentProduct4101SpecificInput] payment_product4101_specific_input
20
22
  # @attr [Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentProduct809SpecificInput] payment_product809_specific_input
21
23
  # @attr [Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentProduct816SpecificInput] payment_product816_specific_input
22
24
  # @attr [Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentProduct840SpecificInput] payment_product840_specific_input
@@ -30,6 +32,8 @@ module Ingenico::Connect::SDK
30
32
 
31
33
  attr_accessor :is_recurring
32
34
 
35
+ attr_accessor :payment_product4101_specific_input
36
+
33
37
  attr_accessor :payment_product809_specific_input
34
38
 
35
39
  attr_accessor :payment_product816_specific_input
@@ -54,6 +58,7 @@ module Ingenico::Connect::SDK
54
58
  def to_h
55
59
  hash = super
56
60
  hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
61
+ hash['paymentProduct4101SpecificInput'] = @payment_product4101_specific_input.to_h unless @payment_product4101_specific_input.nil?
57
62
  hash['paymentProduct809SpecificInput'] = @payment_product809_specific_input.to_h unless @payment_product809_specific_input.nil?
58
63
  hash['paymentProduct816SpecificInput'] = @payment_product816_specific_input.to_h unless @payment_product816_specific_input.nil?
59
64
  hash['paymentProduct840SpecificInput'] = @payment_product840_specific_input.to_h unless @payment_product840_specific_input.nil?
@@ -71,6 +76,10 @@ module Ingenico::Connect::SDK
71
76
  if hash.has_key? 'isRecurring'
72
77
  @is_recurring = hash['isRecurring']
73
78
  end
79
+ if hash.has_key? 'paymentProduct4101SpecificInput'
80
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct4101SpecificInput']] unless hash['paymentProduct4101SpecificInput'].is_a? Hash
81
+ @payment_product4101_specific_input = Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentProduct4101SpecificInput.new_from_hash(hash['paymentProduct4101SpecificInput'])
82
+ end
74
83
  if hash.has_key? 'paymentProduct809SpecificInput'
75
84
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct809SpecificInput']] unless hash['paymentProduct809SpecificInput'].is_a? Hash
76
85
  @payment_product809_specific_input = Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentProduct809SpecificInput.new_from_hash(hash['paymentProduct809SpecificInput'])
@@ -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 Payment
10
+
11
+ # @attr [String] display_name
12
+ # @attr [String] integration_type
13
+ # @attr [String] virtual_payment_address
14
+ class RedirectPaymentProduct4101SpecificInput < Ingenico::Connect::SDK::DataObject
15
+
16
+ attr_accessor :display_name
17
+
18
+ attr_accessor :integration_type
19
+
20
+ attr_accessor :virtual_payment_address
21
+
22
+ # @return (Hash)
23
+ def to_h
24
+ hash = super
25
+ hash['displayName'] = @display_name unless @display_name.nil?
26
+ hash['integrationType'] = @integration_type unless @integration_type.nil?
27
+ hash['virtualPaymentAddress'] = @virtual_payment_address unless @virtual_payment_address.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? 'integrationType'
37
+ @integration_type = hash['integrationType']
38
+ end
39
+ if hash.has_key? 'virtualPaymentAddress'
40
+ @virtual_payment_address = hash['virtualPaymentAddress']
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -19,6 +19,8 @@ module Ingenico::Connect::SDK
19
19
  # @attr [String] sdk_transaction_id
20
20
  class SdkDataInput < Ingenico::Connect::SDK::DataObject
21
21
 
22
+ #
23
+ # @deprecated No replacement
22
24
  attr_accessor :device_info
23
25
 
24
26
  attr_accessor :device_render_options
@@ -23,6 +23,8 @@ module Ingenico::Connect::SDK
23
23
 
24
24
  attr_accessor :bank_account_iban
25
25
 
26
+ #
27
+ # @deprecated Moved to PayoutDetails
26
28
  attr_accessor :customer
27
29
 
28
30
  attr_accessor :payout_date
@@ -4,6 +4,7 @@
4
4
  #
5
5
  require 'ingenico/connect/sdk/domain/definitions/card'
6
6
  require 'ingenico/connect/sdk/domain/payout/abstract_payout_method_specific_input'
7
+ require 'ingenico/connect/sdk/domain/payout/payout_recipient'
7
8
 
8
9
  module Ingenico::Connect::SDK
9
10
  module Domain
@@ -11,6 +12,7 @@ module Ingenico::Connect::SDK
11
12
 
12
13
  # @attr [Ingenico::Connect::SDK::Domain::Definitions::Card] card
13
14
  # @attr [Integer] payment_product_id
15
+ # @attr [Ingenico::Connect::SDK::Domain::Payout::PayoutRecipient] recipient
14
16
  # @attr [String] token
15
17
  class CardPayoutMethodSpecificInput < Ingenico::Connect::SDK::Domain::Payout::AbstractPayoutMethodSpecificInput
16
18
 
@@ -18,6 +20,8 @@ module Ingenico::Connect::SDK
18
20
 
19
21
  attr_accessor :payment_product_id
20
22
 
23
+ attr_accessor :recipient
24
+
21
25
  attr_accessor :token
22
26
 
23
27
  # @return (Hash)
@@ -25,6 +29,7 @@ module Ingenico::Connect::SDK
25
29
  hash = super
26
30
  hash['card'] = @card.to_h unless @card.nil?
27
31
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
32
+ hash['recipient'] = @recipient.to_h unless @recipient.nil?
28
33
  hash['token'] = @token unless @token.nil?
29
34
  hash
30
35
  end
@@ -38,6 +43,10 @@ module Ingenico::Connect::SDK
38
43
  if hash.has_key? 'paymentProductId'
39
44
  @payment_product_id = hash['paymentProductId']
40
45
  end
46
+ if hash.has_key? 'recipient'
47
+ raise TypeError, "value '%s' is not a Hash" % [hash['recipient']] unless hash['recipient'].is_a? Hash
48
+ @recipient = Ingenico::Connect::SDK::Domain::Payout::PayoutRecipient.new_from_hash(hash['recipient'])
49
+ end
41
50
  if hash.has_key? 'token'
42
51
  @token = hash['token']
43
52
  end
@@ -9,6 +9,7 @@ require 'ingenico/connect/sdk/domain/definitions/bank_account_iban'
9
9
  require 'ingenico/connect/sdk/domain/payout/bank_transfer_payout_method_specific_input'
10
10
  require 'ingenico/connect/sdk/domain/payout/card_payout_method_specific_input'
11
11
  require 'ingenico/connect/sdk/domain/payout/payout_customer'
12
+ require 'ingenico/connect/sdk/domain/payout/payout_details'
12
13
  require 'ingenico/connect/sdk/domain/payout/payout_references'
13
14
 
14
15
  module Ingenico::Connect::SDK
@@ -22,11 +23,14 @@ module Ingenico::Connect::SDK
22
23
  # @attr [Ingenico::Connect::SDK::Domain::Payout::CardPayoutMethodSpecificInput] card_payout_method_specific_input
23
24
  # @attr [Ingenico::Connect::SDK::Domain::Payout::PayoutCustomer] customer
24
25
  # @attr [String] payout_date
26
+ # @attr [Ingenico::Connect::SDK::Domain::Payout::PayoutDetails] payout_details
25
27
  # @attr [String] payout_text
26
28
  # @attr [Ingenico::Connect::SDK::Domain::Payout::PayoutReferences] references
27
29
  # @attr [String] swift_code
28
30
  class CreatePayoutRequest < Ingenico::Connect::SDK::DataObject
29
31
 
32
+ #
33
+ # @deprecated Moved to PayoutDetails
30
34
  attr_accessor :amount_of_money
31
35
 
32
36
  #
@@ -42,17 +46,21 @@ module Ingenico::Connect::SDK
42
46
  attr_accessor :card_payout_method_specific_input
43
47
 
44
48
  #
45
- # @deprecated Moved to BankTransferPayoutMethodSpecificInput
49
+ # @deprecated Moved to PayoutDetails
46
50
  attr_accessor :customer
47
51
 
48
52
  #
49
53
  # @deprecated Moved to BankTransferPayoutMethodSpecificInput
50
54
  attr_accessor :payout_date
51
55
 
56
+ attr_accessor :payout_details
57
+
52
58
  #
53
59
  # @deprecated Moved to BankTransferPayoutMethodSpecificInput
54
60
  attr_accessor :payout_text
55
61
 
62
+ #
63
+ # @deprecated Moved to PayoutDetails
56
64
  attr_accessor :references
57
65
 
58
66
  #
@@ -69,6 +77,7 @@ module Ingenico::Connect::SDK
69
77
  hash['cardPayoutMethodSpecificInput'] = @card_payout_method_specific_input.to_h unless @card_payout_method_specific_input.nil?
70
78
  hash['customer'] = @customer.to_h unless @customer.nil?
71
79
  hash['payoutDate'] = @payout_date unless @payout_date.nil?
80
+ hash['payoutDetails'] = @payout_details.to_h unless @payout_details.nil?
72
81
  hash['payoutText'] = @payout_text unless @payout_text.nil?
73
82
  hash['references'] = @references.to_h unless @references.nil?
74
83
  hash['swiftCode'] = @swift_code unless @swift_code.nil?
@@ -104,6 +113,10 @@ module Ingenico::Connect::SDK
104
113
  if hash.has_key? 'payoutDate'
105
114
  @payout_date = hash['payoutDate']
106
115
  end
116
+ if hash.has_key? 'payoutDetails'
117
+ raise TypeError, "value '%s' is not a Hash" % [hash['payoutDetails']] unless hash['payoutDetails'].is_a? Hash
118
+ @payout_details = Ingenico::Connect::SDK::Domain::Payout::PayoutDetails.new_from_hash(hash['payoutDetails'])
119
+ end
107
120
  if hash.has_key? 'payoutText'
108
121
  @payout_text = hash['payoutText']
109
122
  end
@@ -0,0 +1,52 @@
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
+ require 'ingenico/connect/sdk/domain/payout/payout_customer'
8
+ require 'ingenico/connect/sdk/domain/payout/payout_references'
9
+
10
+ module Ingenico::Connect::SDK
11
+ module Domain
12
+ module Payout
13
+
14
+ # @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money
15
+ # @attr [Ingenico::Connect::SDK::Domain::Payout::PayoutCustomer] customer
16
+ # @attr [Ingenico::Connect::SDK::Domain::Payout::PayoutReferences] references
17
+ class PayoutDetails < Ingenico::Connect::SDK::DataObject
18
+
19
+ attr_accessor :amount_of_money
20
+
21
+ attr_accessor :customer
22
+
23
+ attr_accessor :references
24
+
25
+ # @return (Hash)
26
+ def to_h
27
+ hash = super
28
+ hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
29
+ hash['customer'] = @customer.to_h unless @customer.nil?
30
+ hash['references'] = @references.to_h unless @references.nil?
31
+ hash
32
+ end
33
+
34
+ def from_hash(hash)
35
+ super
36
+ if hash.has_key? 'amountOfMoney'
37
+ raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
38
+ @amount_of_money = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
39
+ end
40
+ if hash.has_key? 'customer'
41
+ raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash
42
+ @customer = Ingenico::Connect::SDK::Domain::Payout::PayoutCustomer.new_from_hash(hash['customer'])
43
+ end
44
+ if hash.has_key? 'references'
45
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
46
+ @references = Ingenico::Connect::SDK::Domain::Payout::PayoutReferences.new_from_hash(hash['references'])
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ 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 Payout
10
+
11
+ # @attr [String] first_name
12
+ # @attr [String] surname
13
+ # @attr [String] surname_prefix
14
+ class PayoutRecipient < Ingenico::Connect::SDK::DataObject
15
+
16
+ attr_accessor :first_name
17
+
18
+ attr_accessor :surname
19
+
20
+ attr_accessor :surname_prefix
21
+
22
+ # @return (Hash)
23
+ def to_h
24
+ hash = super
25
+ hash['firstName'] = @first_name unless @first_name.nil?
26
+ hash['surname'] = @surname unless @surname.nil?
27
+ hash['surnamePrefix'] = @surname_prefix unless @surname_prefix.nil?
28
+ hash
29
+ end
30
+
31
+ def from_hash(hash)
32
+ super
33
+ if hash.has_key? 'firstName'
34
+ @first_name = hash['firstName']
35
+ end
36
+ if hash.has_key? 'surname'
37
+ @surname = hash['surname']
38
+ end
39
+ if hash.has_key? 'surnamePrefix'
40
+ @surname_prefix = hash['surnamePrefix']
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -11,8 +11,8 @@ module Ingenico::Connect::SDK
11
11
  # located at _configuration_file_name_.
12
12
  #
13
13
  # @param configuration_file_name [String] Path to the configuration file to use, should be in YAML format.
14
- # @param api_key_id [String] Key id for the GlobalCollect service.
15
- # @param secret_api_key [String] Secret key used for authentication to the GlobalCollect service.
14
+ # @param api_key_id [String] Key id for the Ingenico ePayments platform.
15
+ # @param secret_api_key [String] Secret key used for authentication to the Ingenico ePayments platform.
16
16
  # @return [Ingenico::Connect::SDK::CommunicatorConfiguration] The created communicator configuration
17
17
  def self.create_configuration(configuration_file_name, api_key_id, secret_api_key)
18
18
  properties = YAML::load_file(configuration_file_name)
@@ -56,8 +56,8 @@ module Ingenico::Connect::SDK
56
56
  # using the _api_key_id_ and _secret_api_key_ in the CommunicatorConfiguration.
57
57
  #
58
58
  # @param configuration_file_name [String] Path to the configuration file to use, should be in YAML format.
59
- # @param api_key_id [String] Key id for the GlobalCollect service.
60
- # @param secret_api_key [String] Secret key used for authentication to the GlobalCollect service.
59
+ # @param api_key_id [String] Key id for the Ingenico ePayments platform.
60
+ # @param secret_api_key [String] Secret key used for authentication to the Ingenico ePayments platform.
61
61
  # @param meta_data_provider [Ingenico::Connect::SDK::MetaDataProvider] stores the metadata for the communicating client.
62
62
  # @param connection [Ingenico::Connect::SDK::Connection] connection that can be used to communicate with the Ingenico ePayments platform.
63
63
  # @param authenticator [Ingenico::Connect::SDK::Authenticator] authenticator that can authenticate messages sent to the Ingenico ePayments platform.
@@ -69,7 +69,7 @@ module Ingenico::Connect::SDK
69
69
  authenticator: authenticator)
70
70
  end
71
71
 
72
- # Creates and returns an {Ingenico::Connect::SDK::Communicator} that is used for communication with the GlobalCollect service.
72
+ # Creates and returns an {Ingenico::Connect::SDK::Communicator} that is used for communication with the Ingenico ePayments platform.
73
73
  #
74
74
  # @param session [Ingenico::Connect::SDK::Session] session that the communicator will utilize for communication.
75
75
  # @return [Ingenico::Connect::SDK::Communicator] The created communicator
@@ -77,7 +77,7 @@ module Ingenico::Connect::SDK
77
77
  Communicator.new(session, DefaultImpl::DefaultMarshaller.INSTANCE)
78
78
  end
79
79
 
80
- # Creates and returns an {Ingenico::Connect::SDK::Communicator} that can be used for communication with the GlobalCollect service.
80
+ # Creates and returns an {Ingenico::Connect::SDK::Communicator} that can be used for communication with the Ingenico ePayments platform.
81
81
  #
82
82
  # @param configuration [Ingenico::Connect::SDK::CommunicatorConfiguration] contains configuration settings to be used by the client.
83
83
  # @return [Ingenico::Connect::SDK::Communicator] The created communicator
@@ -86,11 +86,11 @@ module Ingenico::Connect::SDK
86
86
  Communicator.new(session, DefaultImpl::DefaultMarshaller.INSTANCE)
87
87
  end
88
88
 
89
- # Creates and returns an {Ingenico::Connect::SDK::Communicator} that is used for communication with the GlobalCollect service.
89
+ # Creates and returns an {Ingenico::Connect::SDK::Communicator} that is used for communication with the Ingenico ePayments platform.
90
90
  #
91
91
  # @param configuration_file_name [String] Path to the configuration file to use, should be in YAML format.
92
- # @param api_key_id [String] Key id for the GlobalCollect service.
93
- # @param secret_api_key [String] Secret key used for authentication to the GlobalCollect service.
92
+ # @param api_key_id [String] Key id for the Ingenico ePayments platform.
93
+ # @param secret_api_key [String] Secret key used for authentication to the Ingenico ePayments platform.
94
94
  # @return [Ingenico::Connect::SDK::Communicator] The created communicator
95
95
  def self.create_communicator_from_file(configuration_file_name, api_key_id, secret_api_key)
96
96
  configuration = create_configuration(configuration_file_name, api_key_id, secret_api_key)
@@ -98,7 +98,7 @@ module Ingenico::Connect::SDK
98
98
  Communicator.new(session, DefaultImpl::DefaultMarshaller.INSTANCE)
99
99
  end
100
100
 
101
- # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the GlobalCollect service.
101
+ # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the Ingenico ePayments platform.
102
102
  # If a code block is given, the created client is returned to the code block and closed afterwards.
103
103
  #
104
104
  # @example Providing a code block
@@ -123,7 +123,7 @@ module Ingenico::Connect::SDK
123
123
  end
124
124
  end
125
125
 
126
- # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the GlobalCollect service.
126
+ # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the Ingenico ePayments platform.
127
127
  # If a code block is given, the created client is returned to the code block and closed afterwards.
128
128
  #
129
129
  # @example Providing a code block
@@ -147,7 +147,7 @@ module Ingenico::Connect::SDK
147
147
  end
148
148
  end
149
149
 
150
- # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the GlobalCollect service.
150
+ # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the Ingenico ePayments platform.
151
151
  # If a code block is given, the created client is returned to the code block and closed afterwards.
152
152
  #
153
153
  # @example Providing a code block
@@ -172,7 +172,7 @@ module Ingenico::Connect::SDK
172
172
  end
173
173
  end
174
174
 
175
- # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the GlobalCollect service.
175
+ # Creates and returns an {Ingenico::Connect::SDK::Client} that provides the a high-level interface with the Ingenico ePayments platform.
176
176
  # If a code block is given, the created client is returned to the code block and closed afterwards.
177
177
  #
178
178
  # @example Providing a code block
@@ -182,8 +182,8 @@ module Ingenico::Connect::SDK
182
182
  # # client is closed here
183
183
  #
184
184
  # @param configuration_file_name [String] Path to the configuration file to use, should be in YAML format.
185
- # @param api_key_id [String] Key id for the GlobalCollect service.
186
- # @param secret_api_key [String] Secret key used for authentication to the GlobalCollect service.
185
+ # @param api_key_id [String] Key id for the Ingenico ePayments platform.
186
+ # @param secret_api_key [String] Secret key used for authentication to the Ingenico ePayments platform.
187
187
  # @return [Ingenico::Connect::SDK::Client] The created client
188
188
  def self.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
189
189
  communicator = create_communicator_from_file(configuration_file_name, api_key_id, secret_api_key)
@@ -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.20.0'
10
+ @@SDK_VERSION = '2.24.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
@@ -11,7 +11,7 @@ end
11
11
  module Ingenico::Connect::SDK::Logging
12
12
  end
13
13
 
14
- # Contains interfaces to all GlobalCollect services. These services are accessed through a *Ingenico::Connect::SDK::Client* instance.
14
+ # Contains interfaces to all Ingenico ePayments services. These services are accessed through a *Ingenico::Connect::SDK::Client* instance.
15
15
  module Ingenico::Connect::SDK::Merchant
16
16
  end
17
17
 
@@ -1,5 +1,5 @@
1
1
  --- # YAML settings used in testing the SDK
2
- connect.api.endpoint.host: api-sandbox.globalcollect.com
2
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
3
3
  connect.api.authorizationType: v1HMAC
4
4
  connect.api.connectTimeout: -1
5
5
  connect.api.socketTimeout: -1
@@ -9,5 +9,5 @@
9
9
  connect.api.proxy.uri: http://localhost:9999
10
10
  # change username and password to authentication credentials for the proxy, omit the entries if no authentication is required
11
11
  # authentication is done using basic proxy authentication. Therefore, to avoid leaking credentials you should connect to the proxy using SSL
12
- connect.api.proxy.username: global-collect
13
- connect.api.proxy.password: global-collect
12
+ connect.api.proxy.username: test-user
13
+ connect.api.proxy.password: test-password
@@ -1,5 +1,5 @@
1
1
  --- # YAML settings used in testing the SDK
2
- connect.api.endpoint.host: api-sandbox.globalcollect.com
2
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
3
3
  connect.api.authorizationType: v1HMAC
4
4
  connect.api.connectTimeout: -1
5
5
  connect.api.socketTimeout: -1
@@ -24,7 +24,8 @@ describe 'proxies' do
24
24
  proxy_server = Thread.new do
25
25
  config = { Realm: 'testing' }
26
26
  htpasswd = WEBrick::HTTPAuth::Htpasswd.new(password_filename) # create new Apache password file
27
- htpasswd.set_passwd config[:Realm], 'global-collect', 'global-collect' # same as properties.proxy.yml
27
+ proxy_configuration = Integration.init_communicator_configuration(Integration::PROPERTIES_URI_PROXY).proxy_configuration
28
+ htpasswd.set_passwd config[:Realm], proxy_configuration.username, proxy_configuration.password
28
29
  config[:UserDB] = htpasswd
29
30
  basic_auth = WEBrick::HTTPAuth::ProxyBasicAuth.new(config)
30
31
 
@@ -51,7 +52,7 @@ describe 'proxies' do
51
52
  end
52
53
 
53
54
  # NOTE: if this test is running for a long time with no response
54
- # check https://api-sandbox.globalcollect.com coz this is where merchant
55
+ # check https://eu.sandbox.api-ingenico.com because this is where merchant
55
56
  # connects to.
56
57
  it 'can be connected to' do
57
58
  request = Ingenico::Connect::SDK::Merchant::Services::ConvertAmountParams.new
@@ -22,7 +22,7 @@ module Integration
22
22
  def self.init_communicator_configuration(properties_url: PROPERTIES_URI, max_connections: nil)
23
23
  yaml = YAML.load_file(properties_url)
24
24
  configuration = Ingenico::Connect::SDK::CommunicatorConfiguration.new(properties: yaml,
25
- api_endpoint: 'https://api-sandbox.globalcollect.com',
25
+ api_endpoint: 'https://eu.sandbox.api-ingenico.com',
26
26
  authorization_type: 'v1HMAC',
27
27
  api_key_id: API_KEY_ID,
28
28
  secret_api_key: SECRET_API_KEY,
@@ -7,7 +7,7 @@ describe 'CommunicatorConfiguration' do
7
7
 
8
8
  it 'can be constructed without a proxy' do
9
9
  yaml = '---
10
- connect.api.endpoint.host: api-sandbox.globalcollect.com
10
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
11
11
  connect.api.authorizationType: v1HMAC
12
12
  connect.api.connectTimeout: 20
13
13
  connect.api.socketTimeout: 10'
@@ -15,7 +15,7 @@ describe 'CommunicatorConfiguration' do
15
15
 
16
16
  communicator_config = CommunicatorConfiguration.new(properties: config)
17
17
 
18
- expect(communicator_config.api_endpoint).to eq('https://api-sandbox.globalcollect.com')
18
+ expect(communicator_config.api_endpoint).to eq('https://eu.sandbox.api-ingenico.com')
19
19
  expect(communicator_config.authorization_type).to eq('v1HMAC')
20
20
  expect(communicator_config.connect_timeout).to eq(20)
21
21
  expect(communicator_config.socket_timeout).to eq(10)
@@ -29,7 +29,7 @@ describe 'CommunicatorConfiguration' do
29
29
 
30
30
  it 'can be constructed with a proxy, without authentication' do
31
31
  yaml = '---
32
- connect.api.endpoint.host: api-sandbox.globalcollect.com
32
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
33
33
  connect.api.authorizationType: v1HMAC
34
34
  connect.api.connectTimeout: 20
35
35
  connect.api.socketTimeout: 10
@@ -39,7 +39,7 @@ describe 'CommunicatorConfiguration' do
39
39
  communicator_config = CommunicatorConfiguration.new(properties: config)
40
40
  proxy_config = communicator_config.proxy_configuration
41
41
 
42
- expect(communicator_config.api_endpoint).to eq('https://api-sandbox.globalcollect.com')
42
+ expect(communicator_config.api_endpoint).to eq('https://eu.sandbox.api-ingenico.com')
43
43
  expect(communicator_config.authorization_type).to eq('v1HMAC')
44
44
  expect(communicator_config.connect_timeout).to eq(20)
45
45
  expect(communicator_config.socket_timeout).to eq(10)
@@ -56,19 +56,19 @@ describe 'CommunicatorConfiguration' do
56
56
 
57
57
  it 'can be constructed to authenticate to a proxy' do
58
58
  yaml = '---
59
- connect.api.endpoint.host: api-sandbox.globalcollect.com
59
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
60
60
  connect.api.authorizationType: v1HMAC
61
61
  connect.api.connectTimeout: 20
62
62
  connect.api.socketTimeout: 10
63
63
  connect.api.proxy.uri: http://proxy.example.org:3128
64
- connect.api.proxy.username: global-collect-username
65
- connect.api.proxy.password: global-collect-password'
64
+ connect.api.proxy.username: test-username
65
+ connect.api.proxy.password: test-password'
66
66
  config = YAML.load(yaml)
67
67
 
68
68
  communicator_config = CommunicatorConfiguration.new(properties: config)
69
69
  proxy_config = communicator_config.proxy_configuration
70
70
 
71
- expect(communicator_config.api_endpoint).to eq('https://api-sandbox.globalcollect.com')
71
+ expect(communicator_config.api_endpoint).to eq('https://eu.sandbox.api-ingenico.com')
72
72
  expect(communicator_config.authorization_type).to eq('v1HMAC')
73
73
  expect(communicator_config.connect_timeout).to eq(20)
74
74
  expect(communicator_config.socket_timeout).to eq(10)
@@ -79,13 +79,13 @@ describe 'CommunicatorConfiguration' do
79
79
  expect(proxy_config.scheme).to eq('http')
80
80
  expect(proxy_config.host).to eq('proxy.example.org')
81
81
  expect(proxy_config.port).to eq(3128)
82
- expect(proxy_config.username).to eq('global-collect-username')
83
- expect(proxy_config.password).to eq('global-collect-password')
82
+ expect(proxy_config.username).to eq('test-username')
83
+ expect(proxy_config.password).to eq('test-password')
84
84
  end
85
85
 
86
86
  it 'accepts a different number of maximum connections' do
87
87
  yaml = '---
88
- connect.api.endpoint.host: api-sandbox.globalcollect.com
88
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
89
89
  connect.api.authorizationType: v1HMAC
90
90
  connect.api.connectTimeout: 20
91
91
  connect.api.socketTimeout: 10
@@ -94,7 +94,7 @@ describe 'CommunicatorConfiguration' do
94
94
 
95
95
  communicator_config = CommunicatorConfiguration.new(properties: config)
96
96
 
97
- expect(communicator_config.api_endpoint).to eq('https://api-sandbox.globalcollect.com')
97
+ expect(communicator_config.api_endpoint).to eq('https://eu.sandbox.api-ingenico.com')
98
98
  expect(communicator_config.authorization_type).to eq('v1HMAC')
99
99
  expect(communicator_config.connect_timeout).to eq(20)
100
100
  expect(communicator_config.socket_timeout).to eq(10)
@@ -107,7 +107,7 @@ describe 'CommunicatorConfiguration' do
107
107
 
108
108
  it 'uses specific scheme to override default' do
109
109
  yaml = '---
110
- connect.api.endpoint.host: api-sandbox.globalcollect.com
110
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
111
111
  connect.api.authorizationType: v1HMAC
112
112
  connect.api.connectTimeout: 20
113
113
  connect.api.socketTimeout: 10
@@ -116,12 +116,12 @@ describe 'CommunicatorConfiguration' do
116
116
 
117
117
  communicator_config = CommunicatorConfiguration.new(properties: config)
118
118
 
119
- expect(communicator_config.api_endpoint).to eq('http://api-sandbox.globalcollect.com')
119
+ expect(communicator_config.api_endpoint).to eq('http://eu.sandbox.api-ingenico.com')
120
120
  end
121
121
 
122
122
  it 'uses specific port to override default' do
123
123
  yaml = '---
124
- connect.api.endpoint.host: api-sandbox.globalcollect.com
124
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
125
125
  connect.api.authorizationType: v1HMAC
126
126
  connect.api.connectTimeout: 20
127
127
  connect.api.socketTimeout: 10
@@ -130,12 +130,12 @@ describe 'CommunicatorConfiguration' do
130
130
 
131
131
  communicator_config = CommunicatorConfiguration.new(properties: config)
132
132
 
133
- expect(communicator_config.api_endpoint).to eq('https://api-sandbox.globalcollect.com:8080')
133
+ expect(communicator_config.api_endpoint).to eq('https://eu.sandbox.api-ingenico.com:8080')
134
134
  end
135
135
 
136
136
  it 'uses specific scheme and port to override default' do
137
137
  yaml = '---
138
- connect.api.endpoint.host: api-sandbox.globalcollect.com
138
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
139
139
  connect.api.authorizationType: v1HMAC
140
140
  connect.api.connectTimeout: 20
141
141
  connect.api.socketTimeout: 10
@@ -145,12 +145,12 @@ describe 'CommunicatorConfiguration' do
145
145
 
146
146
  communicator_config = CommunicatorConfiguration.new(properties: config)
147
147
 
148
- expect(communicator_config.api_endpoint).to eq('http://api-sandbox.globalcollect.com:8080')
148
+ expect(communicator_config.api_endpoint).to eq('http://eu.sandbox.api-ingenico.com:8080')
149
149
  end
150
150
 
151
151
  it 'stores shoppingCartExtension data' do
152
152
  yaml = '---
153
- connect.api.endpoint.host: api-sandbox.globalcollect.com
153
+ connect.api.endpoint.host: eu.sandbox.api-ingenico.com
154
154
  connect.api.authorizationType: v1HMAC
155
155
  connect.api.connectTimeout: 20
156
156
  connect.api.socketTimeout: 10
@@ -163,7 +163,7 @@ describe 'CommunicatorConfiguration' do
163
163
 
164
164
  communicator_config = CommunicatorConfiguration.new(properties: config)
165
165
 
166
- expect(communicator_config.api_endpoint).to eq('https://api-sandbox.globalcollect.com')
166
+ expect(communicator_config.api_endpoint).to eq('https://eu.sandbox.api-ingenico.com')
167
167
  expect(communicator_config.authorization_type).to eq('v1HMAC')
168
168
  expect(communicator_config.connect_timeout).to eq(20)
169
169
  expect(communicator_config.socket_timeout).to eq(10)
@@ -7,15 +7,15 @@ RequestParam ||= Ingenico::Connect::SDK::RequestParam
7
7
 
8
8
  describe Communicator do
9
9
 
10
- let(:session){instance_double('Session', :api_endpoint => URI('https://api-sandbox.globalcollect.com'))}
10
+ let(:session){instance_double('Session', :api_endpoint => URI('https://eu.sandbox.api-ingenico.com'))}
11
11
  let(:communicator){communicator = Communicator.new(session, DefaultMarshaller.INSTANCE)}
12
12
  context 'to_absolute_uri()' do
13
13
  it 'accepts a uri with or without a leading slash' do
14
14
  uri1 = communicator.send(:to_absolute_uri, 'v1/merchant/20000/convertamount', [])
15
15
  uri2 = communicator.send(:to_absolute_uri, '/v1/merchant/20000/convertamount', [])
16
16
  # Ruby URI library adds port in HTTPS url's by default
17
- expect(uri1.to_s).to eq('https://api-sandbox.globalcollect.com:443/v1/merchant/20000/convertamount')
18
- expect(uri2.to_s).to eq('https://api-sandbox.globalcollect.com:443/v1/merchant/20000/convertamount')
17
+ expect(uri1.to_s).to eq('https://eu.sandbox.api-ingenico.com:443/v1/merchant/20000/convertamount')
18
+ expect(uri2.to_s).to eq('https://eu.sandbox.api-ingenico.com:443/v1/merchant/20000/convertamount')
19
19
  end
20
20
 
21
21
  it 'adds request parameters to the uri' do
@@ -24,7 +24,7 @@ describe Communicator do
24
24
 
25
25
  uri = communicator.send(:to_absolute_uri, 'v1/merchant/20000/convertamount', request_params)
26
26
 
27
- expect(uri.to_s).to eq('https://api-sandbox.globalcollect.com:443/v1/merchant/20000/convertamount'\
27
+ expect(uri.to_s).to eq('https://eu.sandbox.api-ingenico.com:443/v1/merchant/20000/convertamount'\
28
28
  '?amount=123&source=USD&target=EUR&dummy=%C3%A9%26%25%3D')
29
29
  end
30
30
  end
@@ -17,10 +17,10 @@ describe 'DefaultConnectionIdempotence' do
17
17
  call_context = CallContext.new(idempotence_key)
18
18
  request = create_payment_request
19
19
 
20
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/20000/payments')
20
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/20000/payments')
21
21
  .with(headers: {'X-GCS-Idempotence-Key' => idempotence_key})
22
22
  .to_return(status: 201, body: response_body,
23
- headers: base_headers.merge({'Content-Type' => 'application/json', 'Location' => 'api-sandbox.globalcollect.com/v1/20000/payments/000002000020142549460000100001'}))
23
+ headers: base_headers.merge({'Content-Type' => 'application/json', 'Location' => 'eu.sandbox.api-ingenico.com/v1/20000/payments/000002000020142549460000100001'}))
24
24
 
25
25
  response = CLIENT.merchant('20000').payments.create(request, call_context)
26
26
 
@@ -37,12 +37,11 @@ describe 'DefaultConnectionIdempotence' do
37
37
  call_context = CallContext.new(idempotence_key)
38
38
  request = create_payment_request
39
39
 
40
-
41
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/20000/payments')
40
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/20000/payments')
42
41
  .with(headers: {'X-GCS-Idempotence-Key' => idempotence_key})
43
42
  .to_return(status: 201, body: response_body,
44
43
  headers: base_headers.merge({'Content-Type' => 'application/json',
45
- 'Location' => 'api-sandbox.globalcollect.com/v1/20000/payments/000002000020142549460000100001',
44
+ 'Location' => 'eu.sandbox.api-ingenico.com/v1/20000/payments/000002000020142549460000100001',
46
45
  'X-GCS-Idempotence-Request-Timestamp' => idempotence_timestamp}))
47
46
 
48
47
  response = CLIENT.merchant('20000').payments.create(request, call_context)
@@ -60,7 +59,7 @@ describe 'DefaultConnectionIdempotence' do
60
59
  call_context = CallContext.new(idempotence_key)
61
60
  request = create_payment_request
62
61
 
63
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/20000/payments')
62
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/20000/payments')
64
63
  .with(headers: {'X-GCS-Idempotence-Key' => idempotence_key})
65
64
  .to_return(status: 402, body: response_body,
66
65
  headers: base_headers.merge({'Content-Type' => 'application/json'}))
@@ -81,7 +80,7 @@ describe 'DefaultConnectionIdempotence' do
81
80
  call_context = CallContext.new(idempotence_key)
82
81
  request = create_payment_request
83
82
 
84
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/20000/payments')
83
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/20000/payments')
85
84
  .with(headers: {'X-GCS-Idempotence-Key' => idempotence_key})
86
85
  .to_return(status: 402, body: response_body,
87
86
  headers: base_headers.merge({'Content-Type' => 'application/json',
@@ -103,7 +102,7 @@ describe 'DefaultConnectionIdempotence' do
103
102
  call_context = CallContext.new(idempotence_key)
104
103
  request = create_payment_request
105
104
 
106
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/20000/payments')
105
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/20000/payments')
107
106
  .with(headers: {'X-GCS-Idempotence-Key' => idempotence_key})
108
107
  .to_return(status: 409, body: response_body,
109
108
  headers: base_headers.merge({'Content-Type' => 'application/json',
@@ -135,7 +135,7 @@ module ValidationDict
135
135
  message =~ RESPONSE_START
136
136
  id = $1 # capture id from the regular expression above
137
137
  expect(message).to match(STATUS_201)
138
- expect(message).to match(%r(Location="api-sandbox\.globalcollect\.com/v1/1234/payments/000000123410000595980000100001"))
138
+ expect(message).to match(%r(Location="eu\.sandbox\.api-ingenico\.com/v1/1234/payments/000000123410000595980000100001"))
139
139
  expect(message).to match(DATA_JSON_HEADER)
140
140
  # expect(message).to match(DUMMY_HEADER)
141
141
  expect(message).to match(DATEHEADER)
@@ -163,7 +163,7 @@ module ValidationDict
163
163
  message =~ RESPONSE_START
164
164
  id = $1 # capture id from the regular expression above
165
165
  expect(message).to match(STATUS_201)
166
- expect(message).to match(%r(Location="api-sandbox\.globalcollect\.com/v1/1234/payments/000000123410000595980000100001"))
166
+ expect(message).to match(%r(Location="eu\.sandbox\.api-ingenico\.com/v1/1234/payments/000000123410000595980000100001"))
167
167
  expect(message).to match(DATA_JSON_HEADER)
168
168
  # expect(message).to match(DUMMY_HEADER)
169
169
  expect(message).to match(DATEHEADER)
@@ -260,7 +260,7 @@ describe 'DefaultConnectionLogging' do
260
260
  it 'should be able to log a simple request' do
261
261
  response_body = IO.read(resource_prefix + 'testConnection.json')
262
262
 
263
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/testconnection')
263
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/testconnection')
264
264
  .to_return(status: 200, body: response_body,
265
265
  headers: base_headers.merge({'Content-Type' => 'application/json'}))
266
266
 
@@ -277,7 +277,7 @@ describe 'DefaultConnectionLogging' do
277
277
  it 'can log a GET request with parameters' do
278
278
  response_body = IO.read(resource_prefix + 'convertAmount.json')
279
279
 
280
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/convert/amount?source=EUR&target=USD&amount=1000')
280
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/convert/amount?source=EUR&target=USD&amount=1000')
281
281
  .to_return(status: 200, body: response_body,
282
282
  headers: base_headers.merge({'Content-Type' => 'application/json'}))
283
283
 
@@ -297,7 +297,7 @@ describe 'DefaultConnectionLogging' do
297
297
 
298
298
  # tests delete token
299
299
  it 'can log DELETE requests' do
300
- stub_request(:delete, 'https://api-sandbox.globalcollect.com/v1/1234/tokens/5678')
300
+ stub_request(:delete, 'https://eu.sandbox.api-ingenico.com/v1/1234/tokens/5678')
301
301
  .to_return(status: 204, headers: base_headers)
302
302
 
303
303
  CLIENT.enable_logging(logger)
@@ -313,10 +313,10 @@ describe 'DefaultConnectionLogging' do
313
313
  response_body = IO.read(resource_prefix + 'createPayment.json')
314
314
  request = create_payment_request
315
315
 
316
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/1234/payments')
316
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/1234/payments')
317
317
  .to_return(status: 201, body: response_body,
318
318
  headers: base_headers.merge({'Content-Type' => 'application/json',
319
- 'Location' => 'api-sandbox.globalcollect.com/v1/1234/payments/000000123410000595980000100001'}))
319
+ 'Location' => 'eu.sandbox.api-ingenico.com/v1/1234/payments/000000123410000595980000100001'}))
320
320
 
321
321
  CLIENT.enable_logging(logger)
322
322
  response = CLIENT.merchant('1234').payments.create(request)
@@ -331,10 +331,10 @@ describe 'DefaultConnectionLogging' do
331
331
  response_body = IO.read(resource_prefix + 'createPayment.unicode.json')
332
332
  request = create_payment_request
333
333
 
334
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/1234/payments')
334
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/1234/payments')
335
335
  .to_return(status: 201, body: response_body,
336
336
  headers: base_headers.merge({'Content-Type' => 'application/json',
337
- 'Location' => 'api-sandbox.globalcollect.com/v1/1234/payments/000000123410000595980000100001'}))
337
+ 'Location' => 'eu.sandbox.api-ingenico.com/v1/1234/payments/000000123410000595980000100001'}))
338
338
 
339
339
  CLIENT.enable_logging(logger)
340
340
  response = CLIENT.merchant('1234').payments.create(request)
@@ -351,7 +351,7 @@ describe 'DefaultConnectionLogging' do
351
351
  response_body = IO.read(resource_prefix + 'createPayment.failure.invalidCardNumber.json')
352
352
  request = create_payment_request
353
353
 
354
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/1234/payments')
354
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/1234/payments')
355
355
  .to_return(status: 400, body: response_body,
356
356
  headers: base_headers.merge({'Content-Type' => 'application/json'}))
357
357
 
@@ -366,7 +366,7 @@ describe 'DefaultConnectionLogging' do
366
366
  response_body = IO.read(resource_prefix + 'createPayment.failure.rejected.json')
367
367
  request = create_payment_request
368
368
 
369
- stub_request(:post, 'https://api-sandbox.globalcollect.com/v1/1234/payments')
369
+ stub_request(:post, 'https://eu.sandbox.api-ingenico.com/v1/1234/payments')
370
370
  .to_return(status: 402, body: response_body,
371
371
  headers: base_headers.merge({'Content-Type' => 'application/json'}))
372
372
 
@@ -380,7 +380,7 @@ describe 'DefaultConnectionLogging' do
380
380
  it 'logs general HTTP errors' do
381
381
  response_body = IO.read(resource_prefix + 'unknownServerError.json')
382
382
 
383
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/testconnection')
383
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/testconnection')
384
384
  .to_return(status: 500, body: response_body,
385
385
  headers: base_headers.merge({'Content-Type' => 'application/json'}))
386
386
 
@@ -394,7 +394,7 @@ describe 'DefaultConnectionLogging' do
394
394
  it 'logs non-json' do
395
395
  response_body = IO.read(resource_prefix + 'notFound.html')
396
396
 
397
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/testconnection')
397
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/testconnection')
398
398
  .to_return(status: 404, body: response_body,
399
399
  headers: base_headers.merge({'Content-Type' => 'text/html'}))
400
400
 
@@ -406,7 +406,7 @@ describe 'DefaultConnectionLogging' do
406
406
 
407
407
  # tests a read timeout
408
408
  it 'logs timeouts' do
409
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/testconnection')
409
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/testconnection')
410
410
  .to_raise(HTTPClient::ReceiveTimeoutError)
411
411
 
412
412
  CLIENT.enable_logging(logger)
@@ -427,7 +427,7 @@ describe 'DefaultConnectionLogging' do
427
427
  it 'can log requests individually' do
428
428
  response_body = IO.read(resource_prefix + 'testConnection.json')
429
429
 
430
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/testconnection')
430
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/testconnection')
431
431
  .to_return{ |request| CLIENT.disable_logging
432
432
  {body: response_body, status: 200, headers: base_headers.merge({'Content-type' => 'application/json'})}}
433
433
 
@@ -446,7 +446,7 @@ describe 'DefaultConnectionLogging' do
446
446
  it 'can log responses individually' do
447
447
  response_body = IO.read(resource_prefix + 'testConnection.json')
448
448
 
449
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/testconnection')
449
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/testconnection')
450
450
  .to_return{ |request| CLIENT.enable_logging(logger)
451
451
  {body: response_body, status: 200, headers: base_headers.merge({'Content-type' => 'application/json'})}}
452
452
 
@@ -462,7 +462,7 @@ describe 'DefaultConnectionLogging' do
462
462
  end
463
463
 
464
464
  it 'can log errors individually' do
465
- stub_request(:get, 'https://api-sandbox.globalcollect.com/v1/1234/services/testconnection')
465
+ stub_request(:get, 'https://eu.sandbox.api-ingenico.com/v1/1234/services/testconnection')
466
466
  .to_return{ |request| CLIENT.enable_logging(logger)
467
467
  raise HTTPClient::ReceiveTimeoutError.new}
468
468
 
@@ -7,7 +7,7 @@ describe 'Factory' do
7
7
  it 'can initialize configurations' do
8
8
  configuration = Factory.create_configuration(PROPERTIES_URI, API_KEY_ID, SECRET_API_KEY)
9
9
 
10
- expect(configuration.api_endpoint).to eq('https://api-sandbox.globalcollect.com')
10
+ expect(configuration.api_endpoint).to eq('https://eu.sandbox.api-ingenico.com')
11
11
  expect(configuration.authorization_type).to eq('v1HMAC')
12
12
  expect(configuration.connect_timeout).to eq(-1)
13
13
  expect(configuration.socket_timeout).to eq(-1)
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.20.0
4
+ version: 2.24.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: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -419,6 +419,7 @@ files:
419
419
  - lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input.rb
420
420
  - lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input_base.rb
421
421
  - lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_output.rb
422
+ - lib/ingenico/connect/sdk/domain/payment/redirect_payment_product4101_specific_input.rb
422
423
  - lib/ingenico/connect/sdk/domain/payment/redirect_payment_product809_specific_input.rb
423
424
  - lib/ingenico/connect/sdk/domain/payment/redirect_payment_product816_specific_input.rb
424
425
  - lib/ingenico/connect/sdk/domain/payment/redirect_payment_product840_specific_input.rb
@@ -463,7 +464,9 @@ files:
463
464
  - lib/ingenico/connect/sdk/domain/payout/create_payout_request.rb
464
465
  - lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb
465
466
  - lib/ingenico/connect/sdk/domain/payout/payout_customer.rb
467
+ - lib/ingenico/connect/sdk/domain/payout/payout_details.rb
466
468
  - lib/ingenico/connect/sdk/domain/payout/payout_error_response.rb
469
+ - lib/ingenico/connect/sdk/domain/payout/payout_recipient.rb
467
470
  - lib/ingenico/connect/sdk/domain/payout/payout_references.rb
468
471
  - lib/ingenico/connect/sdk/domain/payout/payout_response.rb
469
472
  - lib/ingenico/connect/sdk/domain/payout/payout_result.rb