direct-sdk-ruby 1.3.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 368be9daafdb29379a5a1a0fa0f182f5c6700c95b1194188363ad1f278f598c1
4
- data.tar.gz: abe512b988eb61a082b1096f8c394adfda5e13e212bdc3a286a888e005e556fb
3
+ metadata.gz: d760a3e89a21e37005358485947cfb7ff4feb53563df85c96b487d808e360bb1
4
+ data.tar.gz: 71570745e91763569f1e74c2d09c6b453db1956ab781b6c8a48a3db460ef3e7e
5
5
  SHA512:
6
- metadata.gz: cfba82d0dcf563684dd6c3f15804d85ebb998accb3406cac529292619b3d411e21a1a5f8bdc2ffc2a2bd70b9d81bffd4ac89feb1280643e616b23a0de7acac80
7
- data.tar.gz: eb7a6e6550e453152d0748db40859888dc99aae02f42ea03251d328ac39b88a615c1d71d49dfb4cf957ce3b2a1585191c201e5671e5aedce63af746418a5de06
6
+ metadata.gz: 9e243365cdf7340eaf4650df349a95b4a202b075088ac832a0ff90ad680a3f8ece59218011adce74025d568b195a17fb4ea33d9005549dc3c10325df5143118d
7
+ data.tar.gz: 5065a5f36e56f65680ece1a92be625b87dfc1005cdb4332a88ddbd542e235bb28997c93cb79d0d35474b8bb9eb45a0dc20d5c29fb6266bf3004b172addba775f
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'direct-sdk-ruby'
3
- spec.version = '1.3.0'
3
+ spec.version = '1.7.0'
4
4
  spec.authors = ['Ingenico ePayments']
5
5
  spec.email = ['60233882+ingenico-dev-team@users.noreply.github.com']
6
6
  spec.summary = %q{SDK to communicate with the Ingenico ePayments platform using the Ingenico Direct Server API}
@@ -5,6 +5,7 @@
5
5
  require 'ingenico/direct/sdk/data_object'
6
6
  require 'ingenico/direct/sdk/domain/airline_data'
7
7
  require 'ingenico/direct/sdk/domain/loan_recipient'
8
+ require 'ingenico/direct/sdk/domain/lodging_data'
8
9
  require 'ingenico/direct/sdk/domain/order_type_information'
9
10
 
10
11
  module Ingenico::Direct::SDK
@@ -12,10 +13,12 @@ module Ingenico::Direct::SDK
12
13
 
13
14
  # @attr [Ingenico::Direct::SDK::Domain::AirlineData] airline_data
14
15
  # @attr [Ingenico::Direct::SDK::Domain::LoanRecipient] loan_recipient
16
+ # @attr [Ingenico::Direct::SDK::Domain::LodgingData] lodging_data
15
17
  # @attr [Ingenico::Direct::SDK::Domain::OrderTypeInformation] type_information
16
18
  class AdditionalOrderInput < Ingenico::Direct::SDK::DataObject
17
19
  attr_accessor :airline_data
18
20
  attr_accessor :loan_recipient
21
+ attr_accessor :lodging_data
19
22
  attr_accessor :type_information
20
23
 
21
24
  # @return (Hash)
@@ -23,6 +26,7 @@ module Ingenico::Direct::SDK
23
26
  hash = super
24
27
  hash['airlineData'] = @airline_data.to_h if @airline_data
25
28
  hash['loanRecipient'] = @loan_recipient.to_h if @loan_recipient
29
+ hash['lodgingData'] = @lodging_data.to_h if @lodging_data
26
30
  hash['typeInformation'] = @type_information.to_h if @type_information
27
31
  hash
28
32
  end
@@ -37,6 +41,10 @@ module Ingenico::Direct::SDK
37
41
  raise TypeError, "value '%s' is not a Hash" % [hash['loanRecipient']] unless hash['loanRecipient'].is_a? Hash
38
42
  @loan_recipient = Ingenico::Direct::SDK::Domain::LoanRecipient.new_from_hash(hash['loanRecipient'])
39
43
  end
44
+ if hash.key? 'lodgingData'
45
+ raise TypeError, "value '%s' is not a Hash" % [hash['lodgingData']] unless hash['lodgingData'].is_a? Hash
46
+ @lodging_data = Ingenico::Direct::SDK::Domain::LodgingData.new_from_hash(hash['lodgingData'])
47
+ end
40
48
  if hash.key? 'typeInformation'
41
49
  raise TypeError, "value '%s' is not a Hash" % [hash['typeInformation']] unless hash['typeInformation'].is_a? Hash
42
50
  @type_information = Ingenico::Direct::SDK::Domain::OrderTypeInformation.new_from_hash(hash['typeInformation'])
@@ -3,21 +3,25 @@
3
3
  # https://support.direct.ingenico.com/documentation/api/reference/
4
4
  #
5
5
  require 'ingenico/direct/sdk/data_object'
