connect-sdk-ruby 1.11.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/connect-sdk-ruby.gemspec +1 -1
  3. data/examples/merchant/products/get_customer_details_example.rb +38 -0
  4. data/lib/ingenico/connect/sdk/domain/capture/capture_output.rb +11 -0
  5. data/lib/ingenico/connect/sdk/domain/payment/create_payment_request.rb +11 -0
  6. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input.rb +49 -0
  7. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_output.rb +35 -0
  8. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_input.rb +42 -0
  9. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_output.rb +31 -0
  10. data/lib/ingenico/connect/sdk/domain/payment/order_line_details.rb +14 -0
  11. data/lib/ingenico/connect/sdk/domain/payment/payment_output.rb +11 -0
  12. data/lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb +45 -0
  13. data/lib/ingenico/connect/sdk/domain/product/get_customer_details_response.rb +94 -0
  14. data/lib/ingenico/connect/sdk/domain/product/payment_product.rb +7 -0
  15. data/lib/ingenico/connect/sdk/domain/product/payment_product_field.rb +7 -0
  16. data/lib/ingenico/connect/sdk/domain/product/payment_product_field_display_element.rb +45 -0
  17. data/lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb +7 -0
  18. data/lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb +16 -0
  19. data/lib/ingenico/connect/sdk/merchant/products/products_client.rb +35 -0
  20. data/lib/ingenico/connect/sdk/meta_data_provider.rb +1 -1
  21. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fa93ae1a0b1906f29848bd7f0e49d386e6eadc4
4
- data.tar.gz: 99851487ac294d01a1a5cf6c10c341f34d85ffcc
3
+ metadata.gz: 878a7c505429391350c874631ebae262a112539f
4
+ data.tar.gz: 9049d2000576c76c1dce0928543cc76a78e20225
5
5
  SHA512:
6
- metadata.gz: 37564db3a6955c8e1df86872064921abba401c943593d962572c6c51060df55c36623c3a1b8269bd9eaa83fc813c0682c5ad353e8cd925164a99fca8c080a057
7
- data.tar.gz: e03cfab1c45a7f6f990486688abffe3890aced5d64c40eb8d1fd0537b28f086689ee45d17fa67436c4178bf3227494ba3f2897e8167a00439be143673e6cb072
6
+ metadata.gz: 2ebd749be5d4c3a3992ca605bff3156e7aca76e74bcf30dc12965890b035b738c089ea80aaabc0a412f22b803f44995d7f3fc0761cb12a92763891b2f633fb1c
7
+ data.tar.gz: ff278fea60d81c48c82716ef7cc5b5c62b62ed7de80db81b4f9cf947d77c4e27456385ae277d1c4c9146fb3f535ce59c76f29037b6b189b5f54b2b07b05f83fc
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '1.11.0'
3
+ spec.version = '1.12.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}
@@ -0,0 +1,38 @@
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/factory'
6
+ require 'ingenico/connect/sdk/domain/definitions/key_value_pair'
7
+ require 'ingenico/connect/sdk/domain/product/get_customer_details_request'
8
+
9
+ Definitions = Ingenico::Connect::SDK::Domain::Definitions
10
+ Product = Ingenico::Connect::SDK::Domain::Product
11
+
12
+ def example
13
+ get_client do |client|
14
+ values = []
15
+
16
+ value1 = Definitions::KeyValuePair.new
17
+ value1.key = 'fiscalNumber'
18
+ value1.value = '01234567890'
19
+
20
+ values << value1
21
+
22
+ body = Product::GetCustomerDetailsRequest.new
23
+ body.country_code = 'SE'
24
+ body.values = values
25
+
26
+ response = client.merchant('merchantId').products().customer_details(1, body)
27
+ end
28
+ end
29
+
30
+ def get_client
31
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
32
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
33
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
34
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
35
+ ensure
36
+ # Free networking resources when done
37
+ client.close unless client.nil?
38
+ end
@@ -5,6 +5,7 @@
5
5
  require 'ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_output'
6
6
  require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_output'
7
7
  require 'ingenico/connect/sdk/domain/payment/cash_payment_method_specific_output'
8
+ require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_output'
8
9
  require 'ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_output'
9
10
  require 'ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_output'
10
11
  require 'ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_output'
