onlinepayments-sdk-ruby 3.3.0 → 4.0.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: eb15584f49b1b90c0cede980de44a2eae2afd5eb1fe254859581a7391d5fca6a
4
- data.tar.gz: d3341c23e5433b0c4a6e550f5446e2d5f66962ebad0883992f648a967d0cd210
3
+ metadata.gz: 798ac2c299201457114d254ca4dd555af4ece6e3c0e9835f23dc7034f00565df
4
+ data.tar.gz: f75a681a88a307aafe5562ae4c23e0be5efd1ab8ef8c94ff8a5b84abc0b87768
5
5
  SHA512:
6
- metadata.gz: d80aeb2f72e6715cc61980a52aef26cded8cf48c02cffd7b55d3682ac9905dd49f1303005d4117e633c80b2cdff2520f4ccc27115ef3391aeaeb18cb9c61bd94
7
- data.tar.gz: 7a80eaedc398ed1e0ba479d18bd2ac6ced5c7eb5683d077dff3291dbf10a4372e230242f30e6a8d550d1ec83940e64733620b9423420c7911018939f4e237665
6
+ metadata.gz: 28cbab7009596844bcb2ef116155c6243a4c8457c747f544d0eed3a6a3b9bbb7c56d996f438b5e33143605441d39d01a7b4febfbd89338faeed2fb31f16dfd18
7
+ data.tar.gz: 81abd4440383843dcb5afb318eeed0c5e7e5af61d061fdf9758d0d03661e936df2ed97b258aef4d56a1926ad73547425b79c0304e49693571ada27c2fc5c371c
@@ -8,6 +8,7 @@ module OnlinePayments::SDK
8
8
 
9
9
  # @attr [String] category
10
10
  # @attr [String] code
11
+ # @attr [String] error_code
11
12
  # @attr [Integer] http_status_code
12
13
  # @attr [String] id
13
14
  # @attr [String] message
@@ -15,6 +16,7 @@ module OnlinePayments::SDK
15
16
  class APIError < OnlinePayments::SDK::DataObject
16
17
  attr_accessor :category
17
18
  attr_accessor :code
19
+ attr_accessor :error_code
18
20
  attr_accessor :http_status_code
19
21
  attr_accessor :id
20
22
  attr_accessor :message
@@ -25,6 +27,7 @@ module OnlinePayments::SDK
25
27
  hash = super
26
28
  hash['category'] = @category unless @category.nil?
27
29
  hash['code'] = @code unless @code.nil?
30
+ hash['errorCode'] = @error_code unless @error_code.nil?
28
31
  hash['httpStatusCode'] = @http_status_code unless @http_status_code.nil?
29
32
  hash['id'] = @id unless @id.nil?
30
33
  hash['message'] = @message unless @message.nil?
@@ -36,6 +39,7 @@ module OnlinePayments::SDK
36
39
  super
37
40
  @category = hash['category'] if hash.key? 'category'
38
41
  @code = hash['code'] if hash.key? 'code'
42
+ @error_code = hash['errorCode'] if hash.key? 'errorCode'
39
43
  @http_status_code = hash['httpStatusCode'] if hash.key? 'httpStatusCode'
40
44
  @id = hash['id'] if hash.key? 'id'
41
45
  @message = hash['message'] if hash.key? 'message'
@@ -0,0 +1,34 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+ require 'onlinepayments/sdk/domain/amount_of_money'
6
+
7
+ module OnlinePayments::SDK
8
+ module Domain
9
+
10
+ # @attr [OnlinePayments::SDK::Domain::AmountOfMoney] amount_of_money
11
+ # @attr [true/false] is_final
12
+ class CancelPaymentRequest < OnlinePayments::SDK::DataObject
13
+ attr_accessor :amount_of_money
14
+ attr_accessor :is_final
15
+
16
+ # @return (Hash)
17
+ def to_h
18
+ hash = super
19
+ hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money
20
+ hash['isFinal'] = @is_final unless @is_final.nil?
21
+ hash
22
+ end
23
+
24
+ def from_hash(hash)
25
+ super
26
+ if hash.key? 'amountOfMoney'
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
28
+ @amount_of_money = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
29
+ end
30
+ @is_final = hash['isFinal'] if hash.key? 'isFinal'
31
+ end
32
+ end
33
+ end
34
+ end
@@ -18,6 +18,7 @@ module OnlinePayments::SDK
18
18
  # @attr [Integer] payment_product_id
19
19
  # @attr [OnlinePayments::SDK::Domain::CardRecurrenceDetails] recurring
20
20
  # @attr [String] return_url
21
+ # @attr [String] scheme_reference_data
21
22
  # @attr [true/false] skip_authentication
