onlinepayments-sdk-ruby 8.4.0 → 8.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 214a7d33b7e66eba1729b2f5c9d783aa651d58b9433b70b73e7ee12be787171f
4
- data.tar.gz: 3443cef8b63ba39f4ef8045867284e1daef75895cf216da7966ebcadebbf0ab9
3
+ metadata.gz: b9615a0a08130de6acdf0931dc3aaa0b275add41b0498db178c0db5464ee3742
4
+ data.tar.gz: d172cd906ca8936a073cd5c72ba8146e62915f55e621abc28a8c864d76ee02a1
5
5
  SHA512:
6
- metadata.gz: c5808702960a9914a8b5a259676eb6fd583958b451ca46ecb6365e7c4f071740b569854d7a4e879cf08139b19cd2a4817606313952dbe8579902c1c7a86e89db
7
- data.tar.gz: 3f322458e2988857ea119038535ed63cee028a32d815c4ce2917d0cfb5766f06bd2ecd2e43f2f75a181f4aa74739cb6a43aff78fa1f1d6c64f2b9832df314a07
6
+ metadata.gz: dfc3fddbd4e31be6a676a25c04457c147053aed5923b90742b7f029c6520aae2b355f97ad447f9d44a05003fa8ee5889fa0bec6b2e28ecaa81e71e82d398cbc8
7
+ data.tar.gz: cfb1d50eaee277265581fd4e353116b36c3a70b2bd78dce7bd3c5d7e02d537d937fd989f43d5b9cd09146c73272f23a721876675767c5762de4d2744368065c5
@@ -13,7 +13,7 @@ module OnlinePayments
13
13
  class MetadataProvider
14
14
  private
15
15
 
16
- SDK_VERSION = '8.4.0'.freeze
16
+ SDK_VERSION = '8.5.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/card_payment_method_specific_output_summary_card'
5
+ require 'onlinepayments/sdk/domain/data_object'
6
+
7
+ module OnlinePayments
8
+ module SDK
9
+ module Domain
10
+ # @attr [OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutputSummaryCard] card
11
+ # @attr [String] token
12
+ class CardPaymentMethodSpecificOutputSummary < OnlinePayments::SDK::Domain::DataObject
13
+
14
+ attr_accessor :card
15
+
16
+ attr_accessor :token
17
+
18
+ # @return (Hash)
19
+ def to_h
20
+ hash = super
21
+ hash['card'] = @card.to_h unless @card.nil?
22
+ hash['token'] = @token unless @token.nil?
23
+ hash
24
+ end
25
+
26
+ def from_hash(hash)
27
+ super
28
+ if hash.has_key? 'card'
29
+ raise TypeError, "value '%s' is not a Hash" % [hash['card']] unless hash['card'].is_a? Hash
30
+ @card = OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutputSummaryCard.new_from_hash(hash['card'])
31
+ end
32
+ if hash.has_key? 'token'
33
+ @token = hash['token']
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ 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] card_number
10
+ class CardPaymentMethodSpecificOutputSummaryCard < OnlinePayments::SDK::Domain::DataObject
11
+
12
+ attr_accessor :card_number
13
+
14
+ # @return (Hash)
15
+ def to_h
16
+ hash = super
17
+ hash['cardNumber'] = @card_number unless @card_number.nil?
18
+ hash
19
+ end
20
+
21
+ def from_hash(hash)
22
+ super
23
+ if hash.has_key? 'cardNumber'
24
+ @card_number = hash['cardNumber']
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -7,17 +7,21 @@ module OnlinePayments
7
7
  module SDK
8
8
  module Domain
9
9
  # @attr [String] locale
10
+ # @attr [String] origin
10
11
  # @attr [Array<String>] tokens
11
12
  class CreateHostedFieldsSessionRequest < OnlinePayments::SDK::Domain::DataObject
12
13
 
13
14
  attr_accessor :locale
14
15
 
16
+ attr_accessor :origin
17
+
15
18
  attr_accessor :tokens
16
19
 
17
20
  # @return (Hash)
18
21
  def to_h
19
22
  hash = super
20
23
  hash['locale'] = @locale unless @locale.nil?
24
+ hash['origin'] = @origin unless @origin.nil?
21
25
  hash['tokens'] = @tokens unless @tokens.nil?
22
26
  hash
23
27
  end
@@ -27,6 +31,9 @@ module OnlinePayments
27
31
  if hash.has_key? 'locale'