@@ -33,6 +34,9 @@ module Ingenico::Connect::SDK
33
34
  # {Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentMethodSpecificOutput}
34
35
  attr_accessor :direct_debit_payment_method_specific_output
35
36
 
37
+ # {Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificOutput}
38
+ attr_accessor :e_invoice_payment_method_specific_output
39
+
36
40
  # {Ingenico::Connect::SDK::Domain::Payment::InvoicePaymentMethodSpecificOutput}
37
41
  attr_accessor :invoice_payment_method_specific_output
38
42
 
@@ -55,6 +59,7 @@ module Ingenico::Connect::SDK
55
59
  add_to_hash(hash, 'cardPaymentMethodSpecificOutput', @card_payment_method_specific_output)
56
60
  add_to_hash(hash, 'cashPaymentMethodSpecificOutput', @cash_payment_method_specific_output)
57
61
  add_to_hash(hash, 'directDebitPaymentMethodSpecificOutput', @direct_debit_payment_method_specific_output)
62
+ add_to_hash(hash, 'eInvoicePaymentMethodSpecificOutput', @e_invoice_payment_method_specific_output)
58
63
  add_to_hash(hash, 'invoicePaymentMethodSpecificOutput', @invoice_payment_method_specific_output)
59
64
  add_to_hash(hash, 'mobilePaymentMethodSpecificOutput', @mobile_payment_method_specific_output)
60
65
  add_to_hash(hash, 'paymentMethod', @payment_method)
@@ -92,6 +97,12 @@ module Ingenico::Connect::SDK
92
97
  end
93
98
  @direct_debit_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentMethodSpecificOutput.new_from_hash(hash['directDebitPaymentMethodSpecificOutput'])
94
99
  end
100
+ if hash.has_key?('eInvoicePaymentMethodSpecificOutput')
101
+ if !(hash['eInvoicePaymentMethodSpecificOutput'].is_a? Hash)
102
+ raise TypeError, "value '%s' is not a Hash" % [hash['eInvoicePaymentMethodSpecificOutput']]
103
+ end
104
+ @e_invoice_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificOutput.new_from_hash(hash['eInvoicePaymentMethodSpecificOutput'])
105
+ end
95
106
  if hash.has_key?('invoicePaymentMethodSpecificOutput')
96
107
  if !(hash['invoicePaymentMethodSpecificOutput'].is_a? Hash)
97
108
  raise TypeError, "value '%s' is not a Hash" % [hash['invoicePaymentMethodSpecificOutput']]
@@ -7,6 +7,7 @@ require 'ingenico/connect/sdk/domain/definitions/fraud_fields'
7
7
  require 'ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_input'
8
8
  require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_input'
9
9
  require 'ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input'
10
+ require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input'
10
11
  require 'ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_input'
11
12
  require 'ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_input'
12
13
  require 'ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_input'
@@ -32,6 +33,9 @@ module Ingenico::Connect::SDK
32
33
  # {Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentMethodSpecificInput}
33
34
  attr_accessor :direct_debit_payment_method_specific_input
34
35
 
36
+ # {Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificInput}
37
+ attr_accessor :e_invoice_payment_method_specific_input
38
+
35
39
  # String
36
40
  attr_accessor :encrypted_customer_input
37
41
 
@@ -59,6 +63,7 @@ module Ingenico::Connect::SDK
59
63
  add_to_hash(hash, 'cardPaymentMethodSpecificInput', @card_payment_method_specific_input)
60
64
  add_to_hash(hash, 'cashPaymentMethodSpecificInput', @cash_payment_method_specific_input)
61
65
  add_to_hash(hash, 'directDebitPaymentMethodSpecificInput', @direct_debit_payment_method_specific_input)
66
+ add_to_hash(hash, 'eInvoicePaymentMethodSpecificInput', @e_invoice_payment_method_specific_input)
62
67
  add_to_hash(hash, 'encryptedCustomerInput', @encrypted_customer_input)
63
68
  add_to_hash(hash, 'fraudFields', @fraud_fields)
64
69
  add_to_hash(hash, 'invoicePaymentMethodSpecificInput', @invoice_payment_method_specific_input)
@@ -95,6 +100,12 @@ module Ingenico::Connect::SDK
95
100
  end