22
23
  # @attr [OnlinePayments::SDK::Domain::ThreeDSecure] three_d_secure
23
24
  # @attr [String] token
@@ -34,6 +35,7 @@ module OnlinePayments::SDK
34
35
  attr_accessor :payment_product_id
35
36
  attr_accessor :recurring
36
37
  attr_accessor :return_url
38
+ attr_accessor :scheme_reference_data
37
39
  attr_accessor :skip_authentication
38
40
  attr_accessor :three_d_secure
39
41
  attr_accessor :token
@@ -53,6 +55,7 @@ module OnlinePayments::SDK
53
55
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
54
56
  hash['recurring'] = @recurring.to_h if @recurring
55
57
  hash['returnUrl'] = @return_url unless @return_url.nil?
58
+ hash['schemeReferenceData'] = @scheme_reference_data unless @scheme_reference_data.nil?
56
59
  hash['skipAuthentication'] = @skip_authentication unless @skip_authentication.nil?
57
60
  hash['threeDSecure'] = @three_d_secure.to_h if @three_d_secure
58
61
  hash['token'] = @token unless @token.nil?
@@ -82,6 +85,7 @@ module OnlinePayments::SDK
82
85
  @recurring = OnlinePayments::SDK::Domain::CardRecurrenceDetails.new_from_hash(hash['recurring'])
83
86
  end
84
87
  @return_url = hash['returnUrl'] if hash.key? 'returnUrl'
88
+ @scheme_reference_data = hash['schemeReferenceData'] if hash.key? 'schemeReferenceData'
85
89
  @skip_authentication = hash['skipAuthentication'] if hash.key? 'skipAuthentication'
86
90
  if hash.key? 'threeDSecure'
87
91
  raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecure']] unless hash['threeDSecure'].is_a? Hash
@@ -0,0 +1,26 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+
6
+ module OnlinePayments::SDK
7
+ module Domain
8
+
9
+ # @attr [String] ip_address_country_code
10
+ class CustomerDeviceOutput < OnlinePayments::SDK::DataObject
11
+ attr_accessor :ip_address_country_code
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['ipAddressCountryCode'] = @ip_address_country_code unless @ip_address_country_code.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @ip_address_country_code = hash['ipAddressCountryCode'] if hash.key? 'ipAddressCountryCode'
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,30 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+ require 'onlinepayments/sdk/domain/customer_device_output'
6
+
7
+ module OnlinePayments::SDK
8
+ module Domain
9
+
10
+ # @attr [OnlinePayments::SDK::Domain::CustomerDeviceOutput] device
11
+ class CustomerOutput < OnlinePayments::SDK::DataObject
12
+ attr_accessor :device
13
+
14
+ # @return (Hash)
15
+ def to_h
16
+ hash = super
17
+ hash['device'] = @device.to_h if @device
18
+ hash
19
+ end
20
+
21
+ def from_hash(hash)
22
+ super
23
+ if hash.key? 'device'
24
+ raise TypeError, "value '%s' is not a Hash" % [hash['device']] unless hash['device'].is_a? Hash
25
+ @device = OnlinePayments::SDK::Domain::CustomerDeviceOutput.new_from_hash(hash['device'])
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,26 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+
6
+ module OnlinePayments::SDK
7
+ module Domain
8
+
9
+ # @attr [String] html_content
10
+ class GetPrivacyPolicyResponse < OnlinePayments::SDK::DataObject
11
+ attr_accessor :html_content
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['htmlContent'] = @html_content unless @html_content.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @html_content = hash['htmlContent'] if hash.key? 'htmlContent'
23
+ end
24
+ end
25
+ end
26
+ end
@@ -4,6 +4,7 @@
4
4
  require 'onlinepayments/sdk/data_object'
5
5
  require 'onlinepayments/sdk/domain/amount_of_money'
6
6
  require 'onlinepayments/sdk/domain/card_payment_method_specific_output'
7
+ require 'onlinepayments/sdk/domain/customer_output'
7
8
  require 'onlinepayments/sdk/domain/mobile_payment_method_specific_output'
8
9
  require 'onlinepayments/sdk/domain/payment_references'
9
10
  require 'onlinepayments/sdk/domain/redirect_payment_method_specific_output'
@@ -15,6 +16,7 @@ module OnlinePayments::SDK
15
16
  # @attr [OnlinePayments::SDK::Domain::AmountOfMoney] amount_of_money
16
17
  # @attr [Long] amount_paid
17
18
  # @attr [OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutput] card_payment_method_specific_output
19
+ # @attr [OnlinePayments::SDK::Domain::CustomerOutput] customer
18
20
  # @attr [String] merchant_parameters
19
21
  # @attr [OnlinePayments::SDK::Domain::MobilePaymentMethodSpecificOutput] mobile_payment_method_specific_output
