Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Release 2.43.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngenicoEPayments committed Oct 16, 2023
1 parent 241efb2 commit 60bba1c
Show file tree
Hide file tree
Showing 15 changed files with 493 additions and 2 deletions.
2 changes: 1 addition & 1 deletion connect-sdk-ruby.gemspec
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
36 changes: 36 additions & 0 deletions examples/merchant/installments/get_installments_info_example.rb
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions lib/ingenico/connect/sdk/domain/hostedcheckout/frequency.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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?
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions lib/ingenico/connect/sdk/domain/hostedcheckout/trial_period.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 60bba1c

Please sign in to comment.