96
101
  @direct_debit_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentMethodSpecificInput.new_from_hash(hash['directDebitPaymentMethodSpecificInput'])
97
102
  end
103
+ if hash.has_key?('eInvoicePaymentMethodSpecificInput')
104
+ if !(hash['eInvoicePaymentMethodSpecificInput'].is_a? Hash)
105
+ raise TypeError, "value '%s' is not a Hash" % [hash['eInvoicePaymentMethodSpecificInput']]
106
+ end
107
+ @e_invoice_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificInput.new_from_hash(hash['eInvoicePaymentMethodSpecificInput'])
108
+ end
98
109
  if hash.has_key?('encryptedCustomerInput')
99
110
  @encrypted_customer_input = hash['encryptedCustomerInput']
100
111
  end
@@ -0,0 +1,49 @@
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/domain/definitions/abstract_payment_method_specific_input'
6
+ require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_input'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Payment
11
+
12
+ class EInvoicePaymentMethodSpecificInput < Ingenico::Connect::SDK::Domain::Definitions::AbstractPaymentMethodSpecificInput
13
+
14
+ # true/false
15
+ attr_accessor :accepted_terms_and_conditions
16
+
17
+ # {Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentProduct9000SpecificInput}
18
+ attr_accessor :payment_product9000_specific_input
19
+
20
+ # true/false
21
+ attr_accessor :requires_approval
22
+
23
+ def to_h
24
+ hash = super
25
+ add_to_hash(hash, 'acceptedTermsAndConditions', @accepted_terms_and_conditions)
26
+ add_to_hash(hash, 'paymentProduct9000SpecificInput', @payment_product9000_specific_input)
27
+ add_to_hash(hash, 'requiresApproval', @requires_approval)
28
+ hash
29
+ end
30
+
31
+ def from_hash(hash)
32
+ super
33
+ if hash.has_key?('acceptedTermsAndConditions')
34
+ @accepted_terms_and_conditions = hash['acceptedTermsAndConditions']
35
+ end
36
+ if hash.has_key?('paymentProduct9000SpecificInput')
37
+ if !(hash['paymentProduct9000SpecificInput'].is_a? Hash)
38
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct9000SpecificInput']]
39
+ end
40
+ @payment_product9000_specific_input = Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentProduct9000SpecificInput.new_from_hash(hash['paymentProduct9000SpecificInput'])
41
+ end
42
+ if hash.has_key?('requiresApproval')
43
+ @requires_approval = hash['requiresApproval']
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,35 @@
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/domain/payment/abstract_payment_method_specific_output'
6
+ require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_output'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Payment
11
+
12
+ class EInvoicePaymentMethodSpecificOutput < Ingenico::Connect::SDK::Domain::Payment::AbstractPaymentMethodSpecificOutput
13
+
14
+ # {Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentProduct9000SpecificOutput}
15
+ attr_accessor :payment_product9000_specific_output
16
+
17
+ def to_h
18
+ hash = super
19
+ add_to_hash(hash, 'paymentProduct9000SpecificOutput', @payment_product9000_specific_output)
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ if hash.has_key?('paymentProduct9000SpecificOutput')
26
+ if !(hash['paymentProduct9000SpecificOutput'].is_a? Hash)
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct9000SpecificOutput']]
28
+ end
29
+ @payment_product9000_specific_output = Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentProduct9000SpecificOutput.new_from_hash(hash['paymentProduct9000SpecificOutput'])
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,42 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+ require 'ingenico/connect/sdk/domain/definitions/bank_account_iban'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Payment
11
+
12
+ class EInvoicePaymentProduct9000SpecificInput < Ingenico::Connect::SDK::DataObject
13
+
14
+ # {Ingenico::Connect::SDK::Domain::Definitions::BankAccountIban}
15
+ attr_accessor :bank_account_iban
16
+
17
+ # String
18
+ attr_accessor :installment_id
19
+
20
+ def to_h
21
+ hash = super
22
+ add_to_hash(hash, 'bankAccountIban', @bank_account_iban)
23
+ add_to_hash(hash, 'installmentId', @installment_id)
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key?('bankAccountIban')
30
+ if !(hash['bankAccountIban'].is_a? Hash)
31
+ raise TypeError, "value '%s' is not a Hash" % [hash['bankAccountIban']]
32
+ end
33
+ @bank_account_iban = Ingenico::Connect::SDK::Domain::Definitions::BankAccountIban.new_from_hash(hash['bankAccountIban'])
34
+ end
35
+ if hash.has_key?('installmentId')
36
+ @installment_id = hash['installmentId']
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,31 @@
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
+ class EInvoicePaymentProduct9000SpecificOutput < Ingenico::Connect::SDK::DataObject
12
+
13
+ # String
14
+ attr_accessor :installment_id
15
+
16
+ def to_h
17
+ hash = super
18
+ add_to_hash(hash, 'installmentId', @installment_id)
19
+ hash
20
+ end
21
+
22
+ def from_hash(hash)
23
+ super
24
+ if hash.has_key?('installmentId')
25
+ @installment_id = hash['installmentId']
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -13,12 +13,18 @@ module Ingenico::Connect::SDK
13
13
  # Integer
