connect-sdk-ruby 1.24.0 → 1.25.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: 727b5afdfef561e3deb6d664a160345ff7ce82817419f5c33f37aa36760a9f30
4
- data.tar.gz: 3b1d4b5ee500b438d0679ccc7d849c9c34aad610cb1207d071c540936f371de7
3
+ metadata.gz: a42bcd03641691e3db8d36b18cff6941d794ad445428eb2c0f82d81a2fba16b0
4
+ data.tar.gz: 9d6c229ba972ec75175e6b5907680f8706fdfbe001c23a386fbce37a6a52152f
5
5
  SHA512:
6
- metadata.gz: b9ab1c7de67289d82ebcf08e2b58e705c1008541aedfb551386ae33eae2b6ef68489d9759b505e7e8b13fd9e48d442f90eb4ea37c3c1387070a3d37aa8bab3c8
7
- data.tar.gz: cd3d112e6641520b9543ecf467e70ede22aa2401ac3b491603fcf52ee62ce6f5bd473c54adc26cdfc6b0bc8f80d889f1119d0e1742580e7aa9509b6195ee35f2
6
+ metadata.gz: 9a65a7811cc1ac4abbbc98d0d0d396efe27bf934a9eb2d7f207d383767cead6f29c51258b0c039c34ecef2aca20dda1ad7d233ebc5a328d42de8a6a215453147
7
+ data.tar.gz: 739c9e5ebbe49dd517572a84e6d8d3513eec193c8718d914540928a0de38c5164490ea9133c4f4f57a8cff28a71fff6f064cce0e53c043b89fb3120d07a37e2f
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '1.24.0'
3
+ spec.version = '1.25.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,26 @@
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/product/device_fingerprint_request'
7
+
8
+ Product = Ingenico::Connect::SDK::Domain::Product
9
+
10
+ def example
11
+ get_client do |client|
12
+ body = Product::DeviceFingerprintRequest.new
13
+
14
+ response = client.merchant('merchantId').productgroups().device_fingerprint('cards', body)
15
+ end
16
+ end
17
+
18
+ def get_client
19
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
20
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
21
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
22
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
23
+ ensure
24
+ # Free networking resources when done
25
+ client.close unless client.nil?
26
+ end
@@ -72,6 +72,18 @@ module Ingenico::Connect::SDK
72
72
  # String
73
73
  attr_accessor :ticket_number
74
74
 
75
+ # Integer
76
+ attr_accessor :total_fare
77
+
78
+ # Integer
79
+ attr_accessor :total_fee
80
+
81
+ # Integer
82
+ attr_accessor :total_taxes
83
+
84
+ # String
85
+ attr_accessor :travel_agency_name
86
+
75
87
  def to_h
76
88
  hash = super
77
89
  add_to_hash(hash, 'agentNumericCode', @agent_numeric_code)
@@ -94,6 +106,10 @@ module Ingenico::Connect::SDK
94
106
  add_to_hash(hash, 'posCityCode', @pos_city_code)
95
107
  add_to_hash(hash, 'ticketDeliveryMethod', @ticket_delivery_method)
96
108
  add_to_hash(hash, 'ticketNumber', @ticket_number)
109
+ add_to_hash(hash, 'totalFare', @total_fare)
110
+ add_to_hash(hash, 'totalFee', @total_fee)
111
+ add_to_hash(hash, 'totalTaxes', @total_taxes)
112
+ add_to_hash(hash, 'travelAgencyName', @travel_agency_name)
97
113
  hash
98
114
  end
99
115
 
@@ -171,6 +187,18 @@ module Ingenico::Connect::SDK
171
187
  if hash.has_key?('ticketNumber')
172
188
  @ticket_number = hash['ticketNumber']
173
189
  end
190
+ if hash.has_key?('totalFare')
191
+ @total_fare = hash['totalFare']
192
+ end
193
+ if hash.has_key?('totalFee')
194
+ @total_fee = hash['totalFee']
195
+ end
196
+ if hash.has_key?('totalTaxes')
197
+ @total_taxes = hash['totalTaxes']
198
+ end
199
+ if hash.has_key?('travelAgencyName')
200
+ @travel_agency_name = hash['travelAgencyName']
201
+ end
174
202
  end
175
203
  end
176
204
  end
@@ -16,21 +16,39 @@ module Ingenico::Connect::SDK
16
16
  # String
