dana-python 2.2.0__tar.gz → 2.2.1__tar.gz
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.
- {dana_python-2.2.0/dana_python.egg-info → dana_python-2.2.1}/PKG-INFO +1 -1
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/api/disbursement_api.py +49 -61
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/custom_validation.py +94 -112
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/custom_validation.py +98 -48
- {dana_python-2.2.0 → dana_python-2.2.1/dana_python.egg-info}/PKG-INFO +1 -1
- {dana_python-2.2.0 → dana_python-2.2.1}/dana_python.egg-info/SOURCES.txt +1 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/pyproject.toml +1 -1
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_disbursement_api.py +0 -46
- dana_python-2.2.1/tests/test_disbursement_custom_validation_enrich.py +126 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_payment_gateway_api.py +14 -9
- {dana_python-2.2.0 → dana_python-2.2.1}/LICENSE +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/README.md +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/api_client.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/api_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/base/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/base/configuration.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/base/model.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/base/types.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/api/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/enum.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/bank_account_inquiry_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/bank_account_inquiry_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/bank_account_inquiry_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/bank_account_inquiry_response_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/dana_account_inquiry_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/dana_account_inquiry_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/dana_account_inquiry_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/money.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_bank_inquiry_status_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_bank_inquiry_status_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_bank_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_bank_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_bank_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_dana_inquiry_status_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_dana_inquiry_status_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_dana_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_dana_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/disbursement/v1/models/transfer_to_dana_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/exceptions.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/api/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/api/merchant_management_api.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/enum.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/address_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/asset_card_list_item.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/business_docs.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_division_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_division_request_ext_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_division_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_division_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_division_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_division_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_shop_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_shop_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_shop_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_shop_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/create_shop_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/division_resource_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/member_asset_result_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_account_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_certificate_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_contact_address.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_contact_email.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_contact_mobile_no.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_corporate_certificate.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_information.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/merchant_resource_information.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/mobile_no_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/pic_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_asset_card_list_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_asset_card_list_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_asset_card_list_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_asset_card_list_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_asset_card_list_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_division_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_division_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_division_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_division_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_division_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_info_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_info_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_info_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_info_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_info_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_resource_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_resource_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_resource_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_resource_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_merchant_resource_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_shop_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_shop_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_shop_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_shop_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/query_shop_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/result_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/shop_resource_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_division_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_division_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_division_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_division_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_division_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_shop_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_shop_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_shop_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/update_shop_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/merchant_management/v1/models/user_name.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/api/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/api/payment_gateway_api.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/enum.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/actor_context.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/amount_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/audit_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/buyer.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/cancel_order_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/cancel_order_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/consult_pay_payment_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/consult_pay_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/consult_pay_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/consult_pay_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/create_order_by_api_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/create_order_by_api_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/create_order_by_redirect_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/create_order_by_redirect_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/create_order_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/create_order_response_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/env_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/goods.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/money.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/order_api_object.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/order_redirect_object.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/pay_option_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/pay_option_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/pay_option_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/payment_view.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/promo_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/query_payment_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/query_payment_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/query_payment_response_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/refund_option_bill.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/refund_order_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/refund_order_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/refund_order_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/seller.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/shipping_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/status_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/time_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/url_param.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/payment_gateway/v1/models/virtual_account_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/rest.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/date_validation.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/models.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/open_api_configuration.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/open_api_header.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/script.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/snap_configuration.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/snap_header.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/utils/url.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/finish_notify_payment_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/finish_notify_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/finish_notify_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/finish_notify_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/money.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/pay_option_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/shop_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/webhook/webhook.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/api/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/api/widget_api.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/custom_validation.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/enum.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/__init__.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/account_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/account_unbinding_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/account_unbinding_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/account_unbinding_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/amount_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_ott_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_ott_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_ott_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_ott_response_user_resources_inner.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_token_authorization_code_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_token_refresh_token_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_token_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_token_response_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/apply_token_response_additional_info_user_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/balance_inquiry_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/balance_inquiry_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/balance_inquiry_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/buyer.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/cancel_order_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/cancel_order_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/env_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/goods.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/international_order_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/international_order_info_exchange_rate.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/money.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/oauth2_url_data.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/oauth2_url_data_seamless_data.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/order.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/pay_option_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/pay_option_detail_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/pay_option_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/payment_promo_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/payment_view.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_payment_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_payment_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_payment_response_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_user_profile_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_user_profile_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_user_profile_response_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_user_profile_response_response_body.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/query_user_profile_response_response_head.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/refund_order_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/refund_order_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/refund_order_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/refund_promo_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/result_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/seller.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/service_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/shipping_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/status_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/time_detail.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/url_param.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/user_resource_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/virtual_account_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/widget_payment_request.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/widget_payment_request_additional_info.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/models/widget_payment_response.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana/widget/v1/util.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana_python.egg-info/dependency_links.txt +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana_python.egg-info/requires.txt +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/dana_python.egg-info/top_level.txt +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/setup.cfg +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_merchant_management_api.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_payment_gateway_with_automation.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_snap_header.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_webhook.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_widget_api.py +0 -0
- {dana_python-2.2.0 → dana_python-2.2.1}/tests/test_widget_with_automation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dana-python
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: API Client (SDK) for DANA APIs based on https://dashboard.dana.id/api-docs
|
|
5
5
|
Author-email: DANA Package Manager <package-manager@dana.id>
|
|
6
6
|
Maintainer-email: DANA Package Manager <package-manager@dana.id>
|
|
@@ -54,7 +54,7 @@ from dana.utils.snap_header import SnapHeader
|
|
|
54
54
|
from dana.disbursement.v1.custom_validation import (
|
|
55
55
|
custom_validation,
|
|
56
56
|
custom_validation_response,
|
|
57
|
-
|
|
57
|
+
enrich_disbursement_error,
|
|
58
58
|
)
|
|
59
59
|
from dana.exceptions import ApiException
|
|
60
60
|
|
|
@@ -144,11 +144,10 @@ class DisbursementApi:
|
|
|
144
144
|
pass
|
|
145
145
|
return api_response.data
|
|
146
146
|
except ApiException as e:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
raise e
|
|
147
|
+
try:
|
|
148
|
+
raise enrich_disbursement_error(bank_account_inquiry_request, e)
|
|
149
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
150
|
+
raise e
|
|
152
151
|
raise e
|
|
153
152
|
|
|
154
153
|
|
|
@@ -224,11 +223,10 @@ class DisbursementApi:
|
|
|
224
223
|
pass
|
|
225
224
|
return api_response
|
|
226
225
|
except ApiException as e:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
raise e
|
|
226
|
+
try:
|
|
227
|
+
raise enrich_disbursement_error(bank_account_inquiry_request, e)
|
|
228
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
229
|
+
raise e
|
|
232
230
|
raise e
|
|
233
231
|
|
|
234
232
|
|
|
@@ -464,11 +462,10 @@ class DisbursementApi:
|
|
|
464
462
|
pass
|
|
465
463
|
return api_response.data
|
|
466
464
|
except ApiException as e:
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
raise e
|
|
465
|
+
try:
|
|
466
|
+
raise enrich_disbursement_error(dana_account_inquiry_request, e)
|
|
467
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
468
|
+
raise e
|
|
472
469
|
raise e
|
|
473
470
|
|
|
474
471
|
|
|
@@ -544,11 +541,10 @@ class DisbursementApi:
|
|
|
544
541
|
pass
|
|
545
542
|
return api_response
|
|
546
543
|
except ApiException as e:
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
raise e
|
|
544
|
+
try:
|
|
545
|
+
raise enrich_disbursement_error(dana_account_inquiry_request, e)
|
|
546
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
547
|
+
raise e
|
|
552
548
|
raise e
|
|
553
549
|
|
|
554
550
|
|
|
@@ -785,11 +781,10 @@ class DisbursementApi:
|
|
|
785
781
|
pass
|
|
786
782
|
return api_response.data
|
|
787
783
|
except ApiException as e:
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
raise e
|
|
784
|
+
try:
|
|
785
|
+
raise enrich_disbursement_error(transfer_to_bank_request, e)
|
|
786
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
787
|
+
raise e
|
|
793
788
|
raise e
|
|
794
789
|
|
|
795
790
|
|
|
@@ -866,11 +861,10 @@ class DisbursementApi:
|
|
|
866
861
|
pass
|
|
867
862
|
return api_response
|
|
868
863
|
except ApiException as e:
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
raise e
|
|
864
|
+
try:
|
|
865
|
+
raise enrich_disbursement_error(transfer_to_bank_request, e)
|
|
866
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
867
|
+
raise e
|
|
874
868
|
raise e
|
|
875
869
|
|
|
876
870
|
|
|
@@ -1107,11 +1101,10 @@ class DisbursementApi:
|
|
|
1107
1101
|
pass
|
|
1108
1102
|
return api_response.data
|
|
1109
1103
|
except ApiException as e:
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
raise e
|
|
1104
|
+
try:
|
|
1105
|
+
raise enrich_disbursement_error(transfer_to_bank_inquiry_status_request, e)
|
|
1106
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
1107
|
+
raise e
|
|
1115
1108
|
raise e
|
|
1116
1109
|
|
|
1117
1110
|
|
|
@@ -1187,11 +1180,10 @@ class DisbursementApi:
|
|
|
1187
1180
|
pass
|
|
1188
1181
|
return api_response
|
|
1189
1182
|
except ApiException as e:
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
raise e
|
|
1183
|
+
try:
|
|
1184
|
+
raise enrich_disbursement_error(transfer_to_bank_inquiry_status_request, e)
|
|
1185
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
1186
|
+
raise e
|
|
1195
1187
|
raise e
|
|
1196
1188
|
|
|
1197
1189
|
|
|
@@ -1427,11 +1419,10 @@ class DisbursementApi:
|
|
|
1427
1419
|
pass
|
|
1428
1420
|
return api_response.data
|
|
1429
1421
|
except ApiException as e:
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
raise e
|
|
1422
|
+
try:
|
|
1423
|
+
raise enrich_disbursement_error(transfer_to_dana_request, e)
|
|
1424
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
1425
|
+
raise e
|
|
1435
1426
|
raise e
|
|
1436
1427
|
|
|
1437
1428
|
|
|
@@ -1507,11 +1498,10 @@ class DisbursementApi:
|
|
|
1507
1498
|
pass
|
|
1508
1499
|
return api_response
|
|
1509
1500
|
except ApiException as e:
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
raise e
|
|
1501
|
+
try:
|
|
1502
|
+
raise enrich_disbursement_error(transfer_to_dana_request, e)
|
|
1503
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
1504
|
+
raise e
|
|
1515
1505
|
raise e
|
|
1516
1506
|
|
|
1517
1507
|
|
|
@@ -1747,11 +1737,10 @@ class DisbursementApi:
|
|
|
1747
1737
|
pass
|
|
1748
1738
|
return api_response.data
|
|
1749
1739
|
except ApiException as e:
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
raise e
|
|
1740
|
+
try:
|
|
1741
|
+
raise enrich_disbursement_error(transfer_to_dana_inquiry_status_request, e)
|
|
1742
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
1743
|
+
raise e
|
|
1755
1744
|
raise e
|
|
1756
1745
|
|
|
1757
1746
|
|
|
@@ -1827,11 +1816,10 @@ class DisbursementApi:
|
|
|
1827
1816
|
pass
|
|
1828
1817
|
return api_response
|
|
1829
1818
|
except ApiException as e:
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
raise e
|
|
1819
|
+
try:
|
|
1820
|
+
raise enrich_disbursement_error(transfer_to_dana_inquiry_status_request, e)
|
|
1821
|
+
except (ImportError, ModuleNotFoundError, NameError):
|
|
1822
|
+
raise e
|
|
1835
1823
|
raise e
|
|
1836
1824
|
|
|
1837
1825
|
|
|
@@ -27,16 +27,24 @@ from typing import Any, Callable, Dict, List, Optional
|
|
|
27
27
|
from dana.exceptions import ApiException
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
SANDBOX_BENEFICIARY_ACCOUNT_NUMBER = '2460888509'
|
|
31
|
-
SANDBOX_BENEFICIARY_BANK_CODE = '014'
|
|
32
|
-
# Sandbox maximum amount (major units) for Disbursement.
|
|
33
|
-
SANDBOX_MAX_AMOUNT = 20000000
|
|
34
30
|
ALLOWED_ACCOUNT_TYPES = frozenset({
|
|
35
31
|
'MERCHANT_DEPOSIT_ACCOUNT',
|
|
36
32
|
'SETTLEMENT_ACCOUNT',
|
|
37
33
|
'DIVISION_DEPOSIT_ACCOUNT',
|
|
38
34
|
})
|
|
39
35
|
|
|
36
|
+
SANDBOX_POSITIVE_BENEFICIARY_ACCOUNT_NUMBER = '2460888509'
|
|
37
|
+
SANDBOX_POSITIVE_BENEFICIARY_BANK_CODE = '014'
|
|
38
|
+
SANDBOX_MAX_AMOUNT = 20000000
|
|
39
|
+
|
|
40
|
+
SANDBOX_POSITIVE_BANK_HINT = (
|
|
41
|
+
f'For testing positive case in sandbox use beneficiaryAccountNumber '
|
|
42
|
+
f'{SANDBOX_POSITIVE_BENEFICIARY_ACCOUNT_NUMBER} and beneficiaryBankCode '
|
|
43
|
+
f'{SANDBOX_POSITIVE_BENEFICIARY_BANK_CODE}'
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
SANDBOX_AMOUNT_MAX_HINT = f'In sandbox, amount.value must not exceed {SANDBOX_MAX_AMOUNT}'
|
|
47
|
+
|
|
40
48
|
SANDBOX_DANA_BALANCE_LIMIT_HINT = (
|
|
41
49
|
'Make sure DANA balance not exceeding limit of 21000000 after topup'
|
|
42
50
|
)
|
|
@@ -62,7 +70,7 @@ def _append_sandbox_hint(
|
|
|
62
70
|
hint: str,
|
|
63
71
|
*already_present_markers: str,
|
|
64
72
|
) -> str:
|
|
65
|
-
"""Always append
|
|
73
|
+
"""Always append. Uses markers to avoid duplicates. No 150-char truncate."""
|
|
66
74
|
msg = (response_message or '').strip()
|
|
67
75
|
lower_msg = msg.lower()
|
|
68
76
|
for marker in already_present_markers:
|
|
@@ -75,30 +83,11 @@ def _append_sandbox_hint(
|
|
|
75
83
|
return f'{msg}. {hint}'
|
|
76
84
|
|
|
77
85
|
|
|
78
|
-
def
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
def validate_sandbox_amount(request: Any) -> None:
|
|
84
|
-
"""In sandbox, amount.value must not exceed SANDBOX_MAX_AMOUNT."""
|
|
85
|
-
if request is None or not _is_sandbox():
|
|
86
|
-
return
|
|
87
|
-
amount = getattr(request, 'amount', None)
|
|
88
|
-
if amount is None:
|
|
89
|
-
return
|
|
90
|
-
value = getattr(amount, 'value', None)
|
|
91
|
-
if value is None or str(value).strip() == '':
|
|
92
|
-
return
|
|
93
|
-
try:
|
|
94
|
-
parsed = float(value)
|
|
95
|
-
except (TypeError, ValueError):
|
|
96
|
-
return
|
|
97
|
-
if parsed > SANDBOX_MAX_AMOUNT:
|
|
98
|
-
raise ApiException(status=0, contexts=[_ctx(
|
|
99
|
-
'amount.value',
|
|
100
|
-
f'in sandbox, amount.value must not exceed {SANDBOX_MAX_AMOUNT}; got {value!r}',
|
|
101
|
-
)])
|
|
86
|
+
def _should_append_dana_balance_hint(response_code: Any, response_message: Any) -> bool:
|
|
87
|
+
msg = str(response_message or '').lower()
|
|
88
|
+
if 'exceed' in msg or 'melebihi' in msg:
|
|
89
|
+
return True
|
|
90
|
+
return str(response_code or '').strip() == '4033802'
|
|
102
91
|
|
|
103
92
|
|
|
104
93
|
def _require_non_empty(value: Any, field_path: str) -> None:
|
|
@@ -213,63 +202,6 @@ def validate_account_type_transfer_to_dana(request: Any) -> None:
|
|
|
213
202
|
_validate_account_type_value(current, 'additionalInfo.accountType')
|
|
214
203
|
|
|
215
204
|
|
|
216
|
-
def validate_sandbox_beneficiary_bank_account_inquiry(request: Any) -> None:
|
|
217
|
-
"""In sandbox, beneficiaryAccountNumber must be 2460888509 and beneficiaryBankCode must be 014."""
|
|
218
|
-
if request is None or not _is_sandbox():
|
|
219
|
-
return
|
|
220
|
-
contexts: List[Dict[str, str]] = []
|
|
221
|
-
account_number = _trim_str(getattr(request, 'beneficiary_account_number', None))
|
|
222
|
-
if account_number != SANDBOX_BENEFICIARY_ACCOUNT_NUMBER:
|
|
223
|
-
contexts.append(_ctx(
|
|
224
|
-
'beneficiaryAccountNumber',
|
|
225
|
-
(
|
|
226
|
-
f'in sandbox, beneficiaryAccountNumber must be {SANDBOX_BENEFICIARY_ACCOUNT_NUMBER}; '
|
|
227
|
-
f'got {getattr(request, "beneficiary_account_number", None)!r}'
|
|
228
|
-
),
|
|
229
|
-
))
|
|
230
|
-
additional_info = getattr(request, 'additional_info', None)
|
|
231
|
-
bank_code = _trim_str(
|
|
232
|
-
getattr(additional_info, 'beneficiary_bank_code', None) if additional_info is not None else None
|
|
233
|
-
)
|
|
234
|
-
if bank_code != SANDBOX_BENEFICIARY_BANK_CODE:
|
|
235
|
-
contexts.append(_ctx(
|
|
236
|
-
'additionalInfo.beneficiaryBankCode',
|
|
237
|
-
(
|
|
238
|
-
f'in sandbox, additionalInfo.beneficiaryBankCode must be {SANDBOX_BENEFICIARY_BANK_CODE}; '
|
|
239
|
-
f'got {bank_code!r}'
|
|
240
|
-
),
|
|
241
|
-
))
|
|
242
|
-
if contexts:
|
|
243
|
-
raise ApiException(status=0, contexts=contexts)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
def validate_sandbox_beneficiary_transfer_to_bank(request: Any) -> None:
|
|
247
|
-
"""In sandbox, beneficiaryAccountNumber must be 2460888509 and beneficiaryBankCode must be 014."""
|
|
248
|
-
if request is None or not _is_sandbox():
|
|
249
|
-
return
|
|
250
|
-
contexts: List[Dict[str, str]] = []
|
|
251
|
-
account_number = _trim_str(getattr(request, 'beneficiary_account_number', None))
|
|
252
|
-
if account_number != SANDBOX_BENEFICIARY_ACCOUNT_NUMBER:
|
|
253
|
-
contexts.append(_ctx(
|
|
254
|
-
'beneficiaryAccountNumber',
|
|
255
|
-
(
|
|
256
|
-
f'in sandbox, beneficiaryAccountNumber must be {SANDBOX_BENEFICIARY_ACCOUNT_NUMBER}; '
|
|
257
|
-
f'got {getattr(request, "beneficiary_account_number", None)!r}'
|
|
258
|
-
),
|
|
259
|
-
))
|
|
260
|
-
bank_code = _trim_str(getattr(request, 'beneficiary_bank_code', None))
|
|
261
|
-
if bank_code != SANDBOX_BENEFICIARY_BANK_CODE:
|
|
262
|
-
contexts.append(_ctx(
|
|
263
|
-
'beneficiaryBankCode',
|
|
264
|
-
(
|
|
265
|
-
f'in sandbox, beneficiaryBankCode must be {SANDBOX_BENEFICIARY_BANK_CODE}; '
|
|
266
|
-
f'got {getattr(request, "beneficiary_bank_code", None)!r}'
|
|
267
|
-
),
|
|
268
|
-
))
|
|
269
|
-
if contexts:
|
|
270
|
-
raise ApiException(status=0, contexts=contexts)
|
|
271
|
-
|
|
272
|
-
|
|
273
205
|
def validate_required_additional_info_not_empty_bank_account_inquiry(request: Any) -> None:
|
|
274
206
|
if request is None:
|
|
275
207
|
return
|
|
@@ -323,26 +255,20 @@ validation_registry: Dict[str, List[Callable[[Any], None]]] = {
|
|
|
323
255
|
'BankAccountInquiryRequest': [
|
|
324
256
|
strip_sandbox_ignored_fields_bank_account_inquiry,
|
|
325
257
|
validate_account_type_bank_account_inquiry,
|
|
326
|
-
validate_sandbox_beneficiary_bank_account_inquiry,
|
|
327
|
-
validate_sandbox_amount,
|
|
328
258
|
validate_required_additional_info_not_empty_bank_account_inquiry,
|
|
329
259
|
],
|
|
330
260
|
'TransferToBankRequest': [
|
|
331
261
|
strip_sandbox_ignored_fields_transfer_to_bank,
|
|
332
262
|
validate_account_type_transfer_to_bank,
|
|
333
|
-
validate_sandbox_beneficiary_transfer_to_bank,
|
|
334
|
-
validate_sandbox_amount,
|
|
335
263
|
validate_required_additional_info_not_empty_transfer_to_bank,
|
|
336
264
|
],
|
|
337
265
|
'TransferToDanaRequest': [
|
|
338
266
|
strip_sandbox_ignored_fields_transfer_to_dana,
|
|
339
267
|
validate_account_type_transfer_to_dana,
|
|
340
|
-
validate_sandbox_amount,
|
|
341
268
|
validate_required_additional_info_not_empty_transfer_to_dana,
|
|
342
269
|
],
|
|
343
270
|
'DanaAccountInquiryRequest': [
|
|
344
271
|
strip_sandbox_ignored_fields_dana_account_inquiry,
|
|
345
|
-
validate_sandbox_amount,
|
|
346
272
|
validate_required_additional_info_not_empty_dana_account_inquiry,
|
|
347
273
|
],
|
|
348
274
|
}
|
|
@@ -379,31 +305,62 @@ def custom_validation(request: Any) -> None:
|
|
|
379
305
|
)
|
|
380
306
|
|
|
381
307
|
|
|
382
|
-
def
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
308
|
+
def _is_bank_transfer_request(request: Any) -> bool:
|
|
309
|
+
return request.__class__.__name__ in ('BankAccountInquiryRequest', 'TransferToBankRequest')
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
def _should_append_positive_bank_hint(response_code: Any) -> bool:
|
|
313
|
+
return str(response_code or '').strip().startswith('500')
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
def _should_append_amount_max_hint(response_message: Any) -> bool:
|
|
317
|
+
msg = str(response_message or '').lower()
|
|
318
|
+
return 'exceed' in msg or 'melebihi' in msg
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def _apply_sandbox_disbursement_hints(request: Any, response: Any) -> None:
|
|
388
322
|
if not hasattr(response, 'response_message'):
|
|
389
323
|
return
|
|
390
324
|
response_code = getattr(response, 'response_code', None)
|
|
391
|
-
|
|
325
|
+
response_message = getattr(response, 'response_message', None)
|
|
326
|
+
|
|
327
|
+
updated = str(response_message or '')
|
|
328
|
+
|
|
329
|
+
if _is_bank_transfer_request(request) and _should_append_positive_bank_hint(response_code):
|
|
330
|
+
updated = _append_sandbox_hint(
|
|
331
|
+
updated,
|
|
332
|
+
SANDBOX_POSITIVE_BANK_HINT,
|
|
333
|
+
SANDBOX_POSITIVE_BENEFICIARY_ACCOUNT_NUMBER,
|
|
334
|
+
f'beneficiarybankcode {SANDBOX_POSITIVE_BENEFICIARY_BANK_CODE}',
|
|
335
|
+
)
|
|
336
|
+
|
|
337
|
+
if request.__class__.__name__ == 'TransferToDanaRequest':
|
|
338
|
+
if _should_append_dana_balance_hint(response_code, response_message):
|
|
339
|
+
updated = _append_sandbox_hint(
|
|
340
|
+
updated,
|
|
341
|
+
SANDBOX_DANA_BALANCE_LIMIT_HINT,
|
|
342
|
+
'21000000',
|
|
343
|
+
'after topup',
|
|
344
|
+
)
|
|
345
|
+
elif _should_append_amount_max_hint(response_message):
|
|
346
|
+
updated = _append_sandbox_hint(updated, SANDBOX_AMOUNT_MAX_HINT, str(SANDBOX_MAX_AMOUNT))
|
|
347
|
+
|
|
348
|
+
if updated != str(response_message or ''):
|
|
349
|
+
response.response_message = updated
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
def custom_validation_response(request: Any, response: Any) -> None:
|
|
353
|
+
"""Augment Disbursement responses in sandbox with account/amount guidance."""
|
|
354
|
+
if not _is_sandbox() or request is None or response is None:
|
|
392
355
|
return
|
|
393
|
-
response
|
|
394
|
-
response.response_message,
|
|
395
|
-
SANDBOX_DANA_BALANCE_LIMIT_HINT,
|
|
396
|
-
'21000000',
|
|
397
|
-
'after topup',
|
|
398
|
-
)
|
|
356
|
+
_apply_sandbox_disbursement_hints(request, response)
|
|
399
357
|
|
|
400
358
|
|
|
401
|
-
def
|
|
402
|
-
"""Enrich
|
|
359
|
+
def enrich_disbursement_error(request: Any, exc: ApiException) -> ApiException:
|
|
360
|
+
"""Enrich Disbursement HTTP errors in sandbox (keeps exception; updates reason / data).
|
|
361
|
+
"""
|
|
403
362
|
if not _is_sandbox() or request is None or exc is None:
|
|
404
363
|
return exc
|
|
405
|
-
if request.__class__.__name__ != 'TransferToDanaRequest':
|
|
406
|
-
return exc
|
|
407
364
|
|
|
408
365
|
body = exc.body
|
|
409
366
|
if body is None or body == '':
|
|
@@ -420,13 +377,24 @@ def enrich_transfer_to_dana_error(request: Any, exc: ApiException) -> ApiExcepti
|
|
|
420
377
|
if not isinstance(payload, dict):
|
|
421
378
|
return exc
|
|
422
379
|
|
|
380
|
+
partner_reference_no = str(
|
|
381
|
+
payload.get('partnerReferenceNo')
|
|
382
|
+
or payload.get('originalPartnerReferenceNo')
|
|
383
|
+
or ''
|
|
384
|
+
)
|
|
423
385
|
response = SimpleNamespace(
|
|
424
386
|
response_code=str(payload.get('responseCode') or ''),
|
|
425
387
|
response_message=str(payload.get('responseMessage') or ''),
|
|
426
|
-
partner_reference_no=
|
|
388
|
+
partner_reference_no=partner_reference_no,
|
|
427
389
|
)
|
|
390
|
+
original_msg = response.response_message
|
|
428
391
|
custom_validation_response(request, response)
|
|
429
392
|
|
|
393
|
+
reason = exc.reason
|
|
394
|
+
if response.response_message and response.response_message != original_msg:
|
|
395
|
+
status = exc.status if exc.status is not None else ''
|
|
396
|
+
reason = f'{status}: {response.response_message}'
|
|
397
|
+
|
|
430
398
|
enriched_data = {
|
|
431
399
|
'responseCode': response.response_code,
|
|
432
400
|
'responseMessage': response.response_message,
|
|
@@ -435,12 +403,26 @@ def enrich_transfer_to_dana_error(request: Any, exc: ApiException) -> ApiExcepti
|
|
|
435
403
|
if isinstance(exc.data, dict):
|
|
436
404
|
enriched_data = {**exc.data, **enriched_data}
|
|
437
405
|
|
|
406
|
+
enriched_body = body_str
|
|
407
|
+
if response.response_message != original_msg:
|
|
408
|
+
enriched_payload = dict(payload)
|
|
409
|
+
enriched_payload['responseCode'] = enriched_data['responseCode']
|
|
410
|
+
enriched_payload['responseMessage'] = enriched_data['responseMessage']
|
|
411
|
+
if enriched_data.get('partnerReferenceNo'):
|
|
412
|
+
enriched_payload['partnerReferenceNo'] = enriched_data['partnerReferenceNo']
|
|
413
|
+
enriched_body = json.dumps(enriched_payload)
|
|
414
|
+
|
|
438
415
|
# Preserve subclass (e.g. NotFoundException for HTTP 404) so callers can catch by type
|
|
439
416
|
enriched = type(exc)(
|
|
440
417
|
status=exc.status,
|
|
441
|
-
reason=
|
|
442
|
-
body=
|
|
418
|
+
reason=reason,
|
|
419
|
+
body=enriched_body,
|
|
443
420
|
data=enriched_data,
|
|
444
421
|
)
|
|
445
422
|
enriched.headers = getattr(exc, 'headers', None)
|
|
446
423
|
return enriched
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
def enrich_transfer_to_dana_error(request: Any, exc: ApiException) -> ApiException:
|
|
427
|
+
"""Enrich TransferToDana HTTP errors in sandbox (alias for enrich_disbursement_error)."""
|
|
428
|
+
return enrich_disbursement_error(request, exc)
|