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
ede029a
commit 1eaf5e0
Showing
10 changed files
with
255 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
33 changes: 33 additions & 0 deletions
33
examples/merchant/products/create_payment_product_session_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,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 |
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
32 changes: 32 additions & 0 deletions
32
...ect/sdk/domain/hostedcheckout/mobile_payment_product302_specific_input_hosted_checkout.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,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 |
34 changes: 34 additions & 0 deletions
34
lib/ingenico/connect/sdk/domain/product/create_payment_product_session_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,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 |
34 changes: 34 additions & 0 deletions
34
lib/ingenico/connect/sdk/domain/product/create_payment_product_session_response.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,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 |
46 changes: 46 additions & 0 deletions
46
lib/ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_input.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 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 |
32 changes: 32 additions & 0 deletions
32
lib/ingenico/connect/sdk/domain/product/mobile_payment_product_session302_specific_output.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,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 |
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