6
+ require 'ingenico/direct/sdk/domain/payment_references'
6
7
 
7
8
  module Ingenico::Direct::SDK
8
9
  module Domain
9
10
 
10
11
  # @attr [Long] amount
11
12
  # @attr [true/false] is_final
13
+ # @attr [Ingenico::Direct::SDK::Domain::PaymentReferences] references
12
14
  class CapturePaymentRequest < Ingenico::Direct::SDK::DataObject
13
15
  attr_accessor :amount
14
16
  attr_accessor :is_final
17
+ attr_accessor :references
15
18
 
16
19
  # @return (Hash)
17
20
  def to_h
18
21
  hash = super
19
22
  hash['amount'] = @amount unless @amount.nil?
20
23
  hash['isFinal'] = @is_final unless @is_final.nil?
24
+ hash['references'] = @references.to_h if @references
21
25
  hash
22
26
  end
23
27
 
@@ -25,6 +29,10 @@ module Ingenico::Direct::SDK
25
29
  super
26
30
  @amount = hash['amount'] if hash.key? 'amount'
27
31
  @is_final = hash['isFinal'] if hash.key? 'isFinal'
32
+ if hash.key? 'references'
33
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
34
+ @references = Ingenico::Direct::SDK::Domain::PaymentReferences.new_from_hash(hash['references'])
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -5,13 +5,16 @@
5
5
  require 'ingenico/direct/sdk/data_object'
6
6
  require 'ingenico/direct/sdk/domain/card_essentials'
7
7
  require 'ingenico/direct/sdk/domain/card_fraud_results'
8
+ require 'ingenico/direct/sdk/domain/external_token_linked'
8
9
  require 'ingenico/direct/sdk/domain/three_d_secure_results'
9
10
 
10
11
  module Ingenico::Direct::SDK
11
12
  module Domain
12
13
 
14
+ # @attr [Long] authenticated_amount
13
15
  # @attr [String] authorisation_code
14
16
  # @attr [Ingenico::Direct::SDK::Domain::CardEssentials] card
17
+ # @attr [Ingenico::Direct::SDK::Domain::ExternalTokenLinked] external_token_linked
15
18
  # @attr [Ingenico::Direct::SDK::Domain::CardFraudResults] fraud_results
16
19
  # @attr [String] initial_scheme_transaction_id
17
20
  # @attr [String] payment_option
@@ -19,8 +22,10 @@ module Ingenico::Direct::SDK
19
22
  # @attr [Ingenico::Direct::SDK::Domain::ThreeDSecureResults] three_d_secure_results
20
23
  # @attr [String] token
21
24
  class CardPaymentMethodSpecificOutput < Ingenico::Direct::SDK::DataObject
25
+ attr_accessor :authenticated_amount
22
26
  attr_accessor :authorisation_code
23
27
  attr_accessor :card
28
+ attr_accessor :external_token_linked
24
29
  attr_accessor :fraud_results
25
30
  attr_accessor :initial_scheme_transaction_id
26
31
  attr_accessor :payment_option
@@ -31,8 +36,10 @@ module Ingenico::Direct::SDK
31
36
  # @return (Hash)
32
37
  def to_h
33
38
  hash = super
39
+ hash['authenticatedAmount'] = @authenticated_amount unless @authenticated_amount.nil?
34
40
  hash['authorisationCode'] = @authorisation_code unless @authorisation_code.nil?
35
41
  hash['card'] = @card.to_h if @card
42
+ hash['externalTokenLinked'] = @external_token_linked.to_h if @external_token_linked
36
43
  hash['fraudResults'] = @fraud_results.to_h if @fraud_results
37
44
  hash['initialSchemeTransactionId'] = @initial_scheme_transaction_id unless @initial_scheme_transaction_id.nil?
38
45
  hash['paymentOption'] = @payment_option unless @payment_option.nil?
@@ -44,11 +51,16 @@ module Ingenico::Direct::SDK
44
51
 
45
52
  def from_hash(hash)
46
53
  super
54
+ @authenticated_amount = hash['authenticatedAmount'] if hash.key? 'authenticatedAmount'
47
55
  @authorisation_code = hash['authorisationCode'] if hash.key? 'authorisationCode'
48
56
  if hash.key? 'card'
49
57
  raise TypeError, "value '%s' is not a Hash" % [hash['card']] unless hash['card'].is_a? Hash
50
58
  @card = Ingenico::Direct::SDK::Domain::CardEssentials.new_from_hash(hash['card'])
51
59
  end
60
+ if hash.key? 'externalTokenLinked'
61
+ raise TypeError, "value '%s' is not a Hash" % [hash['externalTokenLinked']] unless hash['externalTokenLinked'].is_a? Hash
62
+ @external_token_linked = Ingenico::Direct::SDK::Domain::ExternalTokenLinked.new_from_hash(hash['externalTokenLinked'])
63
+ end
52
64
  if hash.key? 'fraudResults'
53
65
  raise TypeError, "value '%s' is not a Hash" % [hash['fraudResults']] unless hash['fraudResults'].is_a? Hash