14
14
  attr_accessor :discount_amount
15
15
 
16
+ # Integer
17
+ attr_accessor :google_product_category_id
18
+
16
19
  # Integer
17
20
  attr_accessor :line_amount_total
18
21
 
19
22
  # String
20
23
  attr_accessor :product_code
21
24
 
25
+ # String
26
+ attr_accessor :product_name
27
+
22
28
  # Integer
23
29
  attr_accessor :product_price
24
30
 
@@ -37,8 +43,10 @@ module Ingenico::Connect::SDK
37
43
  def to_h
38
44
  hash = super
39
45
  add_to_hash(hash, 'discountAmount', @discount_amount)
46
+ add_to_hash(hash, 'googleProductCategoryId', @google_product_category_id)
40
47
  add_to_hash(hash, 'lineAmountTotal', @line_amount_total)
41
48
  add_to_hash(hash, 'productCode', @product_code)
49
+ add_to_hash(hash, 'productName', @product_name)
42
50
  add_to_hash(hash, 'productPrice', @product_price)
43
51
  add_to_hash(hash, 'productType', @product_type)
44
52
  add_to_hash(hash, 'quantity', @quantity)
@@ -52,12 +60,18 @@ module Ingenico::Connect::SDK
52
60
  if hash.has_key?('discountAmount')
53
61
  @discount_amount = hash['discountAmount']
54
62
  end
63
+ if hash.has_key?('googleProductCategoryId')
64
+ @google_product_category_id = hash['googleProductCategoryId']
65
+ end
55
66
  if hash.has_key?('lineAmountTotal')
56
67
  @line_amount_total = hash['lineAmountTotal']
57
68
  end
58
69
  if hash.has_key?('productCode')
59
70
  @product_code = hash['productCode']
60
71
  end
72
+ if hash.has_key?('productName')
73
+ @product_name = hash['productName']
74
+ end
61
75
  if hash.has_key?('productPrice')
62
76
  @product_price = hash['productPrice']
63
77
  end
@@ -5,6 +5,7 @@
5
5
  require 'ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_output'
6
6
  require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_output'
7
7
  require 'ingenico/connect/sdk/domain/payment/cash_payment_method_specific_output'
8
+ require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_output'
8
9
  require 'ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_output'
9
10
  require 'ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_output'
10
11
  require 'ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_output'
@@ -33,6 +34,9 @@ module Ingenico::Connect::SDK
33
34
  # {Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentMethodSpecificOutput}
34
35
  attr_accessor :direct_debit_payment_method_specific_output
35
36
 
37
+ # {Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificOutput}
38
+ attr_accessor :e_invoice_payment_method_specific_output
39
+
36
40
  # {Ingenico::Connect::SDK::Domain::Payment::InvoicePaymentMethodSpecificOutput}
37
41
  attr_accessor :invoice_payment_method_specific_output
38
42
 
@@ -55,6 +59,7 @@ module Ingenico::Connect::SDK
55
59
  add_to_hash(hash, 'cardPaymentMethodSpecificOutput', @card_payment_method_specific_output)
56
60
  add_to_hash(hash, 'cashPaymentMethodSpecificOutput', @cash_payment_method_specific_output)
57
61
  add_to_hash(hash, 'directDebitPaymentMethodSpecificOutput', @direct_debit_payment_method_specific_output)