28
32
  @locale = hash['locale']
29
33
  end
34
+ if hash.has_key? 'origin'
35
+ @origin = hash['origin']
36
+ end
30
37
  if hash.has_key? 'tokens'
31
38
  raise TypeError, "value '%s' is not an Array" % [hash['tokens']] unless hash['tokens'].is_a? Array
32
39
  @tokens = []
@@ -7,12 +7,15 @@ require 'onlinepayments/sdk/domain/session_data'
7
7
  module OnlinePayments
8
8
  module SDK
9
9
  module Domain
10
+ # @attr [String] hosted_fields_session_id
10
11
  # @attr [Array<String>] invalid_tokens
11
12
  # @attr [String] sdk_sri
12
13
  # @attr [String] sdk_url
13
14
  # @attr [OnlinePayments::SDK::Domain::SessionData] session_data
14
15
  class CreateHostedFieldsSessionResponse < OnlinePayments::SDK::Domain::DataObject
15
16
 
17
+ attr_accessor :hosted_fields_session_id
18
+
16
19
  attr_accessor :invalid_tokens
17
20
 
18
21
  attr_accessor :sdk_sri
@@ -24,6 +27,7 @@ module OnlinePayments
24
27
  # @return (Hash)
25
28
  def to_h
26
29
  hash = super
30
+ hash['hostedFieldsSessionId'] = @hosted_fields_session_id unless @hosted_fields_session_id.nil?
27
31
  hash['invalidTokens'] = @invalid_tokens unless @invalid_tokens.nil?
28
32
  hash['sdkSri'] = @sdk_sri unless @sdk_sri.nil?
29
33
  hash['sdkUrl'] = @sdk_url unless @sdk_url.nil?
@@ -33,6 +37,9 @@ module OnlinePayments
33
37
 
34
38
  def from_hash(hash)
35
39
  super
40
+ if hash.has_key? 'hostedFieldsSessionId'
41
+ @hosted_fields_session_id = hash['hostedFieldsSessionId']
42
+ end
36
43
  if hash.has_key? 'invalidTokens'
37
44
  raise TypeError, "value '%s' is not an Array" % [hash['invalidTokens']] unless hash['invalidTokens'].is_a? Array
38
45
  @invalid_tokens = []
@@ -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 [true/false] has_more
10
+ # @attr [String] next_cursor
11
+ class CursorPaginationInfo < OnlinePayments::SDK::Domain::DataObject
12
+
13
+ attr_accessor :has_more
14
+
15
+ attr_accessor :next_cursor
16
+
17
+ # @return (Hash)
18
+ def to_h
19
+ hash = super
20
+ hash['hasMore'] = @has_more unless @has_more.nil?
21
+ hash['nextCursor'] = @next_cursor unless @next_cursor.nil?
22
+ hash
23
+ end
24
+
25
+ def from_hash(hash)
26
+ super
27
+ if hash.has_key? 'hasMore'
28
+ @has_more = hash['hasMore']
29
+ end
30
+ if hash.has_key? 'nextCursor'
31
+ @next_cursor = hash['nextCursor']
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -7,14 +7,18 @@ module OnlinePayments
7
7
  module SDK
8
8
  module Domain
9
9
  # @attr [String] email_address
10
+ # @attr [String] phone_number
10
11
  class MandateContactDetails < OnlinePayments::SDK::Domain::DataObject
11
12
 
12
13
  attr_accessor :email_address
13
14
 
15
+ attr_accessor :phone_number
16
+
14
17
  # @return (Hash)
15
18
  def to_h
16
19
  hash = super
17
20
  hash['emailAddress'] = @email_address unless @email_address.nil?
21
+ hash['phoneNumber'] = @phone_number unless @phone_number.nil?
18
22
  hash
19
23
  end
20
24
 
@@ -23,6 +27,9 @@ module OnlinePayments
23
27
  if hash.has_key? 'emailAddress'
24
28
  @email_address = hash['emailAddress']
25
29
  end
30
+ if hash.has_key? 'phoneNumber'
31
+ @phone_number = hash['phoneNumber']
32
+ end
26
33
  end
27
34
  end
28
35
  end
@@ -6,34 +6,55 @@ require 'onlinepayments/sdk/domain/data_object'
6
6
  module OnlinePayments
7
7
  module SDK
8
8
  module Domain
