connect-sdk-ruby 2.18.0 → 2.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/connect-sdk-ruby.gemspec +1 -1
- data/examples/merchant/example_configuration.yml +1 -1
- data/examples/merchant/payments/complete_payment_example.rb +1 -1
- data/examples/merchant/payments/create_payment_example.rb +1 -1
- data/examples/merchant/riskassessments/risk_assessment_cards_example.rb +1 -1
- data/examples/merchant/tokens/update_token_example.rb +1 -1
- data/lib/ingenico/connect/sdk/api_resource.rb +2 -2
- data/lib/ingenico/connect/sdk/domain/payment/decrypted_payment_data.rb +2 -0
- data/lib/ingenico/connect/sdk/domain/payment/device_render_options.rb +13 -0
- data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_input.rb +7 -0
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input.rb +9 -0
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_output.rb +16 -0
- data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product4101_specific_input.rb +53 -0
- data/lib/ingenico/connect/sdk/domain/payment/sdk_data_input.rb +2 -0
- data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input.rb +7 -0
- data/lib/ingenico/connect/sdk/domain/services/payment_context.rb +7 -0
- data/lib/ingenico/connect/sdk/factory.rb +15 -15
- data/lib/ingenico/connect/sdk/meta_data_provider.rb +1 -1
- data/lib/ingenico/connect/sdk/modules.rb +1 -1
- data/spec/fixtures/resources/properties.proxy.yml +3 -3
- data/spec/fixtures/resources/properties.yml +1 -1
- data/spec/integration/sdk_proxy_spec.rb +3 -2
- data/spec/integration_setup.rb +1 -1
- data/spec/lib/communicator_configuration_spec.rb +20 -20
- data/spec/lib/communicator_spec.rb +4 -4
- data/spec/lib/defaultimpl/default_connection_idempotence_spec.rb +7 -8
- data/spec/lib/defaultimpl/default_connection_logger_spec.rb +17 -17
- data/spec/lib/factory_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd9456adb9b4baf2b7f80f4fc96d3735929a1b898d142ce011a959f51c1a4307
|
4
|
+
data.tar.gz: 9eac7d96809ada5e0400facf432ce81020ad32a889657e5549d155bfeab2330a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11f7518e42e278611cdfb0b8661847e0b6a7d17e09fe2190d9e1f2776091d6cfb17187989694804f2652a13f39fe355edd8ca48a068b53520640f3418b11642
|
7
|
+
data.tar.gz: e4983a30b14a9abaa600bfaef7796903a009b203040c14386fcd4a7ac7b19b4e3fa3e404c26c3ae0ddf232a719fd9fc0882447075311bf992e865bc704ed391f
|
data/connect-sdk-ruby.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'connect-sdk-ruby'
|
3
|
-
spec.version = '2.
|
3
|
+
spec.version = '2.22.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}
|
@@ -15,7 +15,7 @@ def example
|
|
15
15
|
card = Definitions::CardWithoutCvv.new
|
16
16
|
card.card_number = '67030000000000003'
|
17
17
|
card.cardholder_name = 'Wile E. Coyote'
|
18
|
-
card.expiry_date = '
|
18
|
+
card.expiry_date = '1299'
|
19
19
|
|
20
20
|
card_payment_method_specific_input = Payment::CompletePaymentCardPaymentMethodSpecificInput.new
|
21
21
|
card_payment_method_specific_input.card = card
|
@@ -37,7 +37,7 @@ def example
|
|
37
37
|
card.card_number = '4567350000427977'
|
38
38
|
card.cardholder_name = 'Wile E. Coyote'
|
39
39
|
card.cvv = '123'
|
40
|
-
card.expiry_date = '
|
40
|
+
card.expiry_date = '1299'
|
41
41
|
|
42
42
|
authentication_amount = Definitions::AmountOfMoney.new
|
43
43
|
authentication_amount.amount = 2980
|
@@ -47,7 +47,7 @@ def example
|
|
47
47
|
card_without_cvv = Definitions::CardWithoutCvv.new
|
48
48
|
card_without_cvv.card_number = '4567350000427977'
|
49
49
|
card_without_cvv.cardholder_name = 'Wile E. Coyote'
|
50
|
-
card_without_cvv.expiry_date = '
|
50
|
+
card_without_cvv.expiry_date = '1299'
|
51
51
|
card_without_cvv.issue_number = '12'
|
52
52
|
|
53
53
|
data = Token::TokenCardData.new
|
@@ -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-
|
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-
|
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
|
@@ -18,6 +18,8 @@ module Ingenico::Connect::SDK
|
|
18
18
|
# @attr [String] payment_method
|
19
19
|
class DecryptedPaymentData < Ingenico::Connect::SDK::DataObject
|
20
20
|
|
21
|
+
#
|
22
|
+
# @deprecated Use decryptedPaymentData.paymentMethod instead
|
21
23
|
attr_accessor :auth_method
|
22
24
|
|
23
25
|
attr_accessor :cardholder_name
|
@@ -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
|
data/lib/ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_input.rb
CHANGED
@@ -16,6 +16,7 @@ module Ingenico::Connect::SDK
|
|
16
16
|
# @attr [Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentProduct705SpecificInput] payment_product705_specific_input
|
17
17
|
# @attr [Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentProduct730SpecificInput] payment_product730_specific_input
|
18
18
|
# @attr [String] recurring_payment_sequence_indicator
|
19
|
+
# @attr [true/false] requires_approval
|
19
20
|
# @attr [String] token
|
20
21
|
# @attr [true/false] tokenize
|
21
22
|
class NonSepaDirectDebitPaymentMethodSpecificInput < Ingenico::Connect::SDK::Domain::Definitions::AbstractPaymentMethodSpecificInput
|
@@ -32,6 +33,8 @@ module Ingenico::Connect::SDK
|
|
32
33
|
|
33
34
|
attr_accessor :recurring_payment_sequence_indicator
|
34
35
|
|
36
|
+
attr_accessor :requires_approval
|
37
|
+
|
35
38
|
attr_accessor :token
|
36
39
|
|
37
40
|
attr_accessor :tokenize
|
@@ -45,6 +48,7 @@ module Ingenico::Connect::SDK
|
|
45
48
|
hash['paymentProduct705SpecificInput'] = @payment_product705_specific_input.to_h unless @payment_product705_specific_input.nil?
|
46
49
|
hash['paymentProduct730SpecificInput'] = @payment_product730_specific_input.to_h unless @payment_product730_specific_input.nil?
|
47
50
|
hash['recurringPaymentSequenceIndicator'] = @recurring_payment_sequence_indicator unless @recurring_payment_sequence_indicator.nil?
|
51
|
+
hash['requiresApproval'] = @requires_approval unless @requires_approval.nil?
|
48
52
|
hash['token'] = @token unless @token.nil?
|
49
53
|
hash['tokenize'] = @tokenize unless @tokenize.nil?
|
50
54
|
hash
|
@@ -72,6 +76,9 @@ module Ingenico::Connect::SDK
|
|
72
76
|
if hash.has_key? 'recurringPaymentSequenceIndicator'
|
73
77
|
@recurring_payment_sequence_indicator = hash['recurringPaymentSequenceIndicator']
|
74
78
|
end
|
79
|
+
if hash.has_key? 'requiresApproval'
|
80
|
+
@requires_approval = hash['requiresApproval']
|
81
|
+
end
|
75
82
|
if hash.has_key? 'token'
|
76
83
|
@token = hash['token']
|
77
84
|
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'])
|
@@ -2,6 +2,7 @@
|
|
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/domain/definitions/bank_account_bban'
|
5
6
|
require 'ingenico/connect/sdk/domain/definitions/bank_account_iban'
|
6
7
|
require 'ingenico/connect/sdk/domain/definitions/fraud_results'
|
7
8
|
require 'ingenico/connect/sdk/domain/payment/abstract_payment_method_specific_output'
|
@@ -14,7 +15,9 @@ module Ingenico::Connect::SDK
|
|
14
15
|
module Domain
|
15
16
|
module Payment
|
16
17
|
|
18
|
+
# @attr [Ingenico::Connect::SDK::Domain::Definitions::BankAccountBban] bank_account_bban
|
17
19
|
# @attr [Ingenico::Connect::SDK::Domain::Definitions::BankAccountIban] bank_account_iban
|
20
|
+
# @attr [String] bic
|
18
21
|
# @attr [Ingenico::Connect::SDK::Domain::Definitions::FraudResults] fraud_results
|
19
22
|
# @attr [Ingenico::Connect::SDK::Domain::Payment::PaymentProduct3201SpecificOutput] payment_product3201_specific_output
|
20
23
|
# @attr [Ingenico::Connect::SDK::Domain::Payment::PaymentProduct806SpecificOutput] payment_product806_specific_output
|
@@ -23,8 +26,12 @@ module Ingenico::Connect::SDK
|
|
23
26
|
# @attr [String] token
|
24
27
|
class RedirectPaymentMethodSpecificOutput < Ingenico::Connect::SDK::Domain::Payment::AbstractPaymentMethodSpecificOutput
|
25
28
|
|
29
|
+
attr_accessor :bank_account_bban
|
30
|
+
|
26
31
|
attr_accessor :bank_account_iban
|
27
32
|
|
33
|
+
attr_accessor :bic
|
34
|
+
|
28
35
|
attr_accessor :fraud_results
|
29
36
|
|
30
37
|
attr_accessor :payment_product3201_specific_output
|
@@ -40,7 +47,9 @@ module Ingenico::Connect::SDK
|
|
40
47
|
# @return (Hash)
|
41
48
|
def to_h
|
42
49
|
hash = super
|
50
|
+
hash['bankAccountBban'] = @bank_account_bban.to_h unless @bank_account_bban.nil?
|
43
51
|
hash['bankAccountIban'] = @bank_account_iban.to_h unless @bank_account_iban.nil?
|
52
|
+
hash['bic'] = @bic unless @bic.nil?
|
44
53
|
hash['fraudResults'] = @fraud_results.to_h unless @fraud_results.nil?
|
45
54
|
hash['paymentProduct3201SpecificOutput'] = @payment_product3201_specific_output.to_h unless @payment_product3201_specific_output.nil?
|
46
55
|
hash['paymentProduct806SpecificOutput'] = @payment_product806_specific_output.to_h unless @payment_product806_specific_output.nil?
|
@@ -52,10 +61,17 @@ module Ingenico::Connect::SDK
|
|
52
61
|
|
53
62
|
def from_hash(hash)
|
54
63
|
super
|
64
|
+
if hash.has_key? 'bankAccountBban'
|
65
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['bankAccountBban']] unless hash['bankAccountBban'].is_a? Hash
|
66
|
+
@bank_account_bban = Ingenico::Connect::SDK::Domain::Definitions::BankAccountBban.new_from_hash(hash['bankAccountBban'])
|
67
|
+
end
|
55
68
|
if hash.has_key? 'bankAccountIban'
|
56
69
|
raise TypeError, "value '%s' is not a Hash" % [hash['bankAccountIban']] unless hash['bankAccountIban'].is_a? Hash
|
57
70
|
@bank_account_iban = Ingenico::Connect::SDK::Domain::Definitions::BankAccountIban.new_from_hash(hash['bankAccountIban'])
|
58
71
|
end
|
72
|
+
if hash.has_key? 'bic'
|
73
|
+
@bic = hash['bic']
|
74
|
+
end
|
59
75
|
if hash.has_key? 'fraudResults'
|
60
76
|
raise TypeError, "value '%s' is not a Hash" % [hash['fraudResults']] unless hash['fraudResults'].is_a? Hash
|
61
77
|
@fraud_results = Ingenico::Connect::SDK::Domain::Definitions::FraudResults.new_from_hash(hash['fraudResults'])
|
@@ -0,0 +1,53 @@
|
|
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] integration_type
|
12
|
+
# @attr [String] merchant_name
|
13
|
+
# @attr [String] transaction_note
|
14
|
+
# @attr [String] vpa
|
15
|
+
class RedirectPaymentProduct4101SpecificInput < Ingenico::Connect::SDK::DataObject
|
16
|
+
|
17
|
+
attr_accessor :integration_type
|
18
|
+
|
19
|
+
attr_accessor :merchant_name
|
20
|
+
|
21
|
+
attr_accessor :transaction_note
|
22
|
+
|
23
|
+
attr_accessor :vpa
|
24
|
+
|
25
|
+
# @return (Hash)
|
26
|
+
def to_h
|
27
|
+
hash = super
|
28
|
+
hash['integrationType'] = @integration_type unless @integration_type.nil?
|
29
|
+
hash['merchantName'] = @merchant_name unless @merchant_name.nil?
|
30
|
+
hash['transactionNote'] = @transaction_note unless @transaction_note.nil?
|
31
|
+
hash['vpa'] = @vpa unless @vpa.nil?
|
32
|
+
hash
|
33
|
+
end
|
34
|
+
|
35
|
+
def from_hash(hash)
|
36
|
+
super
|
37
|
+
if hash.has_key? 'integrationType'
|
38
|
+
@integration_type = hash['integrationType']
|
39
|
+
end
|
40
|
+
if hash.has_key? 'merchantName'
|
41
|
+
@merchant_name = hash['merchantName']
|
42
|
+
end
|
43
|
+
if hash.has_key? 'transactionNote'
|
44
|
+
@transaction_note = hash['transactionNote']
|
45
|
+
end
|
46
|
+
if hash.has_key? 'vpa'
|
47
|
+
@vpa = hash['vpa']
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input.rb
CHANGED
@@ -14,6 +14,7 @@ module Ingenico::Connect::SDK
|
|
14
14
|
# @attr [true/false] is_recurring
|
15
15
|
# @attr [Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentProduct771SpecificInput] payment_product771_specific_input
|
16
16
|
# @attr [String] recurring_payment_sequence_indicator
|
17
|
+
# @attr [true/false] requires_approval
|
17
18
|
# @attr [String] token
|
18
19
|
# @attr [true/false] tokenize
|
19
20
|
class SepaDirectDebitPaymentMethodSpecificInput < Ingenico::Connect::SDK::Domain::Payment::AbstractSepaDirectDebitPaymentMethodSpecificInput
|
@@ -28,6 +29,8 @@ module Ingenico::Connect::SDK
|
|
28
29
|
|
29
30
|
attr_accessor :recurring_payment_sequence_indicator
|
30
31
|
|
32
|
+
attr_accessor :requires_approval
|
33
|
+
|
31
34
|
attr_accessor :token
|
32
35
|
|
33
36
|
attr_accessor :tokenize
|
@@ -40,6 +43,7 @@ module Ingenico::Connect::SDK
|
|
40
43
|
hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
|
41
44
|
hash['paymentProduct771SpecificInput'] = @payment_product771_specific_input.to_h unless @payment_product771_specific_input.nil?
|
42
45
|
hash['recurringPaymentSequenceIndicator'] = @recurring_payment_sequence_indicator unless @recurring_payment_sequence_indicator.nil?
|
46
|
+
hash['requiresApproval'] = @requires_approval unless @requires_approval.nil?
|
43
47
|
hash['token'] = @token unless @token.nil?
|
44
48
|
hash['tokenize'] = @tokenize unless @tokenize.nil?
|
45
49
|
hash
|
@@ -63,6 +67,9 @@ module Ingenico::Connect::SDK
|
|
63
67
|
if hash.has_key? 'recurringPaymentSequenceIndicator'
|
64
68
|
@recurring_payment_sequence_indicator = hash['recurringPaymentSequenceIndicator']
|
65
69
|
end
|
70
|
+
if hash.has_key? 'requiresApproval'
|
71
|
+
@requires_approval = hash['requiresApproval']
|
72
|
+
end
|
66
73
|
if hash.has_key? 'token'
|
67
74
|
@token = hash['token']
|
68
75
|
end
|
@@ -11,6 +11,7 @@ module Ingenico::Connect::SDK
|
|
11
11
|
|
12
12
|
# @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money
|
13
13
|
# @attr [String] country_code
|
14
|
+
# @attr [true/false] is_installments
|
14
15
|
# @attr [true/false] is_recurring
|
15
16
|
class PaymentContext < Ingenico::Connect::SDK::DataObject
|
16
17
|
|
@@ -18,6 +19,8 @@ module Ingenico::Connect::SDK
|
|
18
19
|
|
19
20
|
attr_accessor :country_code
|
20
21
|
|
22
|
+
attr_accessor :is_installments
|
23
|
+
|
21
24
|
attr_accessor :is_recurring
|
22
25
|
|
23
26
|
# @return (Hash)
|
@@ -25,6 +28,7 @@ module Ingenico::Connect::SDK
|
|
25
28
|
hash = super
|
26
29
|
hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
|
27
30
|
hash['countryCode'] = @country_code unless @country_code.nil?
|
31
|
+
hash['isInstallments'] = @is_installments unless @is_installments.nil?
|
28
32
|
hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
|
29
33
|
hash
|
30
34
|
end
|
@@ -38,6 +42,9 @@ module Ingenico::Connect::SDK
|
|
38
42
|
if hash.has_key? 'countryCode'
|
39
43
|
@country_code = hash['countryCode']
|
40
44
|
end
|
45
|
+
if hash.has_key? 'isInstallments'
|
46
|
+
@is_installments = hash['isInstallments']
|
47
|
+
end
|
41
48
|
if hash.has_key? 'isRecurring'
|
42
49
|
@is_recurring = hash['isRecurring']
|
43
50
|
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
|
15
|
-
# @param secret_api_key [String] Secret key used for authentication to the
|
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
|
60
|
-
# @param secret_api_key [String] Secret key used for authentication to the
|
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
|
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
|
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
|
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
|
93
|
-
# @param secret_api_key [String] Secret key used for authentication to the
|
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
|
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
|
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
|
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
|
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
|
186
|
-
# @param secret_api_key [String] Secret key used for authentication to the
|
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.
|
10
|
+
@@SDK_VERSION = '2.22.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
|
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-
|
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:
|
13
|
-
connect.api.proxy.password:
|
12
|
+
connect.api.proxy.username: test-user
|
13
|
+
connect.api.proxy.password: test-password
|
@@ -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
|
-
|
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-
|
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
|
data/spec/integration_setup.rb
CHANGED
@@ -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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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:
|
65
|
-
connect.api.proxy.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-
|
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('
|
83
|
-
expect(proxy_config.password).to eq('
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
18
|
-
expect(uri2.to_s).to eq('https://api-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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
|
|
data/spec/lib/factory_spec.rb
CHANGED
@@ -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-
|
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.
|
4
|
+
version: 2.22.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:
|
11
|
+
date: 2021-06-24 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
|