diff --git a/connect-sdk-ruby.gemspec b/connect-sdk-ruby.gemspec index 7b28861..b167547 100644 --- a/connect-sdk-ruby.gemspec +++ b/connect-sdk-ruby.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'connect-sdk-ruby' - spec.version = '2.42.0' + spec.version = '2.43.0' spec.authors = ['Ingenico ePayments'] spec.email = ['github@epay.ingenico.com'] spec.summary = %q{SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API} diff --git a/examples/merchant/installments/get_installments_info_example.rb b/examples/merchant/installments/get_installments_info_example.rb new file mode 100644 index 0000000..c71f051 --- /dev/null +++ b/examples/merchant/installments/get_installments_info_example.rb @@ -0,0 +1,36 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/factory' +require 'ingenico/connect/sdk/domain/definitions/amount_of_money' +require 'ingenico/connect/sdk/domain/installments/get_installment_request' + +Definitions = Ingenico::Connect::SDK::Domain::Definitions +Installments = Ingenico::Connect::SDK::Domain::Installments + +def example + get_client do |client| + amount_of_money = Definitions::AmountOfMoney.new + amount_of_money.amount = 123 + amount_of_money.currency_code = 'EUR' + + body = Installments::GetInstallmentRequest.new + body.amount_of_money = amount_of_money + body.bin = '123455' + body.country_code = 'NL' + body.payment_product_id = 123 + + response = client.merchant('merchantId').installments.get_installments_info(body) + end +end + +def get_client + api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey') + secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret') + configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml') + yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key) +ensure + # Free networking resources when done + client.close unless client.nil? +end diff --git a/lib/ingenico/connect/sdk/domain/hostedcheckout/frequency.rb b/lib/ingenico/connect/sdk/domain/hostedcheckout/frequency.rb new file mode 100644 index 0000000..8750f7e --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/hostedcheckout/frequency.rb @@ -0,0 +1,39 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' + +module Ingenico::Connect::SDK + module Domain + module Hostedcheckout + + # @attr [String] interval + # @attr [Integer] interval_frequency + class Frequency < Ingenico::Connect::SDK::DataObject + + attr_accessor :interval + + attr_accessor :interval_frequency + + # @return (Hash) + def to_h + hash = super + hash['interval'] = @interval unless @interval.nil? + hash['intervalFrequency'] = @interval_frequency unless @interval_frequency.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'interval' + @interval = hash['interval'] + end + if hash.has_key? 'intervalFrequency' + @interval_frequency = hash['intervalFrequency'] + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb b/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb index fd4fb6e..45078c2 100644 --- a/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb +++ b/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb @@ -4,6 +4,7 @@ # require 'ingenico/connect/sdk/data_object' require 'ingenico/connect/sdk/domain/hostedcheckout/payment_product_filters_hosted_checkout' +require 'ingenico/connect/sdk/domain/hostedcheckout/recurring_payments_data' module Ingenico::Connect::SDK module Domain @@ -12,6 +13,7 @@ module Hostedcheckout # @attr [true/false] is_recurring # @attr [String] locale # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::PaymentProductFiltersHostedCheckout] payment_product_filters + # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::RecurringPaymentsData] recurring_payments_data # @attr [true/false] return_cancel_state # @attr [String] return_url # @attr [true/false] show_result_page @@ -26,6 +28,8 @@ class HostedCheckoutSpecificInput < Ingenico::Connect::SDK::DataObject attr_accessor :payment_product_filters + attr_accessor :recurring_payments_data + attr_accessor :return_cancel_state attr_accessor :return_url @@ -44,6 +48,7 @@ def to_h hash['isRecurring'] = @is_recurring unless @is_recurring.nil? hash['locale'] = @locale unless @locale.nil? hash['paymentProductFilters'] = @payment_product_filters.to_h unless @payment_product_filters.nil? + hash['recurringPaymentsData'] = @recurring_payments_data.to_h unless @recurring_payments_data.nil? hash['returnCancelState'] = @return_cancel_state unless @return_cancel_state.nil? hash['returnUrl'] = @return_url unless @return_url.nil? hash['showResultPage'] = @show_result_page unless @show_result_page.nil? @@ -65,6 +70,10 @@ def from_hash(hash) raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductFilters']] unless hash['paymentProductFilters'].is_a? Hash @payment_product_filters = Ingenico::Connect::SDK::Domain::Hostedcheckout::PaymentProductFiltersHostedCheckout.new_from_hash(hash['paymentProductFilters']) end + if hash.has_key? 'recurringPaymentsData' + raise TypeError, "value '%s' is not a Hash" % [hash['recurringPaymentsData']] unless hash['recurringPaymentsData'].is_a? Hash + @recurring_payments_data = Ingenico::Connect::SDK::Domain::Hostedcheckout::RecurringPaymentsData.new_from_hash(hash['recurringPaymentsData']) + end if hash.has_key? 'returnCancelState' @return_cancel_state = hash['returnCancelState'] end diff --git a/lib/ingenico/connect/sdk/domain/hostedcheckout/recurring_payments_data.rb b/lib/ingenico/connect/sdk/domain/hostedcheckout/recurring_payments_data.rb new file mode 100644 index 0000000..49eca30 --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/hostedcheckout/recurring_payments_data.rb @@ -0,0 +1,43 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' +require 'ingenico/connect/sdk/domain/hostedcheckout/frequency' +require 'ingenico/connect/sdk/domain/hostedcheckout/trial_information' + +module Ingenico::Connect::SDK + module Domain + module Hostedcheckout + + # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::Frequency] recurring_interval + # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialInformation] trial_information + class RecurringPaymentsData < Ingenico::Connect::SDK::DataObject + + attr_accessor :recurring_interval + + attr_accessor :trial_information + + # @return (Hash) + def to_h + hash = super + hash['recurringInterval'] = @recurring_interval.to_h unless @recurring_interval.nil? + hash['trialInformation'] = @trial_information.to_h unless @trial_information.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'recurringInterval' + raise TypeError, "value '%s' is not a Hash" % [hash['recurringInterval']] unless hash['recurringInterval'].is_a? Hash + @recurring_interval = Ingenico::Connect::SDK::Domain::Hostedcheckout::Frequency.new_from_hash(hash['recurringInterval']) + end + if hash.has_key? 'trialInformation' + raise TypeError, "value '%s' is not a Hash" % [hash['trialInformation']] unless hash['trialInformation'].is_a? Hash + @trial_information = Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialInformation.new_from_hash(hash['trialInformation']) + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb b/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb new file mode 100644 index 0000000..abe183c --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb @@ -0,0 +1,66 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' +require 'ingenico/connect/sdk/domain/definitions/amount_of_money' +require 'ingenico/connect/sdk/domain/hostedcheckout/frequency' +require 'ingenico/connect/sdk/domain/hostedcheckout/trial_period' + +module Ingenico::Connect::SDK + module Domain + module Hostedcheckout + + # @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money_after_trial + # @attr [String] end_date + # @attr [true/false] is_recurring + # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialPeriod] trial_period + # @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::Frequency] trial_period_recurring + class TrialInformation < Ingenico::Connect::SDK::DataObject + + attr_accessor :amount_of_money_after_trial + + attr_accessor :end_date + + attr_accessor :is_recurring + + attr_accessor :trial_period + + attr_accessor :trial_period_recurring + + # @return (Hash) + def to_h + hash = super + hash['amountOfMoneyAfterTrial'] = @amount_of_money_after_trial.to_h unless @amount_of_money_after_trial.nil? + hash['endDate'] = @end_date unless @end_date.nil? + hash['isRecurring'] = @is_recurring unless @is_recurring.nil? + hash['trialPeriod'] = @trial_period.to_h unless @trial_period.nil? + hash['trialPeriodRecurring'] = @trial_period_recurring.to_h unless @trial_period_recurring.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'amountOfMoneyAfterTrial' + raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoneyAfterTrial']] unless hash['amountOfMoneyAfterTrial'].is_a? Hash + @amount_of_money_after_trial = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoneyAfterTrial']) + end + if hash.has_key? 'endDate' + @end_date = hash['endDate'] + end + if hash.has_key? 'isRecurring' + @is_recurring = hash['isRecurring'] + end + if hash.has_key? 'trialPeriod' + raise TypeError, "value '%s' is not a Hash" % [hash['trialPeriod']] unless hash['trialPeriod'].is_a? Hash + @trial_period = Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialPeriod.new_from_hash(hash['trialPeriod']) + end + if hash.has_key? 'trialPeriodRecurring' + raise TypeError, "value '%s' is not a Hash" % [hash['trialPeriodRecurring']] unless hash['trialPeriodRecurring'].is_a? Hash + @trial_period_recurring = Ingenico::Connect::SDK::Domain::Hostedcheckout::Frequency.new_from_hash(hash['trialPeriodRecurring']) + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_period.rb b/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_period.rb new file mode 100644 index 0000000..d2af031 --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/hostedcheckout/trial_period.rb @@ -0,0 +1,39 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' + +module Ingenico::Connect::SDK + module Domain + module Hostedcheckout + + # @attr [Integer] duration + # @attr [String] interval + class TrialPeriod < Ingenico::Connect::SDK::DataObject + + attr_accessor :duration + + attr_accessor :interval + + # @return (Hash) + def to_h + hash = super + hash['duration'] = @duration unless @duration.nil? + hash['interval'] = @interval unless @interval.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'duration' + @duration = hash['duration'] + end + if hash.has_key? 'interval' + @interval = hash['interval'] + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/installments/get_installment_request.rb b/lib/ingenico/connect/sdk/domain/installments/get_installment_request.rb new file mode 100644 index 0000000..747a038 --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/installments/get_installment_request.rb @@ -0,0 +1,55 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' +require 'ingenico/connect/sdk/domain/definitions/amount_of_money' + +module Ingenico::Connect::SDK + module Domain + module Installments + + # @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money + # @attr [String] bin + # @attr [String] country_code + # @attr [Integer] payment_product_id + class GetInstallmentRequest < Ingenico::Connect::SDK::DataObject + + attr_accessor :amount_of_money + + attr_accessor :bin + + attr_accessor :country_code + + attr_accessor :payment_product_id + + # @return (Hash) + def to_h + hash = super + hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? + hash['bin'] = @bin unless @bin.nil? + hash['countryCode'] = @country_code unless @country_code.nil? + hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'amountOfMoney' + raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash + @amount_of_money = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoney']) + end + if hash.has_key? 'bin' + @bin = hash['bin'] + end + if hash.has_key? 'countryCode' + @country_code = hash['countryCode'] + end + if hash.has_key? 'paymentProductId' + @payment_product_id = hash['paymentProductId'] + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/installments/installment_display_hints.rb b/lib/ingenico/connect/sdk/domain/installments/installment_display_hints.rb new file mode 100644 index 0000000..a24e257 --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/installments/installment_display_hints.rb @@ -0,0 +1,46 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' + +module Ingenico::Connect::SDK + module Domain + module Installments + + # @attr [Integer] display_order + # @attr [String] label + # @attr [String] logo + class InstallmentDisplayHints < Ingenico::Connect::SDK::DataObject + + attr_accessor :display_order + + attr_accessor :label + + attr_accessor :logo + + # @return (Hash) + def to_h + hash = super + hash['displayOrder'] = @display_order unless @display_order.nil? + hash['label'] = @label unless @label.nil? + hash['logo'] = @logo unless @logo.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'displayOrder' + @display_order = hash['displayOrder'] + end + if hash.has_key? 'label' + @label = hash['label'] + end + if hash.has_key? 'logo' + @logo = hash['logo'] + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/installments/installment_options.rb b/lib/ingenico/connect/sdk/domain/installments/installment_options.rb new file mode 100644 index 0000000..3554776 --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/installments/installment_options.rb @@ -0,0 +1,53 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' +require 'ingenico/connect/sdk/domain/installments/installment_display_hints' +require 'ingenico/connect/sdk/domain/payment/installments' + +module Ingenico::Connect::SDK + module Domain + module Installments + + # @attr [Ingenico::Connect::SDK::Domain::Installments::InstallmentDisplayHints] display_hints + # @attr [String] id + # @attr [Array] installment_plans + class InstallmentOptions < Ingenico::Connect::SDK::DataObject + + attr_accessor :display_hints + + attr_accessor :id + + attr_accessor :installment_plans + + # @return (Hash) + def to_h + hash = super + hash['displayHints'] = @display_hints.to_h unless @display_hints.nil? + hash['id'] = @id unless @id.nil? + hash['installmentPlans'] = @installment_plans.collect{|val| val.to_h} unless @installment_plans.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'displayHints' + raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash + @display_hints = Ingenico::Connect::SDK::Domain::Installments::InstallmentDisplayHints.new_from_hash(hash['displayHints']) + end + if hash.has_key? 'id' + @id = hash['id'] + end + if hash.has_key? 'installmentPlans' + raise TypeError, "value '%s' is not an Array" % [hash['installmentPlans']] unless hash['installmentPlans'].is_a? Array + @installment_plans = [] + hash['installmentPlans'].each do |e| + @installment_plans << Ingenico::Connect::SDK::Domain::Payment::Installments.new_from_hash(e) + end + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/installments/installment_options_response.rb b/lib/ingenico/connect/sdk/domain/installments/installment_options_response.rb new file mode 100644 index 0000000..a549667 --- /dev/null +++ b/lib/ingenico/connect/sdk/domain/installments/installment_options_response.rb @@ -0,0 +1,37 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/data_object' +require 'ingenico/connect/sdk/domain/installments/installment_options' + +module Ingenico::Connect::SDK + module Domain + module Installments + + # @attr [Array] installment_options + class InstallmentOptionsResponse < Ingenico::Connect::SDK::DataObject + + attr_accessor :installment_options + + # @return (Hash) + def to_h + hash = super + hash['installmentOptions'] = @installment_options.collect{|val| val.to_h} unless @installment_options.nil? + hash + end + + def from_hash(hash) + super + if hash.has_key? 'installmentOptions' + raise TypeError, "value '%s' is not an Array" % [hash['installmentOptions']] unless hash['installmentOptions'].is_a? Array + @installment_options = [] + hash['installmentOptions'].each do |e| + @installment_options << Ingenico::Connect::SDK::Domain::Installments::InstallmentOptions.new_from_hash(e) + end + end + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/domain/payment/installments.rb b/lib/ingenico/connect/sdk/domain/payment/installments.rb index 0b386e5..88822ce 100644 --- a/lib/ingenico/connect/sdk/domain/payment/installments.rb +++ b/lib/ingenico/connect/sdk/domain/payment/installments.rb @@ -10,6 +10,7 @@ module Domain module Payment # @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money_per_installment + # @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money_total # @attr [String] frequency_of_installments # @attr [Integer] installment_plan_code # @attr [String] interest_rate @@ -18,6 +19,8 @@ class Installments < Ingenico::Connect::SDK::DataObject attr_accessor :amount_of_money_per_installment + attr_accessor :amount_of_money_total + attr_accessor :frequency_of_installments attr_accessor :installment_plan_code @@ -30,6 +33,7 @@ class Installments < Ingenico::Connect::SDK::DataObject def to_h hash = super hash['amountOfMoneyPerInstallment'] = @amount_of_money_per_installment.to_h unless @amount_of_money_per_installment.nil? + hash['amountOfMoneyTotal'] = @amount_of_money_total.to_h unless @amount_of_money_total.nil? hash['frequencyOfInstallments'] = @frequency_of_installments unless @frequency_of_installments.nil? hash['installmentPlanCode'] = @installment_plan_code unless @installment_plan_code.nil? hash['interestRate'] = @interest_rate unless @interest_rate.nil? @@ -43,6 +47,10 @@ def from_hash(hash) raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoneyPerInstallment']] unless hash['amountOfMoneyPerInstallment'].is_a? Hash @amount_of_money_per_installment = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoneyPerInstallment']) end + if hash.has_key? 'amountOfMoneyTotal' + raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoneyTotal']] unless hash['amountOfMoneyTotal'].is_a? Hash + @amount_of_money_total = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoneyTotal']) + end if hash.has_key? 'frequencyOfInstallments' @frequency_of_installments = hash['frequencyOfInstallments'] end diff --git a/lib/ingenico/connect/sdk/merchant/installments/installments_client.rb b/lib/ingenico/connect/sdk/merchant/installments/installments_client.rb new file mode 100644 index 0000000..98697cb --- /dev/null +++ b/lib/ingenico/connect/sdk/merchant/installments/installments_client.rb @@ -0,0 +1,53 @@ +# +# This class was auto-generated from the API references found at +# https://epayments-api.developer-ingenico.com/s2sapi/v1/ +# +require 'ingenico/connect/sdk/api_resource' +require 'ingenico/connect/sdk/response_exception' +require 'ingenico/connect/sdk/domain/errors/error_response' +require 'ingenico/connect/sdk/domain/installments/installment_options_response' + +module Ingenico::Connect::SDK + module Merchant + module Installments + + # Installments client. Thread-safe. + class InstallmentsClient < Ingenico::Connect::SDK::ApiResource + + # @param parent [Ingenico::Connect::SDK::ApiResource] + # @param path_context [Hash] + def initialize(parent, path_context) + super(parent, path_context) + end + + # Resource /!{merchantId}/installments/getInstallmentsInfo - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/installments/getInstallmentsInfo.html Get Installment Info} + # @param body [Ingenico::Connect::SDK::Domain::Installments::GetInstallmentRequest] + # @param context [Ingenico::Connect::SDK::CallContext] + # @return [Ingenico::Connect::SDK::Domain::Installments::InstallmentOptionsResponse] + # @raise [Ingenico::Connect::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400) + # @raise [Ingenico::Connect::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403) + # @raise [Ingenico::Connect::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409) + # @raise [Ingenico::Connect::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed, + # or there was a conflict (HTTP status code 404, 409 or 410) + # @raise [Ingenico::Connect::SDK::GlobalCollectException] if something went wrong at the Ingenico ePayments platform, + # the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer, + # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + # @raise [Ingenico::Connect::SDK::ApiException]if the Ingenico ePayments platform returned any other error + def get_installments_info(body, context=nil) + uri = instantiate_uri('/v1/{merchantId}/installments/getInstallmentsInfo', nil) + return @communicator.post( + uri, + client_headers, + nil, + body, + Ingenico::Connect::SDK::Domain::Installments::InstallmentOptionsResponse, + context) + rescue ResponseException => e + error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse + error_object = @communicator.marshaller.unmarshal(e.body, error_type) + raise create_exception(e.status_code, e.body, error_object, context) + end + end + end + end +end diff --git a/lib/ingenico/connect/sdk/merchant/merchant_client.rb b/lib/ingenico/connect/sdk/merchant/merchant_client.rb index 568a25c..41ba38b 100644 --- a/lib/ingenico/connect/sdk/merchant/merchant_client.rb +++ b/lib/ingenico/connect/sdk/merchant/merchant_client.rb @@ -8,6 +8,7 @@ require 'ingenico/connect/sdk/merchant/files/files_client' require 'ingenico/connect/sdk/merchant/hostedcheckouts/hostedcheckouts_client' require 'ingenico/connect/sdk/merchant/hostedmandatemanagements/hostedmandatemanagements_client' +require 'ingenico/connect/sdk/merchant/installments/installments_client' require 'ingenico/connect/sdk/merchant/mandates/mandates_client' require 'ingenico/connect/sdk/merchant/payments/payments_client' require 'ingenico/connect/sdk/merchant/payouts/payouts_client' @@ -115,6 +116,12 @@ def sessions Ingenico::Connect::SDK::Merchant::Sessions::SessionsClient.new(self, nil) end + # Resource /!{merchantId}/installments + # @return [Ingenico::Connect::SDK::Merchant::Installments::InstallmentsClient] + def installments + Ingenico::Connect::SDK::Merchant::Installments::InstallmentsClient.new(self, nil) + end + # Resource /!{merchantId}/files # @return [Ingenico::Connect::SDK::Merchant::Files::FilesClient] def files diff --git a/lib/ingenico/connect/sdk/meta_data_provider.rb b/lib/ingenico/connect/sdk/meta_data_provider.rb index 8baadec..0e54378 100644 --- a/lib/ingenico/connect/sdk/meta_data_provider.rb +++ b/lib/ingenico/connect/sdk/meta_data_provider.rb @@ -7,7 +7,7 @@ module Ingenico::Connect::SDK # # @attr_reader [Array] meta_data_headers List of headers that should be used in all requests. class MetaDataProvider - @@SDK_VERSION = '2.42.0' + @@SDK_VERSION = '2.43.0' @@SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo' @@PROHIBITED_HEADERS = [@@SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key', 'Date', 'Content-Type', 'Authorization'].sort!.freeze