62
+ add_to_hash(hash, 'eInvoicePaymentMethodSpecificOutput', @e_invoice_payment_method_specific_output)
58
63
  add_to_hash(hash, 'invoicePaymentMethodSpecificOutput', @invoice_payment_method_specific_output)
59
64
  add_to_hash(hash, 'mobilePaymentMethodSpecificOutput', @mobile_payment_method_specific_output)
60
65
  add_to_hash(hash, 'paymentMethod', @payment_method)
@@ -92,6 +97,12 @@ module Ingenico::Connect::SDK
92
97
  end
93
98
  @direct_debit_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::NonSepaDirectDebitPaymentMethodSpecificOutput.new_from_hash(hash['directDebitPaymentMethodSpecificOutput'])
94
99
  end
100
+ if hash.has_key?('eInvoicePaymentMethodSpecificOutput')
101
+ if !(hash['eInvoicePaymentMethodSpecificOutput'].is_a? Hash)
102
+ raise TypeError, "value '%s' is not a Hash" % [hash['eInvoicePaymentMethodSpecificOutput']]
103
+ end
104
+ @e_invoice_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificOutput.new_from_hash(hash['eInvoicePaymentMethodSpecificOutput'])
105
+ end
95
106
  if hash.has_key?('invoicePaymentMethodSpecificOutput')
96
107
  if !(hash['invoicePaymentMethodSpecificOutput'].is_a? Hash)
97
108
  raise TypeError, "value '%s' is not a Hash" % [hash['invoicePaymentMethodSpecificOutput']]
@@ -0,0 +1,45 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+ require 'ingenico/connect/sdk/domain/definitions/key_value_pair'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Product
11
+
12
+ class GetCustomerDetailsRequest < Ingenico::Connect::SDK::DataObject
13
+
14
+ # String
15
+ attr_accessor :country_code
16
+
17
+ # Array of {Ingenico::Connect::SDK::Domain::Definitions::KeyValuePair}
18
+ attr_accessor :values
19
+
20
+ def to_h
21
+ hash = super
22
+ add_to_hash(hash, 'countryCode', @country_code)
23
+ add_to_hash(hash, 'values', @values)
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key?('countryCode')
30
+ @country_code = hash['countryCode']
31
+ end
32
+ if hash.has_key?('values')
33
+ if !(hash['values'].is_a? Array)
34
+ raise TypeError, "value '%s' is not an Array" % [hash['values']]
35
+ end
36
+ @values = []
37
+ hash['values'].each do |e|
38
+ @values << Ingenico::Connect::SDK::Domain::Definitions::KeyValuePair.new_from_hash(e)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,94 @@
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 Product
10
+
11
+ class GetCustomerDetailsResponse < Ingenico::Connect::SDK::DataObject
12
+
13
+ # String
14
+ attr_accessor :city
15
+
16
+ # String
17
+ attr_accessor :country
18
+
19
+ # String
20
+ attr_accessor :email_address
21
+
22
+ # String
23
+ attr_accessor :first_name
24
+
25
+ # String
26
+ attr_accessor :fiscal_number
27
+
28
+ # String
29
+ attr_accessor :language_code
30
+
31
+ # String
32
+ attr_accessor :phone_number
33
+
34
+ # String
35
+ attr_accessor :street
36
+
37
+ # String
38
+ attr_accessor :surname
39
+
40
+ # String
41
+ attr_accessor :zip
42
+
43
+ def to_h
44
+ hash = super
45
+ add_to_hash(hash, 'city', @city)
46
+ add_to_hash(hash, 'country', @country)
47
+ add_to_hash(hash, 'emailAddress', @email_address)
48
+ add_to_hash(hash, 'firstName', @first_name)
49
+ add_to_hash(hash, 'fiscalNumber', @fiscal_number)
50
+ add_to_hash(hash, 'languageCode', @language_code)
51
+ add_to_hash(hash, 'phoneNumber', @phone_number)
52
+ add_to_hash(hash, 'street', @street)
53
+ add_to_hash(hash, 'surname', @surname)
54
+ add_to_hash(hash, 'zip', @zip)
55
+ hash
56
+ end
57
+
58
+ def from_hash(hash)
59
+ super
60
+ if hash.has_key?('city')
61
+ @city = hash['city']
62
+ end
63
+ if hash.has_key?('country')
64
+ @country = hash['country']
65
+ end
66
+ if hash.has_key?('emailAddress')
67
+ @email_address = hash['emailAddress']
68
+ end
69
+ if hash.has_key?('firstName')
70
+ @first_name = hash['firstName']
71
+ end
72
+ if hash.has_key?('fiscalNumber')
73
+ @fiscal_number = hash['fiscalNumber']
74
+ end
75
+ if hash.has_key?('languageCode')
76
+ @language_code = hash['languageCode']
77
+ end
78
+ if hash.has_key?('phoneNumber')
79
+ @phone_number = hash['phoneNumber']
80
+ end
81
+ if hash.has_key?('street')
82
+ @street = hash['street']
83
+ end
84
+ if hash.has_key?('surname')
85
+ @surname = hash['surname']
86
+ end
87
+ if hash.has_key?('zip')
88
+ @zip = hash['zip']
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
@@ -38,6 +38,9 @@ module Ingenico::Connect::SDK
38
38
  # Array of {Ingenico::Connect::SDK::Domain::Product::PaymentProductField}