9
+ # @attr [String] merchant_comment
10
+ # @attr [String] merchant_reconciliation_reference
9
11
  # @attr [String] merchant_reference
10
12
  # @attr [String] operation_group_reference
13
+ # @attr [String] soft_descriptor
11
14
  # @attr [String] structured_creditor_reference
12
15
  class OperationPaymentReferences < OnlinePayments::SDK::Domain::DataObject
13
16
 
17
+ attr_accessor :merchant_comment
18
+
19
+ attr_accessor :merchant_reconciliation_reference
20
+
14
21
  attr_accessor :merchant_reference
15
22
 
16
23
  attr_accessor :operation_group_reference
17
24
 
25
+ attr_accessor :soft_descriptor
26
+
18
27
  attr_accessor :structured_creditor_reference
19
28
 
20
29
  # @return (Hash)
21
30
  def to_h
22
31
  hash = super
32
+ hash['merchantComment'] = @merchant_comment unless @merchant_comment.nil?
33
+ hash['merchantReconciliationReference'] = @merchant_reconciliation_reference unless @merchant_reconciliation_reference.nil?
23
34
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
24
35
  hash['operationGroupReference'] = @operation_group_reference unless @operation_group_reference.nil?
36
+ hash['softDescriptor'] = @soft_descriptor unless @soft_descriptor.nil?
25
37
  hash['structuredCreditorReference'] = @structured_creditor_reference unless @structured_creditor_reference.nil?
26
38
  hash
27
39
  end
28
40
 
29
41
  def from_hash(hash)
30
42
  super
43
+ if hash.has_key? 'merchantComment'
44
+ @merchant_comment = hash['merchantComment']
45
+ end
46
+ if hash.has_key? 'merchantReconciliationReference'
47
+ @merchant_reconciliation_reference = hash['merchantReconciliationReference']
48
+ end
31
49
  if hash.has_key? 'merchantReference'
32
50
  @merchant_reference = hash['merchantReference']
33
51
  end
34
52
  if hash.has_key? 'operationGroupReference'
35
53
  @operation_group_reference = hash['operationGroupReference']
36
54
  end
55
+ if hash.has_key? 'softDescriptor'
56
+ @soft_descriptor = hash['softDescriptor']
57
+ end
37
58
  if hash.has_key? 'structuredCreditorReference'
38
59
  @structured_creditor_reference = hash['structuredCreditorReference']
39
60
  end
@@ -7,29 +7,41 @@ module OnlinePayments
7
7
  module SDK
8
8
  module Domain
9
9
  # @attr [String] descriptor
10
+ # @attr [String] merchant_comment
10
11
  # @attr [String] merchant_parameters
12
+ # @attr [String] merchant_reconciliation_reference
11
13
  # @attr [String] merchant_reference
12
14
  # @attr [String] operation_group_reference
15
+ # @attr [String] soft_descriptor
13
16
  # @attr [String] structured_creditor_reference
14
17
  class OrderReferences < OnlinePayments::SDK::Domain::DataObject
15
18
 
16
19
  attr_accessor :descriptor
17
20
 
21
+ attr_accessor :merchant_comment
22
+
18
23
  attr_accessor :merchant_parameters
19
24
 
25
+ attr_accessor :merchant_reconciliation_reference
26
+
20
27
  attr_accessor :merchant_reference
21
28
 
22
29
  attr_accessor :operation_group_reference
23
30
 
31
+ attr_accessor :soft_descriptor
32
+
24
33
  attr_accessor :structured_creditor_reference
25
34
 
26
35
  # @return (Hash)
27
36
  def to_h
28
37
  hash = super
29
38
  hash['descriptor'] = @descriptor unless @descriptor.nil?
39
+ hash['merchantComment'] = @merchant_comment unless @merchant_comment.nil?
30
40
  hash['merchantParameters'] = @merchant_parameters unless @merchant_parameters.nil?
41
+ hash['merchantReconciliationReference'] = @merchant_reconciliation_reference unless @merchant_reconciliation_reference.nil?
31
42
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
32
43
  hash['operationGroupReference'] = @operation_group_reference unless @operation_group_reference.nil?
44
+ hash['softDescriptor'] = @soft_descriptor unless @soft_descriptor.nil?
33
45
  hash['structuredCreditorReference'] = @structured_creditor_reference unless @structured_creditor_reference.nil?
34
46
  hash
35
47
  end