54
66
  @fraud_results = Ingenico::Direct::SDK::Domain::CardFraudResults.new_from_hash(hash['fraudResults'])
@@ -7,10 +7,12 @@ require 'ingenico/direct/sdk/data_object'
7
7
  module Ingenico::Direct::SDK
8
8
  module Domain
9
9
 
10
+ # @attr [Array<String>] expired_card_tokens
10
11
  # @attr [String] hosted_tokenization_id
11
12
  # @attr [Array<String>] invalid_tokens
12
13
  # @attr [String] partial_redirect_url
13
14
  class CreateHostedTokenizationResponse < Ingenico::Direct::SDK::DataObject
15
+ attr_accessor :expired_card_tokens
14
16
  attr_accessor :hosted_tokenization_id
15
17
  attr_accessor :invalid_tokens
16
18
  attr_accessor :partial_redirect_url
@@ -18,6 +20,7 @@ module Ingenico::Direct::SDK
18
20
  # @return (Hash)
19
21
  def to_h
20
22
  hash = super
23
+ hash['expiredCardTokens'] = @expired_card_tokens unless @expired_card_tokens.nil?
21
24
  hash['hostedTokenizationId'] = @hosted_tokenization_id unless @hosted_tokenization_id.nil?
22
25
  hash['invalidTokens'] = @invalid_tokens unless @invalid_tokens.nil?
23
26
  hash['partialRedirectUrl'] = @partial_redirect_url unless @partial_redirect_url.nil?
@@ -26,6 +29,13 @@ module Ingenico::Direct::SDK
26
29
 
27
30
  def from_hash(hash)
28
31
  super
32
+ if hash.key? 'expiredCardTokens'
33
+ raise TypeError, "value '%s' is not an Array" % [hash['expiredCardTokens']] unless hash['expiredCardTokens'].is_a? Array
34
+ @expired_card_tokens = []
35
+ hash['expiredCardTokens'].each do |e|
36
+ @expired_card_tokens << e
37
+ end
38
+ end
29
39
  @hosted_tokenization_id = hash['hostedTokenizationId'] if hash.key? 'hostedTokenizationId'
30
40
  if hash.key? 'invalidTokens'
31
41
  raise TypeError, "value '%s' is not an Array" % [hash['invalidTokens']] unless hash['invalidTokens'].is_a? Array
@@ -7,20 +7,28 @@ require 'ingenico/direct/sdk/data_object'
7
7
  module Ingenico::Direct::SDK
8
8
  module Domain
9
9
 
10
+ # @attr [String] computed_token
10
11
  # @attr [String] gts_computed_token
12
+ # @attr [String] generated_token
11
13
  class ExternalTokenLinked < Ingenico::Direct::SDK::DataObject
14
+ attr_accessor :computed_token
12
15
  attr_accessor :gts_computed_token
16
+ attr_accessor :generated_token
13
17
 
14
18
  # @return (Hash)
15
19
  def to_h
16
20
  hash = super
21
+ hash['ComputedToken'] = @computed_token unless @computed_token.nil?
17
22
  hash['GTSComputedToken'] = @gts_computed_token unless @gts_computed_token.nil?
23
+ hash['GeneratedToken'] = @generated_token unless @generated_token.nil?
18
24
  hash
19
25
  end
20
26
 
21
27
  def from_hash(hash)
22
28
  super
29
+ @computed_token = hash['ComputedToken'] if hash.key? 'ComputedToken'
23
30
  @gts_computed_token = hash['GTSComputedToken'] if hash.key? 'GTSComputedToken'
31
+ @generated_token = hash['GeneratedToken'] if hash.key? 'GeneratedToken'
24
32
  end
25
33
  end
26
34
  end