39
39
  attr_accessor :fields
40
40
 
41
+ # String
42
+ attr_accessor :fields_warning
43
+
41
44
  # Integer
42
45
  attr_accessor :id
43
46
 
@@ -69,6 +72,7 @@ module Ingenico::Connect::SDK
69
72
  add_to_hash(hash, 'canBeIframed', @can_be_iframed)
70
73
  add_to_hash(hash, 'displayHints', @display_hints)
71
74
  add_to_hash(hash, 'fields', @fields)
75
+ add_to_hash(hash, 'fieldsWarning', @fields_warning)
72
76
  add_to_hash(hash, 'id', @id)
73
77
  add_to_hash(hash, 'maxAmount', @max_amount)
74
78
  add_to_hash(hash, 'minAmount', @min_amount)
@@ -123,6 +127,9 @@ module Ingenico::Connect::SDK
123
127
  @fields << Ingenico::Connect::SDK::Domain::Product::PaymentProductField.new_from_hash(e)
124
128
  end
125
129
  end
130
+ if hash.has_key?('fieldsWarning')
131
+ @fields_warning = hash['fieldsWarning']
132
+ end
126
133
  if hash.has_key?('id')
127
134
  @id = hash['id']
128
135
  end
@@ -24,12 +24,16 @@ module Ingenico::Connect::SDK
24
24
  # String
25
25
  attr_accessor :type
26
26
 
27
+ # true/false
28
+ attr_accessor :used_for_lookup
29
+
27
30
  def to_h
28
31
  hash = super
29
32
  add_to_hash(hash, 'dataRestrictions', @data_restrictions)
30
33
  add_to_hash(hash, 'displayHints', @display_hints)
31
34
  add_to_hash(hash, 'id', @id)
32
35
  add_to_hash(hash, 'type', @type)
36
+ add_to_hash(hash, 'usedForLookup', @used_for_lookup)
33
37
  hash
34
38
  end
35
39
 
@@ -53,6 +57,9 @@ module Ingenico::Connect::SDK
53
57
  if hash.has_key?('type')
54
58
  @type = hash['type']
55
59
  end
60
+ if hash.has_key?('usedForLookup')
61
+ @used_for_lookup = hash['usedForLookup']
62
+ end
56
63
  end
57
64
  end
58
65
  end
@@ -0,0 +1,45 @@
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 Product
10
+
11
+ class PaymentProductFieldDisplayElement < Ingenico::Connect::SDK::DataObject
12
+
13
+ # String
14
+ attr_accessor :id
15
+
16
+ # String
17
+ attr_accessor :type
18
+
19
+ # String
20
+ attr_accessor :value
21
+
22
+ def to_h
23
+ hash = super
24
+ add_to_hash(hash, 'id', @id)
25
+ add_to_hash(hash, 'type', @type)
26
+ add_to_hash(hash, 'value', @value)
27
+ hash
28
+ end
29
+
30
+ def from_hash(hash)
31
+ super
32
+ if hash.has_key?('id')
33
+ @id = hash['id']
34
+ end
35
+ if hash.has_key?('type')
36
+ @type = hash['type']
37
+ end
38
+ if hash.has_key?('value')
39
+ @value = hash['value']
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -24,6 +24,9 @@ module Ingenico::Connect::SDK
24
24
  # String
