pnz-payments-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +98 -0
- data/lib/account_and_transaction_api_specification/api_helper.rb +10 -0
- data/lib/account_and_transaction_api_specification/client.rb +114 -0
- data/lib/account_and_transaction_api_specification/configuration.rb +127 -0
- data/lib/account_and_transaction_api_specification/controllers/accounts_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/balances_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/base_controller.rb +66 -0
- data/lib/account_and_transaction_api_specification/controllers/beneficiaries_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/direct_debits_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/offers_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/party_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/scheduled_payments_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/standing_orders_controller.rb +146 -0
- data/lib/account_and_transaction_api_specification/controllers/statements_controller.rb +421 -0
- data/lib/account_and_transaction_api_specification/controllers/transactions_controller.rb +170 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_balances503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_beneficiaries503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_direct_debits503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_offers503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_party503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_scheduled_payments503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_standing_orders503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_statements_transactions503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/accounts_transactions503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/api_exception.rb +21 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/balances503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/beneficiaries503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/direct_debits503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/offers503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/party503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/scheduled_payments503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/standing_orders503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/statements503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions400_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions403_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions500_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/exceptions/transactions503_error_exception.rb +72 -0
- data/lib/account_and_transaction_api_specification/http/auth/o_auth2.rb +43 -0
- data/lib/account_and_transaction_api_specification/http/http_call_back.rb +10 -0
- data/lib/account_and_transaction_api_specification/http/http_method_enum.rb +10 -0
- data/lib/account_and_transaction_api_specification/http/http_request.rb +10 -0
- data/lib/account_and_transaction_api_specification/http/http_response.rb +10 -0
- data/lib/account_and_transaction_api_specification/models/account.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_model.rb +60 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_pos_tresponse.rb +86 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_response.rb +86 -0
- data/lib/account_and_transaction_api_specification/models/account_access_consent_response_model.rb +120 -0
- data/lib/account_and_transaction_api_specification/models/account_access_status_enum.rb +29 -0
- data/lib/account_and_transaction_api_specification/models/account_model.rb +137 -0
- data/lib/account_and_transaction_api_specification/models/account_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/account_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/account_scheme_model_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/account_sub_type_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/account_type_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/address.rb +137 -0
- data/lib/account_and_transaction_api_specification/models/address_type_enum.rb +20 -0
- data/lib/account_and_transaction_api_specification/models/address_type_option_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/authorisation_type_enum.rb +26 -0
- data/lib/account_and_transaction_api_specification/models/balance.rb +82 -0
- data/lib/account_and_transaction_api_specification/models/balance_model.rb +136 -0
- data/lib/account_and_transaction_api_specification/models/balance_model_type_enum.rb +47 -0
- data/lib/account_and_transaction_api_specification/models/balances_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/balances_response_data.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/bank_transaction_code.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/base_model.rb +110 -0
- data/lib/account_and_transaction_api_specification/models/becs_remittance.rb +109 -0
- data/lib/account_and_transaction_api_specification/models/beneficiaries_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/beneficiaries_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/beneficiary_model.rb +110 -0
- data/lib/account_and_transaction_api_specification/models/card_instrument.rb +97 -0
- data/lib/account_and_transaction_api_specification/models/card_scheme_name_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/consent.rb +145 -0
- data/lib/account_and_transaction_api_specification/models/credit_debit_indicator_enum.rb +24 -0
- data/lib/account_and_transaction_api_specification/models/credit_line.rb +82 -0
- data/lib/account_and_transaction_api_specification/models/credit_line_type_enum.rb +26 -0
- data/lib/account_and_transaction_api_specification/models/creditor_account.rb +102 -0
- data/lib/account_and_transaction_api_specification/models/creditor_agent.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/creditor_reference.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/currency_exchange.rb +147 -0
- data/lib/account_and_transaction_api_specification/models/data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/debtor_account.rb +102 -0
- data/lib/account_and_transaction_api_specification/models/debtor_agent.rb +70 -0
- data/lib/account_and_transaction_api_specification/models/debtor_reference.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/delivery_address.rb +138 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_model.rb +146 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/direct_debit_status_code_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/error.rb +92 -0
- data/lib/account_and_transaction_api_specification/models/error_code_enum.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/error_response.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/fee.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/final_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/first_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/geo_location.rb +72 -0
- data/lib/account_and_transaction_api_specification/models/get_account_offers_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_party_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_party_response_data.rb +62 -0
- data/lib/account_and_transaction_api_specification/models/get_account_scheduled_payments_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_response_data.rb +62 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_transactions_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statement_transactions_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statements_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_account_statements_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_offers_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_offers_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_party_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_scheduled_payments_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_scheduled_payments_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/get_statements_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/get_statements_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/instructed_amount.rb +73 -0
- data/lib/account_and_transaction_api_specification/models/links.rb +100 -0
- data/lib/account_and_transaction_api_specification/models/merchant_details.rb +75 -0
- data/lib/account_and_transaction_api_specification/models/meta.rb +112 -0
- data/lib/account_and_transaction_api_specification/models/meta_data.rb +112 -0
- data/lib/account_and_transaction_api_specification/models/next_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/offer_model.rb +199 -0
- data/lib/account_and_transaction_api_specification/models/offer_type_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/party_model.rb +144 -0
- data/lib/account_and_transaction_api_specification/models/party_type_enum.rb +26 -0
- data/lib/account_and_transaction_api_specification/models/payment_context_code_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/permission_enum.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/postal_address.rb +138 -0
- data/lib/account_and_transaction_api_specification/models/previous_payment_amount.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/proprietary_bank_transaction_code.rb +70 -0
- data/lib/account_and_transaction_api_specification/models/reference.rb +95 -0
- data/lib/account_and_transaction_api_specification/models/risk.rb +164 -0
- data/lib/account_and_transaction_api_specification/models/scheduled_payment_model.rb +155 -0
- data/lib/account_and_transaction_api_specification/models/scheduled_type_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/scheme_name_enum.rb +21 -0
- data/lib/account_and_transaction_api_specification/models/servicer.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/standing_order_model.rb +289 -0
- data/lib/account_and_transaction_api_specification/models/standing_order_status_code_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/standing_orders_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/standing_orders_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/models/statement.rb +313 -0
- data/lib/account_and_transaction_api_specification/models/statement_amount.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/statement_amount_type_enum.rb +83 -0
- data/lib/account_and_transaction_api_specification/models/statement_benefit.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/statement_benefit_type_enum.rb +29 -0
- data/lib/account_and_transaction_api_specification/models/statement_date_time.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/statement_date_time_type_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/statement_fee.rb +80 -0
- data/lib/account_and_transaction_api_specification/models/statement_fee_type_enum.rb +59 -0
- data/lib/account_and_transaction_api_specification/models/statement_interest.rb +81 -0
- data/lib/account_and_transaction_api_specification/models/statement_interest_type_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/statement_model.rb +313 -0
- data/lib/account_and_transaction_api_specification/models/statement_rate.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/statement_rate_type_enum.rb +47 -0
- data/lib/account_and_transaction_api_specification/models/statement_type_enum.rb +32 -0
- data/lib/account_and_transaction_api_specification/models/statement_value.rb +69 -0
- data/lib/account_and_transaction_api_specification/models/statement_value_type_enum.rb +41 -0
- data/lib/account_and_transaction_api_specification/models/transaction_model.rb +333 -0
- data/lib/account_and_transaction_api_specification/models/transaction_reference.rb +95 -0
- data/lib/account_and_transaction_api_specification/models/transaction_status_enum.rb +23 -0
- data/lib/account_and_transaction_api_specification/models/transactions_response.rb +76 -0
- data/lib/account_and_transaction_api_specification/models/transactions_response_data.rb +71 -0
- data/lib/account_and_transaction_api_specification/utilities/date_time_helper.rb +11 -0
- data/lib/account_and_transaction_api_specification/utilities/file_wrapper.rb +28 -0
- data/lib/account_and_transaction_api_specification.rb +439 -0
- data/test/controllers/controller_test_base.rb +29 -0
- data/test/controllers/test_accounts_controller.rb +45 -0
- data/test/controllers/test_balances_controller.rb +45 -0
- data/test/controllers/test_beneficiaries_controller.rb +45 -0
- data/test/controllers/test_direct_debits_controller.rb +45 -0
- data/test/controllers/test_offers_controller.rb +45 -0
- data/test/controllers/test_party_controller.rb +45 -0
- data/test/controllers/test_scheduled_payments_controller.rb +45 -0
- data/test/controllers/test_standing_orders_controller.rb +45 -0
- data/test/controllers/test_statements_controller.rb +49 -0
- data/test/controllers/test_transactions_controller.rb +49 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +349 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f99dbba022e67d5251e809c1c9b8fbc5e99243071bc0896a7ec87c13f21f4127
|
4
|
+
data.tar.gz: c0e6f1a93b48253d3aea1a6651da5736e3007e7994fdc26cfb89fdeec4bde9e2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 47464041a823b74b69a61d90546df5f238636da68c9f41eb61ec7924335c22446f0365010bdd7267375ca0cd6d87d3dfb050227eba0cfb1adcff501518ae4798
|
7
|
+
data.tar.gz: 1d3c0e9194ba8a5e68634ab675f8f5d5a4ec57261ca1ba129db31c78f75bcb094b0a7d5dcfb2ef2c1f02a6f929a106f25a3eba12f258158b5ddc316f65ff89c9
|
data/LICENSE
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
License:
|
2
|
+
========
|
3
|
+
The MIT License (MIT)
|
4
|
+
http://opensource.org/licenses/MIT
|
5
|
+
|
6
|
+
Copyright (c) 2014 - 2025 APIMATIC Limited
|
7
|
+
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
10
|
+
in the Software without restriction, including without limitation the rights
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
13
|
+
furnished to do so, subject to the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
16
|
+
all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
THE SOFTWARE.
|
25
|
+
|
26
|
+
Trade Mark:
|
27
|
+
==========
|
28
|
+
APIMATIC is a trade mark for APIMATIC Limited
|
data/README.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
|
2
|
+
# Getting Started with Account and Transaction API Specification
|
3
|
+
|
4
|
+
## Introduction
|
5
|
+
|
6
|
+
Swagger for Account and Transaction API Specification. This is heavily derived from the Open Banking UK API - see www.openbanking.org.uk for details.
|
7
|
+
|
8
|
+
## Install the Package
|
9
|
+
|
10
|
+
Install the gem from the command line:
|
11
|
+
|
12
|
+
```bash
|
13
|
+
gem install pnz-payments-sdk -v 1.0.0
|
14
|
+
```
|
15
|
+
|
16
|
+
Or add the gem to your Gemfile and run `bundle`:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'pnz-payments-sdk', '1.0.0'
|
20
|
+
```
|
21
|
+
|
22
|
+
For additional gem details, see the [RubyGems page for the pnz-payments-sdk gem](https://rubygems.org/gems/pnz-payments-sdk/versions/1.0.0).
|
23
|
+
|
24
|
+
## Test the SDK
|
25
|
+
|
26
|
+
To run the tests, navigate to the root directory of the SDK in your terminal and execute the following command:
|
27
|
+
|
28
|
+
```
|
29
|
+
rake
|
30
|
+
```
|
31
|
+
|
32
|
+
## Initialize the API Client
|
33
|
+
|
34
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/client.md)
|
35
|
+
|
36
|
+
The following parameters are configurable for the API Client:
|
37
|
+
|
38
|
+
| Parameter | Type | Description |
|
39
|
+
| --- | --- | --- |
|
40
|
+
| `environment` | `Environment` | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
41
|
+
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
42
|
+
| `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
43
|
+
| `timeout` | `Float` | The value to use for connection timeout. <br> **Default: 60** |
|
44
|
+
| `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
45
|
+
| `retry_interval` | `Float` | Pause in seconds between retries. <br> **Default: 1** |
|
46
|
+
| `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
|
47
|
+
| `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
48
|
+
| `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
49
|
+
| `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
50
|
+
| `bearer_auth_credentials` | [`BearerAuthCredentials`](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/auth/oauth-2-bearer-token.md) | The credential object for OAuth 2 Bearer token |
|
51
|
+
|
52
|
+
The API client can be initialized as follows:
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
client = AccountAndTransactionApiSpecification::Client.new(
|
56
|
+
bearer_auth_credentials: BearerAuthCredentials.new(
|
57
|
+
access_token: 'AccessToken'
|
58
|
+
),
|
59
|
+
environment: Environment::PRODUCTION
|
60
|
+
)
|
61
|
+
```
|
62
|
+
|
63
|
+
## Environments
|
64
|
+
|
65
|
+
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
66
|
+
|
67
|
+
### Fields
|
68
|
+
|
69
|
+
| Name | Description |
|
70
|
+
| --- | --- |
|
71
|
+
| production | **Default** |
|
72
|
+
| environment2 | - |
|
73
|
+
|
74
|
+
## Authorization
|
75
|
+
|
76
|
+
This API uses the following authentication schemes.
|
77
|
+
|
78
|
+
* [`HTTPBearerAuthentication (OAuth 2 Bearer token)`](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/auth/oauth-2-bearer-token.md)
|
79
|
+
|
80
|
+
## List of APIs
|
81
|
+
|
82
|
+
* [Direct Debits](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/direct-debits.md)
|
83
|
+
* [Scheduled Payments](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/scheduled-payments.md)
|
84
|
+
* [Standing Orders](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/standing-orders.md)
|
85
|
+
* [Accounts](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/accounts.md)
|
86
|
+
* [Balances](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/balances.md)
|
87
|
+
* [Beneficiaries](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/beneficiaries.md)
|
88
|
+
* [Offers](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/offers.md)
|
89
|
+
* [Party](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/party.md)
|
90
|
+
* [Statements](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/statements.md)
|
91
|
+
* [Transactions](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/controllers/transactions.md)
|
92
|
+
|
93
|
+
## Classes Documentation
|
94
|
+
|
95
|
+
* [Utility Classes](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/utility-classes.md)
|
96
|
+
* [HttpResponse](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/http-response.md)
|
97
|
+
* [HttpRequest](https://www.github.com/sdks-io/pnz-payments-ruby-sdk/tree/1.0.0/doc/http-request.md)
|
98
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# API utility class
|
8
|
+
class APIHelper < CoreLibrary::ApiHelper
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# account_and_transaction_api_specification client class.
|
8
|
+
class Client
|
9
|
+
include CoreLibrary
|
10
|
+
attr_reader :config, :auth_managers
|
11
|
+
|
12
|
+
# Access to accounts controller.
|
13
|
+
# @return [AccountsController] Returns the controller instance.
|
14
|
+
def accounts
|
15
|
+
@accounts ||= AccountsController.new @global_configuration
|
16
|
+
end
|
17
|
+
|
18
|
+
# Access to balances controller.
|
19
|
+
# @return [BalancesController] Returns the controller instance.
|
20
|
+
def balances
|
21
|
+
@balances ||= BalancesController.new @global_configuration
|
22
|
+
end
|
23
|
+
|
24
|
+
# Access to beneficiaries controller.
|
25
|
+
# @return [BeneficiariesController] Returns the controller instance.
|
26
|
+
def beneficiaries
|
27
|
+
@beneficiaries ||= BeneficiariesController.new @global_configuration
|
28
|
+
end
|
29
|
+
|
30
|
+
# Access to direct_debits controller.
|
31
|
+
# @return [DirectDebitsController] Returns the controller instance.
|
32
|
+
def direct_debits
|
33
|
+
@direct_debits ||= DirectDebitsController.new @global_configuration
|
34
|
+
end
|
35
|
+
|
36
|
+
# Access to offers controller.
|
37
|
+
# @return [OffersController] Returns the controller instance.
|
38
|
+
def offers
|
39
|
+
@offers ||= OffersController.new @global_configuration
|
40
|
+
end
|
41
|
+
|
42
|
+
# Access to party controller.
|
43
|
+
# @return [PartyController] Returns the controller instance.
|
44
|
+
def party
|
45
|
+
@party ||= PartyController.new @global_configuration
|
46
|
+
end
|
47
|
+
|
48
|
+
# Access to scheduled_payments controller.
|
49
|
+
# @return [ScheduledPaymentsController] Returns the controller instance.
|
50
|
+
def scheduled_payments
|
51
|
+
@scheduled_payments ||= ScheduledPaymentsController.new @global_configuration
|
52
|
+
end
|
53
|
+
|
54
|
+
# Access to standing_orders controller.
|
55
|
+
# @return [StandingOrdersController] Returns the controller instance.
|
56
|
+
def standing_orders
|
57
|
+
@standing_orders ||= StandingOrdersController.new @global_configuration
|
58
|
+
end
|
59
|
+
|
60
|
+
# Access to statements controller.
|
61
|
+
# @return [StatementsController] Returns the controller instance.
|
62
|
+
def statements
|
63
|
+
@statements ||= StatementsController.new @global_configuration
|
64
|
+
end
|
65
|
+
|
66
|
+
# Access to transactions controller.
|
67
|
+
# @return [TransactionsController] Returns the controller instance.
|
68
|
+
def transactions
|
69
|
+
@transactions ||= TransactionsController.new @global_configuration
|
70
|
+
end
|
71
|
+
|
72
|
+
def initialize(
|
73
|
+
connection: nil, adapter: :net_http_persistent, timeout: 60,
|
74
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
75
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
76
|
+
retry_methods: %i[get put], http_callback: nil,
|
77
|
+
environment: Environment::PRODUCTION, access_token: nil,
|
78
|
+
bearer_auth_credentials: nil, config: nil
|
79
|
+
)
|
80
|
+
@config = if config.nil?
|
81
|
+
Configuration.new(
|
82
|
+
connection: connection, adapter: adapter, timeout: timeout,
|
83
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
84
|
+
backoff_factor: backoff_factor,
|
85
|
+
retry_statuses: retry_statuses,
|
86
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
87
|
+
environment: environment, access_token: access_token,
|
88
|
+
bearer_auth_credentials: bearer_auth_credentials
|
89
|
+
)
|
90
|
+
else
|
91
|
+
config
|
92
|
+
end
|
93
|
+
|
94
|
+
@global_configuration = GlobalConfiguration.new(client_configuration: @config)
|
95
|
+
.base_uri_executor(@config.method(:get_base_uri))
|
96
|
+
.global_errors(BaseController::GLOBAL_ERRORS)
|
97
|
+
.user_agent(BaseController.user_agent)
|
98
|
+
|
99
|
+
initialize_auth_managers(@global_configuration)
|
100
|
+
@global_configuration = @global_configuration.auth_managers(@auth_managers)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Initializes the auth managers hash used for authenticating API calls.
|
104
|
+
# @param [GlobalConfiguration] global_config The global configuration of the SDK)
|
105
|
+
def initialize_auth_managers(global_config)
|
106
|
+
@auth_managers = {}
|
107
|
+
http_client_config = global_config.client_configuration
|
108
|
+
%w[HTTPBearerAuthentication].each { |auth| @auth_managers[auth] = nil }
|
109
|
+
@auth_managers['HTTPBearerAuthentication'] = OAuth2.new(
|
110
|
+
http_client_config.bearer_auth_credentials
|
111
|
+
)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# An enum for SDK environments.
|
8
|
+
class Environment
|
9
|
+
ENVIRONMENT = [
|
10
|
+
PRODUCTION = 'production'.freeze,
|
11
|
+
ENVIRONMENT2 = 'environment2'.freeze
|
12
|
+
].freeze
|
13
|
+
end
|
14
|
+
|
15
|
+
# An enum for API servers.
|
16
|
+
class Server
|
17
|
+
SERVER = [
|
18
|
+
DEFAULT = 'default'.freeze
|
19
|
+
].freeze
|
20
|
+
end
|
21
|
+
|
22
|
+
# All configuration including auth info and base URI for the API access
|
23
|
+
# are configured in this class.
|
24
|
+
class Configuration < CoreLibrary::HttpClientConfiguration
|
25
|
+
def access_token
|
26
|
+
@bearer_auth_credentials.access_token
|
27
|
+
end
|
28
|
+
|
29
|
+
# The attribute readers for properties.
|
30
|
+
attr_reader :environment, :bearer_auth_credentials
|
31
|
+
|
32
|
+
class << self
|
33
|
+
attr_reader :environments
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(
|
37
|
+
connection: nil, adapter: :net_http_persistent, timeout: 60,
|
38
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
39
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
40
|
+
retry_methods: %i[get put], http_callback: nil,
|
41
|
+
environment: Environment::PRODUCTION, access_token: nil,
|
42
|
+
bearer_auth_credentials: nil
|
43
|
+
)
|
44
|
+
|
45
|
+
super connection: connection, adapter: adapter, timeout: timeout,
|
46
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
47
|
+
backoff_factor: backoff_factor, retry_statuses: retry_statuses,
|
48
|
+
retry_methods: retry_methods, http_callback: http_callback
|
49
|
+
|
50
|
+
# Current API environment
|
51
|
+
@environment = String(environment)
|
52
|
+
|
53
|
+
# The OAuth 2.0 Access Token to use for API requests.
|
54
|
+
@access_token = access_token
|
55
|
+
|
56
|
+
# Initializing OAuth 2 Bearer token credentials with the provided auth parameters
|
57
|
+
@bearer_auth_credentials = create_auth_credentials_object(
|
58
|
+
access_token, bearer_auth_credentials
|
59
|
+
)
|
60
|
+
|
61
|
+
# The Http Client to use for making requests.
|
62
|
+
set_http_client CoreLibrary::FaradayClient.new(self)
|
63
|
+
end
|
64
|
+
|
65
|
+
def clone_with(connection: nil, adapter: nil, timeout: nil,
|
66
|
+
max_retries: nil, retry_interval: nil, backoff_factor: nil,
|
67
|
+
retry_statuses: nil, retry_methods: nil, http_callback: nil,
|
68
|
+
environment: nil, access_token: nil,
|
69
|
+
bearer_auth_credentials: nil)
|
70
|
+
connection ||= self.connection
|
71
|
+
adapter ||= self.adapter
|
72
|
+
timeout ||= self.timeout
|
73
|
+
max_retries ||= self.max_retries
|
74
|
+
retry_interval ||= self.retry_interval
|
75
|
+
backoff_factor ||= self.backoff_factor
|
76
|
+
retry_statuses ||= self.retry_statuses
|
77
|
+
retry_methods ||= self.retry_methods
|
78
|
+
http_callback ||= self.http_callback
|
79
|
+
environment ||= self.environment
|
80
|
+
bearer_auth_credentials = create_auth_credentials_object(
|
81
|
+
access_token, bearer_auth_credentials || self.bearer_auth_credentials
|
82
|
+
)
|
83
|
+
|
84
|
+
Configuration.new(connection: connection, adapter: adapter,
|
85
|
+
timeout: timeout, max_retries: max_retries,
|
86
|
+
retry_interval: retry_interval,
|
87
|
+
backoff_factor: backoff_factor,
|
88
|
+
retry_statuses: retry_statuses,
|
89
|
+
retry_methods: retry_methods,
|
90
|
+
http_callback: http_callback, environment: environment,
|
91
|
+
bearer_auth_credentials: bearer_auth_credentials)
|
92
|
+
end
|
93
|
+
|
94
|
+
def create_auth_credentials_object(access_token, bearer_auth_credentials)
|
95
|
+
return bearer_auth_credentials if access_token.nil?
|
96
|
+
|
97
|
+
warn('The \'access_token\' params are deprecated. Use \'bearer_auth_cred'\
|
98
|
+
'entials\' param instead.')
|
99
|
+
|
100
|
+
unless bearer_auth_credentials.nil?
|
101
|
+
return bearer_auth_credentials.clone_with(
|
102
|
+
access_token: access_token
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
BearerAuthCredentials.new(access_token: access_token)
|
107
|
+
end
|
108
|
+
|
109
|
+
# All the environments the SDK can run in.
|
110
|
+
ENVIRONMENTS = {
|
111
|
+
Environment::PRODUCTION => {
|
112
|
+
Server::DEFAULT => 'https://api-nomatls.apicentre.middleware.co.nz/open-banking-nz/v2.3'
|
113
|
+
},
|
114
|
+
Environment::ENVIRONMENT2 => {
|
115
|
+
Server::DEFAULT => 'https://authserver.example'
|
116
|
+
}
|
117
|
+
}.freeze
|
118
|
+
|
119
|
+
# Generates the appropriate base URI for the environment and the server.
|
120
|
+
# @param [Configuration::Server] server The server enum for which the base URI is
|
121
|
+
# required.
|
122
|
+
# @return [String] The base URI.
|
123
|
+
def get_base_uri(server = Server::DEFAULT)
|
124
|
+
ENVIRONMENTS[environment][server].clone
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,146 @@
|
|
1
|
+
# account_and_transaction_api_specification
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AccountAndTransactionApiSpecification
|
7
|
+
# AccountsController
|
8
|
+
class AccountsController < BaseController
|
9
|
+
# Get an account
|
10
|
+
# @param [String] account_id Required parameter: A unique identifier used to
|
11
|
+
# identify the account resource.
|
12
|
+
# @param [String] x_fapi_auth_date Optional parameter: The time when the
|
13
|
+
# Customer last logged in with the Third Party. All dates in the HTTP
|
14
|
+
# headers are represented as RFC 7231 Full Dates. An example is below: Sun,
|
15
|
+
# 10 Sep 2017 19:43:31 UTC
|
16
|
+
# @param [String] x_fapi_customer_ip_address Optional parameter: The
|
17
|
+
# Customer's IP address if the Customer is currently logged in with the
|
18
|
+
# Third Party.
|
19
|
+
# @param [String] x_fapi_interaction_id Optional parameter: An RFC4122 UID
|
20
|
+
# used as a correlation id.
|
21
|
+
# @param [String] x_merchant_ip_address Optional parameter: The IP address
|
22
|
+
# of the merchant when making account information requests through a Third
|
23
|
+
# Party.
|
24
|
+
# @param [String] x_customer_user_agent Optional parameter: The User-Agent
|
25
|
+
# of the application on the customer device that is used to make the account
|
26
|
+
# information request
|
27
|
+
# @return [AccountResponse] response from the API call.
|
28
|
+
def get_account(account_id,
|
29
|
+
x_fapi_auth_date: nil,
|
30
|
+
x_fapi_customer_ip_address: nil,
|
31
|
+
x_fapi_interaction_id: nil,
|
32
|
+
x_merchant_ip_address: nil,
|
33
|
+
x_customer_user_agent: nil)
|
34
|
+
new_api_call_builder
|
35
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
36
|
+
'/accounts/{AccountId}',
|
37
|
+
Server::DEFAULT)
|
38
|
+
.template_param(new_parameter(account_id, key: 'AccountId')
|
39
|
+
.should_encode(true))
|
40
|
+
.header_param(new_parameter(x_fapi_auth_date, key: 'x-fapi-auth-date'))
|
41
|
+
.header_param(new_parameter(x_fapi_customer_ip_address, key: 'x-fapi-customer-ip-address'))
|
42
|
+
.header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id'))
|
43
|
+
.header_param(new_parameter(x_merchant_ip_address, key: 'x-merchant-ip-address'))
|
44
|
+
.header_param(new_parameter(x_customer_user_agent, key: 'x-customer-user-agent'))
|
45
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
46
|
+
.auth(Single.new('HTTPBearerAuthentication')))
|
47
|
+
.response(new_response_handler
|
48
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
49
|
+
.deserialize_into(AccountResponse.method(:from_hash))
|
50
|
+
.local_error('400',
|
51
|
+
'Bad Request',
|
52
|
+
Accounts400ErrorException)
|
53
|
+
.local_error('401',
|
54
|
+
'Unauthorized',
|
55
|
+
APIException)
|
56
|
+
.local_error('403',
|
57
|
+
'Forbidden',
|
58
|
+
Accounts403ErrorException)
|
59
|
+
.local_error('405',
|
60
|
+
'Method Not Allowed',
|
61
|
+
APIException)
|
62
|
+
.local_error('406',
|
63
|
+
'Not Acceptable',
|
64
|
+
APIException)
|
65
|
+
.local_error('429',
|
66
|
+
'Too Many Requests',
|
67
|
+
APIException)
|
68
|
+
.local_error('500',
|
69
|
+
'Internal Server Error',
|
70
|
+
Accounts500ErrorException)
|
71
|
+
.local_error('501',
|
72
|
+
'Not Implemented',
|
73
|
+
APIException)
|
74
|
+
.local_error('503',
|
75
|
+
'Service Unavailable',
|
76
|
+
Accounts503ErrorException))
|
77
|
+
.execute
|
78
|
+
end
|
79
|
+
|
80
|
+
# Get a list of accounts
|
81
|
+
# @param [String] x_fapi_auth_date Optional parameter: The time when the
|
82
|
+
# Customer last logged in with the Third Party. All dates in the HTTP
|
83
|
+
# headers are represented as RFC 7231 Full Dates. An example is below: Sun,
|
84
|
+
# 10 Sep 2017 19:43:31 UTC
|
85
|
+
# @param [String] x_fapi_customer_ip_address Optional parameter: The
|
86
|
+
# Customer's IP address if the Customer is currently logged in with the
|
87
|
+
# Third Party.
|
88
|
+
# @param [String] x_fapi_interaction_id Optional parameter: An RFC4122 UID
|
89
|
+
# used as a correlation id.
|
90
|
+
# @param [String] x_merchant_ip_address Optional parameter: The IP address
|
91
|
+
# of the merchant when making account information requests through a Third
|
92
|
+
# Party.
|
93
|
+
# @param [String] x_customer_user_agent Optional parameter: The User-Agent
|
94
|
+
# of the application on the customer device that is used to make the account
|
95
|
+
# information request
|
96
|
+
# @return [AccountResponse] response from the API call.
|
97
|
+
def get_accounts(x_fapi_auth_date: nil,
|
98
|
+
x_fapi_customer_ip_address: nil,
|
99
|
+
x_fapi_interaction_id: nil,
|
100
|
+
x_merchant_ip_address: nil,
|
101
|
+
x_customer_user_agent: nil)
|
102
|
+
new_api_call_builder
|
103
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
104
|
+
'/accounts',
|
105
|
+
Server::DEFAULT)
|
106
|
+
.header_param(new_parameter(x_fapi_auth_date, key: 'x-fapi-auth-date'))
|
107
|
+
.header_param(new_parameter(x_fapi_customer_ip_address, key: 'x-fapi-customer-ip-address'))
|
108
|
+
.header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id'))
|
109
|
+
.header_param(new_parameter(x_merchant_ip_address, key: 'x-merchant-ip-address'))
|
110
|
+
.header_param(new_parameter(x_customer_user_agent, key: 'x-customer-user-agent'))
|
111
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
112
|
+
.auth(Single.new('HTTPBearerAuthentication')))
|
113
|
+
.response(new_response_handler
|
114
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
115
|
+
.deserialize_into(AccountResponse.method(:from_hash))
|
116
|
+
.local_error('400',
|
117
|
+
'Bad Request',
|
118
|
+
Accounts400ErrorException)
|
119
|
+
.local_error('401',
|
120
|
+
'Unauthorized',
|
121
|
+
APIException)
|
122
|
+
.local_error('403',
|
123
|
+
'Forbidden',
|
124
|
+
Accounts403ErrorException)
|
125
|
+
.local_error('405',
|
126
|
+
'Method Not Allowed',
|
127
|
+
APIException)
|
128
|
+
.local_error('406',
|
129
|
+
'Not Acceptable',
|
130
|
+
APIException)
|
131
|
+
.local_error('429',
|
132
|
+
'Too Many Requests',
|
133
|
+
APIException)
|
134
|
+
.local_error('500',
|
135
|
+
'Internal Server Error',
|
136
|
+
Accounts500ErrorException)
|
137
|
+
.local_error('501',
|
138
|
+
'Not Implemented',
|
139
|
+
APIException)
|
140
|
+
.local_error('503',
|
141
|
+
'Service Unavailable',
|
142
|
+
Accounts503ErrorException))
|
143
|
+
.execute
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|