17
17
  attr_accessor :arrival_airport
18
18
 
19
+ # String
20
+ attr_accessor :arrival_time
21
+
19
22
  # String
20
23
  attr_accessor :carrier_code
21
24
 
25
+ # String
26
+ attr_accessor :conjunction_ticket
27
+
28
+ # String
29
+ attr_accessor :coupon_number
30
+
22
31
  # String
23
32
  attr_accessor :date
24
33
 
25
34
  # String
26
35
  attr_accessor :departure_time
27
36
 
37
+ # String
38
+ attr_accessor :endorsement_or_restriction
39
+
40
+ # String
41
+ attr_accessor :exchange_ticket
42
+
28
43
  # String
29
44
  attr_accessor :fare
30
45
 
31
46
  # String
32
47
  attr_accessor :fare_basis
33
48
 
49
+ # Integer
50
+ attr_accessor :fee
51
+
34
52
  # String
35
53
  attr_accessor :flight_number
36
54
 
@@ -41,25 +59,41 @@ module Ingenico::Connect::SDK
41
59
  attr_accessor :origin_airport
42
60
 
43
61
  # String
62
+ attr_accessor :passenger_class
63
+
64
+ # String
65
+ #
66
+ # Deprecated; Use passengerClass instead
44
67
  attr_accessor :service_class
45
68
 
46
69
  # String
47
70
  attr_accessor :stopover_code
48
71
 
72
+ # Integer
73
+ attr_accessor :taxes
74
+
49
75
  def to_h
50
76
  hash = super
51
77
  add_to_hash(hash, 'airlineClass', @airline_class)
52
78
  add_to_hash(hash, 'arrivalAirport', @arrival_airport)
79
+ add_to_hash(hash, 'arrivalTime', @arrival_time)
53
80
  add_to_hash(hash, 'carrierCode', @carrier_code)
81
+ add_to_hash(hash, 'conjunctionTicket', @conjunction_ticket)
82
+ add_to_hash(hash, 'couponNumber', @coupon_number)
54
83
  add_to_hash(hash, 'date', @date)
55
84
  add_to_hash(hash, 'departureTime', @departure_time)
85
+ add_to_hash(hash, 'endorsementOrRestriction', @endorsement_or_restriction)
86
+ add_to_hash(hash, 'exchangeTicket', @exchange_ticket)
56
87
  add_to_hash(hash, 'fare', @fare)
57
88
  add_to_hash(hash, 'fareBasis', @fare_basis)
89
+ add_to_hash(hash, 'fee', @fee)
58
90
  add_to_hash(hash, 'flightNumber', @flight_number)
59
91
  add_to_hash(hash, 'number', @number)
60
92
  add_to_hash(hash, 'originAirport', @origin_airport)
93
+ add_to_hash(hash, 'passengerClass', @passenger_class)
61
94
  add_to_hash(hash, 'serviceClass', @service_class)
62
95
  add_to_hash(hash, 'stopoverCode', @stopover_code)
96
+ add_to_hash(hash, 'taxes', @taxes)
63
97
  hash
64
98
  end
65
99
 
@@ -71,21 +105,39 @@ module Ingenico::Connect::SDK
71
105
  if hash.has_key?('arrivalAirport')
72
106
  @arrival_airport = hash['arrivalAirport']
73
107
  end
108
+ if hash.has_key?('arrivalTime')
109
+ @arrival_time = hash['arrivalTime']
110
+ end
74
111
  if hash.has_key?('carrierCode')
75
112
  @carrier_code = hash['carrierCode']
76
113
  end
114
+ if hash.has_key?('conjunctionTicket')
115
+ @conjunction_ticket = hash['conjunctionTicket']
116
+ end
117
+ if hash.has_key?('couponNumber')
118
+ @coupon_number = hash['couponNumber']
119
+ end
77
120
  if hash.has_key?('date')
78
121
  @date = hash['date']
79
122
  end
80
123
  if hash.has_key?('departureTime')
81
124
  @departure_time = hash['departureTime']
82
125
  end
126
+ if hash.has_key?('endorsementOrRestriction')
127
+ @endorsement_or_restriction = hash['endorsementOrRestriction']
128
+ end
129
+ if hash.has_key?('exchangeTicket')
130
+ @exchange_ticket = hash['exchangeTicket']
131
+ end
83
132
  if hash.has_key?('fare')