@@ -0,0 +1,27 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://support.direct.ingenico.com/documentation/api/reference/
4
+ #
5
+ require 'ingenico/direct/sdk/data_object'
6
+
7
+ module Ingenico::Direct::SDK
8
+ module Domain
9
+
10
+ # @attr [String] check_in_date
11
+ class LodgingData < Ingenico::Direct::SDK::DataObject
12
+ attr_accessor :check_in_date
13
+
14
+ # @return (Hash)
15
+ def to_h
16
+ hash = super
17
+ hash['checkInDate'] = @check_in_date unless @check_in_date.nil?
18
+ hash
19
+ end
20
+
21
+ def from_hash(hash)
22
+ super
23
+ @check_in_date = hash['checkInDate'] if hash.key? 'checkInDate'
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,59 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://support.direct.ingenico.com/documentation/api/reference/
4
+ #
5
+ require 'ingenico/direct/sdk/data_object'
6
+ require 'ingenico/direct/sdk/domain/amount_of_money'
7
+ require 'ingenico/direct/sdk/domain/payment_references'
8
+ require 'ingenico/direct/sdk/domain/payment_status_output'
9
+
10
+ module Ingenico::Direct::SDK
11
+ module Domain
12
+
13
+ # @attr [Ingenico::Direct::SDK::Domain::AmountOfMoney] amount_of_money
14
+ # @attr [String] id
15
+ # @attr [String] payment_method
16
+ # @attr [Ingenico::Direct::SDK::Domain::PaymentReferences] references
17
+ # @attr [String] status
18
+ # @attr [Ingenico::Direct::SDK::Domain::PaymentStatusOutput] status_output
19
+ class OperationOutput < Ingenico::Direct::SDK::DataObject
20
+ attr_accessor :amount_of_money
21
+ attr_accessor :id
22
+ attr_accessor :payment_method
23
+ attr_accessor :references
24
+ attr_accessor :status
25
+ attr_accessor :status_output
26
+
27
+ # @return (Hash)
28
+ def to_h
29
+ hash = super
30
+ hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money
31
+ hash['id'] = @id unless @id.nil?
32
+ hash['paymentMethod'] = @payment_method unless @payment_method.nil?
33
+ hash['references'] = @references.to_h if @references
34
+ hash['status'] = @status unless @status.nil?
35
+ hash['statusOutput'] = @status_output.to_h if @status_output
36
+ hash
37
+ end
38
+
39
+ def from_hash(hash)
40
+ super
41
+ if hash.key? 'amountOfMoney'
42
+ raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
43
+ @amount_of_money = Ingenico::Direct::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
44
+ end
45
+ @id = hash['id'] if hash.key? 'id'
46
+ @payment_method = hash['paymentMethod'] if hash.key? 'paymentMethod'
47
+ if hash.key? 'references'
48
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
49
+ @references = Ingenico::Direct::SDK::Domain::PaymentReferences.new_from_hash(hash['references'])
50
+ end
51
+ @status = hash['status'] if hash.key? 'status'
52
+ if hash.key? 'statusOutput'
53
+ raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash
54
+ @status_output = Ingenico::Direct::SDK::Domain::PaymentStatusOutput.new_from_hash(hash['statusOutput'])
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -8,15 +8,18 @@ module Ingenico::Direct::SDK
8
8
  module Domain
9
9
 
10
10
  # @attr [String] descriptor
11
+ # @attr [String] merchant_parameters
11
12
  # @attr [String] merchant_reference
12
13
  class OrderReferences < Ingenico::Direct::SDK::DataObject
13
14
  attr_accessor :descriptor
15
+ attr_accessor :merchant_parameters
14
16
  attr_accessor :merchant_reference
15
17
 
16
18
  # @return (Hash)
17
19
  def to_h
18
20
  hash = super
19
21
  hash['descriptor'] = @descriptor unless @descriptor.nil?
22
+ hash['merchantParameters'] = @merchant_parameters unless @merchant_parameters.nil?
20
23
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
21
24
  hash
22
25
  end
@@ -24,6 +27,7 @@ module Ingenico::Direct::SDK
24
27
  def from_hash(hash)
25
28
  super
26
29
  @descriptor = hash['descriptor'] if hash.key? 'descriptor'
30
+ @merchant_parameters = hash['merchantParameters'] if hash.key? 'merchantParameters'
27
31
  @merchant_reference = hash['merchantReference'] if hash.key? 'merchantReference'
28
32
  end
29
33
  end