25
25
  attr_accessor :label
26
26
 
27
+ # String
28
+ attr_accessor :link
29
+
27
30
  # String
28
31
  attr_accessor :mask
29
32
 
@@ -45,6 +48,7 @@ module Ingenico::Connect::SDK
45
48
  add_to_hash(hash, 'displayOrder', @display_order)
46
49
  add_to_hash(hash, 'formElement', @form_element)
47
50
  add_to_hash(hash, 'label', @label)
51
+ add_to_hash(hash, 'link', @link)
48
52
  add_to_hash(hash, 'mask', @mask)
49
53
  add_to_hash(hash, 'obfuscate', @obfuscate)
50
54
  add_to_hash(hash, 'placeholderLabel', @placeholder_label)
@@ -70,6 +74,9 @@ module Ingenico::Connect::SDK
70
74
  if hash.has_key?('label')
71
75
  @label = hash['label']
72
76
  end
77
+ if hash.has_key?('link')
78
+ @link = hash['link']
79
+ end
73
80
  if hash.has_key?('mask')
74
81
  @mask = hash['mask']
75
82
  end
@@ -3,6 +3,7 @@
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
5
  require 'ingenico/connect/sdk/data_object'
6
+ require 'ingenico/connect/sdk/domain/product/payment_product_field_display_element'
6
7
 
7
8
  module Ingenico::Connect::SDK
8
9
  module Domain
@@ -10,7 +11,12 @@ module Ingenico::Connect::SDK
10
11
 
11
12
  class ValueMappingElement < Ingenico::Connect::SDK::DataObject
12
13
 
14
+ # Array of {Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayElement}
15
+ attr_accessor :display_elements
16
+
13
17
  # String
18
+ #
19
+ # Deprecated; use displayElement with ID 'displayName' instead.
14
20
  attr_accessor :display_name
15
21
 
16
22
  # String
@@ -18,6 +24,7 @@ module Ingenico::Connect::SDK
18
24
 
19
25
  def to_h
20
26
  hash = super
27
+ add_to_hash(hash, 'displayElements', @display_elements)
21
28
  add_to_hash(hash, 'displayName', @display_name)
22
29
  add_to_hash(hash, 'value', @value)
23
30
  hash
@@ -25,6 +32,15 @@ module Ingenico::Connect::SDK
25
32
 
26
33
  def from_hash(hash)
27
34
  super
35
+ if hash.has_key?('displayElements')
36
+ if !(hash['displayElements'].is_a? Array)
37
+ raise TypeError, "value '%s' is not an Array" % [hash['displayElements']]
38
+ end
39
+ @display_elements = []
40
+ hash['displayElements'].each do |e|
41
+ @display_elements << Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDisplayElement.new_from_hash(e)
42
+ end
43
+ end
28
44
  if hash.has_key?('displayName')
29
45
  @display_name = hash['displayName']
30
46
  end
@@ -6,6 +6,7 @@ require 'ingenico/connect/sdk/api_resource'
6
6
  require 'ingenico/connect/sdk/response_exception'
7
7
  require 'ingenico/connect/sdk/domain/errors/error_response'
8
8
  require 'ingenico/connect/sdk/domain/product/directory'
9
+ require 'ingenico/connect/sdk/domain/product/get_customer_details_response'
9
10
  require 'ingenico/connect/sdk/domain/product/payment_product_networks_response'
10
11
  require 'ingenico/connect/sdk/domain/product/payment_product_response'
11
12
  require 'ingenico/connect/sdk/domain/product/payment_products'
@@ -183,6 +184,40 @@ module Ingenico::Connect::SDK
183
184
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
184
185
  raise create_exception(e.status_code, e.body, error_object, context)
185
186
  end
