direct-sdk-ruby 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/direct-sdk-ruby.gemspec +1 -1
- data/lib/ingenico/direct/sdk/domain/card_essentials.rb +4 -0
- data/lib/ingenico/direct/sdk/domain/get_iin_details_request.rb +35 -0
- data/lib/ingenico/direct/sdk/domain/get_iin_details_response.rb +46 -0
- data/lib/ingenico/direct/sdk/domain/iin_detail.rb +31 -0
- data/lib/ingenico/direct/sdk/domain/payment_context.rb +39 -0
- data/lib/ingenico/direct/sdk/merchant/merchant_client.rb +1 -1
- data/lib/ingenico/direct/sdk/merchant/services/services_client.rb +31 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cca7811f8c12b5e503c5b6a41956fde1b930e4c0673307c86d125c8970e32f3
|
4
|
+
data.tar.gz: 3de1950b8190b66188b053b5011dd69e1a4d29b5052d58e858db7b29b0014fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 350075b2c0a98a06245ab738b3724b887c3cf11f602cb70ff057fff87882e3deeb9153a4683bf56fa6bfcc155d77a7f95d7e96c635460f0dde8251425efa45a8
|
7
|
+
data.tar.gz: cb1555157903e1eef77ca7b18e9008a96985d0d67ec89d4aca43112f72942f2ff6f1f68dff3f94d14bb8bab0204af64044ef86179f42196975ad79d7d98abf1d
|
data/direct-sdk-ruby.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'direct-sdk-ruby'
|
3
|
-
spec.version = '1.
|
3
|
+
spec.version = '1.2.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}
|
@@ -7,15 +7,18 @@ require 'ingenico/direct/sdk/data_object'
|
|
7
7
|
module Ingenico::Direct::SDK
|
8
8
|
module Domain
|
9
9
|
|
10
|
+
# @attr [String] bin
|
10
11
|
# @attr [String] card_number
|
11
12
|
# @attr [String] expiry_date
|
12
13
|
class CardEssentials < Ingenico::Direct::SDK::DataObject
|
14
|
+
attr_accessor :bin
|
13
15
|
attr_accessor :card_number
|
14
16
|
attr_accessor :expiry_date
|
15
17
|
|
16
18
|
# @return (Hash)
|
17
19
|
def to_h
|
18
20
|
hash = super
|
21
|
+
hash['bin'] = @bin unless @bin.nil?
|
19
22
|
hash['cardNumber'] = @card_number unless @card_number.nil?
|
20
23
|
hash['expiryDate'] = @expiry_date unless @expiry_date.nil?
|
21
24
|
hash
|
@@ -23,6 +26,7 @@ module Ingenico::Direct::SDK
|
|
23
26
|
|
24
27
|
def from_hash(hash)
|
25
28
|
super
|
29
|
+
@bin = hash['bin'] if hash.key? 'bin'
|
26
30
|
@card_number = hash['cardNumber'] if hash.key? 'cardNumber'
|
27
31
|
@expiry_date = hash['expiryDate'] if hash.key? 'expiryDate'
|
28
32
|
end
|
@@ -0,0 +1,35 @@
|
|
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/payment_context'
|
7
|
+
|
8
|
+
module Ingenico::Direct::SDK
|
9
|
+
module Domain
|
10
|
+
|
11
|
+
# @attr [String] bin
|
12
|
+
# @attr [Ingenico::Direct::SDK::Domain::PaymentContext] payment_context
|
13
|
+
class GetIINDetailsRequest < Ingenico::Direct::SDK::DataObject
|
14
|
+
attr_accessor :bin
|
15
|
+
attr_accessor :payment_context
|
16
|
+
|
17
|
+
# @return (Hash)
|
18
|
+
def to_h
|
19
|
+
hash = super
|
20
|
+
hash['bin'] = @bin unless @bin.nil?
|
21
|
+
hash['paymentContext'] = @payment_context.to_h if @payment_context
|
22
|
+
hash
|
23
|
+
end
|
24
|
+
|
25
|
+
def from_hash(hash)
|
26
|
+
super
|
27
|
+
@bin = hash['bin'] if hash.key? 'bin'
|
28
|
+
if hash.key? 'paymentContext'
|
29
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['paymentContext']] unless hash['paymentContext'].is_a? Hash
|
30
|
+
@payment_context = Ingenico::Direct::SDK::Domain::PaymentContext.new_from_hash(hash['paymentContext'])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,46 @@
|
|
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/iin_detail'
|
7
|
+
|
8
|
+
module Ingenico::Direct::SDK
|
9
|
+
module Domain
|
10
|
+
|
11
|
+
# @attr [Array<Ingenico::Direct::SDK::Domain::IINDetail>] co_brands
|
12
|
+
# @attr [String] country_code
|
13
|
+
# @attr [true/false] is_allowed_in_context
|
14
|
+
# @attr [Integer] payment_product_id
|
15
|
+
class GetIINDetailsResponse < Ingenico::Direct::SDK::DataObject
|
16
|
+
attr_accessor :co_brands
|
17
|
+
attr_accessor :country_code
|
18
|
+
attr_accessor :is_allowed_in_context
|
19
|
+
attr_accessor :payment_product_id
|
20
|
+
|
21
|
+
# @return (Hash)
|
22
|
+
def to_h
|
23
|
+
hash = super
|
24
|
+
hash['coBrands'] = @co_brands.collect(&:to_h) if @co_brands
|
25
|
+
hash['countryCode'] = @country_code unless @country_code.nil?
|
26
|
+
hash['isAllowedInContext'] = @is_allowed_in_context unless @is_allowed_in_context.nil?
|
27
|
+
hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
|
28
|
+
hash
|
29
|
+
end
|
30
|
+
|
31
|
+
def from_hash(hash)
|
32
|
+
super
|
33
|
+
if hash.key? 'coBrands'
|
34
|
+
raise TypeError, "value '%s' is not an Array" % [hash['coBrands']] unless hash['coBrands'].is_a? Array
|
35
|
+
@co_brands = []
|
36
|
+
hash['coBrands'].each do |e|
|
37
|
+
@co_brands << Ingenico::Direct::SDK::Domain::IINDetail.new_from_hash(e)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
@country_code = hash['countryCode'] if hash.key? 'countryCode'
|
41
|
+
@is_allowed_in_context = hash['isAllowedInContext'] if hash.key? 'isAllowedInContext'
|
42
|
+
@payment_product_id = hash['paymentProductId'] if hash.key? 'paymentProductId'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,31 @@
|
|
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 [true/false] is_allowed_in_context
|
11
|
+
# @attr [Integer] payment_product_id
|
12
|
+
class IINDetail < Ingenico::Direct::SDK::DataObject
|
13
|
+
attr_accessor :is_allowed_in_context
|
14
|
+
attr_accessor :payment_product_id
|
15
|
+
|
16
|
+
# @return (Hash)
|
17
|
+
def to_h
|
18
|
+
hash = super
|
19
|
+
hash['isAllowedInContext'] = @is_allowed_in_context unless @is_allowed_in_context.nil?
|
20
|
+
hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
|
21
|
+
hash
|
22
|
+
end
|
23
|
+
|
24
|
+
def from_hash(hash)
|
25
|
+
super
|
26
|
+
@is_allowed_in_context = hash['isAllowedInContext'] if hash.key? 'isAllowedInContext'
|
27
|
+
@payment_product_id = hash['paymentProductId'] if hash.key? 'paymentProductId'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,39 @@
|
|
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
|
+
|
8
|
+
module Ingenico::Direct::SDK
|
9
|
+
module Domain
|
10
|
+
|
11
|
+
# @attr [Ingenico::Direct::SDK::Domain::AmountOfMoney] amount_of_money
|
12
|
+
# @attr [String] country_code
|
13
|
+
# @attr [true/false] is_recurring
|
14
|
+
class PaymentContext < Ingenico::Direct::SDK::DataObject
|
15
|
+
attr_accessor :amount_of_money
|
16
|
+
attr_accessor :country_code
|
17
|
+
attr_accessor :is_recurring
|
18
|
+
|
19
|
+
# @return (Hash)
|
20
|
+
def to_h
|
21
|
+
hash = super
|
22
|
+
hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money
|
23
|
+
hash['countryCode'] = @country_code unless @country_code.nil?
|
24
|
+
hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
|
25
|
+
hash
|
26
|
+
end
|
27
|
+
|
28
|
+
def from_hash(hash)
|
29
|
+
super
|
30
|
+
if hash.key? 'amountOfMoney'
|
31
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
|
32
|
+
@amount_of_money = Ingenico::Direct::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
|
33
|
+
end
|
34
|
+
@country_code = hash['countryCode'] if hash.key? 'countryCode'
|
35
|
+
@is_recurring = hash['isRecurring'] if hash.key? 'isRecurring'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -49,7 +49,7 @@ module Ingenico::Direct::SDK
|
|
49
49
|
Ingenico::Direct::SDK::Merchant::Payments::PaymentsClient.new(self, nil)
|
50
50
|
end
|
51
51
|
|
52
|
-
# Resource /v2/!{merchantId}/services
|
52
|
+
# Resource /v2/!{merchantId}/services
|
53
53
|
# @return [Ingenico::Direct::SDK::Merchant::Services::ServicesClient]
|
54
54
|
def services
|
55
55
|
Ingenico::Direct::SDK::Merchant::Services::ServicesClient.new(self, nil)
|
@@ -5,6 +5,8 @@
|
|
5
5
|
require 'ingenico/direct/sdk/api_resource'
|
6
6
|
require 'ingenico/direct/sdk/response_exception'
|
7
7
|
require 'ingenico/direct/sdk/domain/error_response'
|
8
|
+
require 'ingenico/direct/sdk/domain/get_iin_details_request'
|
9
|
+
require 'ingenico/direct/sdk/domain/get_iin_details_response'
|
8
10
|
require 'ingenico/direct/sdk/domain/test_connection'
|
9
11
|
|
10
12
|
module Ingenico::Direct::SDK
|
@@ -46,6 +48,35 @@ module Ingenico::Direct::SDK
|
|
46
48
|
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
47
49
|
raise create_exception(e.status_code, e.body, error_object, context)
|
48
50
|
end
|
51
|
+
|
52
|
+
# Resource /v2/!{merchantId}/services/getIINdetails - {https://support.direct.ingenico.com/documentation/api/reference#operation/GetIINDetailsApi Get IIN details}
|
53
|
+
# @param body [Ingenico::Direct::SDK::Domain::GetIINDetailsRequest]
|
54
|
+
# @param context [Ingenico::Direct::SDK::CallContext]
|
55
|
+
# @return [Ingenico::Direct::SDK::Domain::GetIINDetailsResponse]
|
56
|
+
# @raise [Ingenico::Direct::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
57
|
+
# @raise [Ingenico::Direct::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
58
|
+
# @raise [Ingenico::Direct::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
59
|
+
# @raise [Ingenico::Direct::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
60
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
61
|
+
# @raise [Ingenico::Direct::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform,
|
62
|
+
# the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
|
63
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
64
|
+
# @raise [Ingenico::Direct::SDK::ApiException]if the Ingenico ePayments platform returned any other error
|
65
|
+
def get_iin_details(body, context = nil)
|
66
|
+
uri = instantiate_uri('/v2/{merchantId}/services/getIINdetails')
|
67
|
+
@communicator.post(
|
68
|
+
uri,
|
69
|
+
client_headers,
|
70
|
+
nil,
|
71
|
+
body,
|
72
|
+
Ingenico::Direct::SDK::Domain::GetIINDetailsResponse,
|
73
|
+
context
|
74
|
+
)
|
75
|
+
rescue ResponseException => e
|
76
|
+
error_type = Ingenico::Direct::SDK::Domain::ErrorResponse
|
77
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
78
|
+
raise create_exception(e.status_code, e.body, error_object, context)
|
79
|
+
end
|
49
80
|
end
|
50
81
|
end
|
51
82
|
end
|
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.
|
4
|
+
version: 1.2.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-
|
11
|
+
date: 2021-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -212,11 +212,14 @@ files:
|
|
212
212
|
- lib/ingenico/direct/sdk/domain/g_pay_three_d_secure.rb
|
213
213
|
- lib/ingenico/direct/sdk/domain/get_hosted_checkout_response.rb
|
214
214
|
- lib/ingenico/direct/sdk/domain/get_hosted_tokenization_response.rb
|
215
|
+
- lib/ingenico/direct/sdk/domain/get_iin_details_request.rb
|
216
|
+
- lib/ingenico/direct/sdk/domain/get_iin_details_response.rb
|
215
217
|
- lib/ingenico/direct/sdk/domain/get_payment_product_groups_response.rb
|
216
218
|
- lib/ingenico/direct/sdk/domain/get_payment_products_response.rb
|
217
219
|
- lib/ingenico/direct/sdk/domain/gift_card_purchase.rb
|
218
220
|
- lib/ingenico/direct/sdk/domain/hosted_checkout_specific_input.rb
|
219
221
|
- lib/ingenico/direct/sdk/domain/hosted_checkout_specific_output.rb
|
222
|
+
- lib/ingenico/direct/sdk/domain/iin_detail.rb
|
220
223
|
- lib/ingenico/direct/sdk/domain/label_template_element.rb
|
221
224
|
- lib/ingenico/direct/sdk/domain/length_validator.rb
|
222
225
|
- lib/ingenico/direct/sdk/domain/line_item.rb
|
@@ -234,6 +237,7 @@ files:
|
|
234
237
|
- lib/ingenico/direct/sdk/domain/order_status_output.rb
|
235
238
|
- lib/ingenico/direct/sdk/domain/order_type_information.rb
|
236
239
|
- lib/ingenico/direct/sdk/domain/payment_account_on_file.rb
|
240
|
+
- lib/ingenico/direct/sdk/domain/payment_context.rb
|
237
241
|
- lib/ingenico/direct/sdk/domain/payment_creation_output.rb
|
238
242
|
- lib/ingenico/direct/sdk/domain/payment_error_response.rb
|
239
243
|
- lib/ingenico/direct/sdk/domain/payment_output.rb
|