20
22
  # @attr [String] payment_method
@@ -25,6 +27,7 @@ module OnlinePayments::SDK
25
27
  attr_accessor :amount_of_money
26
28
  attr_accessor :amount_paid
27
29
  attr_accessor :card_payment_method_specific_output
30
+ attr_accessor :customer
28
31
  attr_accessor :merchant_parameters
29
32
  attr_accessor :mobile_payment_method_specific_output
30
33
  attr_accessor :payment_method
@@ -38,6 +41,7 @@ module OnlinePayments::SDK
38
41
  hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money
39
42
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
40
43
  hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h if @card_payment_method_specific_output
44
+ hash['customer'] = @customer.to_h if @customer
41
45
  hash['merchantParameters'] = @merchant_parameters unless @merchant_parameters.nil?
42
46
  hash['mobilePaymentMethodSpecificOutput'] = @mobile_payment_method_specific_output.to_h if @mobile_payment_method_specific_output
43
47
  hash['paymentMethod'] = @payment_method unless @payment_method.nil?
@@ -58,6 +62,10 @@ module OnlinePayments::SDK
58
62
  raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificOutput']] unless hash['cardPaymentMethodSpecificOutput'].is_a? Hash
59
63
  @card_payment_method_specific_output = OnlinePayments::SDK::Domain::CardPaymentMethodSpecificOutput.new_from_hash(hash['cardPaymentMethodSpecificOutput'])
60
64
  end
65
+ if hash.key? 'customer'
66
+ raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash
67
+ @customer = OnlinePayments::SDK::Domain::CustomerOutput.new_from_hash(hash['customer'])
68
+ end
61
69
  @merchant_parameters = hash['merchantParameters'] if hash.key? 'merchantParameters'
62
70
  if hash.key? 'mobilePaymentMethodSpecificOutput'
63
71
  raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificOutput']] unless hash['mobilePaymentMethodSpecificOutput'].is_a? Hash
@@ -3,6 +3,7 @@
3
3
  #
4
4
  require 'onlinepayments/sdk/api_resource'
5
5
  require 'onlinepayments/sdk/response_exception'
6
+ require 'onlinepayments/sdk/domain/cancel_payment_request'
6
7
  require 'onlinepayments/sdk/domain/cancel_payment_response'
7
8
  require 'onlinepayments/sdk/domain/capture_payment_request'
8
9
  require 'onlinepayments/sdk/domain/capture_response'
@@ -128,6 +129,7 @@ module OnlinePayments::SDK
128
129
 
129
130
  # Resource /v2/!{merchantId}/payments/!{paymentId}/cancel
130
131
  # @param payment_id [String]
132
+ # @param body [OnlinePayments::SDK::Domain::CancelPaymentRequest]
131
133
  # @param context [OnlinePayments::SDK::CallContext]
132
134
  # @return [OnlinePayments::SDK::Domain::CancelPaymentResponse]
133
135
  # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
@@ -139,7 +141,7 @@ module OnlinePayments::SDK
139
141
  # the payment platform was unable to process a message from a downstream partner/acquirer,
140
142
  # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
141
143
  # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
142
- def cancel_payment(payment_id, context = nil)
144
+ def cancel_payment(payment_id, body = nil, context = nil)
143
145
  path_context = {
144
146
  'paymentId'.freeze => payment_id,
145
147
  }
@@ -148,7 +150,7 @@ module OnlinePayments::SDK
148
150
  uri,
149
151
  client_headers,
150
152
  nil,
151
- nil,
153
+ body,
152
154
  OnlinePayments::SDK::Domain::CancelPaymentResponse,
153
155
  context
154
156
  )
@@ -0,0 +1,30 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/param_request'
5
+ require 'onlinepayments/sdk/request_param'
6
+
7
+ module OnlinePayments::SDK
8
+ module Merchant
9
+ module Services
10
+
11
+ # Query parameters for 'Get Privacy Policy'.
12
+ # @attr [String] locale
13
+ # @attr [Integer] payment_product_id
14
+ class GetPrivacyPolicyParams < OnlinePayments::SDK::ParamRequest
15
+
16
+ attr_accessor :locale
17
+
18
+ attr_accessor :payment_product_id
19
+
20
+ # @return [Array<OnlinePayments::SDK::RequestParam>] representing the attributes of this class
21
+ def to_request_parameters
22
+ result = []
23
+ result << RequestParam.new('locale', @locale) unless @locale.nil?
24
+ result << RequestParam.new('paymentProductId', @payment_product_id.to_s) unless @payment_product_id.nil?
25
+ result
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -6,7 +6,9 @@ require 'onlinepayments/sdk/response_exception'
6
6
  require 'onlinepayments/sdk/domain/error_response'
