onlinepayments-sdk-ruby 4.9.0 → 4.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/onlinepayments/sdk/domain/card_info.rb +30 -0
  3. data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input.rb +24 -0
  4. data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input_base.rb +24 -0
  5. data/lib/onlinepayments/sdk/domain/card_payment_method_specific_output.rb +24 -0
  6. data/lib/onlinepayments/sdk/domain/create_payment_link_request.rb +42 -0
  7. data/lib/onlinepayments/sdk/domain/currency_conversion.rb +34 -0
  8. data/lib/onlinepayments/sdk/domain/currency_conversion_input.rb +30 -0
  9. data/lib/onlinepayments/sdk/domain/currency_conversion_request.rb +38 -0
  10. data/lib/onlinepayments/sdk/domain/currency_conversion_response.rb +42 -0
  11. data/lib/onlinepayments/sdk/domain/currency_conversion_result.rb +30 -0
  12. data/lib/onlinepayments/sdk/domain/currency_conversion_specific_input.rb +26 -0
  13. data/lib/onlinepayments/sdk/domain/dcc_proposal.rb +53 -0
  14. data/lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb +4 -0
  15. data/lib/onlinepayments/sdk/domain/payment_link_event.rb +34 -0
  16. data/lib/onlinepayments/sdk/domain/payment_link_order.rb +34 -0
  17. data/lib/onlinepayments/sdk/domain/payment_link_response.rb +65 -0
  18. data/lib/onlinepayments/sdk/domain/payment_product3208_specific_input.rb +26 -0
  19. data/lib/onlinepayments/sdk/domain/payment_product3208_specific_output.rb +26 -0
  20. data/lib/onlinepayments/sdk/domain/payment_product3209_specific_input.rb +26 -0
  21. data/lib/onlinepayments/sdk/domain/payment_product3209_specific_output.rb +26 -0
  22. data/lib/onlinepayments/sdk/domain/payment_product5407.rb +30 -0
  23. data/lib/onlinepayments/sdk/domain/rate_details.rb +42 -0
  24. data/lib/onlinepayments/sdk/domain/redirect_payment_method_specific_input.rb +8 -0
  25. data/lib/onlinepayments/sdk/domain/redirect_payment_product3306_specific_input.rb +26 -0
  26. data/lib/onlinepayments/sdk/domain/refund_card_method_specific_output.rb +8 -0
  27. data/lib/onlinepayments/sdk/domain/show_form_data.rb +8 -0
  28. data/lib/onlinepayments/sdk/domain/transaction.rb +34 -0
  29. data/lib/onlinepayments/sdk/merchant/merchant_client.rb +7 -0
  30. data/lib/onlinepayments/sdk/merchant/paymentlinks/payment_links_client.rb +116 -0
  31. data/lib/onlinepayments/sdk/merchant/services/services_client.rb +31 -0
  32. data/onlinepayments-sdk-ruby.gemspec +1 -1
  33. metadata +23 -2
