pq-api-matic-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 +379 -0
|
@@ -0,0 +1,295 @@
|
|
|
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 ClientSideControllerTest < ControllerTestBase
|
|
9
|
+
# Called only once for the class before any test has executed
|
|
10
|
+
def setup
|
|
11
|
+
setup_class
|
|
12
|
+
@controller = @client.client_side
|
|
13
|
+
@response_catcher = @controller.http_call_back
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Generate a token used to reveal [prepaid card](page:resources/prepaid-cards) information in the form of image data (base64) or JSON.
|
|
17
|
+
#
|
|
18
|
+
def test_create_card_data_token
|
|
19
|
+
# Parameters for the API call
|
|
20
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
21
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
22
|
+
format = 'TEXT'
|
|
23
|
+
side = 'FRONT'
|
|
24
|
+
|
|
25
|
+
# Perform the API call through the SDK function
|
|
26
|
+
result = @controller.create_card_data_token(user_token, destination_token,
|
|
27
|
+
format, side: side)
|
|
28
|
+
|
|
29
|
+
# Test response code
|
|
30
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
31
|
+
# Test headers
|
|
32
|
+
expected_headers = {}
|
|
33
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
34
|
+
|
|
35
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
36
|
+
|
|
37
|
+
# Test whether the captured response is as we expected
|
|
38
|
+
refute_nil(result)
|
|
39
|
+
expected_body = JSON.parse(
|
|
40
|
+
'{"cardProcessorType":"QOLO","resourceValue":"b61bc8708ab84870a2096398b6'\
|
|
41
|
+
'0269d5","token":"iEureKuLW1gZQ7d3/2ijX4+6bDZuUwpp2QmhPfedarncS2Cde1Ebmb'\
|
|
42
|
+
'y+dxfeP7+Iaty9YYCLFwY42HHOm03dliH7Jp0Yo/sjOb/FmSQ3IOVYpNSYBcZYGmgpyBEG9'\
|
|
43
|
+
'gPa2HRIKK8+NcPVjjb+0gfqFAI52Emk0P+VPaBZ2NgsENV/I4MuIkWsUXha3QZh49a0EK3w'\
|
|
44
|
+
'O14jwR4BosY/rk0/9F5uJEWUjv8gvPej+dCFyMnybjj6jPK9f/gFlPUYVHuS","tokenPur'\
|
|
45
|
+
'poseType":"CARD_OPERATION","url":"https://api.sandbox.payquicker.io/api'\
|
|
46
|
+
'/v2/users/user-2bbfc967-d12e-4647-a887-d905172fb4bc/prepaid-cards/dest-'\
|
|
47
|
+
'b61bc870-8ab8-4870-a209-6398b60269d5/pci?token=iEureKuLW1gZQ7d3%2f2ijX4'\
|
|
48
|
+
'%2b6bDZuUwpp2QmhPfedarncS2Cde1Ebmby%2bdxfeP7%2bIaty9YYCLFwY42HHOm03dliH'\
|
|
49
|
+
'7Jp0Yo%2fsjOb%2fFmSQ3IOVYpNSYBcZYGmgpyBEG9gPa2HRIKK8%2bNcPVjjb%2b0gfqFA'\
|
|
50
|
+
'I52Emk0P%2bVPaBZ2NgsENV%2fI4MuIkWsUXha3QZh49a0EK3wO14jwR4BosY%2frk0%2f9'\
|
|
51
|
+
'F5uJEWUjv8gvPej%2bdCFyMnybjj6jPK9f%2fgFlPUYVHuS&format=TEXT","links":[{'\
|
|
52
|
+
'"href":"https://api.sandbox.payquicker.io/api/v2/users/user-2bbfc967-d1'\
|
|
53
|
+
'2e-4647-a887-d905172fb4bc/prepaid-cards/dest-b61bc870-8ab8-4870-a209-63'\
|
|
54
|
+
'98b60269d5/pci/iEureKuLW1gZQ7d3/2ijX4+6bDZuUwpp2QmhPfedarncS2Cde1Ebmby+'\
|
|
55
|
+
'dxfeP7+Iaty9YYCLFwY42HHOm03dliH7Jp0Yo/sjOb/FmSQ3IOVYpNSYBcZYGmgpyBEG9gP'\
|
|
56
|
+
'a2HRIKK8+NcPVjjb+0gfqFAI52Emk0P+VPaBZ2NgsENV/I4MuIkWsUXha3QZh49a0EK3wO1'\
|
|
57
|
+
'4jwR4BosY/rk0/9F5uJEWUjv8gvPej+dCFyMnybjj6jPK9f/gFlPUYVHuS","params":{"'\
|
|
58
|
+
'rel":"self"}}],"meta":{"timezone":"GMT","requestRef":"request-reference'\
|
|
59
|
+
'-value"}}'
|
|
60
|
+
)
|
|
61
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
62
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Return [prepaid card](page:resources/prepaid-cards) data in the form of image data, text, or both.
|
|
66
|
+
#
|
|
67
|
+
def test_retrieve_card_data
|
|
68
|
+
# Parameters for the API call
|
|
69
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
70
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
71
|
+
format = 'TEXT'
|
|
72
|
+
side = 'FRONT'
|
|
73
|
+
body = RetrieveCardData.from_hash(APIHelper.json_deserialize(
|
|
74
|
+
'{"Token":"iEureKuLW1gZQ7d3/2ijX4+6bDZuUwpp2QmhPfedarncS2Cde1Ebmby+dxfeP'\
|
|
75
|
+
'7+Iaty9YYCLFwY42HHOm03dliH7Jp0Yo/sjOb/FmSQ3IOVYpNSYBcZYGmgpyBEG9gPa2HRI'\
|
|
76
|
+
'KK8+NcPVjjb+0gfqFAI52Emk0P+VPaBZ2NgsENV/I4MuIkWsUXha3QZh49a0EK3wO14jwR4'\
|
|
77
|
+
'BosY/rk0/9F5uJEWUjv8gvPej+dCFyMnybjj6jPK9f/gFlPUYVHuS"}', false))
|
|
78
|
+
|
|
79
|
+
# Perform the API call through the SDK function
|
|
80
|
+
result = @controller.retrieve_card_data(user_token, destination_token,
|
|
81
|
+
format, side: side, body: body)
|
|
82
|
+
|
|
83
|
+
# Test response code
|
|
84
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
85
|
+
# Test headers
|
|
86
|
+
expected_headers = {}
|
|
87
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
88
|
+
|
|
89
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
90
|
+
|
|
91
|
+
# Test whether the captured response is as we expected
|
|
92
|
+
refute_nil(result)
|
|
93
|
+
expected_body = JSON.parse(
|
|
94
|
+
'{"cardNumber":4833180000103940,"cvvNumber":"709","expiration":"04/25","'\
|
|
95
|
+
'nameOnCard":"SIDNEY MAYER","token":"dest-b61bc870-8ab8-4870-a209-6398b6'\
|
|
96
|
+
'0269d5","links":[{"href":"https://api.sandbox.payquicker.io/api/v2/user'\
|
|
97
|
+
's/user-2bbfc967-d12e-4647-a887-d905172fb4bc/prepaid-cards/dest-b61bc870'\
|
|
98
|
+
'-8ab8-4870-a209-6398b60269d5/pci","params":{"rel":"self"}}],"meta":{"ti'\
|
|
99
|
+
'mezone":"GMT","requestRef":"request-reference-value"}}'
|
|
100
|
+
)
|
|
101
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
102
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Return [prepaid card](page:resources/prepaid-cards) data in the form of image data, text, or both.
|
|
106
|
+
#
|
|
107
|
+
def test_retrieve_card_data1
|
|
108
|
+
# Parameters for the API call
|
|
109
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
110
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
111
|
+
format = 'TEXT'
|
|
112
|
+
side = 'FRONT'
|
|
113
|
+
body = RetrieveCardData.from_hash(APIHelper.json_deserialize(
|
|
114
|
+
'{"Token":"iEureKuLW1gZQ7d3/2ijX4+6bDZuUwpp2QmhPfedarncS2Cde1Ebmby+dxfeP'\
|
|
115
|
+
'7+Iaty9YYCLFwY42HHOm03dliH7Jp0Yo/sjOb/FmSQ3IOVYpNSYBcZYGmgpyBEG9gPa2HRI'\
|
|
116
|
+
'KK8+NcPVjjb+0gfqFAI52Emk0P+VPaBZ2NgsENV/I4MuIkWsUXha3QZh49a0EK3wO14jwR4'\
|
|
117
|
+
'BosY/rk0/9F5uJEWUjv8gvPej+dCFyMnybjj6jPK9f/gFlPUYVHuS"}', false))
|
|
118
|
+
|
|
119
|
+
# Perform the API call through the SDK function
|
|
120
|
+
result = @controller.retrieve_card_data(user_token, destination_token,
|
|
121
|
+
format, side: side, body: body)
|
|
122
|
+
|
|
123
|
+
# Test response code
|
|
124
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
125
|
+
# Test headers
|
|
126
|
+
expected_headers = {}
|
|
127
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
128
|
+
|
|
129
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
130
|
+
|
|
131
|
+
# Test whether the captured response is as we expected
|
|
132
|
+
refute_nil(result)
|
|
133
|
+
expected_body = JSON.parse(
|
|
134
|
+
'{"cardNumber":4833180000103940,"cvvNumber":"709","expiration":"04/25","'\
|
|
135
|
+
'nameOnCard":"SIDNEY MAYER","token":"dest-b61bc870-8ab8-4870-a209-6398b6'\
|
|
136
|
+
'0269d5","links":[{"href":"https://api.sandbox.payquicker.io/api/v2/user'\
|
|
137
|
+
's/user-2bbfc967-d12e-4647-a887-d905172fb4bc/prepaid-cards/dest-b61bc870'\
|
|
138
|
+
'-8ab8-4870-a209-6398b60269d5/pci","params":{"rel":"self"}}],"meta":{"ti'\
|
|
139
|
+
'mezone":"GMT","requestRef":"request-reference-value"}}'
|
|
140
|
+
)
|
|
141
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
142
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Retrieve one part of a two-part token required to reveal or set a client side [prepaid card](page:resources/prepaid-cards) PIN.
|
|
146
|
+
#
|
|
147
|
+
def test_create_card_pin_token
|
|
148
|
+
# Parameters for the API call
|
|
149
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
150
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
151
|
+
|
|
152
|
+
# Perform the API call through the SDK function
|
|
153
|
+
result = @controller.create_card_pin_token(user_token, destination_token)
|
|
154
|
+
|
|
155
|
+
# Test response code
|
|
156
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
157
|
+
# Test headers
|
|
158
|
+
expected_headers = {}
|
|
159
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
160
|
+
|
|
161
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
162
|
+
|
|
163
|
+
# Test whether the captured response is as we expected
|
|
164
|
+
refute_nil(result)
|
|
165
|
+
expected_body = JSON.parse(
|
|
166
|
+
'{"cardProcessorType":"QOLO","cardPinToken":"/YnZvwn9Q5TczQhubfjB8Sq1inI'\
|
|
167
|
+
'VtMGnKT9ywAcan60uavrMNeMAR1RGyuWj7N8XOiy7W2QrEXGzM/668UIJMzTFOlVqSrkQSn'\
|
|
168
|
+
'22ErWCb5BQTYXl04sF1nW73u8aykRHi1c4lGhu3kSrTKxqqN/GtEJTcDV+SfBj/huWQZrdW'\
|
|
169
|
+
'TxdbnN2XX5jqNkGUHbfkFU0s9oxxwX6cYYreBbtmo0WFSLS0o2RT+LGAtiEqgPvT5T6NlZl'\
|
|
170
|
+
'Na+TF17gbgxHi0sG","token":"dest-b61bc870-8ab8-4870-a209-6398b60269d5","'\
|
|
171
|
+
'url":"https://api.sandbox.payquicker.io/api/v2/users/user-2bbfc967-d12e'\
|
|
172
|
+
'-4647-a887-d905172fb4bc/prepaid-cards/dest-b61bc870-8ab8-4870-a209-6398'\
|
|
173
|
+
'b60269d5/pin?token=%2fYnZvwn9Q5TczQhubfjB8Sq1inIVtMGnKT9ywAcan60uavrMNe'\
|
|
174
|
+
'MAR1RGyuWj7N8XOiy7W2QrEXGzM%2f668UIJMzTFOlVqSrkQSn22ErWCb5BQTYXl04sF1nW'\
|
|
175
|
+
'73u8aykRHi1c4lGhu3kSrTKxqqN%2fGtEJTcDV%2bSfBj%2fhuWQZrdWTxdbnN2XX5jqNkG'\
|
|
176
|
+
'UHbfkFU0s9oxxwX6cYYreBbtmo0WFSLS0o2RT%2bLGAtiEqgPvT5T6NlZlNa%2bTF17gbgx'\
|
|
177
|
+
'Hi0sG","links":[{"href":"https://api.sandbox.payquicker.io/api/v2/users'\
|
|
178
|
+
'/user-2bbfc967-d12e-4647-a887-d905172fb4bc/prepaid-cards/dest-b61bc870-'\
|
|
179
|
+
'8ab8-4870-a209-6398b60269d5/pin","params":{"rel":"self"}}],"meta":{"tim'\
|
|
180
|
+
'ezone":"GMT","requestRef":"request-reference-value"}}'
|
|
181
|
+
)
|
|
182
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
183
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Set a [PIN](#/rest/models/structures/prepaid-card-pin) for a [prepaid card](page:resources/prepaid-cards), if supported by program.
|
|
187
|
+
#
|
|
188
|
+
def test_update_card_pin
|
|
189
|
+
# Parameters for the API call
|
|
190
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
191
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
192
|
+
body = UpdateCardPin.from_hash(APIHelper.json_deserialize(
|
|
193
|
+
'{"cardPinToken":"05OQkdzRkzjP+qlhTrsko00cb58gGERv+g1Nd7/xK+Ol2+vJaOJnjQ'\
|
|
194
|
+
'gdFA0Jqf5TFdYZrjO7dw/2l1V9k8xNGVr3MyKHrQh/CZ+HMz2gdI3VkJVj0x50PStECnN0t'\
|
|
195
|
+
'1P4eXTZqmh93O24fXRyvLn8XvmfyV7nF94IEwzwVe6Xdvl6mHQyyyNwtSNKHtNGGpM88hoX'\
|
|
196
|
+
'5PAvbqgYrsy5tBYi3CcN+Ld5Ia8+nFq9pDAXs6dCLsidU9XJRzLLcWWdhzxR","cardPin"'\
|
|
197
|
+
':"4444"}', false))
|
|
198
|
+
|
|
199
|
+
# Perform the API call through the SDK function
|
|
200
|
+
result = @controller.update_card_pin(user_token, destination_token,
|
|
201
|
+
body: body)
|
|
202
|
+
|
|
203
|
+
# Test response code
|
|
204
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
205
|
+
# Test headers
|
|
206
|
+
expected_headers = {}
|
|
207
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
208
|
+
|
|
209
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
210
|
+
|
|
211
|
+
# Test whether the captured response is as we expected
|
|
212
|
+
refute_nil(result)
|
|
213
|
+
expected_body = JSON.parse(
|
|
214
|
+
'{"result":true,"meta":{"timezone":"GMT","requestRef":"request-reference'\
|
|
215
|
+
'-value"}}'
|
|
216
|
+
)
|
|
217
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
218
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Reveal a [PIN](#/rest/models/structures/prepaid-card-pin) for a [prepaid card](page:resources/prepaid-cards).
|
|
222
|
+
#
|
|
223
|
+
def test_retrieve_card_pin
|
|
224
|
+
# Parameters for the API call
|
|
225
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
226
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
227
|
+
body = RetrieveCardPin.from_hash(APIHelper.json_deserialize(
|
|
228
|
+
'{"cardPinToken":"IzPQ55SGbTumVRn7xscpjL9zgFV29503mQ+GJuKAzCYl8DhLkJKZSB'\
|
|
229
|
+
'qPLWx6rBf/ky9FRqZCptCCVmZ3ZT+sR6sVmBDT9vfK+8Bbv/6Kftz+Pu9DJOXTwd7Hcs9Pu'\
|
|
230
|
+
'aU5qirAq9rp3P5pKL5Ilg+ZkU8b7TP2ZMBIchxYHZG5aJ3b96BdlMyEB4bu1UATKOjS2+vY'\
|
|
231
|
+
'FLUFprtwbnwp94QuaiFALG9NMClQ3CqWJqot/Z1DSbTnPqIq+BRzA8Xdbh1j"}', false))
|
|
232
|
+
|
|
233
|
+
# Perform the API call through the SDK function
|
|
234
|
+
result = @controller.retrieve_card_pin(user_token, destination_token,
|
|
235
|
+
body: body)
|
|
236
|
+
|
|
237
|
+
# Test response code
|
|
238
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
239
|
+
# Test headers
|
|
240
|
+
expected_headers = {}
|
|
241
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
242
|
+
|
|
243
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
244
|
+
|
|
245
|
+
# Test whether the captured response is as we expected
|
|
246
|
+
refute_nil(result)
|
|
247
|
+
expected_body = JSON.parse(
|
|
248
|
+
'{"cardPin":"4444","token":"dest-b61bc870-8ab8-4870-a209-6398b60269d5","'\
|
|
249
|
+
'links":[{"href":"https://api.sandbox.payquicker.io/api/v2/users/user-2b'\
|
|
250
|
+
'bfc967-d12e-4647-a887-d905172fb4bc/prepaid-cards/dest-b61bc870-8ab8-487'\
|
|
251
|
+
'0-a209-6398b60269d5/pin","params":{"rel":"self"}}],"meta":{"timezone":"'\
|
|
252
|
+
'GMT","requestRef":"request-reference-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
|
+
# Reveal a [PIN](#/rest/models/structures/prepaid-card-pin) for a [prepaid card](page:resources/prepaid-cards).
|
|
259
|
+
#
|
|
260
|
+
def test_retrieve_card_pin1
|
|
261
|
+
# Parameters for the API call
|
|
262
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
263
|
+
destination_token = 'dest-4aed86e2-4929-45bf-814d-9030aef21e79'
|
|
264
|
+
body = RetrieveCardPin.from_hash(APIHelper.json_deserialize(
|
|
265
|
+
'{"cardPinToken":"IzPQ55SGbTumVRn7xscpjL9zgFV29503mQ+GJuKAzCYl8DhLkJKZSB'\
|
|
266
|
+
'qPLWx6rBf/ky9FRqZCptCCVmZ3ZT+sR6sVmBDT9vfK+8Bbv/6Kftz+Pu9DJOXTwd7Hcs9Pu'\
|
|
267
|
+
'aU5qirAq9rp3P5pKL5Ilg+ZkU8b7TP2ZMBIchxYHZG5aJ3b96BdlMyEB4bu1UATKOjS2+vY'\
|
|
268
|
+
'FLUFprtwbnwp94QuaiFALG9NMClQ3CqWJqot/Z1DSbTnPqIq+BRzA8Xdbh1j"}', false))
|
|
269
|
+
|
|
270
|
+
# Perform the API call through the SDK function
|
|
271
|
+
result = @controller.retrieve_card_pin(user_token, destination_token,
|
|
272
|
+
body: body)
|
|
273
|
+
|
|
274
|
+
# Test response code
|
|
275
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
276
|
+
# Test headers
|
|
277
|
+
expected_headers = {}
|
|
278
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
279
|
+
|
|
280
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
281
|
+
|
|
282
|
+
# Test whether the captured response is as we expected
|
|
283
|
+
refute_nil(result)
|
|
284
|
+
expected_body = JSON.parse(
|
|
285
|
+
'{"cardPin":"4444","token":"dest-b61bc870-8ab8-4870-a209-6398b60269d5","'\
|
|
286
|
+
'links":[{"href":"https://api.sandbox.payquicker.io/api/v2/users/user-2b'\
|
|
287
|
+
'bfc967-d12e-4647-a887-d905172fb4bc/prepaid-cards/dest-b61bc870-8ab8-487'\
|
|
288
|
+
'0-a209-6398b60269d5/pin","params":{"rel":"self"}}],"meta":{"timezone":"'\
|
|
289
|
+
'GMT","requestRef":"request-reference-value"}}'
|
|
290
|
+
)
|
|
291
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
292
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
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 ComplianceControllerTest < ControllerTestBase
|
|
9
|
+
# Called only once for the class before any test has executed
|
|
10
|
+
def setup
|
|
11
|
+
setup_class
|
|
12
|
+
@controller = @client.compliance
|
|
13
|
+
@response_catcher = @controller.http_call_back
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Retrieve a list of [IDV checks](page:resources/user#list-user-idv-checks) by user token that supports filtering, sorting, and pagination through existing mechanisms.
|
|
17
|
+
#
|
|
18
|
+
def test_list_identity_checks
|
|
19
|
+
# Parameters for the API call
|
|
20
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
21
|
+
|
|
22
|
+
# Perform the API call through the SDK function
|
|
23
|
+
result = @controller.list_identity_checks(user_token)
|
|
24
|
+
|
|
25
|
+
# Test response code
|
|
26
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
27
|
+
# Test headers
|
|
28
|
+
expected_headers = {}
|
|
29
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
30
|
+
|
|
31
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
32
|
+
|
|
33
|
+
# Test whether the captured response is as we expected
|
|
34
|
+
refute_nil(result)
|
|
35
|
+
expected_body = JSON.parse(
|
|
36
|
+
'{"payload":[{"idvProviderReference":"yPV0h4o1Yw3QzdLAvA7a","idvResult":'\
|
|
37
|
+
'"PASS","idvSubResult":"HARD","idvProvider":"HOOYU","createdOn":"2020-02'\
|
|
38
|
+
'-21T22:00:00Z","raw":"<RAW IDV processor output, for informational /deb'\
|
|
39
|
+
'ugging purposes only>","idvCheckType":"NON_DOCUMENTARY","idvDisposition'\
|
|
40
|
+
'":"FINAL","token":"idvc-7e7567e0-c2db-485d-896d-45901a10baa9","userToke'\
|
|
41
|
+
'n":"user-f012bc86-4d42-415b-a8b2-be5e0b90e59a","links":[{"params":{"rel'\
|
|
42
|
+
'":"self"},"href":"https://api.payquicker.io/api/v2/users/user-f012bc86-'\
|
|
43
|
+
'4d42-415b-a8b2-be5e0b90e59a/idv-checks/idvc-7e7567e0-c2db-485d-896d-459'\
|
|
44
|
+
'01a10baa9"}]}],"links":[{"params":{"rel":"self"},"href":"https://api.pa'\
|
|
45
|
+
'yquicker.io/api/v2/users/user-f012bc86-4d42-415b-a8b2-be5e0b90e59a/idv-'\
|
|
46
|
+
'checks"}]}'
|
|
47
|
+
)
|
|
48
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
49
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Retrieve a list of [IDV checks](page:resources/user#retrieve-user-idv-check) by IDVC token that supports filtering, sorting, and pagination through existing mechanisms.
|
|
53
|
+
#
|
|
54
|
+
def test_retrieve_identity_check
|
|
55
|
+
# Parameters for the API call
|
|
56
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
57
|
+
idvc_token = 'idvc-7e7567e0-c2db-485d-896d-45901a10baa9'
|
|
58
|
+
|
|
59
|
+
# Perform the API call through the SDK function
|
|
60
|
+
result = @controller.retrieve_identity_check(user_token, idvc_token)
|
|
61
|
+
|
|
62
|
+
# Test response code
|
|
63
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
64
|
+
# Test headers
|
|
65
|
+
expected_headers = {}
|
|
66
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
67
|
+
|
|
68
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
69
|
+
|
|
70
|
+
# Test whether the captured response is as we expected
|
|
71
|
+
refute_nil(result)
|
|
72
|
+
expected_body = JSON.parse(
|
|
73
|
+
'{"createdOn":"2022-04-20T17:34:50Z","idvCheckType":"PII","idvDispostion'\
|
|
74
|
+
'":"UNDEFINED","idvProvider":"FISIDOLOGY","idvResult":"PASS","idvSubResu'\
|
|
75
|
+
'lt":"HARD","token":"idvc-5a04bacf-f99c-4962-8c02-d8e744c625d6","userTok'\
|
|
76
|
+
'en":"user-2bbfc967-d12e-4647-a887-d905172fb4bc","links":[{"href":"https'\
|
|
77
|
+
'://api.sandbox.payquicker.io/api/v2/users/user-2bbfc967-d12e-4647-a887-'\
|
|
78
|
+
'd905172fb4bc/idv-checks/idvc-5a04bacf-f99c-4962-8c02-d8e744c625d6","par'\
|
|
79
|
+
'ams":{"rel":"self"}}],"meta":{"timezone":"GMT","requestRef":"request-re'\
|
|
80
|
+
'ference-value"}}'
|
|
81
|
+
)
|
|
82
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
83
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
end
|
|
@@ -0,0 +1,212 @@
|
|
|
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 DocumentsControllerTest < ControllerTestBase
|
|
9
|
+
# Called only once for the class before any test has executed
|
|
10
|
+
def setup
|
|
11
|
+
setup_class
|
|
12
|
+
@controller = @client.documents
|
|
13
|
+
@response_catcher = @controller.http_call_back
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Retrieve a list of user [documents](page:resources/documents) that supports filtering, sorting, and pagination through existing mechanisms.
|
|
17
|
+
def test_list_documents
|
|
18
|
+
# Parameters for the API call
|
|
19
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
20
|
+
page = 1
|
|
21
|
+
page_size = 20
|
|
22
|
+
filter = 'string'
|
|
23
|
+
sort = 'string'
|
|
24
|
+
language = 'en-US'
|
|
25
|
+
|
|
26
|
+
# Perform the API call through the SDK function
|
|
27
|
+
result = @controller.list_documents(user_token, page, page_size,
|
|
28
|
+
filter: filter, sort: sort,
|
|
29
|
+
language: language)
|
|
30
|
+
|
|
31
|
+
# Test response code
|
|
32
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
33
|
+
# Test headers
|
|
34
|
+
expected_headers = {}
|
|
35
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
36
|
+
|
|
37
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
38
|
+
|
|
39
|
+
# Test whether the captured response is as we expected
|
|
40
|
+
refute_nil(result)
|
|
41
|
+
expected_body = JSON.parse(
|
|
42
|
+
'{"payload":[{"createDate":"2022-05-04T18:59:38Z","fields":[{"key":"TYPE'\
|
|
43
|
+
'","value":"DRIVERS_LICENSE"},{"key":"STATUS","value":"PROVIDED"},{"key"'\
|
|
44
|
+
':"EXPIRATION_DATE","value":"10-31-2021"}],"filename":"List.jpg","mimeTy'\
|
|
45
|
+
'pe":"image/jpeg","token":"docu-2053aaad-c1a5-45e2-a2da-f71287f32800","l'\
|
|
46
|
+
'inks":[{"href":"https://api.sandbox.payquicker.io/api/v2/users/user-2bb'\
|
|
47
|
+
'fc967-d12e-4647-a887-d905172fb4bc/documents/docu-2053aaad-c1a5-45e2-a2d'\
|
|
48
|
+
'a-f71287f32800","params":{"rel":"self"}}]}],"meta":{"pageNo":"1","pageS'\
|
|
49
|
+
'ize":"2","pageCount":"0","recordCount":"0","timezone":"GMT","requestRef'\
|
|
50
|
+
'":"request-reference-value"},"links":[{"href":"https://api.sandbox.payq'\
|
|
51
|
+
'uicker.io/api/v2/users/user-2bbfc967-d12e-4647-a887-d905172fb4bc/docume'\
|
|
52
|
+
'nts?page=1&pageSize=2","params":{"rel":"self"}}]}'
|
|
53
|
+
)
|
|
54
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
55
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Upload a user [document](page:resources/documents).
|
|
59
|
+
#
|
|
60
|
+
def test_upload_document
|
|
61
|
+
# Parameters for the API call
|
|
62
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
63
|
+
fields = CreateOrUpdateDocumentFields.from_hash(APIHelper.json_deserialize(
|
|
64
|
+
'{"fields":[{"key":"EXPIRATION_DATE","value":"string"}]}', false))
|
|
65
|
+
upload = nil
|
|
66
|
+
|
|
67
|
+
begin
|
|
68
|
+
# Perform the API call through the SDK function
|
|
69
|
+
result = @controller.upload_document(user_token, fields: fields,
|
|
70
|
+
upload: upload)
|
|
71
|
+
|
|
72
|
+
# Test response code
|
|
73
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
74
|
+
# Test headers
|
|
75
|
+
expected_headers = {}
|
|
76
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
77
|
+
|
|
78
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
79
|
+
|
|
80
|
+
# Test whether the captured response is as we expected
|
|
81
|
+
refute_nil(result)
|
|
82
|
+
expected_body = JSON.parse(
|
|
83
|
+
'{"createDate":"2022-05-04T18:59:38Z","fields":[{"key":"EXPIRATION_DAT'\
|
|
84
|
+
'E","value":"10-31-2021"},{"key":"TYPE","value":"DRIVERS_LICENSE"},{"k'\
|
|
85
|
+
'ey":"STATUS","value":"PROVIDED"}],"token":"docu-2053aaad-c1a5-45e2-a2'\
|
|
86
|
+
'da-f71287f32800","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
87
|
+
'api/v2/users/user-2bbfc967-d12e-4647-a887-d905172fb4bc/documents/docu'\
|
|
88
|
+
'-2053aaad-c1a5-45e2-a2da-f71287f32800","params":{"rel":"self"}}],"met'\
|
|
89
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
90
|
+
)
|
|
91
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
92
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
93
|
+
ensure
|
|
94
|
+
upload.close
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Upload a user [document](page:resources/documents).
|
|
99
|
+
#
|
|
100
|
+
def test_upload_document1
|
|
101
|
+
# Parameters for the API call
|
|
102
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
103
|
+
fields = CreateOrUpdateDocumentFields.from_hash(APIHelper.json_deserialize(
|
|
104
|
+
'{"fields":[{"key":"EXPIRATION_DATE","value":"string"}]}', false))
|
|
105
|
+
upload = nil
|
|
106
|
+
|
|
107
|
+
begin
|
|
108
|
+
# Perform the API call through the SDK function
|
|
109
|
+
result = @controller.upload_document(user_token, fields: fields,
|
|
110
|
+
upload: upload)
|
|
111
|
+
|
|
112
|
+
# Test response code
|
|
113
|
+
assert_equal(201, @response_catcher.response.status_code)
|
|
114
|
+
# Test headers
|
|
115
|
+
expected_headers = {}
|
|
116
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
117
|
+
|
|
118
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
119
|
+
|
|
120
|
+
# Test whether the captured response is as we expected
|
|
121
|
+
refute_nil(result)
|
|
122
|
+
expected_body = JSON.parse(
|
|
123
|
+
'{"createDate":"2022-05-04T18:59:38Z","fields":[{"key":"EXPIRATION_DAT'\
|
|
124
|
+
'E","value":"10-31-2021"},{"key":"TYPE","value":"DRIVERS_LICENSE"},{"k'\
|
|
125
|
+
'ey":"STATUS","value":"PROVIDED"}],"token":"docu-2053aaad-c1a5-45e2-a2'\
|
|
126
|
+
'da-f71287f32800","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
127
|
+
'api/v2/users/user-2bbfc967-d12e-4647-a887-d905172fb4bc/documents/docu'\
|
|
128
|
+
'-2053aaad-c1a5-45e2-a2da-f71287f32800","params":{"rel":"self"}}],"met'\
|
|
129
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
130
|
+
)
|
|
131
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
132
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
133
|
+
ensure
|
|
134
|
+
upload.close
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Retrieve a single user [document](page:resources/documents) by its document token.
|
|
139
|
+
#
|
|
140
|
+
def test_retrieve_document
|
|
141
|
+
# Parameters for the API call
|
|
142
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
143
|
+
document_token = 'docu-6e582242-5dd4-4883-b0c2-488e09a26595'
|
|
144
|
+
|
|
145
|
+
# Perform the API call through the SDK function
|
|
146
|
+
result = @controller.retrieve_document(user_token, document_token)
|
|
147
|
+
|
|
148
|
+
# Test response code
|
|
149
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
150
|
+
# Test headers
|
|
151
|
+
expected_headers = {}
|
|
152
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
153
|
+
|
|
154
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
155
|
+
|
|
156
|
+
# Test whether the captured response is as we expected
|
|
157
|
+
refute_nil(result)
|
|
158
|
+
expected_body = JSON.parse(
|
|
159
|
+
'{"createDate":"2022-05-04T18:59:38Z","fields":[{"key":"EXPIRATION_DATE"'\
|
|
160
|
+
',"value":"10-31-2021"},{"key":"TYPE","value":"DRIVERS_LICENSE"},{"key":'\
|
|
161
|
+
'"STATUS","value":"PROVIDED"}],"token":"docu-2053aaad-c1a5-45e2-a2da-f71'\
|
|
162
|
+
'287f32800","links":[{"href":"https://api.sandbox.payquicker.io/api/v2/u'\
|
|
163
|
+
'sers/user-2bbfc967-d12e-4647-a887-d905172fb4bc/documents/docu-2053aaad-'\
|
|
164
|
+
'c1a5-45e2-a2da-f71287f32800","params":{"rel":"self"}}],"meta":{"timezon'\
|
|
165
|
+
'e":"GMT","requestRef":"request-reference-value"}}'
|
|
166
|
+
)
|
|
167
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
168
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Replace the user [documents](page:resources/documents) at the given document token.
|
|
172
|
+
#
|
|
173
|
+
def test_replace_document
|
|
174
|
+
# Parameters for the API call
|
|
175
|
+
user_token = 'user-2bbfc967-d12e-4647-a887-d905172fb4bc'
|
|
176
|
+
document_token = 'docu-6e582242-5dd4-4883-b0c2-488e09a26595'
|
|
177
|
+
fields = CreateOrUpdateDocumentFields.from_hash(APIHelper.json_deserialize(
|
|
178
|
+
'{"fields":[{"key":"EXPIRATION_DATE","value":"string"}]}', false))
|
|
179
|
+
upload = nil
|
|
180
|
+
|
|
181
|
+
begin
|
|
182
|
+
# Perform the API call through the SDK function
|
|
183
|
+
result = @controller.replace_document(user_token, document_token,
|
|
184
|
+
fields: fields, upload: upload)
|
|
185
|
+
|
|
186
|
+
# Test response code
|
|
187
|
+
assert_equal(200, @response_catcher.response.status_code)
|
|
188
|
+
# Test headers
|
|
189
|
+
expected_headers = {}
|
|
190
|
+
expected_headers['content-type'] = 'application/json; charset=utf-8'
|
|
191
|
+
|
|
192
|
+
assert(ComparisonHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
|
193
|
+
|
|
194
|
+
# Test whether the captured response is as we expected
|
|
195
|
+
refute_nil(result)
|
|
196
|
+
expected_body = JSON.parse(
|
|
197
|
+
'{"createDate":"2022-05-04T18:59:38Z","fields":[{"key":"EXPIRATION_DAT'\
|
|
198
|
+
'E","value":"10-31-2021"},{"key":"TYPE","value":"DRIVERS_LICENSE"},{"k'\
|
|
199
|
+
'ey":"STATUS","value":"PROVIDED"}],"token":"docu-2053aaad-c1a5-45e2-a2'\
|
|
200
|
+
'da-f71287f32800","links":[{"href":"https://api.sandbox.payquicker.io/'\
|
|
201
|
+
'api/v2/users/user-2bbfc967-d12e-4647-a887-d905172fb4bc/documents/docu'\
|
|
202
|
+
'-2053aaad-c1a5-45e2-a2da-f71287f32800","params":{"rel":"self"}}],"met'\
|
|
203
|
+
'a":{"timezone":"GMT","requestRef":"request-reference-value"}}'
|
|
204
|
+
)
|
|
205
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
|
206
|
+
assert(ComparisonHelper.match_body(expected_body, received_body))
|
|
207
|
+
ensure
|
|
208
|
+
upload.close
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
end
|