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
Sep 15, 2017
1 parent
15c44c9
commit 6e0334b
Showing
14 changed files
with
473 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
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,30 @@ | ||
# | ||
# 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/merchant/payments/find_payments_params' | ||
|
||
Payments = Ingenico::Connect::SDK::Merchant::Payments | ||
|
||
def example | ||
get_client do |client| | ||
query = Payments::FindPaymentsParams.new | ||
query.merchant_reference = 'AcmeOrder0001' | ||
query.merchant_order_id = 123456 | ||
query.offset = 0 | ||
query.limit = 10 | ||
|
||
response = client.merchant('merchantId').payments().find(query) | ||
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,30 @@ | ||
# | ||
# 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/merchant/payouts/find_payouts_params' | ||
|
||
Payouts = Ingenico::Connect::SDK::Merchant::Payouts | ||
|
||
def example | ||
get_client do |client| | ||
query = Payouts::FindPayoutsParams.new | ||
query.merchant_reference = 'AcmeOrder0001' | ||
query.merchant_order_id = 123456 | ||
query.offset = 0 | ||
query.limit = 10 | ||
|
||
response = client.merchant('merchantId').payouts().find(query) | ||
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,30 @@ | ||
# | ||
# 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/merchant/refunds/find_refunds_params' | ||
|
||
Refunds = Ingenico::Connect::SDK::Merchant::Refunds | ||
|
||
def example | ||
get_client do |client| | ||
query = Refunds::FindRefundsParams.new | ||
query.merchant_reference = 'AcmeOrder0001' | ||
query.merchant_order_id = 123456 | ||
query.offset = 0 | ||
query.limit = 10 | ||
|
||
response = client.merchant('merchantId').refunds().find(query) | ||
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 |
59 changes: 59 additions & 0 deletions
59
lib/ingenico/connect/sdk/domain/payment/find_payments_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,59 @@ | ||
# | ||
# 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/payment/payment' | ||
|
||
module Ingenico::Connect::SDK | ||
module Domain | ||
module Payment | ||
|
||
class FindPaymentsResponse < Ingenico::Connect::SDK::DataObject | ||
|
||
# Integer | ||
attr_accessor :limit | ||
|
||
# Integer | ||
attr_accessor :offset | ||
|
||
# Array of {Ingenico::Connect::SDK::Domain::Payment::Payment} | ||
attr_accessor :payments | ||
|
||
# Integer | ||
attr_accessor :total_count | ||
|
||
def to_h | ||
hash = super | ||
add_to_hash(hash, 'limit', @limit) | ||
add_to_hash(hash, 'offset', @offset) | ||
add_to_hash(hash, 'payments', @payments) | ||
add_to_hash(hash, 'totalCount', @total_count) | ||
hash | ||
end | ||
|
||
def from_hash(hash) | ||
super | ||
if hash.has_key?('limit') | ||
@limit = hash['limit'] | ||
end | ||
if hash.has_key?('offset') | ||
@offset = hash['offset'] | ||
end | ||
if hash.has_key?('payments') | ||
if !(hash['payments'].is_a? Array) | ||
raise TypeError, "value '%s' is not an Array" % [hash['payments']] | ||
end | ||
@payments = [] | ||
hash['payments'].each do |e| | ||
@payments << Ingenico::Connect::SDK::Domain::Payment::Payment.new_from_hash(e) | ||
end | ||
end | ||
if hash.has_key?('totalCount') | ||
@total_count = hash['totalCount'] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
59 changes: 59 additions & 0 deletions
59
lib/ingenico/connect/sdk/domain/payout/find_payouts_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,59 @@ | ||
# | ||
# 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/payout/payout_result' | ||
|
||
module Ingenico::Connect::SDK | ||
module Domain | ||
module Payout | ||
|
||
class FindPayoutsResponse < Ingenico::Connect::SDK::DataObject | ||
|
||
# Integer | ||
attr_accessor :limit | ||
|
||
# Integer | ||
attr_accessor :offset | ||
|
||
# Array of {Ingenico::Connect::SDK::Domain::Payout::PayoutResult} | ||
attr_accessor :payouts | ||
|
||
# Integer | ||
attr_accessor :total_count | ||
|
||
def to_h | ||
hash = super | ||
add_to_hash(hash, 'limit', @limit) | ||
add_to_hash(hash, 'offset', @offset) | ||
add_to_hash(hash, 'payouts', @payouts) | ||
add_to_hash(hash, 'totalCount', @total_count) | ||
hash | ||
end | ||
|
||
def from_hash(hash) | ||
super | ||
if hash.has_key?('limit') | ||
@limit = hash['limit'] | ||
end | ||
if hash.has_key?('offset') | ||
@offset = hash['offset'] | ||
end | ||
if hash.has_key?('payouts') | ||
if !(hash['payouts'].is_a? Array) | ||
raise TypeError, "value '%s' is not an Array" % [hash['payouts']] | ||
end | ||
@payouts = [] | ||
hash['payouts'].each do |e| | ||
@payouts << Ingenico::Connect::SDK::Domain::Payout::PayoutResult.new_from_hash(e) | ||
end | ||
end | ||
if hash.has_key?('totalCount') | ||
@total_count = hash['totalCount'] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
59 changes: 59 additions & 0 deletions
59
lib/ingenico/connect/sdk/domain/refund/find_refunds_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,59 @@ | ||
# | ||
# 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/refund/refund_result' | ||
|
||
module Ingenico::Connect::SDK | ||
module Domain | ||
module Refund | ||
|
||
class FindRefundsResponse < Ingenico::Connect::SDK::DataObject | ||
|
||
# Integer | ||
attr_accessor :limit | ||
|
||
# Integer | ||
attr_accessor :offset | ||
|
||
# Array of {Ingenico::Connect::SDK::Domain::Refund::RefundResult} | ||
attr_accessor :refunds | ||
|
||
# Integer | ||
attr_accessor :total_count | ||
|
||
def to_h | ||
hash = super | ||
add_to_hash(hash, 'limit', @limit) | ||
add_to_hash(hash, 'offset', @offset) | ||
add_to_hash(hash, 'refunds', @refunds) | ||
add_to_hash(hash, 'totalCount', @total_count) | ||
hash | ||
end | ||
|
||
def from_hash(hash) | ||
super | ||
if hash.has_key?('limit') | ||
@limit = hash['limit'] | ||
end | ||
if hash.has_key?('offset') | ||
@offset = hash['offset'] | ||
end | ||
if hash.has_key?('refunds') | ||
if !(hash['refunds'].is_a? Array) | ||
raise TypeError, "value '%s' is not an Array" % [hash['refunds']] | ||
end | ||
@refunds = [] | ||
hash['refunds'].each do |e| | ||
@refunds << Ingenico::Connect::SDK::Domain::Refund::RefundResult.new_from_hash(e) | ||
end | ||
end | ||
if hash.has_key?('totalCount') | ||
@total_count = hash['totalCount'] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
38 changes: 38 additions & 0 deletions
38
lib/ingenico/connect/sdk/merchant/payments/find_payments_params.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/param_request' | ||
|
||
module Ingenico::Connect::SDK | ||
module Merchant | ||
module Payments | ||
|
||
# Query parameters for {https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/ruby/payments/find.html Find payments} | ||
class FindPaymentsParams < Ingenico::Connect::SDK::ParamRequest | ||
|
||
# String | ||
attr_accessor :merchant_reference | ||
|
||
# Integer | ||
attr_accessor :merchant_order_id | ||
|
||
# Integer | ||
attr_accessor :offset | ||
|
||
# Integer | ||
attr_accessor :limit | ||
|
||
# Returns an Array of {Ingenico::Connect::SDK::RequestParam} objects representing the attributes of this class | ||
def to_request_parameters | ||
result = [] | ||
add_parameter(result, 'merchantReference', @merchant_reference) | ||
add_parameter(result, 'merchantOrderId', @merchant_order_id) | ||
add_parameter(result, 'offset', @offset) | ||
add_parameter(result, 'limit', @limit) | ||
result | ||
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
Oops, something went wrong.