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
Ingenico ePayments
committed
Nov 9, 2017
1 parent
2a5771f
commit 23fec58
Showing
36 changed files
with
1,260 additions
and
39 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
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} | ||
|
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,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 |
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/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 |
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,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 |
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,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 |
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,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 |
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
38 changes: 38 additions & 0 deletions
38
lib/ingenico/connect/sdk/domain/definitions/redirect_data_base.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,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 |
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
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
70 changes: 70 additions & 0 deletions
70
lib/ingenico/connect/sdk/domain/mandates/create_mandate_base.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,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
15
lib/ingenico/connect/sdk/domain/mandates/create_mandate_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,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 |
Oops, something went wrong.