84
133
  @fare = hash['fare']
85
134
  end
86
135
  if hash.has_key?('fareBasis')
87
136
  @fare_basis = hash['fareBasis']
88
137
  end
138
+ if hash.has_key?('fee')
139
+ @fee = hash['fee']
140
+ end
89
141
  if hash.has_key?('flightNumber')
90
142
  @flight_number = hash['flightNumber']
91
143
  end
@@ -95,12 +147,18 @@ module Ingenico::Connect::SDK
95
147
  if hash.has_key?('originAirport')
96
148
  @origin_airport = hash['originAirport']
97
149
  end
150
+ if hash.has_key?('passengerClass')
151
+ @passenger_class = hash['passengerClass']
152
+ end
98
153
  if hash.has_key?('serviceClass')
99
154
  @service_class = hash['serviceClass']
100
155
  end
101
156
  if hash.has_key?('stopoverCode')
102
157
  @stopover_code = hash['stopoverCode']
103
158
  end
159
+ if hash.has_key?('taxes')
160
+ @taxes = hash['taxes']
161
+ end
104
162
  end
105
163
  end
106
164
  end
@@ -19,6 +19,9 @@ module Ingenico::Connect::SDK
19
19
  # Array of String
20
20
  attr_accessor :invalid_tokens
21
21
 
22
+ # String
23
+ attr_accessor :merchant_reference
24
+
22
25
  # String
23
26
  attr_accessor :partial_redirect_url
24
27
 
@@ -27,6 +30,7 @@ module Ingenico::Connect::SDK
27
30
  add_to_hash(hash, 'RETURNMAC', @returnmac)
28
31
  add_to_hash(hash, 'hostedCheckoutId', @hosted_checkout_id)
29
32
  add_to_hash(hash, 'invalidTokens', @invalid_tokens)
33
+ add_to_hash(hash, 'merchantReference', @merchant_reference)
30
34
  add_to_hash(hash, 'partialRedirectUrl', @partial_redirect_url)
31
35
  hash
32
36
  end
@@ -48,6 +52,9 @@ module Ingenico::Connect::SDK
48
52
  @invalid_tokens << e
49
53
  end
50
54
  end
55
+ if hash.has_key?('merchantReference')
56
+ @merchant_reference = hash['merchantReference']
57
+ end
51
58
  if hash.has_key?('partialRedirectUrl')
52
59
  @partial_redirect_url = hash['partialRedirectUrl']
53
60
  end
@@ -13,6 +13,9 @@ module Ingenico::Connect::SDK
13
13
  # String
14
14
  attr_accessor :id
15
15
 
16
+ # String
17
+ attr_accessor :label
18
+
16
19
  # String
17
20
  attr_accessor :type
18
21
 
@@ -22,6 +25,7 @@ module Ingenico::Connect::SDK
22
25
  def to_h
23
26
  hash = super
24
27
  add_to_hash(hash, 'id', @id)
28
+ add_to_hash(hash, 'label', @label)
25
29
  add_to_hash(hash, 'type', @type)
26
30
  add_to_hash(hash, 'value', @value)
27
31
  hash
@@ -32,6 +36,9 @@ module Ingenico::Connect::SDK
32
36
  if hash.has_key?('id')
33
37
  @id = hash['id']
34
38
  end
39
+ if hash.has_key?('label')
40
+ @label = hash['label']
41
+ end
35
42
  if hash.has_key?('type')
36
43
  @type = hash['type']
37
44
  end
@@ -16,6 +16,9 @@ module Ingenico::Connect::SDK
16
16
  # Array of {Ingenico::Connect::SDK::Domain::Product::AccountOnFile}
17
17
  attr_accessor :accounts_on_file
18
18
 
19
+ # true/false
20
+ attr_accessor :device_fingerprint_enabled
21
+
19
22
  # {Ingenico::Connect::SDK::Domain::Product::PaymentProductDisplayHints}
20
23
  attr_accessor :display_hints
21
24
 
@@ -28,6 +31,7 @@ module Ingenico::Connect::SDK
28
31
  def to_h
29
32
  hash = super
30
33
  add_to_hash(hash, 'accountsOnFile', @accounts_on_file)
