onlinepayments-sdk-ruby 8.0.0 → 8.1.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/lib/onlinepayments/sdk/communication/metadata_provider.rb +1 -1
- data/lib/onlinepayments/sdk/domain/get_hosted_fields_session_response.rb +39 -0
- data/lib/onlinepayments/sdk/domain/import_cof_series_request.rb +7 -0
- data/lib/onlinepayments/sdk/domain/payment_product_session302_specific_input.rb +37 -0
- data/lib/onlinepayments/sdk/domain/payment_product_session302_specific_output.rb +30 -0
- data/lib/onlinepayments/sdk/domain/payment_product_session_request.rb +32 -0
- data/lib/onlinepayments/sdk/domain/payment_product_session_response.rb +32 -0
- data/lib/onlinepayments/sdk/domain/payment_response.rb +9 -0
- data/lib/onlinepayments/sdk/domain/problem_details_response.rb +58 -0
- data/lib/onlinepayments/sdk/domain/token_info.rb +51 -0
- data/lib/onlinepayments/sdk/exception_factory.rb +5 -0
- data/lib/onlinepayments/sdk/merchant/hostedfields/hosted_fields_client.rb +36 -0
- data/lib/onlinepayments/sdk/merchant/products/products_client.rb +36 -0
- data/lib/onlinepayments/sdk/problem_details_exception.rb +25 -0
- data/onlinepayments-sdk-ruby.gemspec +1 -1
- metadata +9 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28cf4df20be3d38dc13d78392aae4c8f36b89b2c677f457ca51c83c741c11f49
|
|
4
|
+
data.tar.gz: ce7b031f3a454cdb8ce16bc098e2fd3f9d6fb21e545028c62bea3e18c7b427fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4e2d7327af859a6982e27f779c6a8f3ee3e8e9714c3d62972ad81202f246df6075a5de8c64ed9e9d155ec61406ec87f810e07f641bfe71dcef3dd8b67b52576
|
|
7
|
+
data.tar.gz: 517508d4a828fa2ee89713879f26a4201353f2fcca7a1d70dfeac92f9ba9af2f73465777388cf4bb8f89167bd70130cec87ce4ac37ee06c36dd9406ca2a3da60
|
|
@@ -13,7 +13,7 @@ module OnlinePayments
|
|
|
13
13
|
class MetadataProvider
|
|
14
14
|
private
|
|
15
15
|
|
|
16
|
-
SDK_VERSION = '8.
|
|
16
|
+
SDK_VERSION = '8.1.0'.freeze
|
|
17
17
|
SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'.freeze
|
|
18
18
|
PROHIBITED_HEADERS = [SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key', 'Date', 'Content-Type', 'Authorization'].sort!.freeze
|
|
19
19
|
CHARSET = 'utf-8'.freeze
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'onlinepayments/sdk/domain/data_object'
|
|
5
|
+
require 'onlinepayments/sdk/domain/token_info'
|
|
6
|
+
|
|
7
|
+
module OnlinePayments
|
|
8
|
+
module SDK
|
|
9
|
+
module Domain
|
|
10
|
+
# @attr [String] session_id
|
|
11
|
+
# @attr [OnlinePayments::SDK::Domain::TokenInfo] token
|
|
12
|
+
class GetHostedFieldsSessionResponse < OnlinePayments::SDK::Domain::DataObject
|
|
13
|
+
|
|
14
|
+
attr_accessor :session_id
|
|
15
|
+
|
|
16
|
+
attr_accessor :token
|
|
17
|
+
|
|
18
|
+
# @return (Hash)
|
|
19
|
+
def to_h
|
|
20
|
+
hash = super
|
|
21
|
+
hash['sessionId'] = @session_id unless @session_id.nil?
|
|
22
|
+
hash['token'] = @token.to_h unless @token.nil?
|
|
23
|
+
hash
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def from_hash(hash)
|
|
27
|
+
super
|
|
28
|
+
if hash.has_key? 'sessionId'
|
|
29
|
+
@session_id = hash['sessionId']
|
|
30
|
+
end
|
|
31
|
+
if hash.has_key? 'token'
|
|
32
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['token']] unless hash['token'].is_a? Hash
|
|
33
|
+
@token = OnlinePayments::SDK::Domain::TokenInfo.new_from_hash(hash['token'])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -12,6 +12,7 @@ module OnlinePayments
|
|
|
12
12
|
# @attr [Integer] payment_product_id
|
|
13
13
|
# @attr [String] scheme_reference_data
|
|
14
14
|
# @attr [String] token_id
|
|
15
|
+
# @attr [String] transaction_link_identifier
|
|
15
16
|
class ImportCofSeriesRequest < OnlinePayments::SDK::Domain::DataObject
|
|
16
17
|
|
|
17
18
|
attr_accessor :card
|
|
@@ -24,6 +25,8 @@ module OnlinePayments
|
|
|
24
25
|
|
|
25
26
|
attr_accessor :token_id
|
|
26
27
|
|
|
28
|
+
attr_accessor :transaction_link_identifier
|
|
29
|
+
|
|
27
30
|
# @return (Hash)
|
|
28
31
|
def to_h
|
|
29
32
|
hash = super
|
|
@@ -32,6 +35,7 @@ module OnlinePayments
|
|
|
32
35
|
hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
|
|
33
36
|
hash['schemeReferenceData'] = @scheme_reference_data unless @scheme_reference_data.nil?
|
|
34
37
|
hash['tokenId'] = @token_id unless @token_id.nil?
|
|
38
|
+
hash['transactionLinkIdentifier'] = @transaction_link_identifier unless @transaction_link_identifier.nil?
|
|
35
39
|
hash
|
|
36
40
|
end
|
|
37
41
|
|
|
@@ -53,6 +57,9 @@ module OnlinePayments
|
|
|
53
57
|
if hash.has_key? 'tokenId'
|
|
54
58
|
@token_id = hash['tokenId']
|
|
55
59
|
end
|
|
60
|
+
if hash.has_key? 'transactionLinkIdentifier'
|
|
61
|
+
@transaction_link_identifier = hash['transactionLinkIdentifier']
|
|
62
|
+
end
|
|
56
63
|
end
|
|
57
64
|
end
|
|
58
65
|
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'onlinepayments/sdk/domain/data_object'
|
|
5
|
+
|
|
6
|
+
module OnlinePayments
|
|
7
|
+
module SDK
|
|
8
|
+
module Domain
|
|
9
|
+
# @attr [String] display_name
|
|
10
|
+
# @attr [String] domain_name
|
|
11
|
+
class PaymentProductSession302SpecificInput < OnlinePayments::SDK::Domain::DataObject
|
|
12
|
+
|
|
13
|
+
attr_accessor :display_name
|
|
14
|
+
|
|
15
|
+
attr_accessor :domain_name
|
|
16
|
+
|
|
17
|
+
# @return (Hash)
|
|
18
|
+
def to_h
|
|
19
|
+
hash = super
|
|
20
|
+
hash['displayName'] = @display_name unless @display_name.nil?
|
|
21
|
+
hash['domainName'] = @domain_name unless @domain_name.nil?
|
|
22
|
+
hash
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def from_hash(hash)
|
|
26
|
+
super
|
|
27
|
+
if hash.has_key? 'displayName'
|
|
28
|
+
@display_name = hash['displayName']
|
|
29
|
+
end
|
|
30
|
+
if hash.has_key? 'domainName'
|
|
31
|
+
@domain_name = hash['domainName']
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'onlinepayments/sdk/domain/data_object'
|
|
5
|
+
|
|
6
|
+
module OnlinePayments
|
|
7
|
+
module SDK
|
|
8
|
+
module Domain
|
|
9
|
+
# @attr [String] session
|
|
10
|
+
class PaymentProductSession302SpecificOutput < OnlinePayments::SDK::Domain::DataObject
|
|
11
|
+
|
|
12
|
+
attr_accessor :session
|
|
13
|
+
|
|
14
|
+
# @return (Hash)
|
|
15
|
+
def to_h
|
|
16
|
+
hash = super
|
|
17
|
+
hash['session'] = @session unless @session.nil?
|
|
18
|
+
hash
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def from_hash(hash)
|
|
22
|
+
super
|
|
23
|
+
if hash.has_key? 'session'
|
|
24
|
+
@session = hash['session']
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'onlinepayments/sdk/domain/data_object'
|
|
5
|
+
require 'onlinepayments/sdk/domain/payment_product_session302_specific_input'
|
|
6
|
+
|
|
7
|
+
module OnlinePayments
|
|
8
|
+
module SDK
|
|
9
|
+
module Domain
|
|
10
|
+
# @attr [OnlinePayments::SDK::Domain::PaymentProductSession302SpecificInput] payment_product_session302_specific_input
|
|
11
|
+
class PaymentProductSessionRequest < OnlinePayments::SDK::Domain::DataObject
|
|
12
|
+
|
|
13
|
+
attr_accessor :payment_product_session302_specific_input
|
|
14
|
+
|
|
15
|
+
# @return (Hash)
|
|
16
|
+
def to_h
|
|
17
|
+
hash = super
|
|
18
|
+
hash['paymentProductSession302SpecificInput'] = @payment_product_session302_specific_input.to_h unless @payment_product_session302_specific_input.nil?
|
|
19
|
+
hash
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def from_hash(hash)
|
|
23
|
+
super
|
|
24
|
+
if hash.has_key? 'paymentProductSession302SpecificInput'
|
|
25
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductSession302SpecificInput']] unless hash['paymentProductSession302SpecificInput'].is_a? Hash
|
|
26
|
+
@payment_product_session302_specific_input = OnlinePayments::SDK::Domain::PaymentProductSession302SpecificInput.new_from_hash(hash['paymentProductSession302SpecificInput'])
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'onlinepayments/sdk/domain/data_object'
|
|
5
|
+
require 'onlinepayments/sdk/domain/payment_product_session302_specific_output'
|
|
6
|
+
|
|
7
|
+
module OnlinePayments
|
|
8
|
+
module SDK
|
|
9
|
+
module Domain
|
|
10
|
+
# @attr [OnlinePayments::SDK::Domain::PaymentProductSession302SpecificOutput] payment_product_session302_specific_output
|
|
11
|
+
class PaymentProductSessionResponse < OnlinePayments::SDK::Domain::DataObject
|
|
12
|
+
|
|
13
|
+
attr_accessor :payment_product_session302_specific_output
|
|
14
|
+
|
|
15
|
+
# @return (Hash)
|
|
16
|
+
def to_h
|
|
17
|
+
hash = super
|
|
18
|
+
hash['paymentProductSession302SpecificOutput'] = @payment_product_session302_specific_output.to_h unless @payment_product_session302_specific_output.nil?
|
|
19
|
+
hash
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def from_hash(hash)
|
|
23
|
+
super
|
|
24
|
+
if hash.has_key? 'paymentProductSession302SpecificOutput'
|
|
25
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductSession302SpecificOutput']] unless hash['paymentProductSession302SpecificOutput'].is_a? Hash
|
|
26
|
+
@payment_product_session302_specific_output = OnlinePayments::SDK::Domain::PaymentProductSession302SpecificOutput.new_from_hash(hash['paymentProductSession302SpecificOutput'])
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
require 'onlinepayments/sdk/domain/data_object'
|
|
5
5
|
require 'onlinepayments/sdk/domain/hosted_checkout_specific_output'
|
|
6
|
+
require 'onlinepayments/sdk/domain/operation_output'
|
|
6
7
|
require 'onlinepayments/sdk/domain/payment_output'
|
|
7
8
|
require 'onlinepayments/sdk/domain/payment_status_output'
|
|
8
9
|
require 'onlinepayments/sdk/domain/session_details'
|
|
@@ -12,6 +13,7 @@ module OnlinePayments
|
|
|
12
13
|
module Domain
|
|
13
14
|
# @attr [OnlinePayments::SDK::Domain::HostedCheckoutSpecificOutput] hosted_checkout_specific_output
|
|
14
15
|
# @attr [String] id
|
|
16
|
+
# @attr [OnlinePayments::SDK::Domain::OperationOutput] operation_output
|
|
15
17
|
# @attr [OnlinePayments::SDK::Domain::PaymentOutput] payment_output
|
|
16
18
|
# @attr [OnlinePayments::SDK::Domain::SessionDetails] session_details
|
|
17
19
|
# @attr [String] status
|
|
@@ -22,6 +24,8 @@ module OnlinePayments
|
|
|
22
24
|
|
|
23
25
|
attr_accessor :id
|
|
24
26
|
|
|
27
|
+
attr_accessor :operation_output
|
|
28
|
+
|
|
25
29
|
attr_accessor :payment_output
|
|
26
30
|
|
|
27
31
|
attr_accessor :session_details
|
|
@@ -35,6 +39,7 @@ module OnlinePayments
|
|
|
35
39
|
hash = super
|
|
36
40
|
hash['hostedCheckoutSpecificOutput'] = @hosted_checkout_specific_output.to_h unless @hosted_checkout_specific_output.nil?
|
|
37
41
|
hash['id'] = @id unless @id.nil?
|
|
42
|
+
hash['operationOutput'] = @operation_output.to_h unless @operation_output.nil?
|
|
38
43
|
hash['paymentOutput'] = @payment_output.to_h unless @payment_output.nil?
|
|
39
44
|
hash['sessionDetails'] = @session_details.to_h unless @session_details.nil?
|
|
40
45
|
hash['status'] = @status unless @status.nil?
|
|
@@ -51,6 +56,10 @@ module OnlinePayments
|
|
|
51
56
|
if hash.has_key? 'id'
|
|
52
57
|
@id = hash['id']
|
|
53
58
|
end
|
|
59
|
+
if hash.has_key? 'operationOutput'
|
|
60
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['operationOutput']] unless hash['operationOutput'].is_a? Hash
|
|
61
|
+
@operation_output = OnlinePayments::SDK::Domain::OperationOutput.new_from_hash(hash['operationOutput'])
|
|
62
|
+
end
|
|
54
63
|
if hash.has_key? 'paymentOutput'
|
|
55
64
|
raise TypeError, "value '%s' is not a Hash" % [hash['paymentOutput']] unless hash['paymentOutput'].is_a? Hash
|
|
56
65
|
@payment_output = OnlinePayments::SDK::Domain::PaymentOutput.new_from_hash(hash['paymentOutput'])
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'onlinepayments/sdk/domain/data_object'
|
|
5
|
+
|
|
6
|
+
module OnlinePayments
|
|
7
|
+
module SDK
|
|
8
|
+
module Domain
|
|
9
|
+
# @attr [String] detail
|
|
10
|
+
# @attr [String] instance
|
|
11
|
+
# @attr [Integer] status
|
|
12
|
+
# @attr [String] title
|
|
13
|
+
# @attr [String] type
|
|
14
|
+
class ProblemDetailsResponse < OnlinePayments::SDK::Domain::DataObject
|
|
15
|
+
|
|
16
|
+
attr_accessor :detail
|
|
17
|
+
|
|
18
|
+
attr_accessor :instance
|
|
19
|
+
|
|
20
|
+
attr_accessor :status
|
|
21
|
+
|
|
22
|
+
attr_accessor :title
|
|
23
|
+
|
|
24
|
+
attr_accessor :type
|
|
25
|
+
|
|
26
|
+
# @return (Hash)
|
|
27
|
+
def to_h
|
|
28
|
+
hash = super
|
|
29
|
+
hash['detail'] = @detail unless @detail.nil?
|
|
30
|
+
hash['instance'] = @instance unless @instance.nil?
|
|
31
|
+
hash['status'] = @status unless @status.nil?
|
|
32
|
+
hash['title'] = @title unless @title.nil?
|
|
33
|
+
hash['type'] = @type unless @type.nil?
|
|
34
|
+
hash
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def from_hash(hash)
|
|
38
|
+
super
|
|
39
|
+
if hash.has_key? 'detail'
|
|
40
|
+
@detail = hash['detail']
|
|
41
|
+
end
|
|
42
|
+
if hash.has_key? 'instance'
|
|
43
|
+
@instance = hash['instance']
|
|
44
|
+
end
|
|
45
|
+
if hash.has_key? 'status'
|
|
46
|
+
@status = hash['status']
|
|
47
|
+
end
|
|
48
|
+
if hash.has_key? 'title'
|
|
49
|
+
@title = hash['title']
|
|
50
|
+
end
|
|
51
|
+
if hash.has_key? 'type'
|
|
52
|
+
@type = hash['type']
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'onlinepayments/sdk/domain/data_object'
|
|
5
|
+
|
|
6
|
+
module OnlinePayments
|
|
7
|
+
module SDK
|
|
8
|
+
module Domain
|
|
9
|
+
# @attr [String] expiry_date
|
|
10
|
+
# @attr [true/false] is_temporary
|
|
11
|
+
# @attr [String] masked_pan
|
|
12
|
+
# @attr [String] token_id
|
|
13
|
+
class TokenInfo < OnlinePayments::SDK::Domain::DataObject
|
|
14
|
+
|
|
15
|
+
attr_accessor :expiry_date
|
|
16
|
+
|
|
17
|
+
attr_accessor :is_temporary
|
|
18
|
+
|
|
19
|
+
attr_accessor :masked_pan
|
|
20
|
+
|
|
21
|
+
attr_accessor :token_id
|
|
22
|
+
|
|
23
|
+
# @return (Hash)
|
|
24
|
+
def to_h
|
|
25
|
+
hash = super
|
|
26
|
+
hash['expiryDate'] = @expiry_date unless @expiry_date.nil?
|
|
27
|
+
hash['isTemporary'] = @is_temporary unless @is_temporary.nil?
|
|
28
|
+
hash['maskedPan'] = @masked_pan unless @masked_pan.nil?
|
|
29
|
+
hash['tokenId'] = @token_id unless @token_id.nil?
|
|
30
|
+
hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def from_hash(hash)
|
|
34
|
+
super
|
|
35
|
+
if hash.has_key? 'expiryDate'
|
|
36
|
+
@expiry_date = hash['expiryDate']
|
|
37
|
+
end
|
|
38
|
+
if hash.has_key? 'isTemporary'
|
|
39
|
+
@is_temporary = hash['isTemporary']
|
|
40
|
+
end
|
|
41
|
+
if hash.has_key? 'maskedPan'
|
|
42
|
+
@masked_pan = hash['maskedPan']
|
|
43
|
+
end
|
|
44
|
+
if hash.has_key? 'tokenId'
|
|
45
|
+
@token_id = hash['tokenId']
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -8,12 +8,14 @@ require_relative 'declined_payout_exception'
|
|
|
8
8
|
require_relative 'declined_refund_exception'
|
|
9
9
|
require_relative 'idempotence_exception'
|
|
10
10
|
require_relative 'platform_exception'
|
|
11
|
+
require_relative 'problem_details_exception'
|
|
11
12
|
require_relative 'reference_exception'
|
|
12
13
|
require_relative 'validation_exception'
|
|
13
14
|
|
|
14
15
|
require 'onlinepayments/sdk/domain/error_response'
|
|
15
16
|
require 'onlinepayments/sdk/domain/payment_error_response'
|
|
16
17
|
require 'onlinepayments/sdk/domain/payout_error_response'
|
|
18
|
+
require 'onlinepayments/sdk/domain/problem_details_response'
|
|
17
19
|
require 'onlinepayments/sdk/domain/refund_error_response'
|
|
18
20
|
|
|
19
21
|
module OnlinePayments
|
|
@@ -31,6 +33,9 @@ module OnlinePayments
|
|
|
31
33
|
return DeclinedRefundException.new(status_code, response_body, error_object) unless error_object.refund_result.nil?
|
|
32
34
|
return create_exception_from_response_fields(status_code, response_body, error_object.error_id, error_object.errors, context)
|
|
33
35
|
end
|
|
36
|
+
if error_object.is_a?(OnlinePayments::SDK::Domain::ProblemDetailsResponse)
|
|
37
|
+
return ProblemDetailsException.new(status_code, response_body, error_object)
|
|
38
|
+
end
|
|
34
39
|
raise ArgumentError.new("unsupported error object type: " + error_object.class.name) unless error_object.is_a?(OnlinePayments::SDK::Domain::ErrorResponse)
|
|
35
40
|
create_exception_from_response_fields(status_code, response_body, error_object.error_id, error_object.errors, context)
|
|
36
41
|
end
|
|
@@ -6,6 +6,8 @@ require 'onlinepayments/sdk/exception_factory'
|
|
|
6
6
|
require 'onlinepayments/sdk/communication/response_exception'
|
|
7
7
|
require 'onlinepayments/sdk/domain/create_hosted_fields_session_response'
|
|
8
8
|
require 'onlinepayments/sdk/domain/error_response'
|
|
9
|
+
require 'onlinepayments/sdk/domain/get_hosted_fields_session_response'
|
|
10
|
+
require 'onlinepayments/sdk/domain/problem_details_response'
|
|
9
11
|
|
|
10
12
|
module OnlinePayments
|
|
11
13
|
module SDK
|
|
@@ -50,6 +52,40 @@ module OnlinePayments
|
|
|
50
52
|
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
51
53
|
raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context)
|
|
52
54
|
end
|
|
55
|
+
|
|
56
|
+
# Resource /v2/!{merchantId}/hostedfields/sessions/!{sessionId} - Get hosted fields session
|
|
57
|
+
#
|
|
58
|
+
# @param session_id [String]
|
|
59
|
+
# @param context [OnlinePayments::SDK::CallContext, nil]
|
|
60
|
+
# @return [OnlinePayments::SDK::Domain::GetHostedFieldsSessionResponse]
|
|
61
|
+
# @raise [OnlinePayments::SDK::ProblemDetailsException] if the payment platform returned a problem details error response
|
|
62
|
+
# @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
|
63
|
+
# @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
|
64
|
+
# @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
|
65
|
+
# @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
|
66
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
|
67
|
+
# @raise [OnlinePayments::SDK::PlatformException] if something went wrong at the payment platform,
|
|
68
|
+
# the payment platform was unable to process a message from a downstream partner/acquirer,
|
|
69
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
|
70
|
+
# @raise [OnlinePayments::SDK::ApiException] if the payment platform returned any other error
|
|
71
|
+
def get_hosted_fields_session(session_id, context = nil)
|
|
72
|
+
path_context = {
|
|
73
|
+
'sessionId'.freeze => session_id,
|
|
74
|
+
}
|
|
75
|
+
uri = instantiate_uri('/v2/{merchantId}/hostedfields/sessions/{sessionId}', path_context)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@communicator.get(
|
|
79
|
+
uri,
|
|
80
|
+
client_headers,
|
|
81
|
+
nil,
|
|
82
|
+
OnlinePayments::SDK::Domain::GetHostedFieldsSessionResponse,
|
|
83
|
+
context)
|
|
84
|
+
rescue OnlinePayments::SDK::Communication::ResponseException => e
|
|
85
|
+
error_type = OnlinePayments::SDK::Domain::ProblemDetailsResponse
|
|
86
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
87
|
+
raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context)
|
|
88
|
+
end
|
|
53
89
|
end
|
|
54
90
|
end
|
|
55
91
|
end
|
|
@@ -8,6 +8,7 @@ require 'onlinepayments/sdk/domain/error_response'
|
|
|
8
8
|
require 'onlinepayments/sdk/domain/get_payment_products_response'
|
|
9
9
|
require 'onlinepayments/sdk/domain/payment_product'
|
|
10
10
|
require 'onlinepayments/sdk/domain/payment_product_networks_response'
|
|
11
|
+
require 'onlinepayments/sdk/domain/payment_product_session_response'
|
|
11
12
|
require 'onlinepayments/sdk/domain/product_directory'
|
|
12
13
|
|
|
13
14
|
module OnlinePayments
|
|
@@ -154,6 +155,41 @@ module OnlinePayments
|
|
|
154
155
|
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
155
156
|
raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context)
|
|
156
157
|
end
|
|
158
|
+
|
|
159
|
+
# Resource /v2/!{merchantId}/products/!{paymentProductId}/sessions - Create a session for a payment product
|
|
160
|
+
#
|
|
161
|
+
# @param payment_product_id [Integer]
|
|
162
|
+
# @param body [OnlinePayments::SDK::Domain::PaymentProductSessionRequest]
|
|
163
|
+
# @param context [OnlinePayments::SDK::CallContext, nil]
|
|
164
|
+
# @return [OnlinePayments::SDK::Domain::PaymentProductSessionResponse]
|
|
165
|
+
# @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
|
|
166
|
+
# @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
|
167
|
+
# @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
|
168
|
+
# @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
|
169
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
|
170
|
+
# @raise [OnlinePayments::SDK::PlatformException] if something went wrong at the payment platform,
|
|
171
|
+
# the payment platform was unable to process a message from a downstream partner/acquirer,
|
|
172
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
|
173
|
+
# @raise [OnlinePayments::SDK::ApiException] if the payment platform returned any other error
|
|
174
|
+
def create_payment_product_session(payment_product_id, body, context = nil)
|
|
175
|
+
path_context = {
|
|
176
|
+
'paymentProductId'.freeze => payment_product_id.to_s,
|
|
177
|
+
}
|
|
178
|
+
uri = instantiate_uri('/v2/{merchantId}/products/{paymentProductId}/sessions', path_context)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@communicator.post(
|
|
182
|
+
uri,
|
|
183
|
+
client_headers,
|
|
184
|
+
nil,
|
|
185
|
+
body,
|
|
186
|
+
OnlinePayments::SDK::Domain::PaymentProductSessionResponse,
|
|
187
|
+
context)
|
|
188
|
+
rescue OnlinePayments::SDK::Communication::ResponseException => e
|
|
189
|
+
error_type = OnlinePayments::SDK::Domain::ErrorResponse
|
|
190
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
191
|
+
raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context)
|
|
192
|
+
end
|
|
157
193
|
end
|
|
158
194
|
end
|
|
159
195
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require_relative 'api_exception'
|
|
5
|
+
|
|
6
|
+
module OnlinePayments
|
|
7
|
+
module SDK
|
|
8
|
+
# Represents an error response from the payment platform containing problem details.
|
|
9
|
+
class ProblemDetailsException < ApiException
|
|
10
|
+
|
|
11
|
+
# Create a new ProblemDetailsException.
|
|
12
|
+
# @see ApiException#initialize
|
|
13
|
+
def initialize(status_code, response_body, response)
|
|
14
|
+
super(status_code, response_body, nil, nil, 'the payment platform returned a problem details error response')
|
|
15
|
+
@response = response
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# The problem details response.
|
|
19
|
+
# @return [OnlinePayments::SDK::Domain::ProblemDetailsResponse, nil]
|
|
20
|
+
def response
|
|
21
|
+
@response
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |spec|
|
|
2
2
|
spec.name = 'onlinepayments-sdk-ruby'
|
|
3
|
-
spec.version = '8.
|
|
3
|
+
spec.version = '8.1.0'
|
|
4
4
|
spec.authors = ['Worldline Direct support team']
|
|
5
5
|
spec.email = ['82139942+worldline-direct-support-team@users.noreply.github.com']
|
|
6
6
|
spec.summary = %q{SDK to communicate with the Online Payments platform using the Online Payments Server API}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: onlinepayments-sdk-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.
|
|
4
|
+
version: 8.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Worldline Direct support team
|
|
@@ -287,6 +287,7 @@ files:
|
|
|
287
287
|
- lib/onlinepayments/sdk/domain/g_pay_three_d_secure.rb
|
|
288
288
|
- lib/onlinepayments/sdk/domain/get_batch_status_response.rb
|
|
289
289
|
- lib/onlinepayments/sdk/domain/get_hosted_checkout_response.rb
|
|
290
|
+
- lib/onlinepayments/sdk/domain/get_hosted_fields_session_response.rb
|
|
290
291
|
- lib/onlinepayments/sdk/domain/get_hosted_tokenization_response.rb
|
|
291
292
|
- lib/onlinepayments/sdk/domain/get_iin_details_request.rb
|
|
292
293
|
- lib/onlinepayments/sdk/domain/get_iin_details_response.rb
|
|
@@ -398,6 +399,10 @@ files:
|
|
|
398
399
|
- lib/onlinepayments/sdk/domain/payment_product_filters_hosted_tokenization.rb
|
|
399
400
|
- lib/onlinepayments/sdk/domain/payment_product_group.rb
|
|
400
401
|
- lib/onlinepayments/sdk/domain/payment_product_networks_response.rb
|
|
402
|
+
- lib/onlinepayments/sdk/domain/payment_product_session302_specific_input.rb
|
|
403
|
+
- lib/onlinepayments/sdk/domain/payment_product_session302_specific_output.rb
|
|
404
|
+
- lib/onlinepayments/sdk/domain/payment_product_session_request.rb
|
|
405
|
+
- lib/onlinepayments/sdk/domain/payment_product_session_response.rb
|
|
401
406
|
- lib/onlinepayments/sdk/domain/payment_references.rb
|
|
402
407
|
- lib/onlinepayments/sdk/domain/payment_response.rb
|
|
403
408
|
- lib/onlinepayments/sdk/domain/payment_status_output.rb
|
|
@@ -412,6 +417,7 @@ files:
|
|
|
412
417
|
- lib/onlinepayments/sdk/domain/personal_information_token.rb
|
|
413
418
|
- lib/onlinepayments/sdk/domain/personal_name.rb
|
|
414
419
|
- lib/onlinepayments/sdk/domain/personal_name_token.rb
|
|
420
|
+
- lib/onlinepayments/sdk/domain/problem_details_response.rb
|
|
415
421
|
- lib/onlinepayments/sdk/domain/product302_recurring.rb
|
|
416
422
|
- lib/onlinepayments/sdk/domain/product320_recurring.rb
|
|
417
423
|
- lib/onlinepayments/sdk/domain/product_directory.rb
|
|
@@ -505,6 +511,7 @@ files:
|
|
|
505
511
|
- lib/onlinepayments/sdk/domain/token_card_specific_input.rb
|
|
506
512
|
- lib/onlinepayments/sdk/domain/token_data.rb
|
|
507
513
|
- lib/onlinepayments/sdk/domain/token_e_wallet.rb
|
|
514
|
+
- lib/onlinepayments/sdk/domain/token_info.rb
|
|
508
515
|
- lib/onlinepayments/sdk/domain/token_response.rb
|
|
509
516
|
- lib/onlinepayments/sdk/domain/transaction.rb
|
|
510
517
|
- lib/onlinepayments/sdk/domain/uploadable_file.rb
|
|
@@ -586,6 +593,7 @@ files:
|
|
|
586
593
|
- lib/onlinepayments/sdk/merchant/webhooks.rb
|
|
587
594
|
- lib/onlinepayments/sdk/merchant/webhooks/webhooks_client.rb
|
|
588
595
|
- lib/onlinepayments/sdk/platform_exception.rb
|
|
596
|
+
- lib/onlinepayments/sdk/problem_details_exception.rb
|
|
589
597
|
- lib/onlinepayments/sdk/proxy_configuration.rb
|
|
590
598
|
- lib/onlinepayments/sdk/reference_exception.rb
|
|
591
599
|
- lib/onlinepayments/sdk/validation_exception.rb
|