@@ -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
11
+ # @attr [String] merchant_reference
12
+ class PaymentLinkOrder < OnlinePayments::SDK::DataObject
13
+ attr_accessor :amount
14
+ attr_accessor :merchant_reference
15
+
16
+ # @return (Hash)
17
+ def to_h
18
+ hash = super
19
+ hash['amount'] = @amount.to_h if @amount
20
+ hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
21
+ hash
22
+ end
23
+
24
+ def from_hash(hash)
25
+ super
26
+ if hash.key? 'amount'
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['amount']] unless hash['amount'].is_a? Hash
28
+ @amount = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amount'])
29
+ end
30
+ @merchant_reference = hash['merchantReference'] if hash.key? 'merchantReference'
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,65 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/data_object'
5
+ require 'onlinepayments/sdk/domain/payment_link_event'
6
+ require 'onlinepayments/sdk/domain/payment_link_order'
7
+
8
+ module OnlinePayments::SDK
9
+ module Domain
10
+
11
+ # @attr [String] expiration_date
12
+ # @attr [String] payment_id
13
+ # @attr [Array<OnlinePayments::SDK::Domain::PaymentLinkEvent>] payment_link_events
14
+ # @attr [String] payment_link_id
15
+ # @attr [OnlinePayments::SDK::Domain::PaymentLinkOrder] payment_link_order
16
+ # @attr [String] recipient_name
17
+ # @attr [String] redirection_url
18
+ # @attr [String] status
19
+ class PaymentLinkResponse < OnlinePayments::SDK::DataObject
20
+ attr_accessor :expiration_date
21
+ attr_accessor :payment_id
22
+ attr_accessor :payment_link_events
23
+ attr_accessor :payment_link_id
24
+ attr_accessor :payment_link_order
25
+ attr_accessor :recipient_name
26
+ attr_accessor :redirection_url
27
+ attr_accessor :status
28
+
29
+ # @return (Hash)
30
+ def to_h
31
+ hash = super
32
+ hash['expirationDate'] = @expiration_date unless @expiration_date.nil?
33
+ hash['paymentId'] = @payment_id unless @payment_id.nil?
34
+ hash['paymentLinkEvents'] = @payment_link_events.collect(&:to_h) if @payment_link_events
35
+ hash['paymentLinkId'] = @payment_link_id unless @payment_link_id.nil?
36
+ hash['paymentLinkOrder'] = @payment_link_order.to_h if @payment_link_order
37
+ hash['recipientName'] = @recipient_name unless @recipient_name.nil?
38
+ hash['redirectionUrl'] = @redirection_url unless @redirection_url.nil?
39
+ hash['status'] = @status unless @status.nil?
40
+ hash
41
+ end
42
+
43
+ def from_hash(hash)
44
+ super
45
+ @expiration_date = hash['expirationDate'] if hash.key? 'expirationDate'
46
+ @payment_id = hash['paymentId'] if hash.key? 'paymentId'
47
+ if hash.key? 'paymentLinkEvents'
48
+ raise TypeError, "value '%s' is not an Array" % [hash['paymentLinkEvents']] unless hash['paymentLinkEvents'].is_a? Array
49
+ @payment_link_events = []
50
+ hash['paymentLinkEvents'].each do |e|
51
+ @payment_link_events << OnlinePayments::SDK::Domain::PaymentLinkEvent.new_from_hash(e)
52
+ end
53
+ end
54
+ @payment_link_id = hash['paymentLinkId'] if hash.key? 'paymentLinkId'
55
+ if hash.key? 'paymentLinkOrder'
56
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentLinkOrder']] unless hash['paymentLinkOrder'].is_a? Hash
57
+ @payment_link_order = OnlinePayments::SDK::Domain::PaymentLinkOrder.new_from_hash(hash['paymentLinkOrder'])
58
+ end
59
+ @recipient_name = hash['recipientName'] if hash.key? 'recipientName'
60
+ @redirection_url = hash['redirectionUrl'] if hash.key? 'redirectionUrl'
61
+ @status = hash['status'] if hash.key? 'status'
62
+ end
63
+ end
64
+ end
65
+ 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] merchant_finance_code
10
+ class PaymentProduct3208SpecificInput < OnlinePayments::SDK::DataObject
11
+ attr_accessor :merchant_finance_code
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['merchantFinanceCode'] = @merchant_finance_code unless @merchant_finance_code.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @merchant_finance_code = hash['merchantFinanceCode'] if hash.key? 'merchantFinanceCode'
23
+ end
24
+ end
25
+ end
26
+ 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] buyer_compliant_bank_message
10
+ class PaymentProduct3208SpecificOutput < OnlinePayments::SDK::DataObject
11
+ attr_accessor :buyer_compliant_bank_message
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['buyerCompliantBankMessage'] = @buyer_compliant_bank_message unless @buyer_compliant_bank_message.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @buyer_compliant_bank_message = hash['buyerCompliantBankMessage'] if hash.key? 'buyerCompliantBankMessage'
23
+ end
24
+ end
25
+ end
26
+ 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] merchant_finance_code
10
+ class PaymentProduct3209SpecificInput < OnlinePayments::SDK::DataObject
11
+ attr_accessor :merchant_finance_code
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['merchantFinanceCode'] = @merchant_finance_code unless @merchant_finance_code.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @merchant_finance_code = hash['merchantFinanceCode'] if hash.key? 'merchantFinanceCode'
23
+ end
24
+ end
25
+ end
26
+ 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] buyer_compliant_bank_message
10
+ class PaymentProduct3209SpecificOutput < OnlinePayments::SDK::DataObject
11
+ attr_accessor :buyer_compliant_bank_message
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['buyerCompliantBankMessage'] = @buyer_compliant_bank_message unless @buyer_compliant_bank_message.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @buyer_compliant_bank_message = hash['buyerCompliantBankMessage'] if hash.key? 'buyerCompliantBankMessage'
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
+
6
+ module OnlinePayments::SDK
7
+ module Domain
8
+
9
+ # @attr [String] pairing_token
10
+ # @attr [String] qr_code
11
+ class PaymentProduct5407 < OnlinePayments::SDK::DataObject
12
+ attr_accessor :pairing_token
13
+ attr_accessor :qr_code
14
+
15
+ # @return (Hash)
16
+ def to_h
17
+ hash = super
18
+ hash['pairingToken'] = @pairing_token unless @pairing_token.nil?
19
+ hash['qrCode'] = @qr_code unless @qr_code.nil?
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ @pairing_token = hash['pairingToken'] if hash.key? 'pairingToken'
26
+ @qr_code = hash['qrCode'] if hash.key? 'qrCode'
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,42 @@
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 [Float] exchange_rate
10
+ # @attr [Float] inverted_exchange_rate
11
+ # @attr [Float] mark_up_rate
12
+ # @attr [String] quotation_date_time
13
+ # @attr [String] source
14
+ class RateDetails < OnlinePayments::SDK::DataObject
15
+ attr_accessor :exchange_rate
16
+ attr_accessor :inverted_exchange_rate
17
+ attr_accessor :mark_up_rate
18
+ attr_accessor :quotation_date_time
19
+ attr_accessor :source
20
+
21
+ # @return (Hash)
22
+ def to_h
23
+ hash = super
24
+ hash['exchangeRate'] = @exchange_rate unless @exchange_rate.nil?
25
+ hash['invertedExchangeRate'] = @inverted_exchange_rate unless @inverted_exchange_rate.nil?
26
+ hash['markUpRate'] = @mark_up_rate unless @mark_up_rate.nil?
27
+ hash['quotationDateTime'] = @quotation_date_time unless @quotation_date_time.nil?
28
+ hash['source'] = @source unless @source.nil?
29
+ hash
30
+ end
31
+
32
+ def from_hash(hash)
33
+ super
34
+ @exchange_rate = hash['exchangeRate'] if hash.key? 'exchangeRate'
35
+ @inverted_exchange_rate = hash['invertedExchangeRate'] if hash.key? 'invertedExchangeRate'
36
+ @mark_up_rate = hash['markUpRate'] if hash.key? 'markUpRate'
37
+ @quotation_date_time = hash['quotationDateTime'] if hash.key? 'quotationDateTime'
38
+ @source = hash['source'] if hash.key? 'source'
39
+ end
40
+ end
41
+ end
42
+ end
@@ -2,6 +2,7 @@
2
2
  # This class was auto-generated.