@@ -39,15 +51,24 @@ module OnlinePayments
39
51
  if hash.has_key? 'descriptor'
40
52
  @descriptor = hash['descriptor']
41
53
  end
54
+ if hash.has_key? 'merchantComment'
55
+ @merchant_comment = hash['merchantComment']
56
+ end
42
57
  if hash.has_key? 'merchantParameters'
43
58
  @merchant_parameters = hash['merchantParameters']
44
59
  end
60
+ if hash.has_key? 'merchantReconciliationReference'
61
+ @merchant_reconciliation_reference = hash['merchantReconciliationReference']
62
+ end
45
63
  if hash.has_key? 'merchantReference'
46
64
  @merchant_reference = hash['merchantReference']
47
65
  end
48
66
  if hash.has_key? 'operationGroupReference'
49
67
  @operation_group_reference = hash['operationGroupReference']
50
68
  end
69
+ if hash.has_key? 'softDescriptor'
70
+ @soft_descriptor = hash['softDescriptor']
71
+ end
51
72
  if hash.has_key? 'structuredCreditorReference'
52
73
  @structured_creditor_reference = hash['structuredCreditorReference']
53
74
  end
@@ -0,0 +1,59 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'date'
5
+
6
+ require 'onlinepayments/sdk/domain/amount_of_money'
7
+ require 'onlinepayments/sdk/domain/card_payment_method_specific_output_summary'
8
+ require 'onlinepayments/sdk/domain/data_object'
9
+ require 'onlinepayments/sdk/domain/payment_references'
10
+
11
+ module OnlinePayments
12
+ module SDK
13
+ module Domain
14
+ # @attr [OnlinePayments::SDK::Domain::AmountOfMoney] amount_of_money
15
+ # @attr [OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutputSummary] card_payment_method_specific_output
16
+ # @attr [OnlinePayments::SDK::Domain::PaymentReferences] references
17
+ # @attr [DateTime] transaction_date
18
+ class PaymentOutputSummary < OnlinePayments::SDK::Domain::DataObject
19
+
20
+ attr_accessor :amount_of_money
21
+
22
+ attr_accessor :card_payment_method_specific_output
23
+
24
+ attr_accessor :references
25
+
26
+ attr_accessor :transaction_date
27
+
28
+ # @return (Hash)
29
+ def to_h
30
+ hash = super
31
+ hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil?
32
+ hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil?
33
+ hash['references'] = @references.to_h unless @references.nil?
34
+ hash['transactionDate'] = @transaction_date.iso8601(3) unless @transaction_date.nil?
35
+ hash
36
+ end
37
+
38
+ def from_hash(hash)
39
+ super
40
+ if hash.has_key? 'amountOfMoney'
41
+ raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
42
+ @amount_of_money = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
43
+ end
44
+ if hash.has_key? 'cardPaymentMethodSpecificOutput'
45
+ raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificOutput']] unless hash['cardPaymentMethodSpecificOutput'].is_a? Hash
46
+ @card_payment_method_specific_output = OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutputSummary.new_from_hash(hash['cardPaymentMethodSpecificOutput'])
47
+ end
48
+ if hash.has_key? 'references'
49
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
50
+ @references = OnlinePayments::SDK::Domain::PaymentReferences.new_from_hash(hash['references'])
51
+ end
52
+ if hash.has_key? 'transactionDate'
53
+ @transaction_date = DateTime.parse(hash['transactionDate'])
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -6,41 +6,62 @@ require 'onlinepayments/sdk/domain/data_object'
6
6
  module OnlinePayments
7
7
  module SDK
8
8
  module Domain
9
+ # @attr [String] merchant_comment
9
10
  # @attr [String] merchant_parameters
11
+ # @attr [String] merchant_reconciliation_reference
10
12
  # @attr [String] merchant_reference
11
13
  # @attr [String] operation_group_reference
14
+ # @attr [String] soft_descriptor
12
15
  # @attr [String] structured_creditor_reference
13
16
  class PaymentReferences < OnlinePayments::SDK::Domain::DataObject
14
17
 
18
+ attr_accessor :merchant_comment
19
+
15
20
  attr_accessor :merchant_parameters
16
21
 
22
+ attr_accessor :merchant_reconciliation_reference
23
+
17
24
  attr_accessor :merchant_reference
18
25
 
19
26
  attr_accessor :operation_group_reference
20
27
 