34
+ add_to_hash(hash, 'deviceFingerprintEnabled', @device_fingerprint_enabled)
31
35
  add_to_hash(hash, 'displayHints', @display_hints)
32
36
  add_to_hash(hash, 'fields', @fields)
33
37
  add_to_hash(hash, 'id', @id)
@@ -45,6 +49,9 @@ module Ingenico::Connect::SDK
45
49
  @accounts_on_file << Ingenico::Connect::SDK::Domain::Product::AccountOnFile.new_from_hash(e)
46
50
  end
47
51
  end
52
+ if hash.has_key?('deviceFingerprintEnabled')
53
+ @device_fingerprint_enabled = hash['deviceFingerprintEnabled']
54
+ end
48
55
  if hash.has_key?('displayHints')
49
56
  if !(hash['displayHints'].is_a? Hash)
50
57
  raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']]
@@ -5,6 +5,7 @@
5
5
  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
+ require 'ingenico/connect/sdk/domain/product/device_fingerprint_response'
8
9
  require 'ingenico/connect/sdk/domain/product/payment_product_group_response'
9
10
  require 'ingenico/connect/sdk/domain/product/payment_product_groups'
10
11
 
@@ -82,6 +83,40 @@ module Ingenico::Connect::SDK
82
83
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
83
84
  raise create_exception(e.status_code, e.body, error_object, context)
84
85
  end
86
+
87
+ # Resource /{{merchantId}}/productgroups/{{paymentProductGroupId}}/deviceFingerprint
88
+ #
89
+ # {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/productgroups/deviceFingerprint.html Get device fingerprint}
90
+ # payment_product_group_id:: String
91
+ # body:: {Ingenico::Connect::SDK::Domain::Product::DeviceFingerprintRequest}
92
+ # context:: {Ingenico::Connect::SDK::CallContext}
93
+ # Returns:: {Ingenico::Connect::SDK::Domain::Product::DeviceFingerprintResponse}
94
+ # Raises:: {Ingenico::Connect::SDK::ValidationException} if the request was not correct and couldn't be processed (HTTP status code 400)
95
+ # Raises:: {Ingenico::Connect::SDK::AuthorizationException} if the request was not allowed (HTTP status code 403)
96
+ # Raises:: {Ingenico::Connect::SDK::IdempotenceException} if an idempotent request caused a conflict (HTTP status code 409)
97
+ # Raises:: {Ingenico::Connect::SDK::ReferenceException} if an object was attempted to be referenced that doesn't exist or has been removed,
98
+ # or there was a conflict (HTTP status code 404, 409 or 410)
99
+ # Raises:: {Ingenico::Connect::SDK::GlobalCollectException} if something went wrong at the Ingenico ePayments platform,
100
+ # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
101
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
102
+ # Raises:: {Ingenico::Connect::SDK::ApiException} if the Ingenico ePayments platform returned any other error
103
+ def device_fingerprint(payment_product_group_id, body, context=nil)
104
+ path_context = {
105
+ 'paymentProductGroupId' => payment_product_group_id,
106
+ }
107
+ uri = instantiate_uri('/{apiVersion}/{merchantId}/productgroups/{paymentProductGroupId}/deviceFingerprint', path_context)
108
+ return @communicator.post(
109
+ uri,
110
+ client_headers,
111
+ nil,
112
+ body,
113
+ Ingenico::Connect::SDK::Domain::Product::DeviceFingerprintResponse,
114
+ context)
115
+ rescue ResponseException => e
116
+ error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse
117
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
118
+ raise create_exception(e.status_code, e.body, error_object, context)
119
+ end
85
120
  end
86
121
  end
87
122
  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.24.0'
8
+ @@SDK_VERSION = '1.25.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.24.0
4
+ version: 1.25.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: 2018-09-05 00:00:00.000000000 Z
11
+ date: 2018-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -153,6 +153,7 @@ files:
153
153
  - examples/merchant/payouts/create_payout_example.rb
154
154
  - examples/merchant/payouts/find_payouts_example.rb
155
155
  - examples/merchant/payouts/get_payout_example.rb
156
+ - examples/merchant/productgroups/get_device_fingerprint_for_groups_example.rb
156
157
  - examples/merchant/productgroups/get_payment_product_group_example.rb
157
158
  - examples/merchant/productgroups/get_payment_product_groups_example.rb
158
159
  - examples/merchant/products/get_customer_details_example.rb