3
3
  #
4
4
  require 'onlinepayments/sdk/data_object'
5
+ require 'onlinepayments/sdk/domain/redirect_payment_product3306_specific_input'
5
6
  require 'onlinepayments/sdk/domain/redirect_payment_product809_specific_input'
6
7
  require 'onlinepayments/sdk/domain/redirect_payment_product840_specific_input'
7
8
  require 'onlinepayments/sdk/domain/redirection_data'
@@ -10,6 +11,7 @@ module OnlinePayments::SDK
10
11
  module Domain
11
12
 
12
13
  # @attr [String] payment_option
14
+ # @attr [OnlinePayments::SDK::Domain::RedirectPaymentProduct3306SpecificInput] payment_product3306_specific_input
13
15
  # @attr [OnlinePayments::SDK::Domain::RedirectPaymentProduct809SpecificInput] payment_product809_specific_input
14
16
  # @attr [OnlinePayments::SDK::Domain::RedirectPaymentProduct840SpecificInput] payment_product840_specific_input
15
17
  # @attr [Integer] payment_product_id
@@ -19,6 +21,7 @@ module OnlinePayments::SDK
19
21
  # @attr [true/false] tokenize
20
22
  class RedirectPaymentMethodSpecificInput < OnlinePayments::SDK::DataObject