28
+ attr_accessor :soft_descriptor
29
+
21
30
  attr_accessor :structured_creditor_reference
22
31
 
23
32
  # @return (Hash)
24
33
  def to_h
25
34
  hash = super
35
+ hash['merchantComment'] = @merchant_comment unless @merchant_comment.nil?
26
36
  hash['merchantParameters'] = @merchant_parameters unless @merchant_parameters.nil?
37
+ hash['merchantReconciliationReference'] = @merchant_reconciliation_reference unless @merchant_reconciliation_reference.nil?
27
38
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
28
39
  hash['operationGroupReference'] = @operation_group_reference unless @operation_group_reference.nil?
40
+ hash['softDescriptor'] = @soft_descriptor unless @soft_descriptor.nil?
29
41
  hash['structuredCreditorReference'] = @structured_creditor_reference unless @structured_creditor_reference.nil?
30
42
  hash
31
43
  end
32
44
 
33
45
  def from_hash(hash)
34
46
  super
47
+ if hash.has_key? 'merchantComment'
48
+ @merchant_comment = hash['merchantComment']
49
+ end
35
50
  if hash.has_key? 'merchantParameters'
36
51
  @merchant_parameters = hash['merchantParameters']
37
52
  end
53
+ if hash.has_key? 'merchantReconciliationReference'
54
+ @merchant_reconciliation_reference = hash['merchantReconciliationReference']
55
+ end
38
56
  if hash.has_key? 'merchantReference'
39
57
  @merchant_reference = hash['merchantReference']
40
58
  end
41
59
  if hash.has_key? 'operationGroupReference'
42
60
  @operation_group_reference = hash['operationGroupReference']
43
61
  end
62
+ if hash.has_key? 'softDescriptor'
63
+ @soft_descriptor = hash['softDescriptor']
64
+ end
44
65
  if hash.has_key? 'structuredCreditorReference'
45
66
  @structured_creditor_reference = hash['structuredCreditorReference']
46
67
  end
