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

Commit

Permalink
Release 1.13.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingenico ePayments committed Nov 9, 2017
1 parent 2a5771f commit 23fec58
Show file tree
Hide file tree
Showing 36 changed files with 1,260 additions and 39 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 = '1.12.0'
spec.version = '1.13.0'
spec.authors = ['Ingenico ePayments']
spec.email = ['[email protected]']
spec.summary = %q{SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API}
Expand Down
22 changes: 22 additions & 0 deletions examples/merchant/mandates/block_mandate_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
require 'ingenico/connect/sdk/factory'


def example
get_client do |client|
response = client.merchant('merchantId').mandates().block('42268d8067df43e18a50a2ebf4bdb729')
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
66 changes: 66 additions & 0 deletions examples/merchant/mandates/create_mandate_example.rb
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/factory'
require 'ingenico/connect/sdk/domain/definitions/bank_account_iban'
require 'ingenico/connect/sdk/domain/mandates/create_mandate_request'
require 'ingenico/connect/sdk/domain/mandates/mandate_address'
require 'ingenico/connect/sdk/domain/mandates/mandate_contact_details'
require 'ingenico/connect/sdk/domain/mandates/mandate_customer'
require 'ingenico/connect/sdk/domain/mandates/mandate_personal_information'
require 'ingenico/connect/sdk/domain/mandates/mandate_personal_name'

Definitions = Ingenico::Connect::SDK::Domain::Definitions
Mandates = Ingenico::Connect::SDK::Domain::Mandates

def example
get_client do |client|
bank_account_iban = Definitions::BankAccountIban.new
bank_account_iban.iban = 'DE46940594210000012345'

contact_details = Mandates::MandateContactDetails.new
contact_details.email_address = '[email protected]'
contact_details.phone_number = '+1234567890'

mandate_address = Mandates::MandateAddress.new
mandate_address.city = 'Monumentenvallei'
mandate_address.country_code = 'NL'
mandate_address.street = 'Woestijnweg'
mandate_address.zip = '1337XD'

name = Mandates::MandatePersonalName.new
name.first_name = 'Wile'
name.surname = 'Coyote'

personal_information = Mandates::MandatePersonalInformation.new
personal_information.name = name
personal_information.title = 'Miss'

customer = Mandates::MandateCustomer.new
customer.bank_account_iban = bank_account_iban
customer.company_name = 'Acme labs'
customer.contact_details = contact_details
customer.mandate_address = mandate_address
customer.personal_information = personal_information

body = Mandates::CreateMandateRequest.new
body.customer = customer
body.customer_reference = 'idonthaveareference'
body.language = 'nl'
body.recurrence_type = 'UNIQUE'
body.signature_type = 'UNSIGNED'