21
23
  attr_accessor :payment_option
24
+ attr_accessor :payment_product3306_specific_input
22
25
  attr_accessor :payment_product809_specific_input
23
26
  attr_accessor :payment_product840_specific_input
24
27
  attr_accessor :payment_product_id
@@ -31,6 +34,7 @@ module OnlinePayments::SDK
31
34
  def to_h
32
35
  hash = super
33
36
  hash['paymentOption'] = @payment_option unless @payment_option.nil?
37
+ hash['paymentProduct3306SpecificInput'] = @payment_product3306_specific_input.to_h if @payment_product3306_specific_input
34
38
  hash['paymentProduct809SpecificInput'] = @payment_product809_specific_input.to_h if @payment_product809_specific_input
35
39
  hash['paymentProduct840SpecificInput'] = @payment_product840_specific_input.to_h if @payment_product840_specific_input
36
40
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
@@ -44,6 +48,10 @@ module OnlinePayments::SDK
44
48
  def from_hash(hash)
45
49
  super
46
50
  @payment_option = hash['paymentOption'] if hash.key? 'paymentOption'
51
+ if hash.key? 'paymentProduct3306SpecificInput'
52
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct3306SpecificInput']] unless hash['paymentProduct3306SpecificInput'].is_a? Hash
53
+ @payment_product3306_specific_input = OnlinePayments::SDK::Domain::RedirectPaymentProduct3306SpecificInput.new_from_hash(hash['paymentProduct3306SpecificInput'])
54
+ end
47
55
  if hash.key? 'paymentProduct809SpecificInput'
48
56
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct809SpecificInput']] unless hash['paymentProduct809SpecificInput'].is_a? Hash
49
57
  @payment_product809_specific_input = OnlinePayments::SDK::Domain::RedirectPaymentProduct809SpecificInput.new_from_hash(hash['paymentProduct809SpecificInput'])
@@ -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] extra_merchant_data
10
+ class RedirectPaymentProduct3306SpecificInput < OnlinePayments::SDK::DataObject
11
+ attr_accessor :extra_merchant_data
12
+
13
+ # @return (Hash)
14
+ def to_h
15
+ hash = super
16
+ hash['extraMerchantData'] = @extra_merchant_data unless @extra_merchant_data.nil?
17
+ hash
18
+ end
19
+
20
+ def from_hash(hash)
21
+ super
22
+ @extra_merchant_data = hash['extraMerchantData'] if hash.key? 'extraMerchantData'
23
+ end
24
+ end
25
+ end
26
+ end
@@ -2,19 +2,23 @@
2
2
  # This class was auto-generated.
3
3
  #
4
4
  require 'onlinepayments/sdk/data_object'
5
+ require 'onlinepayments/sdk/domain/currency_conversion'
5
6
 
6
7
  module OnlinePayments::SDK
7
8
  module Domain
8
9
 
10
+ # @attr [OnlinePayments::SDK::Domain::CurrencyConversion] currency_conversion
9
11
  # @attr [Long] total_amount_paid
