payquicker-apimatic-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 +208 -0
- data/bin/console +15 -0
- data/lib/pay_quicker_sdk/api_helper.rb +10 -0
- data/lib/pay_quicker_sdk/client.rb +205 -0
- data/lib/pay_quicker_sdk/configuration.rb +229 -0
- data/lib/pay_quicker_sdk/controllers/agreements_controller.rb +129 -0
- data/lib/pay_quicker_sdk/controllers/balances_controller.rb +156 -0
- data/lib/pay_quicker_sdk/controllers/bank_accounts_controller.rb +587 -0
- data/lib/pay_quicker_sdk/controllers/base_controller.rb +60 -0
- data/lib/pay_quicker_sdk/controllers/client_side_controller.rb +237 -0
- data/lib/pay_quicker_sdk/controllers/compliance_controller.rb +77 -0
- data/lib/pay_quicker_sdk/controllers/documents_controller.rb +233 -0
- data/lib/pay_quicker_sdk/controllers/electronic_wallets_controller.rb +280 -0
- data/lib/pay_quicker_sdk/controllers/events_controller.rb +75 -0
- data/lib/pay_quicker_sdk/controllers/invitations_controller.rb +179 -0
- data/lib/pay_quicker_sdk/controllers/jobs_controller.rb +154 -0
- data/lib/pay_quicker_sdk/controllers/o_auth_authorization_controller.rb +43 -0
- data/lib/pay_quicker_sdk/controllers/payments_controller.rb +217 -0
- data/lib/pay_quicker_sdk/controllers/prepaid_cards_controller.rb +262 -0
- data/lib/pay_quicker_sdk/controllers/program_controller.rb +88 -0
- data/lib/pay_quicker_sdk/controllers/receipts_controller.rb +287 -0
- data/lib/pay_quicker_sdk/controllers/spendback_controller.rb +201 -0
- data/lib/pay_quicker_sdk/controllers/spendback_refunds_controller.rb +232 -0
- data/lib/pay_quicker_sdk/controllers/statements_controller.rb +197 -0
- data/lib/pay_quicker_sdk/controllers/transfers_controller.rb +259 -0
- data/lib/pay_quicker_sdk/controllers/users_controller.rb +151 -0
- data/lib/pay_quicker_sdk/controllers/webhooks_controller.rb +173 -0
- data/lib/pay_quicker_sdk/exceptions/api_error_result_exception.rb +80 -0
- data/lib/pay_quicker_sdk/exceptions/api_exception.rb +21 -0
- data/lib/pay_quicker_sdk/exceptions/o_auth_provider_exception.rb +64 -0
- data/lib/pay_quicker_sdk/http/auth/clientside.rb +53 -0
- data/lib/pay_quicker_sdk/http/auth/server.rb +156 -0
- data/lib/pay_quicker_sdk/http/http_call_back.rb +10 -0
- data/lib/pay_quicker_sdk/http/http_method_enum.rb +10 -0
- data/lib/pay_quicker_sdk/http/http_request.rb +10 -0
- data/lib/pay_quicker_sdk/http/http_response.rb +10 -0
- data/lib/pay_quicker_sdk/http/proxy_settings.rb +22 -0
- data/lib/pay_quicker_sdk/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/pay_quicker_sdk/logging/sdk_logger.rb +17 -0
- data/lib/pay_quicker_sdk/models/addresses.rb +45 -0
- data/lib/pay_quicker_sdk/models/agreement_list_result_json.rb +106 -0
- data/lib/pay_quicker_sdk/models/agreement_object.rb +120 -0
- data/lib/pay_quicker_sdk/models/agreement_result.rb +130 -0
- data/lib/pay_quicker_sdk/models/agreement_types.rb +64 -0
- data/lib/pay_quicker_sdk/models/authorization_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/authorization_object.rb +194 -0
- data/lib/pay_quicker_sdk/models/balance_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/balance_object.rb +118 -0
- data/lib/pay_quicker_sdk/models/balance_result.rb +128 -0
- data/lib/pay_quicker_sdk/models/bank_account_address.rb +132 -0
- data/lib/pay_quicker_sdk/models/bank_account_field.rb +83 -0
- data/lib/pay_quicker_sdk/models/bank_account_fields.rb +195 -0
- data/lib/pay_quicker_sdk/models/bank_account_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/bank_account_object.rb +226 -0
- data/lib/pay_quicker_sdk/models/bank_account_ownership.rb +36 -0
- data/lib/pay_quicker_sdk/models/bank_account_required_fields.rb +125 -0
- data/lib/pay_quicker_sdk/models/bank_account_requirement.rb +142 -0
- data/lib/pay_quicker_sdk/models/bank_account_requirement_format.rb +93 -0
- data/lib/pay_quicker_sdk/models/bank_account_requirement_format_legend.rb +93 -0
- data/lib/pay_quicker_sdk/models/bank_account_requirement_list_result.rb +110 -0
- data/lib/pay_quicker_sdk/models/bank_account_requirement_validator.rb +86 -0
- data/lib/pay_quicker_sdk/models/bank_account_result.rb +234 -0
- data/lib/pay_quicker_sdk/models/bank_account_statuses.rb +49 -0
- data/lib/pay_quicker_sdk/models/bank_account_types.rb +47 -0
- data/lib/pay_quicker_sdk/models/bank_types.rb +68 -0
- data/lib/pay_quicker_sdk/models/base_model.rb +122 -0
- data/lib/pay_quicker_sdk/models/business_contact_roles.rb +44 -0
- data/lib/pay_quicker_sdk/models/card_networks.rb +36 -0
- data/lib/pay_quicker_sdk/models/card_processors.rb +52 -0
- data/lib/pay_quicker_sdk/models/category_types.rb +36 -0
- data/lib/pay_quicker_sdk/models/countries.rb +1031 -0
- data/lib/pay_quicker_sdk/models/countries_alpha_code3.rb +1028 -0
- data/lib/pay_quicker_sdk/models/create_invitation.rb +614 -0
- data/lib/pay_quicker_sdk/models/create_or_update_bank_account.rb +163 -0
- data/lib/pay_quicker_sdk/models/create_or_update_document.rb +82 -0
- data/lib/pay_quicker_sdk/models/create_or_update_document_fields.rb +81 -0
- data/lib/pay_quicker_sdk/models/create_or_update_electronic_wallet.rb +126 -0
- data/lib/pay_quicker_sdk/models/create_or_update_user.rb +614 -0
- data/lib/pay_quicker_sdk/models/create_spendback_refund_quote.rb +173 -0
- data/lib/pay_quicker_sdk/models/create_webhook_request.rb +82 -0
- data/lib/pay_quicker_sdk/models/currencies.rb +700 -0
- data/lib/pay_quicker_sdk/models/delivery_details.rb +119 -0
- data/lib/pay_quicker_sdk/models/document_details.rb +81 -0
- data/lib/pay_quicker_sdk/models/document_list_result.rb +108 -0
- data/lib/pay_quicker_sdk/models/document_object.rb +147 -0
- data/lib/pay_quicker_sdk/models/document_requirements_list_result.rb +91 -0
- data/lib/pay_quicker_sdk/models/document_result.rb +157 -0
- data/lib/pay_quicker_sdk/models/document_status_types.rb +48 -0
- data/lib/pay_quicker_sdk/models/document_types.rb +264 -0
- data/lib/pay_quicker_sdk/models/electronic_funds_transfer_types.rb +36 -0
- data/lib/pay_quicker_sdk/models/electronic_transfer_failure_types.rb +97 -0
- data/lib/pay_quicker_sdk/models/electronic_transfer_status_types.rb +46 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_field.rb +83 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_fields.rb +41 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_object.rb +186 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_required_fields.rb +125 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_requirement.rb +166 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_requirement_format.rb +93 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_requirement_format_legend.rb +93 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_requirement_list_result.rb +110 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_requirement_validator.rb +86 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_result.rb +195 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_statuses.rb +48 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_type.rb +99 -0
- data/lib/pay_quicker_sdk/models/electronic_wallet_types.rb +368 -0
- data/lib/pay_quicker_sdk/models/event_category_types.rb +40 -0
- data/lib/pay_quicker_sdk/models/event_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/event_object.rb +191 -0
- data/lib/pay_quicker_sdk/models/event_requirement_categories.rb +56 -0
- data/lib/pay_quicker_sdk/models/event_requirements.rb +105 -0
- data/lib/pay_quicker_sdk/models/event_statuses.rb +52 -0
- data/lib/pay_quicker_sdk/models/event_types.rb +36 -0
- data/lib/pay_quicker_sdk/models/expected_delivery_types.rb +36 -0
- data/lib/pay_quicker_sdk/models/fee_configuration.rb +154 -0
- data/lib/pay_quicker_sdk/models/fee_distribution.rb +159 -0
- data/lib/pay_quicker_sdk/models/fee_responsibility_parties.rb +44 -0
- data/lib/pay_quicker_sdk/models/fee_responsibility_sources.rb +36 -0
- data/lib/pay_quicker_sdk/models/fee_sources.rb +40 -0
- data/lib/pay_quicker_sdk/models/fee_values.rb +36 -0
- data/lib/pay_quicker_sdk/models/fees.rb +222 -0
- data/lib/pay_quicker_sdk/models/fx_rate.rb +144 -0
- data/lib/pay_quicker_sdk/models/gateway_payment_job.rb +131 -0
- data/lib/pay_quicker_sdk/models/gateway_payment_job_quote.rb +167 -0
- data/lib/pay_quicker_sdk/models/gateway_payment_quote.rb +220 -0
- data/lib/pay_quicker_sdk/models/gateway_spendback_quote.rb +167 -0
- data/lib/pay_quicker_sdk/models/gateway_transfer_quote.rb +195 -0
- data/lib/pay_quicker_sdk/models/genders.rb +48 -0
- data/lib/pay_quicker_sdk/models/government_ids.rb +45 -0
- data/lib/pay_quicker_sdk/models/hateoas_relationship.rb +69 -0
- data/lib/pay_quicker_sdk/models/hateoas_self_ref.rb +84 -0
- data/lib/pay_quicker_sdk/models/identity_verification_providers.rb +62 -0
- data/lib/pay_quicker_sdk/models/identity_verification_result_sub_types.rb +38 -0
- data/lib/pay_quicker_sdk/models/identity_verification_result_types.rb +57 -0
- data/lib/pay_quicker_sdk/models/idv_check_list_result.rb +108 -0
- data/lib/pay_quicker_sdk/models/idv_check_object.rb +209 -0
- data/lib/pay_quicker_sdk/models/idv_check_result.rb +221 -0
- data/lib/pay_quicker_sdk/models/invitation_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/invitation_object.rb +262 -0
- data/lib/pay_quicker_sdk/models/invitation_result.rb +272 -0
- data/lib/pay_quicker_sdk/models/job_status_types.rb +68 -0
- data/lib/pay_quicker_sdk/models/job_types.rb +36 -0
- data/lib/pay_quicker_sdk/models/languages.rb +101 -0
- data/lib/pay_quicker_sdk/models/list_metadata.rb +116 -0
- data/lib/pay_quicker_sdk/models/lock_side_types.rb +37 -0
- data/lib/pay_quicker_sdk/models/metadata.rb +72 -0
- data/lib/pay_quicker_sdk/models/metadata_items.rb +80 -0
- data/lib/pay_quicker_sdk/models/o_auth_provider_error.rb +62 -0
- data/lib/pay_quicker_sdk/models/o_auth_scope_server.rb +36 -0
- data/lib/pay_quicker_sdk/models/o_auth_token.rb +106 -0
- data/lib/pay_quicker_sdk/models/occupations.rb +100 -0
- data/lib/pay_quicker_sdk/models/operation_result.rb +72 -0
- data/lib/pay_quicker_sdk/models/order_prepaid_card.rb +97 -0
- data/lib/pay_quicker_sdk/models/payment_job_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/payment_job_object.rb +211 -0
- data/lib/pay_quicker_sdk/models/payment_job_result.rb +220 -0
- data/lib/pay_quicker_sdk/models/payment_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/payment_object.rb +263 -0
- data/lib/pay_quicker_sdk/models/payment_purposes.rb +58 -0
- data/lib/pay_quicker_sdk/models/payment_result.rb +272 -0
- data/lib/pay_quicker_sdk/models/portal_payment_job.rb +131 -0
- data/lib/pay_quicker_sdk/models/portal_payment_job_quote.rb +176 -0
- data/lib/pay_quicker_sdk/models/portal_payment_quote.rb +228 -0
- data/lib/pay_quicker_sdk/models/portal_spendback_quote.rb +177 -0
- data/lib/pay_quicker_sdk/models/portal_transfer_quote.rb +204 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_authorizations.rb +129 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_capabilities.rb +69 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_data_object.rb +136 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_data_result.rb +146 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_data_token_object.rb +134 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_data_token_result.rb +145 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_data_type.rb +36 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_image_side.rb +36 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_object.rb +243 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_pin_object.rb +108 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_pin_result.rb +121 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_pin_token_object.rb +128 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_pin_token_result.rb +139 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_replacement_reasons.rb +48 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_result.rb +254 -0
- data/lib/pay_quicker_sdk/models/prepaid_card_statuses.rb +71 -0
- data/lib/pay_quicker_sdk/models/program_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/program_object.rb +138 -0
- data/lib/pay_quicker_sdk/models/program_result.rb +147 -0
- data/lib/pay_quicker_sdk/models/program_types.rb +44 -0
- data/lib/pay_quicker_sdk/models/receipt_descriptions.rb +84 -0
- data/lib/pay_quicker_sdk/models/receipt_details.rb +439 -0
- data/lib/pay_quicker_sdk/models/receipt_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/receipt_object.rb +241 -0
- data/lib/pay_quicker_sdk/models/receipt_result.rb +251 -0
- data/lib/pay_quicker_sdk/models/receipt_statuses.rb +76 -0
- data/lib/pay_quicker_sdk/models/replace_prepaid_card.rb +85 -0
- data/lib/pay_quicker_sdk/models/retrieve_card_data.rb +73 -0
- data/lib/pay_quicker_sdk/models/retrieve_card_pin.rb +76 -0
- data/lib/pay_quicker_sdk/models/sandbox_instance.rb +76 -0
- data/lib/pay_quicker_sdk/models/signs.rb +40 -0
- data/lib/pay_quicker_sdk/models/spendback_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/spendback_object.rb +291 -0
- data/lib/pay_quicker_sdk/models/spendback_quote_accept_result.rb +301 -0
- data/lib/pay_quicker_sdk/models/spendback_refund_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/spendback_refund_object.rb +251 -0
- data/lib/pay_quicker_sdk/models/spendback_refund_result.rb +262 -0
- data/lib/pay_quicker_sdk/models/spendback_result.rb +301 -0
- data/lib/pay_quicker_sdk/models/statement_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/statement_object.rb +183 -0
- data/lib/pay_quicker_sdk/models/statement_result.rb +192 -0
- data/lib/pay_quicker_sdk/models/tax_resident_statuses.rb +40 -0
- data/lib/pay_quicker_sdk/models/token_purposes.rb +36 -0
- data/lib/pay_quicker_sdk/models/transfer_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/transfer_method_types.rb +48 -0
- data/lib/pay_quicker_sdk/models/transfer_object.rb +309 -0
- data/lib/pay_quicker_sdk/models/transfer_result.rb +318 -0
- data/lib/pay_quicker_sdk/models/transfer_statuses.rb +76 -0
- data/lib/pay_quicker_sdk/models/transfer_types.rb +112 -0
- data/lib/pay_quicker_sdk/models/translation.rb +85 -0
- data/lib/pay_quicker_sdk/models/uat_instance.rb +48 -0
- data/lib/pay_quicker_sdk/models/update_card_pin.rb +87 -0
- data/lib/pay_quicker_sdk/models/update_prepaid_card.rb +85 -0
- data/lib/pay_quicker_sdk/models/upload_fields.rb +40 -0
- data/lib/pay_quicker_sdk/models/user_action.rb +40 -0
- data/lib/pay_quicker_sdk/models/user_doc_req_item_docs_items_metadata_items.rb +101 -0
- data/lib/pay_quicker_sdk/models/user_doc_req_item_docs_items_metadata_items_name_items.rb +83 -0
- data/lib/pay_quicker_sdk/models/user_doc_req_item_docs_items_supplemental_docs_items.rb +92 -0
- data/lib/pay_quicker_sdk/models/user_document_requirement_item.rb +105 -0
- data/lib/pay_quicker_sdk/models/user_document_requirement_item_documents_items.rb +132 -0
- data/lib/pay_quicker_sdk/models/user_event_result.rb +201 -0
- data/lib/pay_quicker_sdk/models/user_impact.rb +48 -0
- data/lib/pay_quicker_sdk/models/user_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/user_object.rb +676 -0
- data/lib/pay_quicker_sdk/models/user_result.rb +686 -0
- data/lib/pay_quicker_sdk/models/user_statuses.rb +40 -0
- data/lib/pay_quicker_sdk/models/user_types.rb +36 -0
- data/lib/pay_quicker_sdk/models/validator_types.rb +50 -0
- data/lib/pay_quicker_sdk/models/webhook_namespaces.rb +307 -0
- data/lib/pay_quicker_sdk/models/webhook_subscription_list_result.rb +106 -0
- data/lib/pay_quicker_sdk/models/webhook_subscription_object.rb +158 -0
- data/lib/pay_quicker_sdk/models/webhook_subscription_result.rb +167 -0
- data/lib/pay_quicker_sdk/models/webhook_subscription_statuses.rb +44 -0
- data/lib/pay_quicker_sdk/utilities/date_time_helper.rb +11 -0
- data/lib/pay_quicker_sdk/utilities/file_wrapper.rb +28 -0
- data/lib/pay_quicker_sdk/utilities/union_type_lookup.rb +62 -0
- data/lib/pay_quicker_sdk.rb +274 -0
- data/test/controllers/controller_test_base.rb +24 -0
- data/test/controllers/test_agreements_controller.rb +108 -0
- data/test/controllers/test_balances_controller.rb +132 -0
- data/test/controllers/test_bank_accounts_controller.rb +645 -0
- data/test/controllers/test_client_side_controller.rb +295 -0
- data/test/controllers/test_compliance_controller.rb +86 -0
- data/test/controllers/test_documents_controller.rb +212 -0
- data/test/controllers/test_electronic_wallets_controller.rb +292 -0
- data/test/controllers/test_events_controller.rb +138 -0
- data/test/controllers/test_invitations_controller.rb +162 -0
- data/test/controllers/test_jobs_controller.rb +114 -0
- data/test/controllers/test_payments_controller.rb +323 -0
- data/test/controllers/test_prepaid_cards_controller.rb +351 -0
- data/test/controllers/test_program_controller.rb +134 -0
- data/test/controllers/test_receipts_controller.rb +813 -0
- data/test/controllers/test_spendback_controller.rb +302 -0
- data/test/controllers/test_spendback_refunds_controller.rb +128 -0
- data/test/controllers/test_statements_controller.rb +192 -0
- data/test/controllers/test_transfers_controller.rb +613 -0
- data/test/controllers/test_users_controller.rb +483 -0
- data/test/controllers/test_webhooks_controller.rb +402 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +380 -0
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
# pay_quicker_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for PayQuicker by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require_relative 'controller_test_base'
|
|
7
|
+
|
|
8
|
+
class BankAccountsControllerTest < ControllerTestBase
|
|
9
|
+
# Called only once for the class before any test has executed
|
|
10
|
+
def setup
|
|
11
|
+
setup_class
|
|
12
|
+
@controller = @client.bank_accounts
|
|
13
|
+
@response_catcher = @controller.http_call_back
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Retrieve a list of [bank accounts](page:resources/bank-accounts) that supports filtering, sorting, and pagination through existing mechanisms.
|
|
17
|
+
#
|
|
18
|
+
def test_list_bank_accounts
|
|
19
|
+
# Parameters for the API call
|
|
20
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
21
|
+
page = 1
|
|
22
|
+
page_size = 20
|
|
23
|
+
filter = 'string'
|
|
24
|
+
sort = 'string'
|
|
25
|
+
language = 'en-US'
|
|
26
|
+
|
|
27
|
+
# Perform the API call through the SDK function
|
|
28
|
+
result = @controller.list_bank_accounts(user_token, page, page_size,
|
|
29
|
+
filter: filter, sort: sort,
|
|
30
|
+
language: language)
|
|
31
|
+
|
|
32
|
+
# Test response code
|
|
33
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
34
|
+
# Test headers
|
|
35
|
+
expected_headers = {}
|
|
36
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
37
|
+
|
|
38
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
39
|
+
|
|
40
|
+
# Test whether the captured response is as we expected
|
|
41
|
+
refute_nil(result)
|
|
42
|
+
expected_body = JSON.parse(
|
|
43
|
+
'{"payload":[{"token":"dest-969daa60-c743-4e4f-8609-559874f26d6c","bankA'\
|
|
44
|
+
'ccountOwnershipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD"'\
|
|
45
|
+
',"createdOn":"2022-05-20T16:26:25Z","description":"Official USD Testing'\
|
|
46
|
+
' Bank Account 2","fields":[{"key":"BANK_BBAN","value":"****7899"},{"key'\
|
|
47
|
+
'":"BANK_ACH_ABA","value":"****5688"},{"key":"BENEFICIARY_NAME","value":'\
|
|
48
|
+
'"Harry Grady"},{"key":"BANK_NAME","value":"API V2 USD BANK 2"}],"status'\
|
|
49
|
+
'":"VERIFIED","type":"SAVINGS","links":[{"href":"https://api.sandbox.pay'\
|
|
50
|
+
'quicker.io/api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-'\
|
|
51
|
+
'accounts/dest-969daa60-c743-4e4f-8609-559874f26d6c","params":{"rel":"se'\
|
|
52
|
+
'lf"}}]}],"meta":{"pageNo":"1","pageSize":"5","pageCount":"1","recordCou'\
|
|
53
|
+
'nt":"1","timezone":"GMT","requestRef":"request-reference-value"},"links'\
|
|
54
|
+
'":[{"href":"https://api.sandbox.payquicker.io/api/v2/users/user-ae92315'\
|
|
55
|
+
'b-6190-4e56-bdf5-c0189ac420a1/bank-accounts?page=1&pageSize=5&language='\
|
|
56
|
+
'en-US","params":{"rel":"self"}}]}'
|
|
57
|
+
)
|
|
58
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
59
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Create a [bank account](page:resources/bank-accounts) using a user token.
|
|
63
|
+
#
|
|
64
|
+
def test_create_bank_account
|
|
65
|
+
# Parameters for the API call
|
|
66
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
67
|
+
body = CreateOrUpdateBankAccount.from_hash(APIHelper.json_deserialize(
|
|
68
|
+
'{"bankAccountOwnershipType":"BUSINESS","description":"Official USD Test'\
|
|
69
|
+
'ing Bank Account 1","bankCountry":"US","bankCurrency":"USD","type":"SAV'\
|
|
70
|
+
'INGS","fields":[{"key":"BANK_BBAN","value":"01234567890"},{"key":"BANK_'\
|
|
71
|
+
'ACH_ABA","value":"012345678"},{"key":"BANK_NAME","value":"API V2 USD BA'\
|
|
72
|
+
'NK 1"},{"key":"BENEFICIARY_NAME","value":"Hazel Mosciski"}]}', false))
|
|
73
|
+
|
|
74
|
+
# Perform the API call through the SDK function
|
|
75
|
+
result = @controller.create_bank_account(user_token, body: body)
|
|
76
|
+
|
|
77
|
+
# Test response code
|
|
78
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
79
|
+
# Test headers
|
|
80
|
+
expected_headers = {}
|
|
81
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
82
|
+
|
|
83
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
84
|
+
|
|
85
|
+
# Test whether the captured response is as we expected
|
|
86
|
+
refute_nil(result)
|
|
87
|
+
expected_body = JSON.parse(
|
|
88
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
89
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
90
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
91
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
92
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
93
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
94
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
95
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
96
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
97
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
98
|
+
)
|
|
99
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
100
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Create a [bank account](page:resources/bank-accounts) using a user token.
|
|
104
|
+
#
|
|
105
|
+
def test_create_bank_account1
|
|
106
|
+
# Parameters for the API call
|
|
107
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
108
|
+
body = CreateOrUpdateBankAccount.from_hash(APIHelper.json_deserialize(
|
|
109
|
+
'{"bankAccountOwnershipType":"BUSINESS","description":"Official USD Test'\
|
|
110
|
+
'ing Bank Account 1","bankCountry":"US","bankCurrency":"USD","type":"SAV'\
|
|
111
|
+
'INGS","fields":[{"key":"BANK_BBAN","value":"01234567890"},{"key":"BANK_'\
|
|
112
|
+
'ACH_ABA","value":"012345678"},{"key":"BANK_NAME","value":"API V2 USD BA'\
|
|
113
|
+
'NK 1"},{"key":"BENEFICIARY_NAME","value":"Hazel Mosciski"}]}', false))
|
|
114
|
+
|
|
115
|
+
# Perform the API call through the SDK function
|
|
116
|
+
result = @controller.create_bank_account(user_token, body: body)
|
|
117
|
+
|
|
118
|
+
# Test response code
|
|
119
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
120
|
+
# Test headers
|
|
121
|
+
expected_headers = {}
|
|
122
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
123
|
+
|
|
124
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
125
|
+
|
|
126
|
+
# Test whether the captured response is as we expected
|
|
127
|
+
refute_nil(result)
|
|
128
|
+
expected_body = JSON.parse(
|
|
129
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
130
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
131
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
132
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
133
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
134
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
135
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
136
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
137
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
138
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
139
|
+
)
|
|
140
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
141
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Retrieve a single [bank account](page:resources/bank-accounts) using a destination token.
|
|
145
|
+
#
|
|
146
|
+
def test_retrieve_bank_account
|
|
147
|
+
# Parameters for the API call
|
|
148
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
149
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
150
|
+
page = 1
|
|
151
|
+
page_size = 20
|
|
152
|
+
filter = 'string'
|
|
153
|
+
sort = 'string'
|
|
154
|
+
language = 'en-US'
|
|
155
|
+
|
|
156
|
+
# Perform the API call through the SDK function
|
|
157
|
+
result = @controller.retrieve_bank_account(user_token, destination_token,
|
|
158
|
+
page, page_size, filter: filter,
|
|
159
|
+
sort: sort, language: language)
|
|
160
|
+
|
|
161
|
+
# Test response code
|
|
162
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
163
|
+
# Test headers
|
|
164
|
+
expected_headers = {}
|
|
165
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
166
|
+
|
|
167
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
168
|
+
|
|
169
|
+
# Test whether the captured response is as we expected
|
|
170
|
+
refute_nil(result)
|
|
171
|
+
expected_body = JSON.parse(
|
|
172
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
173
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
174
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
175
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
176
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
177
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
178
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
179
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
180
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
181
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
182
|
+
)
|
|
183
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
184
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Update a [bank account](page:resources/bank-accounts).
|
|
188
|
+
#
|
|
189
|
+
def test_update_bank_account
|
|
190
|
+
# Parameters for the API call
|
|
191
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
192
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
193
|
+
body = CreateOrUpdateBankAccount.from_hash(APIHelper.json_deserialize(
|
|
194
|
+
'{"bankAccountOwnershipType":"BUSINESS","description":"Official USD Test'\
|
|
195
|
+
'ing Bank Account 1","bankCountry":"US","bankCurrency":"USD","type":"SAV'\
|
|
196
|
+
'INGS","fields":[{"key":"BANK_BBAN","value":"01234567890"},{"key":"BANK_'\
|
|
197
|
+
'ACH_ABA","value":"012345678"},{"key":"BANK_NAME","value":"API V2 USD BA'\
|
|
198
|
+
'NK 1"},{"key":"BENEFICIARY_NAME","value":"Hazel Mosciski"}]}', false))
|
|
199
|
+
|
|
200
|
+
# Perform the API call through the SDK function
|
|
201
|
+
result = @controller.update_bank_account(user_token, destination_token,
|
|
202
|
+
body: body)
|
|
203
|
+
|
|
204
|
+
# Test response code
|
|
205
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
206
|
+
# Test headers
|
|
207
|
+
expected_headers = {}
|
|
208
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
209
|
+
|
|
210
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
211
|
+
|
|
212
|
+
# Test whether the captured response is as we expected
|
|
213
|
+
refute_nil(result)
|
|
214
|
+
expected_body = JSON.parse(
|
|
215
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
216
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
217
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
218
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
219
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
220
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
221
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
222
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
223
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
224
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
225
|
+
)
|
|
226
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
227
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Delete a user [bank account](page:resources/bank-accounts).
|
|
231
|
+
#
|
|
232
|
+
def test_delete_bank_account
|
|
233
|
+
# Parameters for the API call
|
|
234
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
235
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
236
|
+
|
|
237
|
+
# Perform the API call through the SDK function
|
|
238
|
+
result = @controller.delete_bank_account(user_token, destination_token)
|
|
239
|
+
|
|
240
|
+
# Test response code
|
|
241
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
242
|
+
# Test headers
|
|
243
|
+
expected_headers = {}
|
|
244
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
245
|
+
|
|
246
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
247
|
+
|
|
248
|
+
# Test whether the captured response is as we expected
|
|
249
|
+
refute_nil(result)
|
|
250
|
+
expected_body = JSON.parse(
|
|
251
|
+
'{"result":true,"meta":{"timezone":"GMT","requestRef":"request-reference'\
|
|
252
|
+
'-value"}}'
|
|
253
|
+
)
|
|
254
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
255
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Retrieve requirements for adding a [bank account](page:resources/bank-accounts) using the parameters provided.
|
|
259
|
+
#
|
|
260
|
+
def test_retrieve_creation_requirements
|
|
261
|
+
# Parameters for the API call
|
|
262
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
263
|
+
country = 'US'
|
|
264
|
+
currency = 'USD'
|
|
265
|
+
|
|
266
|
+
# Perform the API call through the SDK function
|
|
267
|
+
result = @controller.retrieve_creation_requirements(user_token,
|
|
268
|
+
country: country,
|
|
269
|
+
currency: currency)
|
|
270
|
+
|
|
271
|
+
# Test response code
|
|
272
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
273
|
+
# Test headers
|
|
274
|
+
expected_headers = {}
|
|
275
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
276
|
+
|
|
277
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
278
|
+
|
|
279
|
+
# Test whether the captured response is as we expected
|
|
280
|
+
refute_nil(result)
|
|
281
|
+
expected_body = JSON.parse(
|
|
282
|
+
'{"payload":[{"bankCountry":"IT","bankCurrency":"EUR","requirements":[{"'\
|
|
283
|
+
'requirement":"BANK_IBAN","format":{"example":"IT43K03104127010000008204'\
|
|
284
|
+
'20","legend":[{"key":"IT43K0310412701000000820420","descriptions":[{"la'\
|
|
285
|
+
'nguage":"en-US","translation":"Example IBAN"},{"language":"it-IT","tran'\
|
|
286
|
+
'slation":"Esempio IBAN"}]}]},"description":[{"language":"en-US","transl'\
|
|
287
|
+
'ation":"IBAN"},{"language":"it-IT","translation":"IBAN"}],"validators":'\
|
|
288
|
+
'[{"validatorType":"REGEX","expression":"^IT\\\\\\\\d{2}[A-Z]\\\\\\\\d{1'\
|
|
289
|
+
'0}[0-9A-Z]{12}$"}]},{"requirement":"BANK_SWIFT_BIC","format":{"example"'\
|
|
290
|
+
':"01234567890","legend":[{"key":"01234567890","descriptions":[{"languag'\
|
|
291
|
+
'e":"en-US","translation":"Example Swift/BIC"},{"language":"it-IT","tran'\
|
|
292
|
+
'slation":"Esempio Swift/BIC"}]}]},"description":[{"language":"en-US","t'\
|
|
293
|
+
'ranslation":"Swift/BIC"},{"language":"it-IT","translation":"Swift/BIC"}'\
|
|
294
|
+
'],"validators":[{"validatorType":"REGEX","expression":"^[a-z0-9A-Z]{8,1'\
|
|
295
|
+
'1}$"}]}],"quote":{"formattedAmount":"$4.32 USD (USD, en-US), 0,00 € E'\
|
|
296
|
+
'UR (EUR, fr-FR)","amount":4.32,"currency":"USD"},"links":[{"params":{"r'\
|
|
297
|
+
'el":"self"},"href":"string"}]}],"links":[{"params":{"rel":"self"},"href'\
|
|
298
|
+
'":"string"}]}'
|
|
299
|
+
)
|
|
300
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
301
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Retrieve a list of company [bank accounts](page:resources/bank-accounts) that supports filtering, sorting, and pagination through existing mechanisms.
|
|
305
|
+
#
|
|
306
|
+
def test_list_company_bank_accounts
|
|
307
|
+
# Parameters for the API call
|
|
308
|
+
account_token = 'acct-3908ab5a-6ce1-474d-8b80-a63a7b147860'
|
|
309
|
+
page = 1
|
|
310
|
+
page_size = 20
|
|
311
|
+
filter = 'string'
|
|
312
|
+
sort = 'string'
|
|
313
|
+
language = 'en-US'
|
|
314
|
+
|
|
315
|
+
# Perform the API call through the SDK function
|
|
316
|
+
result = @controller.list_company_bank_accounts(account_token, page,
|
|
317
|
+
page_size, filter: filter,
|
|
318
|
+
sort: sort,
|
|
319
|
+
language: language)
|
|
320
|
+
|
|
321
|
+
# Test response code
|
|
322
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
323
|
+
# Test headers
|
|
324
|
+
expected_headers = {}
|
|
325
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
326
|
+
|
|
327
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
328
|
+
|
|
329
|
+
# Test whether the captured response is as we expected
|
|
330
|
+
refute_nil(result)
|
|
331
|
+
expected_body = JSON.parse(
|
|
332
|
+
'{"payload":[{"token":"dest-969daa60-c743-4e4f-8609-559874f26d6c","bankA'\
|
|
333
|
+
'ccountOwnershipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD"'\
|
|
334
|
+
',"createdOn":"2022-05-20T16:26:25Z","description":"Official USD Testing'\
|
|
335
|
+
' Bank Account 2","fields":[{"key":"BANK_BBAN","value":"****7899"},{"key'\
|
|
336
|
+
'":"BANK_ACH_ABA","value":"****5688"},{"key":"BENEFICIARY_NAME","value":'\
|
|
337
|
+
'"Harry Grady"},{"key":"BANK_NAME","value":"API V2 USD BANK 2"}],"status'\
|
|
338
|
+
'":"VERIFIED","type":"SAVINGS","links":[{"href":"https://api.sandbox.pay'\
|
|
339
|
+
'quicker.io/api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-'\
|
|
340
|
+
'accounts/dest-969daa60-c743-4e4f-8609-559874f26d6c","params":{"rel":"se'\
|
|
341
|
+
'lf"}}]}],"meta":{"pageNo":"1","pageSize":"5","pageCount":"1","recordCou'\
|
|
342
|
+
'nt":"1","timezone":"GMT","requestRef":"request-reference-value"},"links'\
|
|
343
|
+
'":[{"href":"https://api.sandbox.payquicker.io/api/v2/users/user-ae92315'\
|
|
344
|
+
'b-6190-4e56-bdf5-c0189ac420a1/bank-accounts?page=1&pageSize=5&language='\
|
|
345
|
+
'en-US","params":{"rel":"self"}}]}'
|
|
346
|
+
)
|
|
347
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
348
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
# Create a company [bank account](page:resources/bank-accounts) using an account token.
|
|
352
|
+
#
|
|
353
|
+
def test_create_company_bank_account
|
|
354
|
+
# Parameters for the API call
|
|
355
|
+
account_token = 'acct-3908ab5a-6ce1-474d-8b80-a63a7b147860'
|
|
356
|
+
body = CreateOrUpdateBankAccount.from_hash(APIHelper.json_deserialize(
|
|
357
|
+
'{"bankAccountOwnershipType":"BUSINESS","description":"Official USD Test'\
|
|
358
|
+
'ing Bank Account 1","bankCountry":"US","bankCurrency":"USD","type":"SAV'\
|
|
359
|
+
'INGS","fields":[{"key":"BANK_BBAN","value":"01234567890"},{"key":"BANK_'\
|
|
360
|
+
'ACH_ABA","value":"012345678"},{"key":"BANK_NAME","value":"API V2 USD BA'\
|
|
361
|
+
'NK 1"},{"key":"BENEFICIARY_NAME","value":"Hazel Mosciski"}]}', false))
|
|
362
|
+
|
|
363
|
+
# Perform the API call through the SDK function
|
|
364
|
+
result = @controller.create_company_bank_account(account_token, body: body)
|
|
365
|
+
|
|
366
|
+
# Test response code
|
|
367
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
368
|
+
# Test headers
|
|
369
|
+
expected_headers = {}
|
|
370
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
371
|
+
|
|
372
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
373
|
+
|
|
374
|
+
# Test whether the captured response is as we expected
|
|
375
|
+
refute_nil(result)
|
|
376
|
+
expected_body = JSON.parse(
|
|
377
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
378
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
379
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
380
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
381
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
382
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
383
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
384
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
385
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
386
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
387
|
+
)
|
|
388
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
389
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
# Create a company [bank account](page:resources/bank-accounts) using an account token.
|
|
393
|
+
#
|
|
394
|
+
def test_create_company_bank_account1
|
|
395
|
+
# Parameters for the API call
|
|
396
|
+
account_token = 'acct-3908ab5a-6ce1-474d-8b80-a63a7b147860'
|
|
397
|
+
body = CreateOrUpdateBankAccount.from_hash(APIHelper.json_deserialize(
|
|
398
|
+
'{"bankAccountOwnershipType":"BUSINESS","description":"Official USD Test'\
|
|
399
|
+
'ing Bank Account 1","bankCountry":"US","bankCurrency":"USD","type":"SAV'\
|
|
400
|
+
'INGS","fields":[{"key":"BANK_BBAN","value":"01234567890"},{"key":"BANK_'\
|
|
401
|
+
'ACH_ABA","value":"012345678"},{"key":"BANK_NAME","value":"API V2 USD BA'\
|
|
402
|
+
'NK 1"},{"key":"BENEFICIARY_NAME","value":"Hazel Mosciski"}]}', false))
|
|
403
|
+
|
|
404
|
+
# Perform the API call through the SDK function
|
|
405
|
+
result = @controller.create_company_bank_account(account_token, body: body)
|
|
406
|
+
|
|
407
|
+
# Test response code
|
|
408
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
409
|
+
# Test headers
|
|
410
|
+
expected_headers = {}
|
|
411
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
412
|
+
|
|
413
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
414
|
+
|
|
415
|
+
# Test whether the captured response is as we expected
|
|
416
|
+
refute_nil(result)
|
|
417
|
+
expected_body = JSON.parse(
|
|
418
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
419
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
420
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
421
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
422
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
423
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
424
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
425
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
426
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
427
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
428
|
+
)
|
|
429
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
430
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# Retrieve a single company [bank account](page:resources/bank-accounts) using a destination token.
|
|
434
|
+
#
|
|
435
|
+
def test_retrieve_company_bank_account
|
|
436
|
+
# Parameters for the API call
|
|
437
|
+
account_token = 'acct-3908ab5a-6ce1-474d-8b80-a63a7b147860'
|
|
438
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
439
|
+
page = 1
|
|
440
|
+
page_size = 20
|
|
441
|
+
filter = 'string'
|
|
442
|
+
sort = 'string'
|
|
443
|
+
language = 'en-US'
|
|
444
|
+
|
|
445
|
+
# Perform the API call through the SDK function
|
|
446
|
+
result = @controller.retrieve_company_bank_account(account_token,
|
|
447
|
+
destination_token, page,
|
|
448
|
+
page_size,
|
|
449
|
+
filter: filter,
|
|
450
|
+
sort: sort,
|
|
451
|
+
language: language)
|
|
452
|
+
|
|
453
|
+
# Test response code
|
|
454
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
455
|
+
# Test headers
|
|
456
|
+
expected_headers = {}
|
|
457
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
458
|
+
|
|
459
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
460
|
+
|
|
461
|
+
# Test whether the captured response is as we expected
|
|
462
|
+
refute_nil(result)
|
|
463
|
+
expected_body = JSON.parse(
|
|
464
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
465
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
466
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
467
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
468
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
469
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
470
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
471
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
472
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
473
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
474
|
+
)
|
|
475
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
476
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
# Update a company [bank account](page:resources/bank-accounts).
|
|
480
|
+
#
|
|
481
|
+
def test_update_company_bank_account
|
|
482
|
+
# Parameters for the API call
|
|
483
|
+
account_token = 'acct-3908ab5a-6ce1-474d-8b80-a63a7b147860'
|
|
484
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
485
|
+
body = CreateOrUpdateBankAccount.from_hash(APIHelper.json_deserialize(
|
|
486
|
+
'{"bankAccountOwnershipType":"BUSINESS","description":"Official USD Test'\
|
|
487
|
+
'ing Bank Account 1","bankCountry":"US","bankCurrency":"USD","type":"SAV'\
|
|
488
|
+
'INGS","fields":[{"key":"BANK_BBAN","value":"01234567890"},{"key":"BANK_'\
|
|
489
|
+
'ACH_ABA","value":"012345678"},{"key":"BANK_NAME","value":"API V2 USD BA'\
|
|
490
|
+
'NK 1"},{"key":"BENEFICIARY_NAME","value":"Hazel Mosciski"}]}', false))
|
|
491
|
+
|
|
492
|
+
# Perform the API call through the SDK function
|
|
493
|
+
result = @controller.update_company_bank_account(account_token,
|
|
494
|
+
destination_token,
|
|
495
|
+
body: body)
|
|
496
|
+
|
|
497
|
+
# Test response code
|
|
498
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
499
|
+
# Test headers
|
|
500
|
+
expected_headers = {}
|
|
501
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
502
|
+
|
|
503
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
504
|
+
|
|
505
|
+
# Test whether the captured response is as we expected
|
|
506
|
+
refute_nil(result)
|
|
507
|
+
expected_body = JSON.parse(
|
|
508
|
+
'{"token":"dest-41579f58-35dd-4f7b-9252-aa3e337a2eb4","bankAccountOwners'\
|
|
509
|
+
'hipType":"BUSINESS","bankCountry":"US","bankCurrency":"USD","createdOn"'\
|
|
510
|
+
':"2022-05-20T15:48:54Z","description":"Official USD Testing Bank Accoun'\
|
|
511
|
+
't 1","fields":[{"key":"BANK_BBAN","value":"****7890"},{"key":"BANK_ACH_'\
|
|
512
|
+
'ABA","value":"****5678"},{"key":"BENEFICIARY_NAME","value":"Dennis Brue'\
|
|
513
|
+
'n"},{"key":"BANK_NAME","value":"API V2 USD BANK 1"}],"status":"VERIFIED'\
|
|
514
|
+
'","type":"SAVINGS","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
515
|
+
'api/v2/users/user-ae92315b-6190-4e56-bdf5-c0189ac420a1/bank-accounts/de'\
|
|
516
|
+
'st-41579f58-35dd-4f7b-9252-aa3e337a2eb4","params":{"rel":"self"}}],"met'\
|
|
517
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
518
|
+
)
|
|
519
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
520
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
# Delete a company [bank account](page:resources/bank-accounts).
|
|
524
|
+
#
|
|
525
|
+
def test_delete_company_bank_account
|
|
526
|
+
# Parameters for the API call
|
|
527
|
+
account_token = 'acct-3908ab5a-6ce1-474d-8b80-a63a7b147860'
|
|
528
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
529
|
+
|
|
530
|
+
# Perform the API call through the SDK function
|
|
531
|
+
result = @controller.delete_company_bank_account(account_token,
|
|
532
|
+
destination_token)
|
|
533
|
+
|
|
534
|
+
# Test response code
|
|
535
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
536
|
+
# Test headers
|
|
537
|
+
expected_headers = {}
|
|
538
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
539
|
+
|
|
540
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
541
|
+
|
|
542
|
+
# Test whether the captured response is as we expected
|
|
543
|
+
refute_nil(result)
|
|
544
|
+
expected_body = JSON.parse(
|
|
545
|
+
'{"result":true,"meta":{"timezone":"GMT","requestRef":"request-reference'\
|
|
546
|
+
'-value"}}'
|
|
547
|
+
)
|
|
548
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
549
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
# Retrieve requirements for adding a [bank account](page:resources/bank-accounts) using the parameters provided.
|
|
553
|
+
#
|
|
554
|
+
def test_retrieve_company_bank_account_creation_requirements
|
|
555
|
+
# Parameters for the API call
|
|
556
|
+
account_token = 'acct-3908ab5a-6ce1-474d-8b80-a63a7b147860'
|
|
557
|
+
country = 'US'
|
|
558
|
+
currency = 'USD'
|
|
559
|
+
|
|
560
|
+
# Perform the API call through the SDK function
|
|
561
|
+
result = @controller.retrieve_company_bank_account_creation_requirements(
|
|
562
|
+
account_token, country: country, currency: currency
|
|
563
|
+
)
|
|
564
|
+
|
|
565
|
+
# Test response code
|
|
566
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
567
|
+
# Test headers
|
|
568
|
+
expected_headers = {}
|
|
569
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
570
|
+
|
|
571
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
572
|
+
|
|
573
|
+
# Test whether the captured response is as we expected
|
|
574
|
+
refute_nil(result)
|
|
575
|
+
expected_body = JSON.parse(
|
|
576
|
+
'{"payload":[{"bankCountry":"IT","bankCurrency":"EUR","requirements":[{"'\
|
|
577
|
+
'requirement":"BANK_IBAN","format":{"example":"IT43K03104127010000008204'\
|
|
578
|
+
'20","legend":[{"key":"IT43K0310412701000000820420","descriptions":[{"la'\
|
|
579
|
+
'nguage":"en-US","translation":"Example IBAN"},{"language":"it-IT","tran'\
|
|
580
|
+
'slation":"Esempio IBAN"}]}]},"description":[{"language":"en-US","transl'\
|
|
581
|
+
'ation":"IBAN"},{"language":"it-IT","translation":"IBAN"}],"validators":'\
|
|
582
|
+
'[{"validatorType":"REGEX","expression":"^IT\\\\\\\\d{2}[A-Z]\\\\\\\\d{1'\
|
|
583
|
+
'0}[0-9A-Z]{12}$"}]},{"requirement":"BANK_SWIFT_BIC","format":{"example"'\
|
|
584
|
+
':"01234567890","legend":[{"key":"01234567890","descriptions":[{"languag'\
|
|
585
|
+
'e":"en-US","translation":"Example Swift/BIC"},{"language":"it-IT","tran'\
|
|
586
|
+
'slation":"Esempio Swift/BIC"}]}]},"description":[{"language":"en-US","t'\
|
|
587
|
+
'ranslation":"Swift/BIC"},{"language":"it-IT","translation":"Swift/BIC"}'\
|
|
588
|
+
'],"validators":[{"validatorType":"REGEX","expression":"^[a-z0-9A-Z]{8,1'\
|
|
589
|
+
'1}$"}]}],"quote":{"formattedAmount":"$4.32 USD (USD, en-US), 0,00 € E'\
|
|
590
|
+
'UR (EUR, fr-FR)","amount":4.32,"currency":"USD"},"links":[{"params":{"r'\
|
|
591
|
+
'el":"self"},"href":"string"}]}],"links":[{"params":{"rel":"self"},"href'\
|
|
592
|
+
'":"string"}]}'
|
|
593
|
+
)
|
|
594
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
595
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
596
|
+
end
|
|
597
|
+
|
|
598
|
+
# Retrieve requirements for adding a [bank account](page:resources/bank-accounts) using the pre-paid card as the destination.
|
|
599
|
+
#
|
|
600
|
+
def test_retrieve_bank_account_creation_requirements_for_a_prepaid_card
|
|
601
|
+
# Parameters for the API call
|
|
602
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
603
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
604
|
+
country = 'US'
|
|
605
|
+
currency = 'USD'
|
|
606
|
+
|
|
607
|
+
# Perform the API call through the SDK function
|
|
608
|
+
result = @controller.retrieve_bank_account_creation_requirements_for_a_prepaid_card(
|
|
609
|
+
user_token, destination_token, country: country, currency: currency
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
# Test response code
|
|
613
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
614
|
+
# Test headers
|
|
615
|
+
expected_headers = {}
|
|
616
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
617
|
+
|
|
618
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
619
|
+
|
|
620
|
+
# Test whether the captured response is as we expected
|
|
621
|
+
refute_nil(result)
|
|
622
|
+
expected_body = JSON.parse(
|
|
623
|
+
'{"payload":[{"bankCountry":"IT","bankCurrency":"EUR","requirements":[{"'\
|
|
624
|
+
'requirement":"BANK_IBAN","format":{"example":"IT43K03104127010000008204'\
|
|
625
|
+
'20","legend":[{"key":"IT43K0310412701000000820420","descriptions":[{"la'\
|
|
626
|
+
'nguage":"en-US","translation":"Example IBAN"},{"language":"it-IT","tran'\
|
|
627
|
+
'slation":"Esempio IBAN"}]}]},"description":[{"language":"en-US","transl'\
|
|
628
|
+
'ation":"IBAN"},{"language":"it-IT","translation":"IBAN"}],"validators":'\
|
|
629
|
+
'[{"validatorType":"REGEX","expression":"^IT\\\\\\\\d{2}[A-Z]\\\\\\\\d{1'\
|
|
630
|
+
'0}[0-9A-Z]{12}$"}]},{"requirement":"BANK_SWIFT_BIC","format":{"example"'\
|
|
631
|
+
':"01234567890","legend":[{"key":"01234567890","descriptions":[{"languag'\
|
|
632
|
+
'e":"en-US","translation":"Example Swift/BIC"},{"language":"it-IT","tran'\
|
|
633
|
+
'slation":"Esempio Swift/BIC"}]}]},"description":[{"language":"en-US","t'\
|
|
634
|
+
'ranslation":"Swift/BIC"},{"language":"it-IT","translation":"Swift/BIC"}'\
|
|
635
|
+
'],"validators":[{"validatorType":"REGEX","expression":"^[a-z0-9A-Z]{8,1'\
|
|
636
|
+
'1}$"}]}],"quote":{"formattedAmount":"$4.32 USD (USD, en-US), 0,00 € E'\
|
|
637
|
+
'UR (EUR, fr-FR)","amount":4.32,"currency":"USD"},"links":[{"params":{"r'\
|
|
638
|
+
'el":"self"},"href":"string"}]}],"links":[{"params":{"rel":"self"},"href'\
|
|
639
|
+
'":"string"}]}'
|
|
640
|
+
)
|
|
641
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
642
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
643
|
+
end
|
|
644
|
+
|
|
645
|
+
end
|