@@ -0,0 +1,66 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://support.direct.ingenico.com/documentation/api/reference/
4
+ #
5
+ require 'ingenico/direct/sdk/data_object'
6
+ require 'ingenico/direct/sdk/domain/hosted_checkout_specific_output'
7
+ require 'ingenico/direct/sdk/domain/operation_output'
8
+ require 'ingenico/direct/sdk/domain/payment_output'
9
+ require 'ingenico/direct/sdk/domain/payment_status_output'
10
+
11
+ module Ingenico::Direct::SDK
12
+ module Domain
13
+
14
+ # @attr [Array<Ingenico::Direct::SDK::Domain::OperationOutput>] operations
15
+ # @attr [Ingenico::Direct::SDK::Domain::HostedCheckoutSpecificOutput] hosted_checkout_specific_output
16
+ # @attr [String] id
17
+ # @attr [Ingenico::Direct::SDK::Domain::PaymentOutput] payment_output
18
+ # @attr [String] status
19
+ # @attr [Ingenico::Direct::SDK::Domain::PaymentStatusOutput] status_output
20
+ class PaymentDetailsResponse < Ingenico::Direct::SDK::DataObject
21
+ attr_accessor :operations
22
+ attr_accessor :hosted_checkout_specific_output
23
+ attr_accessor :id
24
+ attr_accessor :payment_output
25
+ attr_accessor :status
26
+ attr_accessor :status_output
27
+
28
+ # @return (Hash)
29
+ def to_h
30
+ hash = super
31
+ hash['Operations'] = @operations.collect(&:to_h) if @operations
32
+ hash['hostedCheckoutSpecificOutput'] = @hosted_checkout_specific_output.to_h if @hosted_checkout_specific_output
33
+ hash['id'] = @id unless @id.nil?
34
+ hash['paymentOutput'] = @payment_output.to_h if @payment_output
35
+ hash['status'] = @status unless @status.nil?
36
+ hash['statusOutput'] = @status_output.to_h if @status_output
37
+ hash
38
+ end
39
+
40
+ def from_hash(hash)
41
+ super
42
+ if hash.key? 'Operations'
43
+ raise TypeError, "value '%s' is not an Array" % [hash['Operations']] unless hash['Operations'].is_a? Array
44
+ @operations = []
45
+ hash['Operations'].each do |e|
46
+ @operations << Ingenico::Direct::SDK::Domain::OperationOutput.new_from_hash(e)
47
+ end
48
+ end
49
+ if hash.key? 'hostedCheckoutSpecificOutput'
50
+ raise TypeError, "value '%s' is not a Hash" % [hash['hostedCheckoutSpecificOutput']] unless hash['hostedCheckoutSpecificOutput'].is_a? Hash
51
+ @hosted_checkout_specific_output = Ingenico::Direct::SDK::Domain::HostedCheckoutSpecificOutput.new_from_hash(hash['hostedCheckoutSpecificOutput'])
52
+ end
53
+ @id = hash['id'] if hash.key? 'id'
54
+ if hash.key? 'paymentOutput'
55
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentOutput']] unless hash['paymentOutput'].is_a? Hash
56
+ @payment_output = Ingenico::Direct::SDK::Domain::PaymentOutput.new_from_hash(hash['paymentOutput'])
57
+ end
58
+ @status = hash['status'] if hash.key? 'status'
59
+ if hash.key? 'statusOutput'
60
+ raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash
61
+ @status_output = Ingenico::Direct::SDK::Domain::PaymentStatusOutput.new_from_hash(hash['statusOutput'])
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -16,6 +16,7 @@ module Ingenico::Direct::SDK
16
16
  # @attr [true/false] allows_recurring
17
17
  # @attr [true/false] allows_tokenization
18
18
  # @attr [Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints] display_hints
19
+ # @attr [Array<Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints>] display_hints_list
19
20
  # @attr [Array<Ingenico::Direct::SDK::Domain::PaymentProductField>] fields
20
21
  # @attr [Integer] id
21
22
  # @attr [String] payment_method
@@ -28,6 +29,7 @@ module Ingenico::Direct::SDK
28
29
  attr_accessor :allows_recurring
29
30
  attr_accessor :allows_tokenization
30
31
  attr_accessor :display_hints
32
+ attr_accessor :display_hints_list
31
33
  attr_accessor :fields
32
34
  attr_accessor :id
33
35
  attr_accessor :payment_method
@@ -43,6 +45,7 @@ module Ingenico::Direct::SDK
43
45
  hash['allowsRecurring'] = @allows_recurring unless @allows_recurring.nil?
44
46
  hash['allowsTokenization'] = @allows_tokenization unless @allows_tokenization.nil?
45
47
  hash['displayHints'] = @display_hints.to_h if @display_hints
48
+ hash['displayHintsList'] = @display_hints_list.collect(&:to_h) if @display_hints_list
46
49
  hash['fields'] = @fields.collect(&:to_h) if @fields
47
50
  hash['id'] = @id unless @id.nil?
48
51
  hash['paymentMethod'] = @payment_method unless @payment_method.nil?
@@ -68,6 +71,13 @@ module Ingenico::Direct::SDK
68
71
  raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash
69
72
  @display_hints = Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints.new_from_hash(hash['displayHints'])
70
73
  end
74
+ if hash.key? 'displayHintsList'
75
+ raise TypeError, "value '%s' is not an Array" % [hash['displayHintsList']] unless hash['displayHintsList'].is_a? Array
76
+ @display_hints_list = []
77
+ hash['displayHintsList'].each do |e|
78
+ @display_hints_list << Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints.new_from_hash(e)
79
+ end
80
+ end
71
81
  if hash.key? 'fields'
72
82
  raise TypeError, "value '%s' is not an Array" % [hash['fields']] unless hash['fields'].is_a? Array
73
83
  @fields = []
@@ -11,10 +11,12 @@ module Ingenico::Direct::SDK
11
11
 
12
12
  # @attr [Ingenico::Direct::SDK::Domain::AccountOnFile] account_on_file
13
13
  # @attr [Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints] display_hints
14
+ # @attr [Array<Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints>] display_hints_list
14
15
  # @attr [String] id
15
16
  class PaymentProductGroup < Ingenico::Direct::SDK::DataObject
16
17
  attr_accessor :account_on_file
17
18
  attr_accessor :display_hints
19
+ attr_accessor :display_hints_list
18
20
  attr_accessor :id
19
21
 
20
22
  # @return (Hash)
@@ -22,6 +24,7 @@ module Ingenico::Direct::SDK
22
24
  hash = super