response = client.merchant('merchantId').mandates().create_with_mandate_reference('42268d8067df43e18a50a2ebf4bdb729', 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
22 changes: 22 additions & 0 deletions examples/merchant/mandates/get_mandate_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
require 'ingenico/connect/sdk/factory'


def example
get_client do |client|
response = client.merchant('merchantId').mandates().get('42268d8067df43e18a50a2ebf4bdb729')
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
22 changes: 22 additions & 0 deletions examples/merchant/mandates/revoke_mandate_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
require 'ingenico/connect/sdk/factory'


def example
get_client do |client|
response = client.merchant('merchantId').mandates().revoke('42268d8067df43e18a50a2ebf4bdb729')
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
22 changes: 22 additions & 0 deletions examples/merchant/mandates/unblock_mandate_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
require 'ingenico/connect/sdk/factory'


def example
get_client do |client|
response = client.merchant('merchantId').mandates().unblock('42268d8067df43e18a50a2ebf4bdb729')
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
2 changes: 1 addition & 1 deletion examples/merchant/products/get_customer_details_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def example
body.country_code = 'SE'
body.values = values

response = client.merchant('merchantId').products().customer_details(1, body)
response = client.merchant('merchantId').products().customer_details(9000, body)
end
end

Expand Down
38 changes: 38 additions & 0 deletions lib/ingenico/connect/sdk/domain/definitions/redirect_data_base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# 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 Definitions

class RedirectDataBase < Ingenico::Connect::SDK::DataObject

# String
attr_accessor :returnmac

# String
attr_accessor :redirect_url

def to_h
hash = super
add_to_hash(hash, 'RETURNMAC', @returnmac)
add_to_hash(hash, 'redirectURL', @redirect_url)
hash
end

def from_hash(hash)
super
if hash.has_key?('RETURNMAC')
@returnmac = hash['RETURNMAC']
end
if hash.has_key?('redirectURL')
@redirect_url = hash['redirectURL']
end
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
require 'ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_input_base'
require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_input_base'
require 'ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input_base'
require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input_base'
require 'ingenico/connect/sdk/domain/payment/order'
require 'ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input_base'
require 'ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input_base'

module Ingenico::Connect::SDK
module Domain
Expand All @@ -26,6 +28,9 @@ class CreateHostedCheckoutRequest < Ingenico::Connect::SDK::DataObject
# {Ingenico::Connect::SDK::Domain::Payment::CashPaymentMethodSpecificInputBase}
attr_accessor :cash_payment_method_specific_input

# {Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificInputBase}
attr_accessor :e_invoice_payment_method_specific_input

# {Ingenico::Connect::SDK::Domain::Definitions::FraudFields}
attr_accessor :fraud_fields

Expand All @@ -38,15 +43,20 @@ class CreateHostedCheckoutRequest < Ingenico::Connect::SDK::DataObject
# {Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentMethodSpecificInputBase}
attr_accessor :redirect_payment_method_specific_input

# {Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentMethodSpecificInputBase}
attr_accessor :sepa_direct_debit_payment_method_specific_input

def to_h
hash = super
add_to_hash(hash, 'bankTransferPaymentMethodSpecificInput', @bank_transfer_payment_method_specific_input)
add_to_hash(hash, 'cardPaymentMethodSpecificInput', @card_payment_method_specific_input)
add_to_hash(hash, 'cashPaymentMethodSpecificInput', @cash_payment_method_specific_input)
add_to_hash(hash, 'eInvoicePaymentMethodSpecificInput', @e_invoice_payment_method_specific_input)
add_to_hash(hash, 'fraudFields', @fraud_fields)
add_to_hash(hash, 'hostedCheckoutSpecificInput', @hosted_checkout_specific_input)
add_to_hash(hash, 'order', @order)
add_to_hash(hash, 'redirectPaymentMethodSpecificInput', @redirect_payment_method_specific_input)
add_to_hash(hash, 'sepaDirectDebitPaymentMethodSpecificInput', @sepa_direct_debit_payment_method_specific_input)
hash
end

Expand All @@ -70,6 +80,12 @@ def from_hash(hash)
end
@cash_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::CashPaymentMethodSpecificInputBase.new_from_hash(hash['cashPaymentMethodSpecificInput'])
end
if hash.has_key?('eInvoicePaymentMethodSpecificInput')
if !(hash['eInvoicePaymentMethodSpecificInput'].is_a? Hash)
raise TypeError, "value '%s' is not a Hash" % [hash['eInvoicePaymentMethodSpecificInput']]
end
@e_invoice_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificInputBase.new_from_hash(hash['eInvoicePaymentMethodSpecificInput'])
end
if hash.has_key?('fraudFields')
if !(hash['fraudFields'].is_a? Hash)
raise TypeError, "value '%s' is not a Hash" % [hash['fraudFields']]
Expand All @@ -94,6 +110,12 @@ def from_hash(hash)
end
@redirect_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentMethodSpecificInputBase.new_from_hash(hash['redirectPaymentMethodSpecificInput'])
end
if hash.has_key?('sepaDirectDebitPaymentMethodSpecificInput')
if !(hash['sepaDirectDebitPaymentMethodSpecificInput'].is_a? Hash)
raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebitPaymentMethodSpecificInput']]
end
@sepa_direct_debit_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentMethodSpecificInputBase.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificInput'])
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class HostedCheckoutSpecificInput < Ingenico::Connect::SDK::DataObject
# {Ingenico::Connect::SDK::Domain::Hostedcheckout::PaymentProductFiltersHostedCheckout}
attr_accessor :payment_product_filters

# true/false
attr_accessor :return_cancel_state

# String
attr_accessor :return_url

Expand All @@ -37,6 +40,7 @@ def to_h
add_to_hash(hash, 'isRecurring', @is_recurring)
add_to_hash(hash, 'locale', @locale)
add_to_hash(hash, 'paymentProductFilters', @payment_product_filters)
add_to_hash(hash, 'returnCancelState', @return_cancel_state)
add_to_hash(hash, 'returnUrl', @return_url)
add_to_hash(hash, 'showResultPage', @show_result_page)
add_to_hash(hash, 'tokens', @tokens)
Expand All @@ -58,6 +62,9 @@ def from_hash(hash)
end
@payment_product_filters = Ingenico::Connect::SDK::Domain::Hostedcheckout::PaymentProductFiltersHostedCheckout.new_from_hash(hash['paymentProductFilters'])
end
if hash.has_key?('returnCancelState')
@return_cancel_state = hash['returnCancelState']
end
if hash.has_key?('returnUrl')
@return_url = hash['returnUrl']
end
Expand Down
70 changes: 70 additions & 0 deletions lib/ingenico/connect/sdk/domain/mandates/create_mandate_base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#
# 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/mandates/mandate_customer'

module Ingenico::Connect::SDK
module Domain
module Mandates

class CreateMandateBase < Ingenico::Connect::SDK::DataObject

# {Ingenico::Connect::SDK::Domain::Mandates::MandateCustomer}
attr_accessor :customer

# String
attr_accessor :customer_reference

# String
attr_accessor :language

# String
attr_accessor :recurrence_type

# String
attr_accessor :return_url

# String
attr_accessor :signature_type

def to_h
hash = super
add_to_hash(hash, 'customer', @customer)
add_to_hash(hash, 'customerReference', @customer_reference)
add_to_hash(hash, 'language', @language)
add_to_hash(hash, 'recurrenceType', @recurrence_type)
add_to_hash(hash, 'returnUrl', @return_url)
add_to_hash(hash, 'signatureType', @signature_type)
hash
end

def from_hash(hash)
super
if hash.has_key?('customer')
if !(hash['customer'].is_a? Hash)
raise TypeError, "value '%s' is not a Hash" % [hash['customer']]
end
@customer = Ingenico::Connect::SDK::Domain::Mandates::MandateCustomer.new_from_hash(hash['customer'])
end
if hash.has_key?('customerReference')
@customer_reference = hash['customerReference']
end
if hash.has_key?('language')
@language = hash['language']
end
if hash.has_key?('recurrenceType')
@recurrence_type = hash['recurrenceType']
end
if hash.has_key?('returnUrl')
@return_url = hash['returnUrl']
end
if hash.has_key?('signatureType')
@signature_type = hash['signatureType']
end
end
end
end
end
end
15 changes: 15 additions & 0 deletions lib/ingenico/connect/sdk/domain/mandates/create_mandate_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
require 'ingenico/connect/sdk/domain/mandates/create_mandate_base'

module Ingenico::Connect::SDK
module Domain
module Mandates

class CreateMandateRequest < Ingenico::Connect::SDK::Domain::Mandates::CreateMandateBase
end
end
end
end
Loading

0 comments on commit 23fec58

Please sign in to comment.