10
12
  # @attr [Long] total_amount_refunded
11
13
  class RefundCardMethodSpecificOutput < OnlinePayments::SDK::DataObject
14
+ attr_accessor :currency_conversion
12
15
  attr_accessor :total_amount_paid
13
16
  attr_accessor :total_amount_refunded
14
17
 
15
18
  # @return (Hash)
16
19
  def to_h
17
20
  hash = super
21
+ hash['currencyConversion'] = @currency_conversion.to_h if @currency_conversion
18
22
  hash['totalAmountPaid'] = @total_amount_paid unless @total_amount_paid.nil?
19
23
  hash['totalAmountRefunded'] = @total_amount_refunded unless @total_amount_refunded.nil?
20
24
  hash
@@ -22,6 +26,10 @@ module OnlinePayments::SDK
22
26
 
23
27
  def from_hash(hash)
24
28
  super
29
+ if hash.key? 'currencyConversion'
30
+ raise TypeError, "value '%s' is not a Hash" % [hash['currencyConversion']] unless hash['currencyConversion'].is_a? Hash
31
+ @currency_conversion = OnlinePayments::SDK::Domain::CurrencyConversion.new_from_hash(hash['currencyConversion'])
32
+ end
25
33
  @total_amount_paid = hash['totalAmountPaid'] if hash.key? 'totalAmountPaid'
26
34
  @total_amount_refunded = hash['totalAmountRefunded'] if hash.key? 'totalAmountRefunded'
27
35
  end
@@ -3,18 +3,22 @@
3
3
  #
4
4
  require 'onlinepayments/sdk/data_object'
5
5
  require 'onlinepayments/sdk/domain/payment_product5404'
6
+ require 'onlinepayments/sdk/domain/payment_product5407'
6
7
 
7
8
  module OnlinePayments::SDK
8
9
  module Domain
9
10
 
10
11
  # @attr [OnlinePayments::SDK::Domain::PaymentProduct5404] payment_product5404
12
+ # @attr [OnlinePayments::SDK::Domain::PaymentProduct5407] payment_product5407
11
13
  class ShowFormData < OnlinePayments::SDK::DataObject
12
14
  attr_accessor :payment_product5404
15
+ attr_accessor :payment_product5407
13
16
 
14
17
  # @return (Hash)
15
18
  def to_h
16
19
  hash = super
17
20
  hash['paymentProduct5404'] = @payment_product5404.to_h if @payment_product5404
21
+ hash['paymentProduct5407'] = @payment_product5407.to_h if @payment_product5407
18
22
  hash
19
23
  end
20
24
 
@@ -24,6 +28,10 @@ module OnlinePayments::SDK
24
28
  raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct5404']] unless hash['paymentProduct5404'].is_a? Hash
25
29
  @payment_product5404 = OnlinePayments::SDK::Domain::PaymentProduct5404.new_from_hash(hash['paymentProduct5404'])
26
30
  end
31
+ if hash.key? 'paymentProduct5407'
32
+ raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct5407']] unless hash['paymentProduct5407'].is_a? Hash
33
+ @payment_product5407 = OnlinePayments::SDK::Domain::PaymentProduct5407.new_from_hash(hash['paymentProduct5407'])
34
+ end
27
35
  end
28
36
  end
29
37
  end
@@ -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
11
+ # @attr [String] local_date_time
12
+ class Transaction < OnlinePayments::SDK::DataObject
13
+ attr_accessor :amount
14
+ attr_accessor :local_date_time
15
+
16
+ # @return (Hash)
17
+ def to_h
18
+ hash = super
19
+ hash['amount'] = @amount.to_h if @amount
20
+ hash['localDateTime'] = @local_date_time unless @local_date_time.nil?
21
+ hash
22
+ end
23
+
24
+ def from_hash(hash)
25
+ super
26
+ if hash.key? 'amount'
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['amount']] unless hash['amount'].is_a? Hash
28
+ @amount = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amount'])
29
+ end
30
+ @local_date_time = hash['localDateTime'] if hash.key? 'localDateTime'
31
+ end
32
+ end
33
+ end
34
+ end
@@ -5,6 +5,7 @@ require 'onlinepayments/sdk/api_resource'
5
5
  require 'onlinepayments/sdk/merchant/hostedcheckout/hosted_checkout_client'
