direct-sdk-ruby 1.2.0 → 1.6.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: 9cca7811f8c12b5e503c5b6a41956fde1b930e4c0673307c86d125c8970e32f3
4
- data.tar.gz: 3de1950b8190b66188b053b5011dd69e1a4d29b5052d58e858db7b29b0014fbd
3
+ metadata.gz: cb17a610c0fb3905e0e3d7dd8e6db33920a263eaeeddd2d78d40e3ffa598f6c2
4
+ data.tar.gz: e154fca29cce669b3334129151efc2d89210c43531c46d7d61474b2f7309e9f3
5
5
  SHA512:
6
- metadata.gz: 350075b2c0a98a06245ab738b3724b887c3cf11f602cb70ff057fff87882e3deeb9153a4683bf56fa6bfcc155d77a7f95d7e96c635460f0dde8251425efa45a8
7
- data.tar.gz: cb1555157903e1eef77ca7b18e9008a96985d0d67ec89d4aca43112f72942f2ff6f1f68dff3f94d14bb8bab0204af64044ef86179f42196975ad79d7d98abf1d
6
+ metadata.gz: d828e4c95a47a72161750b7886a0458c8bffe03f4d80d65c0518ff23b34718f8a1bed63a247e76d6b99f5fa87a2b07a9c585bdf45e6e3c235ea9a04d9e570f2e
7
+ data.tar.gz: 90f994b1b9f1f47064355a963cc02570910dbf35789e77d3b71bcb49ed63d194e60971104a57077d6f9c4febcc2da19939c911c2e65d3f252fcdac3cabee49fe
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'direct-sdk-ruby'
3
- spec.version = '1.2.0'
3
+ spec.version = '1.6.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,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
@@ -3,26 +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/card_payment_method_specific_input_for_hosted_checkout'
7
6
  require 'ingenico/direct/sdk/domain/payment_product_filters_hosted_checkout'
8
7
 
9
8
  module Ingenico::Direct::SDK
10
9
  module Domain
11
10
 
12
- # @attr [Ingenico::Direct::SDK::Domain::CardPaymentMethodSpecificInputForHostedCheckout] card_payment_method_specific_input
13
11
  # @attr [true/false] is_recurring
14
12
  # @attr [String] locale
15
13
  # @attr [Ingenico::Direct::SDK::Domain::PaymentProductFiltersHostedCheckout] payment_product_filters
16
14
  # @attr [String] return_url
15
+ # @attr [Integer] session_timeout
17
16
  # @attr [true/false] show_result_page
18
17
  # @attr [String] tokens
19
18
  # @attr [String] variant
20
19
  class HostedCheckoutSpecificInput < Ingenico::Direct::SDK::DataObject
21
- attr_accessor :card_payment_method_specific_input
22
20
  attr_accessor :is_recurring
23
21
  attr_accessor :locale
24
22
  attr_accessor :payment_product_filters
25
23
  attr_accessor :return_url
24
+ attr_accessor :session_timeout
26
25
  attr_accessor :show_result_page
27
26
  attr_accessor :tokens
28
27
  attr_accessor :variant
@@ -30,11 +29,11 @@ module Ingenico::Direct::SDK
30
29
  # @return (Hash)
31
30
  def to_h
32
31
  hash = super
33
- hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h if @card_payment_method_specific_input
34
32
  hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
35
33
  hash['locale'] = @locale unless @locale.nil?
36
34
  hash['paymentProductFilters'] = @payment_product_filters.to_h if @payment_product_filters
37
35
  hash['returnUrl'] = @return_url unless @return_url.nil?
36
+ hash['sessionTimeout'] = @session_timeout unless @session_timeout.nil?
38
37
  hash['showResultPage'] = @show_result_page unless @show_result_page.nil?
39
38
  hash['tokens'] = @tokens unless @tokens.nil?
40
39
  hash['variant'] = @variant unless @variant.nil?
@@ -43,10 +42,6 @@ module Ingenico::Direct::SDK
43
42
 
44
43
  def from_hash(hash)
45
44
  super
46
- if hash.key? 'cardPaymentMethodSpecificInput'
47
- raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']] unless hash['cardPaymentMethodSpecificInput'].is_a? Hash
48
- @card_payment_method_specific_input = Ingenico::Direct::SDK::Domain::CardPaymentMethodSpecificInputForHostedCheckout.new_from_hash(hash['cardPaymentMethodSpecificInput'])
49
- end
50
45
  @is_recurring = hash['isRecurring'] if hash.key? 'isRecurring'
51
46
  @locale = hash['locale'] if hash.key? 'locale'
52
47
  if hash.key? 'paymentProductFilters'
@@ -54,6 +49,7 @@ module Ingenico::Direct::SDK
54
49
  @payment_product_filters = Ingenico::Direct::SDK::Domain::PaymentProductFiltersHostedCheckout.new_from_hash(hash['paymentProductFilters'])
55
50
  end
56
51
  @return_url = hash['returnUrl'] if hash.key? 'returnUrl'