23
25
  hash['accountOnFile'] = @account_on_file.to_h if @account_on_file
24
26
  hash['displayHints'] = @display_hints.to_h if @display_hints
27
+ hash['displayHintsList'] = @display_hints_list.collect(&:to_h) if @display_hints_list
25
28
  hash['id'] = @id unless @id.nil?
26
29
  hash
27
30
  end
@@ -36,6 +39,13 @@ module Ingenico::Direct::SDK
36
39
  raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash
37
40
  @display_hints = Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints.new_from_hash(hash['displayHints'])
38
41
  end
42
+ if hash.key? 'displayHintsList'
43
+ raise TypeError, "value '%s' is not an Array" % [hash['displayHintsList']] unless hash['displayHintsList'].is_a? Array
44
+ @display_hints_list = []
45
+ hash['displayHintsList'].each do |e|
46
+ @display_hints_list << Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints.new_from_hash(e)
47
+ end
48
+ end
39
49
  @id = hash['id'] if hash.key? 'id'
40
50
  end
41
51
  end
@@ -7,19 +7,23 @@ require 'ingenico/direct/sdk/data_object'
7
7
  module Ingenico::Direct::SDK
8
8
  module Domain
9
9
 
10
+ # @attr [String] merchant_parameters
10
11
  # @attr [String] merchant_reference
11
12
  class PaymentReferences < Ingenico::Direct::SDK::DataObject
13
+ attr_accessor :merchant_parameters
12
14
  attr_accessor :merchant_reference
13
15
 
14
16
  # @return (Hash)
15
17
  def to_h
16
18
  hash = super
19
+ hash['merchantParameters'] = @merchant_parameters unless @merchant_parameters.nil?
17
20
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
18
21
  hash
19
22
  end
20
23
 
21
24
  def from_hash(hash)
22
25
  super
26
+ @merchant_parameters = hash['merchantParameters'] if hash.key? 'merchantParameters'
23
27
  @merchant_reference = hash['merchantReference'] if hash.key? 'merchantReference'
24
28
  end
25
29
  end
@@ -4,18 +4,22 @@
4
4
  #
5
5
  require 'ingenico/direct/sdk/data_object'
6
6
  require 'ingenico/direct/sdk/domain/amount_of_money'
7
+ require 'ingenico/direct/sdk/domain/payment_references'
7
8
 
8
9
  module Ingenico::Direct::SDK
9
10
  module Domain
10
11
 
11
12
  # @attr [Ingenico::Direct::SDK::Domain::AmountOfMoney] amount_of_money
13
+ # @attr [Ingenico::Direct::SDK::Domain::PaymentReferences] references
12
14
  class RefundRequest < Ingenico::Direct::SDK::DataObject
13
15
  attr_accessor :amount_of_money
16
+ attr_accessor :references
14
17
 
15
18
  # @return (Hash)
16
19
  def to_h
17
20
  hash = super
18
21
  hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money
22
+ hash['references'] = @references.to_h if @references
19
23
  hash
20
24
  end
21
25
 
@@ -25,6 +29,10 @@ module Ingenico::Direct::SDK
25
29
  raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
26
30
  @amount_of_money = Ingenico::Direct::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
27
31
  end
32
+ if hash.key? 'references'
33
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
34
+ @references = Ingenico::Direct::SDK::Domain::PaymentReferences.new_from_hash(hash['references'])
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -10,6 +10,7 @@ require 'ingenico/direct/sdk/domain/three_d_secure_data'
10
10
  module Ingenico::Direct::SDK
11
11
  module Domain
12
12
 
13
+ # @attr [Long] authentication_amount
13
14
  # @attr [String] challenge_canvas_size
14
15
  # @attr [String] challenge_indicator
15
16
  # @attr [String] exemption_request
@@ -21,6 +22,7 @@ module Ingenico::Direct::SDK
21
22
  # @attr [true/false] skip_authentication
22
23
  # @attr [true/false] skip_soft_decline
23
24
  class ThreeDSecure < Ingenico::Direct::SDK::DataObject
25
+ attr_accessor :authentication_amount
24
26
  attr_accessor :challenge_canvas_size
25
27
  attr_accessor :challenge_indicator
26
28
  attr_accessor :exemption_request
@@ -35,6 +37,7 @@ module Ingenico::Direct::SDK
35
37
  # @return (Hash)
36
38
  def to_h
37
39
  hash = super
40
+ hash['authenticationAmount'] = @authentication_amount unless @authentication_amount.nil?
38
41
  hash['challengeCanvasSize'] = @challenge_canvas_size unless @challenge_canvas_size.nil?
39
42
  hash['challengeIndicator'] = @challenge_indicator unless @challenge_indicator.nil?
40
43
  hash['exemptionRequest'] = @exemption_request unless @exemption_request.nil?
@@ -50,6 +53,7 @@ module Ingenico::Direct::SDK
50
53
 
51
54
  def from_hash(hash)
52
55
  super
