-
Notifications
You must be signed in to change notification settings - Fork 0
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
WorldlineAcquiring
committed
Dec 11, 2024
1 parent
547abb7
commit b7ea724
Showing
29 changed files
with
697 additions
and
35 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
4 changes: 4 additions & 0 deletions
4
lib/worldline/acquiring/sdk/v1/acquirer/merchant/balanceinquiries.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,4 @@ | ||
# | ||
# This file was automatically generated. | ||
# | ||
Dir[File.join(__dir__, 'balanceinquiries', '*.rb')].each { |f| require f } |
60 changes: 60 additions & 0 deletions
60
...worldline/acquiring/sdk/v1/acquirer/merchant/balanceinquiries/balance_inquiries_client.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,60 @@ | ||
# | ||
# This file was automatically generated. | ||
# | ||
require 'worldline/acquiring/sdk/api_resource' | ||
require 'worldline/acquiring/sdk/communication/response_exception' | ||
require 'worldline/acquiring/sdk/v1/exception_factory' | ||
require 'worldline/acquiring/sdk/v1/domain/api_balance_inquiry_response' | ||
require 'worldline/acquiring/sdk/v1/domain/api_payment_error_response' | ||
|
||
module Worldline | ||
module Acquiring | ||
module SDK | ||
module V1 | ||
module Acquirer | ||
module Merchant | ||
module Balanceinquiries | ||
# BalanceInquiries client. Thread-safe. | ||
class BalanceInquiriesClient < Worldline::Acquiring::SDK::ApiResource | ||
|
||
# @param parent [Worldline::Acquiring::SDK::ApiResource] | ||
# @param path_context [Hash, nil] | ||
def initialize(parent, path_context) | ||
super(parent: parent, path_context: path_context) | ||
end | ||
|
||
# Resource /processing/v1/!{acquirerId}/!{merchantId}/balance-inquiries - {https://docs.acquiring.worldline-solutions.com/api-reference#tag/Balance-Inquiries/operation/processBalanceInquiry Balance inquiry} | ||
# | ||
# @param body [Worldline::Acquiring::SDK::V1::Domain::ApiBalanceInquiryRequest] | ||
# @param context [Worldline::Acquiring::SDK::CallContext, nil] | ||
# @return [Worldline::Acquiring::SDK::V1::Domain::ApiBalanceInquiryResponse] | ||
# @raise [Worldline::Acquiring::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400) | ||
# @raise [Worldline::Acquiring::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403) | ||
# @raise [Worldline::Acquiring::SDK::V1::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 [Worldline::Acquiring::SDK::V1::PlatformException] if something went wrong at the Worldline Acquiring platform, | ||
# the Worldline Acquiring 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 [Worldline::Acquiring::SDK::V1::ApiException] if the Worldline Acquiring platform returned any other error | ||
def process_balance_inquiry(body, context = nil) | ||
uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/balance-inquiries', nil) | ||
@communicator.post( | ||
uri, | ||
nil, | ||
nil, | ||
body, | ||
Worldline::Acquiring::SDK::V1::Domain::ApiBalanceInquiryResponse, | ||
context) | ||
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e | ||
error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse | ||
error_object = @communicator.marshaller.unmarshal(e.body, error_type) | ||
raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context) | ||
end | ||
end | ||
end | ||
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
79 changes: 79 additions & 0 deletions
79
lib/worldline/acquiring/sdk/v1/domain/api_balance_inquiry_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,79 @@ | ||
# | ||
# This file was automatically generated. | ||
# | ||
require 'date' | ||
|
||
require 'worldline/acquiring/sdk/domain/data_object' | ||
require 'worldline/acquiring/sdk/v1/domain/card_payment_data_for_balance_inquiry' | ||
require 'worldline/acquiring/sdk/v1/domain/merchant_data' | ||
require 'worldline/acquiring/sdk/v1/domain/payment_references' | ||
require 'worldline/acquiring/sdk/v1/domain/terminal_data' | ||
|
||
module Worldline | ||
module Acquiring | ||
module SDK | ||
module V1 | ||
module Domain | ||
# @attr [Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForBalanceInquiry] card_payment_data | ||
# @attr [Worldline::Acquiring::SDK::V1::Domain::MerchantData] merchant | ||
# @attr [String] operation_id | ||
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references | ||
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data | ||
# @attr [DateTime] transaction_timestamp | ||
class ApiBalanceInquiryRequest < Worldline::Acquiring::SDK::Domain::DataObject | ||
|
||
attr_accessor :card_payment_data | ||
|
||
attr_accessor :merchant | ||
|
||
attr_accessor :operation_id | ||
|
||
attr_accessor :references | ||
|
||
attr_accessor :terminal_data | ||
|
||
attr_accessor :transaction_timestamp | ||
|
||
# @return (Hash) | ||
def to_h | ||
hash = super | ||
hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil? | ||
hash['merchant'] = @merchant.to_h unless @merchant.nil? | ||
hash['operationId'] = @operation_id unless @operation_id.nil? | ||
hash['references'] = @references.to_h unless @references.nil? | ||
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil? | ||
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil? | ||
hash | ||
end | ||
|
||
def from_hash(hash) | ||
super | ||
if hash.has_key? 'cardPaymentData' | ||
raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash | ||
@card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForBalanceInquiry.new_from_hash(hash['cardPaymentData']) | ||
end | ||
if hash.has_key? 'merchant' | ||
raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash | ||
@merchant = Worldline::Acquiring::SDK::V1::Domain::MerchantData.new_from_hash(hash['merchant']) | ||
end | ||
if hash.has_key? 'operationId' | ||
@operation_id = hash['operationId'] | ||
end | ||
if hash.has_key? 'references' | ||
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash | ||
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references']) | ||
end | ||
if hash.has_key? 'terminalData' | ||
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash | ||
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData']) | ||
end | ||
if hash.has_key? 'transactionTimestamp' | ||
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp']) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
87 changes: 87 additions & 0 deletions
87
lib/worldline/acquiring/sdk/v1/domain/api_balance_inquiry_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,87 @@ | ||
# | ||
# This file was automatically generated. | ||
# | ||
require 'worldline/acquiring/sdk/domain/data_object' | ||
require 'worldline/acquiring/sdk/v1/domain/amount_data' | ||
require 'worldline/acquiring/sdk/v1/domain/api_references_for_responses' | ||
|
||
module Worldline | ||
module Acquiring | ||
module SDK | ||
module V1 | ||
module Domain | ||
# @attr [String] authorization_code | ||
# @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] available_amount | ||
# @attr [String] operation_id | ||
# @attr [Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses] references | ||
# @attr [String] responder | ||
# @attr [String] response_code | ||
# @attr [String] response_code_category | ||
# @attr [String] response_code_description | ||
class ApiBalanceInquiryResponse < Worldline::Acquiring::SDK::Domain::DataObject | ||
|
||
attr_accessor :authorization_code | ||
|
||
attr_accessor :available_amount | ||
|
||
attr_accessor :operation_id | ||
|
||
attr_accessor :references | ||
|
||
attr_accessor :responder | ||
|
||
attr_accessor :response_code | ||
|
||
attr_accessor :response_code_category | ||
|
||
attr_accessor :response_code_description | ||
|
||
# @return (Hash) | ||
def to_h | ||
hash = super | ||
hash['authorizationCode'] = @authorization_code unless @authorization_code.nil? | ||
hash['availableAmount'] = @available_amount.to_h unless @available_amount.nil? | ||
hash['operationId'] = @operation_id unless @operation_id.nil? | ||
hash['references'] = @references.to_h unless @references.nil? | ||
hash['responder'] = @responder unless @responder.nil? | ||
hash['responseCode'] = @response_code unless @response_code.nil? | ||
hash['responseCodeCategory'] = @response_code_category unless @response_code_category.nil? | ||
hash['responseCodeDescription'] = @response_code_description unless @response_code_description.nil? | ||
hash | ||
end | ||
|
||
def from_hash(hash) | ||
super | ||
if hash.has_key? 'authorizationCode' | ||
@authorization_code = hash['authorizationCode'] | ||
end | ||
if hash.has_key? 'availableAmount' | ||
raise TypeError, "value '%s' is not a Hash" % [hash['availableAmount']] unless hash['availableAmount'].is_a? Hash | ||
@available_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['availableAmount']) | ||
end | ||
if hash.has_key? 'operationId' | ||
@operation_id = hash['operationId'] | ||
end | ||
if hash.has_key? 'references' | ||
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash | ||
@references = Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses.new_from_hash(hash['references']) | ||
end | ||
if hash.has_key? 'responder' | ||
@responder = hash['responder'] | ||
end | ||
if hash.has_key? 'responseCode' | ||
@response_code = hash['responseCode'] | ||
end | ||
if hash.has_key? 'responseCodeCategory' | ||
@response_code_category = hash['responseCodeCategory'] | ||
end | ||
if hash.has_key? 'responseCodeDescription' | ||
@response_code_description = hash['responseCodeDescription'] | ||
end | ||
end | ||
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
Oops, something went wrong.