52
+ @session_timeout = hash['sessionTimeout'] if hash.key? 'sessionTimeout'
57
53
  @show_result_page = hash['showResultPage'] if hash.key? 'showResultPage'
58
54
  @tokens = hash['tokens'] if hash.key? 'tokens'
59
55
  @variant = hash['variant'] if hash.key? 'variant'
@@ -7,20 +7,20 @@ require 'ingenico/direct/sdk/data_object'
7
7
  module Ingenico::Direct::SDK
8
8
  module Domain
9
9
 
10
- # @attr [true/false] group_cards
11
- class CardPaymentMethodSpecificInputForHostedCheckout < Ingenico::Direct::SDK::DataObject
12
- attr_accessor :group_cards
10
+ # @attr [String] check_in_date
11
+ class LodgingData < Ingenico::Direct::SDK::DataObject
12
+ attr_accessor :check_in_date
13
13
 
14
14
  # @return (Hash)
15
15
  def to_h
16
16
  hash = super
17
- hash['groupCards'] = @group_cards unless @group_cards.nil?
17
+ hash['checkInDate'] = @check_in_date unless @check_in_date.nil?
18
18
  hash
19
19
  end
20
20
 
21
21
  def from_hash(hash)
22
22
  super
23
- @group_cards = hash['groupCards'] if hash.key? 'groupCards'
23
+ @check_in_date = hash['checkInDate'] if hash.key? 'checkInDate'
24
24
  end
25
25
  end
26
26
  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
@@ -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 = []
@@ -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] gateway
10
11
  # @attr [Array<String>] networks
11
12
  class PaymentProduct320SpecificData < Ingenico::Direct::SDK::DataObject
13
+ attr_accessor :gateway
12
14
  attr_accessor :networks
13
15
 
14
16
  # @return (Hash)
15
17
  def to_h
16
18
  hash = super
19
+ hash['gateway'] = @gateway unless @gateway.nil?
17
20
  hash['networks'] = @networks unless @networks.nil?
18
21
  hash
19
22
  end
20
23
 
21
24
  def from_hash(hash)
22
25
  super
26
+ @gateway = hash['gateway'] if hash.key? 'gateway'
23
27
  if hash.key? 'networks'
24
28
  raise TypeError, "value '%s' is not an Array" % [hash['networks']] unless hash['networks'].is_a? Array
25
29
  @networks = []
@@ -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
@@ -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'
@@ -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.2.0
4
+ version: 1.6.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-22 00:00:00.000000000 Z
11
+ date: 2021-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -174,7 +174,6 @@ files:
174
174
  - lib/ingenico/direct/sdk/domain/card_fraud_results.rb
175
175
  - lib/ingenico/direct/sdk/domain/card_payment_method_specific_input.rb
176
176
  - lib/ingenico/direct/sdk/domain/card_payment_method_specific_input_base.rb
177
- - lib/ingenico/direct/sdk/domain/card_payment_method_specific_input_for_hosted_checkout.rb
178
177
  - lib/ingenico/direct/sdk/domain/card_payment_method_specific_output.rb
179
178
  - lib/ingenico/direct/sdk/domain/card_payout_method_specific_input.rb
180
179
  - lib/ingenico/direct/sdk/domain/card_recurrence_details.rb
@@ -225,12 +224,14 @@ files:
225
224
  - lib/ingenico/direct/sdk/domain/line_item.rb
226
225
  - lib/ingenico/direct/sdk/domain/line_item_invoice_data.rb
227
226
  - lib/ingenico/direct/sdk/domain/loan_recipient.rb
227
+ - lib/ingenico/direct/sdk/domain/lodging_data.rb
228
228
  - lib/ingenico/direct/sdk/domain/merchant_action.rb
229
229
  - lib/ingenico/direct/sdk/domain/mobile_payment_data.rb
230
230
  - lib/ingenico/direct/sdk/domain/mobile_payment_method_hosted_checkout_specific_input.rb
231
231
  - lib/ingenico/direct/sdk/domain/mobile_payment_method_specific_input.rb
232
232
  - lib/ingenico/direct/sdk/domain/mobile_payment_method_specific_output.rb
233
233
  - lib/ingenico/direct/sdk/domain/mobile_payment_product320_specific_input.rb
234
+ - lib/ingenico/direct/sdk/domain/operation_output.rb
234
235
  - lib/ingenico/direct/sdk/domain/order.rb
235
236
  - lib/ingenico/direct/sdk/domain/order_line_details.rb
236
237
  - lib/ingenico/direct/sdk/domain/order_references.rb
@@ -239,6 +240,7 @@ files:
239
240
  - lib/ingenico/direct/sdk/domain/payment_account_on_file.rb
240
241
  - lib/ingenico/direct/sdk/domain/payment_context.rb
241
242
  - lib/ingenico/direct/sdk/domain/payment_creation_output.rb
243
+ - lib/ingenico/direct/sdk/domain/payment_details_response.rb
242
244
  - lib/ingenico/direct/sdk/domain/payment_error_response.rb
243
245
  - lib/ingenico/direct/sdk/domain/payment_output.rb
244
246
  - lib/ingenico/direct/sdk/domain/payment_product.rb