56
+ @authentication_amount = hash['authenticationAmount'] if hash.key? 'authenticationAmount'
53
57
  @challenge_canvas_size = hash['challengeCanvasSize'] if hash.key? 'challengeCanvasSize'
54
58
  @challenge_indicator = hash['challengeIndicator'] if hash.key? 'challengeIndicator'
55
59
  @exemption_request = hash['exemptionRequest'] if hash.key? 'exemptionRequest'
@@ -25,22 +25,16 @@ module Ingenico::Direct::SDK
25
25
  super(parent, path_context)
26
26
  end
27
27
 
28
- # Resource /v2/!{merchantId}/products
29
- # @return [Ingenico::Direct::SDK::Merchant::Products::ProductsClient]
30
- def products
31
- Ingenico::Direct::SDK::Merchant::Products::ProductsClient.new(self, nil)
32
- end
33
-
34
- # Resource /v2/!{merchantId}/sessions
35
- # @return [Ingenico::Direct::SDK::Merchant::Sessions::SessionsClient]
36
- def sessions
37
- Ingenico::Direct::SDK::Merchant::Sessions::SessionsClient.new(self, nil)
28
+ # Resource /v2/!{merchantId}/hostedcheckouts
29
+ # @return [Ingenico::Direct::SDK::Merchant::HostedCheckout::HostedCheckoutClient]
30
+ def hosted_checkout
31
+ Ingenico::Direct::SDK::Merchant::HostedCheckout::HostedCheckoutClient.new(self, nil)
38
32
  end
39
33
 
40
- # Resource /v2/!{merchantId}/payouts
41
- # @return [Ingenico::Direct::SDK::Merchant::Payouts::PayoutsClient]
42
- def payouts
43
- Ingenico::Direct::SDK::Merchant::Payouts::PayoutsClient.new(self, nil)
34
+ # Resource /v2/!{merchantId}/hostedtokenizations
35
+ # @return [Ingenico::Direct::SDK::Merchant::HostedTokenization::HostedTokenizationClient]
36
+ def hosted_tokenization
37
+ Ingenico::Direct::SDK::Merchant::HostedTokenization::HostedTokenizationClient.new(self, nil)
44
38
  end
45
39
 
46
40
  # Resource /v2/!{merchantId}/payments
@@ -49,10 +43,10 @@ module Ingenico::Direct::SDK
49
43
  Ingenico::Direct::SDK::Merchant::Payments::PaymentsClient.new(self, nil)
50
44
  end
51
45
 
52
- # Resource /v2/!{merchantId}/services
53
- # @return [Ingenico::Direct::SDK::Merchant::Services::ServicesClient]
54
- def services
55
- Ingenico::Direct::SDK::Merchant::Services::ServicesClient.new(self, nil)
46
+ # Resource /v2/!{merchantId}/payouts
47
+ # @return [Ingenico::Direct::SDK::Merchant::Payouts::PayoutsClient]
48
+ def payouts
49
+ Ingenico::Direct::SDK::Merchant::Payouts::PayoutsClient.new(self, nil)
56
50
  end
57
51
 
58
52
  # Resource /v2/!{merchantId}/productgroups
@@ -61,10 +55,22 @@ module Ingenico::Direct::SDK
61
55
  Ingenico::Direct::SDK::Merchant::ProductGroups::ProductGroupsClient.new(self, nil)
62
56
  end
63
57
 
64
- # Resource /v2/!{merchantId}/hostedtokenizations
65
- # @return [Ingenico::Direct::SDK::Merchant::HostedTokenization::HostedTokenizationClient]
66
- def hosted_tokenization
67
- Ingenico::Direct::SDK::Merchant::HostedTokenization::HostedTokenizationClient.new(self, nil)
58
+ # Resource /v2/!{merchantId}/products
59
+ # @return [Ingenico::Direct::SDK::Merchant::Products::ProductsClient]
60
+ def products
61
+ Ingenico::Direct::SDK::Merchant::Products::ProductsClient.new(self, nil)
62
+ end
63
+
64
+ # Resource /v2/!{merchantId}/services
65
+ # @return [Ingenico::Direct::SDK::Merchant::Services::ServicesClient]
66
+ def services
67
+ Ingenico::Direct::SDK::Merchant::Services::ServicesClient.new(self, nil)
68
+ end
69
+
70
+ # Resource /v2/!{merchantId}/sessions
71
+ # @return [Ingenico::Direct::SDK::Merchant::Sessions::SessionsClient]
72
+ def sessions
73
+ Ingenico::Direct::SDK::Merchant::Sessions::SessionsClient.new(self, nil)
68
74
  end
69
75
 
70
76
  # Resource /v2/!{merchantId}/tokens
@@ -72,12 +78,6 @@ module Ingenico::Direct::SDK
72
78
  def tokens
73
79
  Ingenico::Direct::SDK::Merchant::Tokens::TokensClient.new(self, nil)
74
80
  end