6
6
  require 'onlinepayments/sdk/merchant/hostedtokenization/hosted_tokenization_client'
7
7
  require 'onlinepayments/sdk/merchant/mandates/mandates_client'
8
+ require 'onlinepayments/sdk/merchant/paymentlinks/payment_links_client'
8
9
  require 'onlinepayments/sdk/merchant/payments/payments_client'
9
10
  require 'onlinepayments/sdk/merchant/payouts/payouts_client'
10
11
  require 'onlinepayments/sdk/merchant/productgroups/product_groups_client'
@@ -43,6 +44,12 @@ module OnlinePayments::SDK
43
44
  OnlinePayments::SDK::Merchant::Mandates::MandatesClient.new(self, nil)
44
45
  end
45
46
 
47
+ # Resource /v2/!{merchantId}/paymentlinks
48
+ # @return [OnlinePayments::SDK::Merchant::PaymentLinks::PaymentLinksClient]
49
+ def payment_links
50
+ OnlinePayments::SDK::Merchant::PaymentLinks::PaymentLinksClient.new(self, nil)
51
+ end
52
+
46
53
  # Resource /v2/!{merchantId}/payments
47
54
  # @return [OnlinePayments::SDK::Merchant::Payments::PaymentsClient]
48
55
  def payments
@@ -0,0 +1,116 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/api_resource'
5
+ require 'onlinepayments/sdk/response_exception'
6
+ require 'onlinepayments/sdk/domain/create_payment_link_request'
7
+ require 'onlinepayments/sdk/domain/error_response'
8
+ require 'onlinepayments/sdk/domain/payment_link_response'
9
+
10
+ module OnlinePayments::SDK
11
+ module Merchant
12
+ module PaymentLinks
13
+
14
+ # PaymentLinks client. Thread-safe.
15
+ class PaymentLinksClient < OnlinePayments::SDK::ApiResource
16
+
17
+ # @param parent [OnlinePayments::SDK::ApiResource]
18
+ # @param path_context [Hash, nil]
19
+ def initialize(parent, path_context = nil)
20
+ super(parent, path_context)
21
+ end
22
+
23
+ # Resource /v2/!{merchantId}/paymentlinks
24
+ # @param body [OnlinePayments::SDK::Domain::CreatePaymentLinkRequest]
25
+ # @param context [OnlinePayments::SDK::CallContext]
26
+ # @return [OnlinePayments::SDK::Domain::PaymentLinkResponse]
27
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
28
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
29
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
30
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
31
+ # or there was a conflict (HTTP status code 404, 409 or 410)
32
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
33
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
34
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
35
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
36
+ def create_payment_link(body, context = nil)
37
+ uri = instantiate_uri('/v2/{merchantId}/paymentlinks')
38
+ @communicator.post(
39
+ uri,
40
+ client_headers,
41
+ nil,
42
+ body,
43
+ OnlinePayments::SDK::Domain::PaymentLinkResponse,
44
+ context
45
+ )
46
+ rescue ResponseException => e
47
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
48
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
49
+ raise create_exception(e.status_code, e.body, error_object, context)
50
+ end
51
+
52
+ # Resource /v2/!{merchantId}/paymentlinks/!{paymentLinkId}
53
+ # @param payment_link_id [String]
54
+ # @param context [OnlinePayments::SDK::CallContext]
55
+ # @return [OnlinePayments::SDK::Domain::PaymentLinkResponse]
56
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
57
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
58
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
59
+ # @raise [OnlinePayments::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 [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
62
+ # the payment 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 [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
65
+ def get_payment_link_by_id(payment_link_id, context = nil)
66
+ path_context = {
67
+ 'paymentLinkId'.freeze => payment_link_id,
68
+ }
69
+ uri = instantiate_uri('/v2/{merchantId}/paymentlinks/{paymentLinkId}', path_context)
70
+ @communicator.get(
71
+ uri,
72
+ client_headers,
73
+ nil,
74
+ OnlinePayments::SDK::Domain::PaymentLinkResponse,
75
+ context
76
+ )
77
+ rescue ResponseException => e
78
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
79
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
80
+ raise create_exception(e.status_code, e.body, error_object, context)
81
+ end
82
+
83
+ # Resource /v2/!{merchantId}/paymentlinks/!{paymentLinkId}/cancel
84
+ # @param payment_link_id [String]
85
+ # @param context [OnlinePayments::SDK::CallContext]
86
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
87
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
88
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
89
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
90
+ # or there was a conflict (HTTP status code 404, 409 or 410)
91
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
92
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
93
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
94
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
95
+ def cancel_payment_link_by_id(payment_link_id, context = nil)
96
+ path_context = {
97
+ 'paymentLinkId'.freeze => payment_link_id,
98
+ }
99
+ uri = instantiate_uri('/v2/{merchantId}/paymentlinks/{paymentLinkId}/cancel', path_context)
100
+ @communicator.post(
101
+ uri,
102
+ client_headers,
103
+ nil,
104
+ nil,
105
+ nil,
106
+ context
107
+ )
108
+ rescue ResponseException => e
109
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
110
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
111
+ raise create_exception(e.status_code, e.body, error_object, context)
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
@@ -5,6 +5,8 @@ require 'onlinepayments/sdk/api_resource'
5
5
  require 'onlinepayments/sdk/response_exception'
