This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
241efb2
commit 60bba1c
Showing
15 changed files
with
493 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
examples/merchant/installments/get_installments_info_example.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
39
lib/ingenico/connect/sdk/domain/hostedcheckout/frequency.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
lib/ingenico/connect/sdk/domain/hostedcheckout/recurring_payments_data.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
66 changes: 66 additions & 0 deletions
66
lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
39
lib/ingenico/connect/sdk/domain/hostedcheckout/trial_period.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
55 changes: 55 additions & 0 deletions
55
lib/ingenico/connect/sdk/domain/installments/get_installment_request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
46 changes: 46 additions & 0 deletions
46
lib/ingenico/connect/sdk/domain/installments/installment_display_hints.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.