@@ -0,0 +1,56 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'onlinepayments/sdk/domain/api_error'
5
+ require 'onlinepayments/sdk/domain/data_object'
6
+
7
+ module OnlinePayments
8
+ module SDK
9
+ module Domain
10
+ # @attr [Array<OnlinePayments::SDK::Domain::APIError>] errors
11
+ # @attr [String] status_category
12
+ # @attr [Integer] status_code
13
+ # @attr [String] status_code_change_date_time
14
+ class PaymentStatusOutputSummary < OnlinePayments::SDK::Domain::DataObject
15
+
16
+ attr_accessor :errors
17
+
18
+ attr_accessor :status_category
19
+
20
+ attr_accessor :status_code
21
+
22
+ attr_accessor :status_code_change_date_time
23
+
24
+ # @return (Hash)
25
+ def to_h
26
+ hash = super
27
+ hash['errors'] = @errors.collect{|val| val.to_h} unless @errors.nil?
28
+ hash['statusCategory'] = @status_category unless @status_category.nil?
29
+ hash['statusCode'] = @status_code unless @status_code.nil?
30
+ hash['statusCodeChangeDateTime'] = @status_code_change_date_time unless @status_code_change_date_time.nil?
31
+ hash
32
+ end
33
+
34
+ def from_hash(hash)
35
+ super
36
+ if hash.has_key? 'errors'
37
+ raise TypeError, "value '%s' is not an Array" % [hash['errors']] unless hash['errors'].is_a? Array
38
+ @errors = []
39
+ hash['errors'].each do |e|
40
+ @errors << OnlinePayments::SDK::Domain::APIError.new_from_hash(e)
41
+ end
42
+ end
43
+ if hash.has_key? 'statusCategory'
44
+ @status_category = hash['statusCategory']
45
+ end
46
+ if hash.has_key? 'statusCode'
47
+ @status_code = hash['statusCode']
48
+ end
49
+ if hash.has_key? 'statusCodeChangeDateTime'
50
+ @status_code_change_date_time = hash['statusCodeChangeDateTime']
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,55 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'onlinepayments/sdk/domain/data_object'
5
+ require 'onlinepayments/sdk/domain/payment_output_summary'
6
+ require 'onlinepayments/sdk/domain/payment_status_output_summary'
7
+
8
+ module OnlinePayments
9
+ module SDK
10
+ module Domain
11
+ # @attr [String] id
12
+ # @attr [OnlinePayments::SDK::Domain::PaymentOutputSummary] payment_output
13
+ # @attr [String] status
14
+ # @attr [OnlinePayments::SDK::Domain::PaymentStatusOutputSummary] status_output
15
+ class PaymentSummary < OnlinePayments::SDK::Domain::DataObject
16
+
17
+ attr_accessor :id
18
+
19
+ attr_accessor :payment_output
20
+
21
+ attr_accessor :status
22
+
23
+ attr_accessor :status_output
24
+
25
+ # @return (Hash)
26
+ def to_h
27
+ hash = super
28
+ hash['id'] = @id unless @id.nil?
29
+ hash['paymentOutput'] = @payment_output.to_h unless @payment_output.nil?
30
+ hash['status'] = @status unless @status.nil?
31
+ hash['statusOutput'] = @status_output.to_h unless @status_output.nil?
32
+ hash
33
+ end
34
+
35
+ def from_hash(hash)
36
+ super
37
+ if hash.has_key? 'id'
38
+ @id = hash['id']
39
+ end
40
+ if hash.has_key? 'paymentOutput'
41
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentOutput']] unless hash['paymentOutput'].is_a? Hash
42
+ @payment_output = OnlinePayments::SDK::Domain::PaymentOutputSummary.new_from_hash(hash['paymentOutput'])
43
+ end
44
+ if hash.has_key? 'status'
45
+ @status = hash['status']
46
+ end
47
+ if hash.has_key? 'statusOutput'
48
+ raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash
49
+ @status_output = OnlinePayments::SDK::Domain::PaymentStatusOutputSummary.new_from_hash(hash['statusOutput'])
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,44 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'onlinepayments/sdk/domain/cursor_pagination_info'
5
+ require 'onlinepayments/sdk/domain/data_object'
6
+ require 'onlinepayments/sdk/domain/payment_summary'
7
+
8
+ module OnlinePayments
9
+ module SDK
10
+ module Domain
11
+ # @attr [OnlinePayments::SDK::Domain::CursorPaginationInfo] pagination
12
+ # @attr [Array<OnlinePayments::SDK::Domain::PaymentSummary>] payments
13
+ class PaymentsReportResponse < OnlinePayments::SDK::Domain::DataObject
14
+
15
+ attr_accessor :pagination
16
+
17
+ attr_accessor :payments
18
+
19
+ # @return (Hash)
20
+ def to_h
21
+ hash = super
22
+ hash['pagination'] = @pagination.to_h unless @pagination.nil?
23
+ hash['payments'] = @payments.collect{|val| val.to_h} unless @payments.nil?
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key? 'pagination'
30
+ raise TypeError, "value '%s' is not a Hash" % [hash['pagination']] unless hash['pagination'].is_a? Hash
31
+ @pagination = OnlinePayments::SDK::Domain::CursorPaginationInfo.new_from_hash(hash['pagination'])
32
+ end
33
+ if hash.has_key? 'payments'
34
+ raise TypeError, "value '%s' is not an Array" % [hash['payments']] unless hash['payments'].is_a? Array
35
+ @payments = []
36
+ hash['payments'].each do |e|
37
+ @payments << OnlinePayments::SDK::Domain::PaymentSummary.new_from_hash(e)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -45,38 +45,38 @@ module OnlinePayments
45
45
 
46
46
  def self.create_exception_from_response_fields(status_code, response_body, error_id, errors, context)
47
47
  case status_code
48
- when 400
49
- return ValidationException.new(status_code, response_body, error_id, errors)
50
- when 403
51
- return AuthorizationException.new(status_code, response_body, error_id, errors)
52
- when 404
53
- return ReferenceException.new(status_code, response_body, error_id, errors)
54
- when 409
55
- if is_idempotence_error(errors, context)
56
- idempotence_key = context.idempotence_key
57
- idempotence_request_timestamp = context.idempotence_request_timestamp
58
- return IdempotenceException.new(status_code, response_body, error_id, errors,
59
- idempotence_key, idempotence_request_timestamp)
60
- else
48
+ when 400
49
+ return ValidationException.new(status_code, response_body, error_id, errors)
50
+ when 403
51
+ return AuthorizationException.new(status_code, response_body, error_id, errors)
52
+ when 404
53
+ return ReferenceException.new(status_code, response_body, error_id, errors)
54
+ when 409
55
+ if is_idempotence_error(errors, context)
56
+ idempotence_key = context.idempotence_key
57
+ idempotence_request_timestamp = context.idempotence_request_timestamp
58
+ return IdempotenceException.new(status_code, response_body, error_id, errors,
59
+ idempotence_key, idempotence_request_timestamp)
60
+ else
61
+ return ReferenceException.new(status_code, response_body, error_id, errors)
62
+ end
63
+ when 410
61
64
  return ReferenceException.new(status_code, response_body, error_id, errors)