7
7
  require 'onlinepayments/sdk/domain/get_iin_details_request'
8
8
  require 'onlinepayments/sdk/domain/get_iin_details_response'
9
+ require 'onlinepayments/sdk/domain/get_privacy_policy_response'
9
10
  require 'onlinepayments/sdk/domain/test_connection'
11
+ require 'onlinepayments/sdk/merchant/services/get_privacy_policy_params'
10
12
 
11
13
  module OnlinePayments::SDK
12
14
  module Merchant
@@ -21,6 +23,34 @@ module OnlinePayments::SDK
21
23
  super(parent, path_context)
22
24
  end
23
25
 
26
+ # Resource /v2/!{merchantId}/services/privacypolicy
27
+ # @param query [OnlinePayments::SDK::Merchant::Services::GetPrivacyPolicyParams]
28
+ # @param context [OnlinePayments::SDK::CallContext]
29
+ # @return [OnlinePayments::SDK::Domain::GetPrivacyPolicyResponse]
30
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
31
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
32
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
33
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
34
+ # or there was a conflict (HTTP status code 404, 409 or 410)
35
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
36
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
37
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
38
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
39
+ def get_privacy_policy(query, context = nil)
40
+ uri = instantiate_uri('/v2/{merchantId}/services/privacypolicy')
41
+ @communicator.get(
42
+ uri,
43
+ client_headers,
44
+ query,
45
+ OnlinePayments::SDK::Domain::GetPrivacyPolicyResponse,
46
+ context
47
+ )
48
+ rescue ResponseException => e
49
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
50
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
51
+ raise create_exception(e.status_code, e.body, error_object, context)
52
+ end
53
+
24
54
  # Resource /v2/!{merchantId}/services/testconnection
25
55
  # @param context [OnlinePayments::SDK::CallContext]
26
56
  # @return [OnlinePayments::SDK::Domain::TestConnection]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'onlinepayments-sdk-ruby'
3
- spec.version = '3.3.0'
3
+ spec.version = '4.0.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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlinepayments-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Worldline Direct support team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-02 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -161,6 +161,7 @@ files:
161
161
  - lib/onlinepayments/sdk/domain/api_error.rb
162
162
  - lib/onlinepayments/sdk/domain/bank_account_iban.rb
163
163
  - lib/onlinepayments/sdk/domain/browser_data.rb
164
+ - lib/onlinepayments/sdk/domain/cancel_payment_request.rb
164
165
  - lib/onlinepayments/sdk/domain/cancel_payment_response.rb
165
166
  - lib/onlinepayments/sdk/domain/capture.rb
166
167
  - lib/onlinepayments/sdk/domain/capture_output.rb
@@ -200,6 +201,8 @@ files:
200
201
  - lib/onlinepayments/sdk/domain/customer_account.rb
201
202
  - lib/onlinepayments/sdk/domain/customer_account_authentication.rb
202
203
  - lib/onlinepayments/sdk/domain/customer_device.rb
204
+ - lib/onlinepayments/sdk/domain/customer_device_output.rb
205
+ - lib/onlinepayments/sdk/domain/customer_output.rb
203
206
  - lib/onlinepayments/sdk/domain/customer_payment_activity.rb
204
207
  - lib/onlinepayments/sdk/domain/customer_token.rb
205
208
  - lib/onlinepayments/sdk/domain/decrypted_payment_data.rb
@@ -219,6 +222,7 @@ files:
219
222
  - lib/onlinepayments/sdk/domain/get_mandate_response.rb
220
223
  - lib/onlinepayments/sdk/domain/get_payment_product_groups_response.rb
221
224
  - lib/onlinepayments/sdk/domain/get_payment_products_response.rb
225
+ - lib/onlinepayments/sdk/domain/get_privacy_policy_response.rb
222
226
  - lib/onlinepayments/sdk/domain/gift_card_purchase.rb
223
227
  - lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb
224
228
  - lib/onlinepayments/sdk/domain/hosted_checkout_specific_output.rb
@@ -362,6 +366,7 @@ files:
362
366
  - lib/onlinepayments/sdk/merchant/products/get_payment_products_params.rb
363
367
  - lib/onlinepayments/sdk/merchant/products/get_product_directory_params.rb
364
368
  - lib/onlinepayments/sdk/merchant/products/products_client.rb
369
+ - lib/onlinepayments/sdk/merchant/services/get_privacy_policy_params.rb
365
370
  - lib/onlinepayments/sdk/merchant/services/services_client.rb
366
371
  - lib/onlinepayments/sdk/merchant/sessions/sessions_client.rb
367
372
  - lib/onlinepayments/sdk/merchant/tokens/tokens_client.rb