6
6
  require 'onlinepayments/sdk/domain/calculate_surcharge_request'
7
7
  require 'onlinepayments/sdk/domain/calculate_surcharge_response'
8
+ require 'onlinepayments/sdk/domain/currency_conversion_request'
9
+ require 'onlinepayments/sdk/domain/currency_conversion_response'
8
10
  require 'onlinepayments/sdk/domain/error_response'
9
11
  require 'onlinepayments/sdk/domain/get_iin_details_request'
10
12
  require 'onlinepayments/sdk/domain/get_iin_details_response'
@@ -54,6 +56,35 @@ module OnlinePayments::SDK
54
56
  raise create_exception(e.status_code, e.body, error_object, context)
55
57
  end
56
58
 
59
+ # Resource /v2/!{merchantId}/services/dccrate
60
+ # @param body [OnlinePayments::SDK::Domain::CurrencyConversionRequest]
61
+ # @param context [OnlinePayments::SDK::CallContext]
62
+ # @return [OnlinePayments::SDK::Domain::CurrencyConversionResponse]
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::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
66
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
67
+ # or there was a conflict (HTTP status code 404, 409 or 410)
68
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
69
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
70
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
71
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
72
+ def get_dcc_rate_inquiry(body, context = nil)
73
+ uri = instantiate_uri('/v2/{merchantId}/services/dccrate')
74
+ @communicator.post(
75
+ uri,
76
+ client_headers,
77
+ nil,
78
+ body,
79
+ OnlinePayments::SDK::Domain::CurrencyConversionResponse,
80
+ context
81
+ )
82
+ rescue ResponseException => e
83
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
84
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
85
+ raise create_exception(e.status_code, e.body, error_object, context)
86
+ end
87
+
57
88
  # Resource /v2/!{merchantId}/services/privacypolicy
58
89
  # @param query [OnlinePayments::SDK::Merchant::Services::GetPrivacyPolicyParams]
59
90
  # @param context [OnlinePayments::SDK::CallContext]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'onlinepayments-sdk-ruby'
3
- spec.version = '4.9.0'
3
+ spec.version = '4.11.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}