62
- end
63
- when 410
64
- return ReferenceException.new(status_code, response_body, error_id, errors)
65
- when 500
66
- return PlatformException.new(status_code, response_body, error_id, errors)
67
- when 502
68
- return PlatformException.new(status_code, response_body, error_id, errors)
69
- when 503
70
- return PlatformException.new(status_code, response_body, error_id, errors)
71
- else
72
- return ApiException.new(status_code, response_body, error_id, errors)
65
+ when 500
66
+ return PlatformException.new(status_code, response_body, error_id, errors)
67
+ when 502
68
+ return PlatformException.new(status_code, response_body, error_id, errors)
69
+ when 503
70
+ return PlatformException.new(status_code, response_body, error_id, errors)
71
+ else
72
+ return ApiException.new(status_code, response_body, error_id, errors)
73
73
  end
74
74
  end
75
75
 
76
76
  def self.is_idempotence_error(errors, context)
77
77
  !context&.idempotence_key.nil? &&
78
78
  errors&.length == 1 &&
79
- errors[0]&.error_code == '1409'
79
+ errors[0]&.error_code == '1409'
80
80
  end
81
81
  end
82
82
  end
@@ -0,0 +1,32 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'onlinepayments/sdk/communication/param_request'
5
+ require 'onlinepayments/sdk/communication/request_param'
6
+
7
+ module OnlinePayments
8
+ module SDK
9
+ module Merchant
10
+ module MerchantBatch
11
+ # Query parameters for Get payments report (/v2/{merchantId}/merchant-batches/{merchantBatchReference}/reports/payments)
12
+ #
13
+ # @attr [String] cursor
14
+ # @attr [Integer] limit
15
+ class GetPaymentsReportParams < OnlinePayments::SDK::Communication::ParamRequest
16
+
17
+ attr_accessor :cursor
18
+
19
+ attr_accessor :limit
20
+
21
+ # @return [Array<OnlinePayments::SDK::Communication::RequestParam>] representing the attributes of this class
22
+ def to_request_parameters
23
+ result = []
24
+ result << OnlinePayments::SDK::Communication::RequestParam.new('cursor', @cursor) unless @cursor.nil?
25
+ result << OnlinePayments::SDK::Communication::RequestParam.new('limit', @limit.to_s) unless @limit.nil?
26
+ result
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -6,6 +6,7 @@ require 'onlinepayments/sdk/exception_factory'
6
6
  require 'onlinepayments/sdk/communication/response_exception'
7
7
  require 'onlinepayments/sdk/domain/error_response'
8
8
  require 'onlinepayments/sdk/domain/get_batch_status_response'
9
+ require 'onlinepayments/sdk/domain/payments_report_response'
9
10
  require 'onlinepayments/sdk/domain/submit_batch_response'
10
11
 
11
12
  module OnlinePayments
@@ -119,6 +120,40 @@ module OnlinePayments
119
120
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
120
121
  raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context)
121
122
  end
123
+
124
+ # Resource /v2/!{merchantId}/merchant-batches/!{merchantBatchReference}/reports/payments - Get payments report
125
+ #
126
+ # @param merchant_batch_reference [String]
127
+ # @param query [OnlinePayments::SDK::Merchant::MerchantBatch::GetPaymentsReportParams]
128
+ # @param context [OnlinePayments::SDK::CallContext, nil]
129
+ # @return [OnlinePayments::SDK::Domain::PaymentsReportResponse]
130
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
131
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
132
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
133
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
134
+ # or there was a conflict (HTTP status code 404, 409 or 410)
135
+ # @raise [OnlinePayments::SDK::PlatformException] if something went wrong at the payment platform,
136
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
137
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
138
+ # @raise [OnlinePayments::SDK::ApiException] if the payment platform returned any other error
139
+ def get_payments_report(merchant_batch_reference, query, context = nil)
140
+ path_context = {
141
+ 'merchantBatchReference'.freeze => merchant_batch_reference,
142
+ }
143
+ uri = instantiate_uri('/v2/{merchantId}/merchant-batches/{merchantBatchReference}/reports/payments', path_context)
144
+
145
+
146
+ @communicator.get(
147
+ uri,
148
+ client_headers,
149
+ query,
150
+ OnlinePayments::SDK::Domain::PaymentsReportResponse,
151
+ context)
152
+ rescue OnlinePayments::SDK::Communication::ResponseException => e
153
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
154
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
155
+ raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context)
156
+ end
122
157
  end