187
+
188
+ # Resource /{{merchantId}}/products/{{paymentProductId}}/customerDetails
189
+ #
190
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/products/customerDetails.html Get customer details}
191
+ # payment_product_id:: Integer
192
+ # body:: {Ingenico::Connect::SDK::Domain::Product::GetCustomerDetailsRequest}
193
+ # context:: {Ingenico::Connect::SDK::CallContext}
194
+ # Returns:: {Ingenico::Connect::SDK::Domain::Product::GetCustomerDetailsResponse}
195
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
196
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
197
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
198
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
199
+ # or there was a conflict (HTTP status code 404, 409 or 410)
200
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
201
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
202
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
203
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
204
+ def customer_details(payment_product_id, body, context=nil)
205
+ path_context = {
206
+ 'paymentProductId' => payment_product_id.to_s,
207
+ }
208
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/products/{paymentProductId}/customerDetails', path_context)
209
+ return @communicator.post(
210
+ uri,
211
+ client_headers,
212
+ nil,
213
+ body,
214
+ Ingenico::Connect::SDK::Domain::Product::GetCustomerDetailsResponse,
215
+ context)
216
+ rescue ResponseException => e
217
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
218
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
219
+ raise create_exception(e.status_code, e.body, error_object, context)
220
+ end
186
221
  end
187
222
  end
188
223
  end
@@ -5,7 +5,7 @@ module Ingenico::Connect::SDK
5
5
 
6
6
  # Manages metadata about the server using the SDK
7
7
  class MetaDataProvider
8
- @@SDK_VERSION = '1.11.0'
8
+ @@SDK_VERSION = '1.12.0'
9
9
  @@SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'
10
10
  @@PROHIBITED_HEADERS = [@@SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key',
11
11
  'Date', 'Content-Type', 'Authorization'].sort!.freeze
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: 1.11.0
4
+ version: 1.12.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: 2017-09-27 00:00:00.000000000 Z
11
+ date: 2017-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -146,6 +146,7 @@ files:
146
146
  - examples/merchant/payouts/get_payout_example.rb
147
147
  - examples/merchant/productgroups/get_payment_product_group_example.rb
148
148
  - examples/merchant/productgroups/get_payment_product_groups_example.rb
149
+ - examples/merchant/products/get_customer_details_example.rb
149
150
  - examples/merchant/products/get_directory_example.rb
150
151
  - examples/merchant/products/get_networks_example.rb
151
152
  - examples/merchant/products/get_payment_product_example.rb
@@ -269,6 +270,10 @@ files:
269
270
  - lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb
270
271
  - lib/ingenico/connect/sdk/domain/payment/customer.rb
271
272
  - lib/ingenico/connect/sdk/domain/payment/decrypted_payment_data.rb
273
+ - lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input.rb
274
+ - lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_output.rb
275
+ - lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_input.rb
276
+ - lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_product9000_specific_output.rb
272
277
  - lib/ingenico/connect/sdk/domain/payment/external_cardholder_authentication_data.rb
273
278
  - lib/ingenico/connect/sdk/domain/payment/find_payments_response.rb
274
279
  - lib/ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_input.rb
@@ -351,12 +356,15 @@ files:
351
356
  - lib/ingenico/connect/sdk/domain/product/directory_entry.rb
352
357
  - lib/ingenico/connect/sdk/domain/product/empty_validator.rb
353
358
  - lib/ingenico/connect/sdk/domain/product/fixed_list_validator.rb
359
+ - lib/ingenico/connect/sdk/domain/product/get_customer_details_request.rb
360
+ - lib/ingenico/connect/sdk/domain/product/get_customer_details_response.rb
354
361
  - lib/ingenico/connect/sdk/domain/product/label_template_element.rb
355
362
  - lib/ingenico/connect/sdk/domain/product/length_validator.rb
356
363
  - lib/ingenico/connect/sdk/domain/product/payment_product.rb
357
364
  - lib/ingenico/connect/sdk/domain/product/payment_product_display_hints.rb
358
365
  - lib/ingenico/connect/sdk/domain/product/payment_product_field.rb
359
366
  - lib/ingenico/connect/sdk/domain/product/payment_product_field_data_restrictions.rb
367
+ - lib/ingenico/connect/sdk/domain/product/payment_product_field_display_element.rb
360
368
  - lib/ingenico/connect/sdk/domain/product/payment_product_field_display_hints.rb
361
369
  - lib/ingenico/connect/sdk/domain/product/payment_product_field_form_element.rb
362
370
  - lib/ingenico/connect/sdk/domain/product/payment_product_field_tooltip.rb