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

Commit

Permalink
Release 2.13.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngenicoEPayments authored and jenkins committed Jul 24, 2020
1 parent ede029a commit 1eaf5e0
Show file tree
Hide file tree
Showing 10 changed files with 255 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.12.0'
spec.version = '2.13.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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# 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/product/create_payment_product_session_request'
require 'ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_input'

Product = Ingenico::Connect::SDK::Domain::Product

def example
get_client do |client|
payment_product_session302_specific_input = Product::MobilePaymentProductSession302SpecificInput.new
payment_product_session302_specific_input.display_name = 'Ingenico'
payment_product_session302_specific_input.domain_name = 'pay1.secured-by-ingenico.com'
payment_product_session302_specific_input.validation_url = 'https://apple-pay-gateway-cert.apple.com/paymentservices/startSession'

body = Product::CreatePaymentProductSessionRequest.new
body.payment_product_session302_specific_input = payment_product_session302_specific_input

response = client.merchant('merchantId').products.sessions(302, 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
require 'ingenico/connect/sdk/domain/definitions/abstract_payment_method_specific_input'
require 'ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product302_specific_input_hosted_checkout'
require 'ingenico/connect/sdk/domain/hostedcheckout/mobile_payment_product320_specific_input_hosted_checkout'

module Ingenico::Connect::SDK
module Domain
module Hostedcheckout

# @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct302SpecificInputHostedCheckout] payment_product302_specific_input
# @attr [Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct320SpecificInputHostedCheckout] payment_product320_specific_input
class MobilePaymentMethodSpecificInputHostedCheckout < Ingenico::Connect::SDK::Domain::Definitions::AbstractPaymentMethodSpecificInput

attr_accessor :payment_product302_specific_input

attr_accessor :payment_product320_specific_input

# @return (Hash)
def to_h
hash = super
hash['paymentProduct302SpecificInput'] = @payment_product302_specific_input.to_h unless @payment_product302_specific_input.nil?
hash['paymentProduct320SpecificInput'] = @payment_product320_specific_input.to_h unless @payment_product320_specific_input.nil?
hash
end

def from_hash(hash)
super
if hash.has_key? 'paymentProduct302SpecificInput'
raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct302SpecificInput']] unless hash['paymentProduct302SpecificInput'].is_a? Hash
@payment_product302_specific_input = Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct302SpecificInputHostedCheckout.new_from_hash(hash['paymentProduct302SpecificInput'])
end
if hash.has_key? 'paymentProduct320SpecificInput'
raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct320SpecificInput']] unless hash['paymentProduct320SpecificInput'].is_a? Hash
@payment_product320_specific_input = Ingenico::Connect::SDK::Domain::Hostedcheckout::MobilePaymentProduct320SpecificInputHostedCheckout.new_from_hash(hash['paymentProduct320SpecificInput'])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# 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] business_name
class MobilePaymentProduct302SpecificInputHostedCheckout < Ingenico::Connect::SDK::DataObject

attr_accessor :business_name

# @return (Hash)
def to_h
hash = super
hash['businessName'] = @business_name unless @business_name.nil?
hash
end

def from_hash(hash)
super
if hash.has_key? 'businessName'
@business_name = hash['businessName']
end
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# 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/product/mobile_payment_product_session302_specific_input'

module Ingenico::Connect::SDK
module Domain
module Product

# @attr [Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificInput] payment_product_session302_specific_input
class CreatePaymentProductSessionRequest < Ingenico::Connect::SDK::DataObject

attr_accessor :payment_product_session302_specific_input

# @return (Hash)
def to_h
hash = super
hash['paymentProductSession302SpecificInput'] = @payment_product_session302_specific_input.to_h unless @payment_product_session302_specific_input.nil?
hash
end

def from_hash(hash)
super
if hash.has_key? 'paymentProductSession302SpecificInput'
raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductSession302SpecificInput']] unless hash['paymentProductSession302SpecificInput'].is_a? Hash
@payment_product_session302_specific_input = Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificInput.new_from_hash(hash['paymentProductSession302SpecificInput'])
end
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# 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/product/mobile_payment_product_session302_specific_output'

module Ingenico::Connect::SDK
module Domain
module Product

# @attr [Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificOutput] payment_product_session302_specific_output
class CreatePaymentProductSessionResponse < Ingenico::Connect::SDK::DataObject

attr_accessor :payment_product_session302_specific_output

# @return (Hash)
def to_h
hash = super
hash['paymentProductSession302SpecificOutput'] = @payment_product_session302_specific_output.to_h unless @payment_product_session302_specific_output.nil?
hash
end

def from_hash(hash)
super
if hash.has_key? 'paymentProductSession302SpecificOutput'
raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductSession302SpecificOutput']] unless hash['paymentProductSession302SpecificOutput'].is_a? Hash
@payment_product_session302_specific_output = Ingenico::Connect::SDK::Domain::Product::MobilePaymentProductSession302SpecificOutput.new_from_hash(hash['paymentProductSession302SpecificOutput'])
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 Product

# @attr [String] display_name
# @attr [String] domain_name
# @attr [String] validation_url
class MobilePaymentProductSession302SpecificInput < Ingenico::Connect::SDK::DataObject

attr_accessor :display_name

attr_accessor :domain_name

attr_accessor :validation_url

# @return (Hash)
def to_h
hash = super
hash['displayName'] = @display_name unless @display_name.nil?
hash['domainName'] = @domain_name unless @domain_name.nil?
hash['validationUrl'] = @validation_url unless @validation_url.nil?
hash
end

def from_hash(hash)
super
if hash.has_key? 'displayName'
@display_name = hash['displayName']
end
if hash.has_key? 'domainName'
@domain_name = hash['domainName']
end
if hash.has_key? 'validationUrl'
@validation_url = hash['validationUrl']
end
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# 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 Product

# @attr [String] session_object
class MobilePaymentProductSession302SpecificOutput < Ingenico::Connect::SDK::DataObject

attr_accessor :session_object

# @return (Hash)
def to_h
hash = super
hash['sessionObject'] = @session_object unless @session_object.nil?
hash
end

def from_hash(hash)
super
if hash.has_key? 'sessionObject'
@session_object = hash['sessionObject']
end
end
end
end
end
end
33 changes: 33 additions & 0 deletions lib/ingenico/connect/sdk/merchant/products/products_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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/product/create_payment_product_session_response'
require 'ingenico/connect/sdk/domain/product/device_fingerprint_response'
require 'ingenico/connect/sdk/domain/product/directory'
require 'ingenico/connect/sdk/domain/product/get_customer_details_response'
Expand Down Expand Up @@ -208,6 +209,38 @@ def networks(payment_product_id, query, context=nil)
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
raise create_exception(e.status_code, e.body, error_object, context)
end

# Resource /!{merchantId}/products/!{paymentProductId}/sessions - {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/products/sessions.html Create session for payment product}
# @param payment_product_id [Integer]
# @param body [Ingenico::Connect::SDK::Domain::Product::CreatePaymentProductSessionRequest]
# @param context [Ingenico::Connect::SDK::CallContext]
# @return [Ingenico::Connect::SDK::Domain::Product::CreatePaymentProductSessionResponse]
# @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 sessions(payment_product_id, body, context=nil)
path_context = {
'paymentProductId'.freeze => payment_product_id.to_s,
}
uri = instantiate_uri('/v1/{merchantId}/products/{paymentProductId}/sessions', path_context)
return @communicator.post(
uri,
client_headers,
nil,
body,
Ingenico::Connect::SDK::Domain::Product::CreatePaymentProductSessionResponse,
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
Expand Down
2 changes: 1 addition & 1 deletion lib/ingenico/connect/sdk/meta_data_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Ingenico::Connect::SDK
#
# @attr_reader [Array<Ingenico::Connect::SDK::RequestHeader>] meta_data_headers List of headers that should be used in all requests.
class MetaDataProvider
@@SDK_VERSION = '2.12.0'
@@SDK_VERSION = '2.13.0'
@@SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'
@@PROHIBITED_HEADERS = [@@SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key',
'Date', 'Content-Type', 'Authorization'].sort!.freeze
Expand Down

0 comments on commit 1eaf5e0

Please sign in to comment.