123
158
  end
124
159
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'onlinepayments-sdk-ruby'
3
- spec.version = '8.4.0'
3
+ spec.version = '8.5.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.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Worldline Direct support team
@@ -221,6 +221,8 @@ files:
221
221
  - lib/onlinepayments/sdk/domain/card_payment_method_specific_input_base.rb
222
222
  - lib/onlinepayments/sdk/domain/card_payment_method_specific_input_for_hosted_checkout.rb
223
223
  - lib/onlinepayments/sdk/domain/card_payment_method_specific_output.rb
224
+ - lib/onlinepayments/sdk/domain/card_payment_method_specific_output_summary.rb
225
+ - lib/onlinepayments/sdk/domain/card_payment_method_specific_output_summary_card.rb
224
226
  - lib/onlinepayments/sdk/domain/card_payout_method_specific_input.rb
225
227
  - lib/onlinepayments/sdk/domain/card_recurrence_details.rb
226
228
  - lib/onlinepayments/sdk/domain/card_source.rb
@@ -259,6 +261,7 @@ files:
259
261
  - lib/onlinepayments/sdk/domain/currency_conversion_response.rb
260
262
  - lib/onlinepayments/sdk/domain/currency_conversion_result.rb
261
263
  - lib/onlinepayments/sdk/domain/currency_conversion_specific_input.rb
264
+ - lib/onlinepayments/sdk/domain/cursor_pagination_info.rb
262
265
  - lib/onlinepayments/sdk/domain/customer.rb
263
266
  - lib/onlinepayments/sdk/domain/customer_account.rb
264
267
  - lib/onlinepayments/sdk/domain/customer_account_authentication.rb
@@ -357,6 +360,7 @@ files:
357
360
  - lib/onlinepayments/sdk/domain/payment_link_specific_input.rb
358
361
  - lib/onlinepayments/sdk/domain/payment_links_response.rb
359
362
  - lib/onlinepayments/sdk/domain/payment_output.rb
363
+ - lib/onlinepayments/sdk/domain/payment_output_summary.rb
360
364
  - lib/onlinepayments/sdk/domain/payment_product.rb
361
365
  - lib/onlinepayments/sdk/domain/payment_product130_specific_input.rb
362
366
  - lib/onlinepayments/sdk/domain/payment_product130_specific_three_d_secure.rb
@@ -406,6 +410,9 @@ files:
406
410
  - lib/onlinepayments/sdk/domain/payment_references.rb
407
411
  - lib/onlinepayments/sdk/domain/payment_response.rb
408
412
  - lib/onlinepayments/sdk/domain/payment_status_output.rb
413
+ - lib/onlinepayments/sdk/domain/payment_status_output_summary.rb
414
+ - lib/onlinepayments/sdk/domain/payment_summary.rb
415
+ - lib/onlinepayments/sdk/domain/payments_report_response.rb
409
416
  - lib/onlinepayments/sdk/domain/payout_card_payment_method_specific_output.rb
410
417
  - lib/onlinepayments/sdk/domain/payout_error_response.rb
411
418
  - lib/onlinepayments/sdk/domain/payout_output.rb
@@ -557,6 +564,7 @@ files:
557
564
  - lib/onlinepayments/sdk/merchant/mandates/mandates_client.rb
558
565
  - lib/onlinepayments/sdk/merchant/merchant_client.rb
559
566
  - lib/onlinepayments/sdk/merchant/merchantbatch.rb
567
+ - lib/onlinepayments/sdk/merchant/merchantbatch/get_payments_report_params.rb
560
568
  - lib/onlinepayments/sdk/merchant/merchantbatch/merchant_batch_client.rb
561
569
  - lib/onlinepayments/sdk/merchant/paymentlinks.rb
562
570
  - lib/onlinepayments/sdk/merchant/paymentlinks/get_payment_links_in_bulk_params.rb