75
-
76
- # Resource /v2/!{merchantId}/hostedcheckouts
77
- # @return [Ingenico::Direct::SDK::Merchant::HostedCheckout::HostedCheckoutClient]
78
- def hosted_checkout
79
- Ingenico::Direct::SDK::Merchant::HostedCheckout::HostedCheckoutClient.new(self, nil)
80
- end
81
81
  end
82
82
  end
83
83
  end
@@ -13,6 +13,7 @@ require 'ingenico/direct/sdk/domain/complete_payment_response'
13
13
  require 'ingenico/direct/sdk/domain/create_payment_request'
14
14
  require 'ingenico/direct/sdk/domain/create_payment_response'
15
15
  require 'ingenico/direct/sdk/domain/error_response'
16
+ require 'ingenico/direct/sdk/domain/payment_details_response'
16
17
  require 'ingenico/direct/sdk/domain/payment_error_response'
17
18
  require 'ingenico/direct/sdk/domain/payment_response'
18
19
  require 'ingenico/direct/sdk/domain/refund_error_response'
@@ -255,6 +256,37 @@ module Ingenico::Direct::SDK
255
256
  raise create_exception(e.status_code, e.body, error_object, context)
256
257
  end
257
258
 
259
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/details - {https://support.direct.ingenico.com/documentation/api/reference#operation/GetPaymentDetailsApi Get payment details}
260
+ # @param payment_id [String]
261
+ # @param context [Ingenico::Direct::SDK::CallContext]
262
+ # @return [Ingenico::Direct::SDK::Domain::PaymentDetailsResponse]
263
+ # @raise [Ingenico::Direct::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
264
+ # @raise [Ingenico::Direct::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
265
+ # @raise [Ingenico::Direct::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
266
+ # @raise [Ingenico::Direct::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
267
+ # or there was a conflict (HTTP status code 404, 409 or 410)
268
+ # @raise [Ingenico::Direct::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
269
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
270
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
271
+ # @raise [Ingenico::Direct::SDK::ApiException]if the Ingenico ePayments platform returned any other error
272
+ def get_payment_details(payment_id, context = nil)
273
+ path_context = {
274
+ 'paymentId'.freeze => payment_id,
275
+ }
276
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/details', path_context)
277
+ @communicator.get(
278
+ uri,
279
+ client_headers,
280
+ nil,
281
+ Ingenico::Direct::SDK::Domain::PaymentDetailsResponse,
282
+ context
283
+ )
284
+ rescue ResponseException => e
285
+ error_type = Ingenico::Direct::SDK::Domain::ErrorResponse
286
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
287
+ raise create_exception(e.status_code, e.body, error_object, context)
288
+ end
289
+
258
290
  # Resource /v2/!{merchantId}/payments/!{paymentId}/refunds - {https://support.direct.ingenico.com/documentation/api/reference#operation/GetRefundsApi Get Refunds Api}
259
291
  # @param payment_id [String]
260
292
  # @param context [Ingenico::Direct::SDK::CallContext]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: direct-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.7.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-06-29 00:00:00.000000000 Z
11
+ date: 2021-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -224,12 +224,14 @@ files:
224
224
  - lib/ingenico/direct/sdk/domain/line_item.rb
225
225
  - lib/ingenico/direct/sdk/domain/line_item_invoice_data.rb
226
226
  - lib/ingenico/direct/sdk/domain/loan_recipient.rb
227
+ - lib/ingenico/direct/sdk/domain/lodging_data.rb
227
228
  - lib/ingenico/direct/sdk/domain/merchant_action.rb
228
229
  - lib/ingenico/direct/sdk/domain/mobile_payment_data.rb
229
230
  - lib/ingenico/direct/sdk/domain/mobile_payment_method_hosted_checkout_specific_input.rb
230
231
  - lib/ingenico/direct/sdk/domain/mobile_payment_method_specific_input.rb
231
232
  - lib/ingenico/direct/sdk/domain/mobile_payment_method_specific_output.rb
232
233
  - lib/ingenico/direct/sdk/domain/mobile_payment_product320_specific_input.rb
234
+ - lib/ingenico/direct/sdk/domain/operation_output.rb
233
235
  - lib/ingenico/direct/sdk/domain/order.rb
234
236
  - lib/ingenico/direct/sdk/domain/order_line_details.rb
235
237
  - lib/ingenico/direct/sdk/domain/order_references.rb
@@ -238,6 +240,7 @@ files:
238
240
  - lib/ingenico/direct/sdk/domain/payment_account_on_file.rb
239
241
  - lib/ingenico/direct/sdk/domain/payment_context.rb
240
242
  - lib/ingenico/direct/sdk/domain/payment_creation_output.rb
243
+ - lib/ingenico/direct/sdk/domain/payment_details_response.rb
241
244
  - lib/ingenico/direct/sdk/domain/payment_error_response.rb
242
245
  - lib/ingenico/direct/sdk/domain/payment_output.rb
243
246
  - lib/ingenico/direct/sdk/domain/payment_product.rb