flashpi 0.1.0__tar.gz → 0.2.0__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.
- {flashpi-0.1.0 → flashpi-0.2.0}/CHANGELOG.md +7 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/PKG-INFO +5 -1
- {flashpi-0.1.0 → flashpi-0.2.0}/README.en.md +4 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/README.md +4 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/openapi/openapi.json +14 -15
- {flashpi-0.1.0 → flashpi-0.2.0}/pyproject.toml +1 -1
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_version.py +1 -1
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/types/_generated.py +12 -6
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_resource_types.py +17 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_resources.py +26 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_types.py +5 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/.gitignore +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/LICENSE +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/scripts/__init__.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/scripts/installed_check.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/scripts/openapi.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/scripts/package_check.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/scripts/readme.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/__init__.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_client.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_errors.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_http.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_network.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_pagination.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_resource.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_response.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_validate.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/_webhooks.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/py.typed +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/__init__.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/documents.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/events.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/issuer_onboardings.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/issuers.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/status.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/uploads.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/resources/webhook_endpoints.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/src/flashpi/types/__init__.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/__init__.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/conftest.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/_context.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_01.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_02.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_03.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_04.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_05.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_06.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_07.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_08.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_09.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_10.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_11.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_12.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_13.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_14.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/en_15.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_01.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_02.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_03.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_04.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_05.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_06.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_07.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_08.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_09.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_10.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_11.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_12.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_13.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_14.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/readme/es_15.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/django/__init__.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/django/http/__init__.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/django/views/__init__.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/django/views/decorators/__init__.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/django/views/decorators/csrf.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/django/views/decorators/http.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/fastapi/__init__.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/fastapi/responses.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/examples/typings/flask/__init__.pyi +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/live/__init__.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/live/test_live.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/support.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_cancellation.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_client.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_deadline.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_errors.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_headers.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_http.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_network.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_openapi.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_operations.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_package_check.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_pagination.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_readme.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_retries.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_review_fixes.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_version.py +0 -0
- {flashpi-0.1.0 → flashpi-0.2.0}/tests/test_webhooks.py +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.0](https://github.com/flashpi1/flashpi-python/compare/v0.1.0...v0.2.0) (2026-11-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **types:** let the last payment leave out its amount ([7bd8801](https://github.com/flashpi1/flashpi-python/commit/7bd880165090ea2fc94951894afbf82edbecfa97))
|
|
9
|
+
|
|
3
10
|
## 0.1.0 (2026-11-13)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: flashpi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: The official Python SDK for Flashpi, the electronic invoicing API for Ecuador's SRI.
|
|
5
5
|
Project-URL: Homepage, https://flashpi.com.ec
|
|
6
6
|
Project-URL: Documentation, https://flashpi.com.ec/docs/sdks/
|
|
@@ -103,6 +103,10 @@ Las peticiones y las respuestas son diccionarios con las claves de la API, en ca
|
|
|
103
103
|
(`from flashpi.types import CreateInvoice, Document`). Los montos y cantidades son **textos**
|
|
104
104
|
(`"1.15"`), nunca números, para no perder decimales.
|
|
105
105
|
|
|
106
|
+
El último pago puede ir sin `amount`: Flashpi le pone lo que los demás pagos dejan del total, así
|
|
107
|
+
que aquí `"payments": [{"method": "cash"}]` paga los 1.15. Con varios pagos, ninguno puede ser 0
|
|
108
|
+
(`zero_payment`). Más en las [reglas](https://flashpi.com.ec/docs/documents/#totales).
|
|
109
|
+
|
|
106
110
|
Con el **emisor demo** puedes emitir en pruebas sin subir un certificado: su id está en el
|
|
107
111
|
Resumen de la consola (hasta 50 comprobantes al día). Más en
|
|
108
112
|
[Sandbox y emisor demo](https://flashpi.com.ec/docs/sandbox/).
|
|
@@ -70,6 +70,10 @@ Requests and answers are dictionaries with the API's own keys, in camelCase
|
|
|
70
70
|
(`from flashpi.types import CreateInvoice, Document`). Amounts and quantities are **strings**
|
|
71
71
|
(`"1.15"`), never numbers, so no decimals are lost.
|
|
72
72
|
|
|
73
|
+
The last payment may leave out `amount`: Flashpi gives it what the other payments leave of the
|
|
74
|
+
total, so `"payments": [{"method": "cash"}]` pays the whole 1.15 here. With several payments none
|
|
75
|
+
can be zero (`zero_payment`). See the [rules](https://flashpi.com.ec/docs/en/documents/#totals).
|
|
76
|
+
|
|
73
77
|
With the **demo issuer** you can issue test documents without uploading a certificate: its id is
|
|
74
78
|
on the console's Overview (up to 50 documents a day). See
|
|
75
79
|
[Sandbox and demo issuer](https://flashpi.com.ec/docs/en/sandbox/).
|
|
@@ -72,6 +72,10 @@ Las peticiones y las respuestas son diccionarios con las claves de la API, en ca
|
|
|
72
72
|
(`from flashpi.types import CreateInvoice, Document`). Los montos y cantidades son **textos**
|
|
73
73
|
(`"1.15"`), nunca números, para no perder decimales.
|
|
74
74
|
|
|
75
|
+
El último pago puede ir sin `amount`: Flashpi le pone lo que los demás pagos dejan del total, así
|
|
76
|
+
que aquí `"payments": [{"method": "cash"}]` paga los 1.15. Con varios pagos, ninguno puede ser 0
|
|
77
|
+
(`zero_payment`). Más en las [reglas](https://flashpi.com.ec/docs/documents/#totales).
|
|
78
|
+
|
|
75
79
|
Con el **emisor demo** puedes emitir en pruebas sin subir un certificado: su id está en el
|
|
76
80
|
Resumen de la consola (hasta 50 comprobantes al día). Más en
|
|
77
81
|
[Sandbox y emisor demo](https://flashpi.com.ec/docs/sandbox/).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"paths": {
|
|
4
4
|
"/v1/status": {
|
|
5
5
|
"get": {
|
|
6
|
-
"description": "Public status of Flashpi
|
|
6
|
+
"description": "Public status of the Flashpi API: `operational` whenever the API answers. It reports no components and no SRI availability. Flashpi's status page, https://flashpi.com.ec/status, shows each component and the notices about incidents, maintenance and the SRI.",
|
|
7
7
|
"operationId": "statusGet",
|
|
8
8
|
"parameters": [
|
|
9
9
|
{
|
|
@@ -2686,7 +2686,7 @@
|
|
|
2686
2686
|
}
|
|
2687
2687
|
},
|
|
2688
2688
|
"422": {
|
|
2689
|
-
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
2689
|
+
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, zero_payment, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
2690
2690
|
"content": {
|
|
2691
2691
|
"application/problem+json": {
|
|
2692
2692
|
"schema": {
|
|
@@ -2933,7 +2933,7 @@
|
|
|
2933
2933
|
}
|
|
2934
2934
|
},
|
|
2935
2935
|
"422": {
|
|
2936
|
-
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
2936
|
+
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, zero_payment, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
2937
2937
|
"content": {
|
|
2938
2938
|
"application/problem+json": {
|
|
2939
2939
|
"schema": {
|
|
@@ -3182,7 +3182,7 @@
|
|
|
3182
3182
|
}
|
|
3183
3183
|
},
|
|
3184
3184
|
"422": {
|
|
3185
|
-
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3185
|
+
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, zero_payment, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3186
3186
|
"content": {
|
|
3187
3187
|
"application/problem+json": {
|
|
3188
3188
|
"schema": {
|
|
@@ -3432,7 +3432,7 @@
|
|
|
3432
3432
|
}
|
|
3433
3433
|
},
|
|
3434
3434
|
"422": {
|
|
3435
|
-
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3435
|
+
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, zero_payment, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3436
3436
|
"content": {
|
|
3437
3437
|
"application/problem+json": {
|
|
3438
3438
|
"schema": {
|
|
@@ -3683,7 +3683,7 @@
|
|
|
3683
3683
|
}
|
|
3684
3684
|
},
|
|
3685
3685
|
"422": {
|
|
3686
|
-
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3686
|
+
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, zero_payment, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3687
3687
|
"content": {
|
|
3688
3688
|
"application/problem+json": {
|
|
3689
3689
|
"schema": {
|
|
@@ -3947,7 +3947,7 @@
|
|
|
3947
3947
|
}
|
|
3948
3948
|
},
|
|
3949
3949
|
"422": {
|
|
3950
|
-
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3950
|
+
"description": "validation_failed (see errors; for example invalid_check_digit, final_consumer_not_allowed, not_in_force, unsupported_character, too_many_additional_fields, amount_mismatch, zero_payment, out_of_range for a sync wait above the maximum, demo_issuer_test_only or demo_issuer_sequential_not_allowed with the demo issuer), total_mismatch (expectedTotal differs from the computed total), document_too_large or document_schema_invalid. Or idempotency_key_reused: the Idempotency-Key was used with a different request.",
|
|
3951
3951
|
"content": {
|
|
3952
3952
|
"application/problem+json": {
|
|
3953
3953
|
"schema": {
|
|
@@ -6284,7 +6284,7 @@
|
|
|
6284
6284
|
"description": "Overall status of Flashpi."
|
|
6285
6285
|
}
|
|
6286
6286
|
},
|
|
6287
|
-
"description": "Public status of Flashpi.
|
|
6287
|
+
"description": "Public status of the Flashpi API. Components and SRI notices are on the status page, https://flashpi.com.ec/status.",
|
|
6288
6288
|
"required": [
|
|
6289
6289
|
"status"
|
|
6290
6290
|
]
|
|
@@ -6369,6 +6369,7 @@
|
|
|
6369
6369
|
"too_many_additional_fields",
|
|
6370
6370
|
"reserved_name",
|
|
6371
6371
|
"amount_mismatch",
|
|
6372
|
+
"zero_payment",
|
|
6372
6373
|
"future_date",
|
|
6373
6374
|
"date_too_early",
|
|
6374
6375
|
"date_too_late",
|
|
@@ -8106,7 +8107,7 @@
|
|
|
8106
8107
|
},
|
|
8107
8108
|
"amount": {
|
|
8108
8109
|
"type": "string",
|
|
8109
|
-
"description": "Amount paid with this method.",
|
|
8110
|
+
"description": "Amount paid with this method. Only the last payment may leave it out: Flashpi gives it what the other payments leave of the total (the whole total when it is the only one). With several payments none can be zero (`zero_payment`), the computed one included.",
|
|
8110
8111
|
"example": "10.35",
|
|
8111
8112
|
"pattern": "^\\d{1,12}(\\.\\d{1,2}0*)?$"
|
|
8112
8113
|
},
|
|
@@ -8126,10 +8127,9 @@
|
|
|
8126
8127
|
]
|
|
8127
8128
|
}
|
|
8128
8129
|
},
|
|
8129
|
-
"description": "A payment. The payments must add up to the document total.",
|
|
8130
|
+
"description": "A payment. The payments must add up to the document total; the last one may leave out `amount` to take the rest of the total.",
|
|
8130
8131
|
"required": [
|
|
8131
|
-
"method"
|
|
8132
|
-
"amount"
|
|
8132
|
+
"method"
|
|
8133
8133
|
]
|
|
8134
8134
|
},
|
|
8135
8135
|
"CreateInvoice": {
|
|
@@ -9732,15 +9732,14 @@
|
|
|
9732
9732
|
},
|
|
9733
9733
|
"amount": {
|
|
9734
9734
|
"type": "string",
|
|
9735
|
-
"description": "Amount.",
|
|
9735
|
+
"description": "Amount. Only the last payment may leave it out: it takes what the other payments leave of the supporting document `total`. With several payments none can be zero (`zero_payment`).",
|
|
9736
9736
|
"example": "1150.00",
|
|
9737
9737
|
"pattern": "^\\d{1,12}(\\.\\d{1,2}0*)?$"
|
|
9738
9738
|
}
|
|
9739
9739
|
},
|
|
9740
9740
|
"description": "A payment of the supporting document.",
|
|
9741
9741
|
"required": [
|
|
9742
|
-
"method"
|
|
9743
|
-
"amount"
|
|
9742
|
+
"method"
|
|
9744
9743
|
]
|
|
9745
9744
|
},
|
|
9746
9745
|
"SupportingDocument": {
|
|
@@ -575,7 +575,8 @@ DocumentPaymentTermUnit: TypeAlias = Literal["days", "months"]
|
|
|
575
575
|
|
|
576
576
|
|
|
577
577
|
class DocumentPayment(TypedDict):
|
|
578
|
-
"""A payment. The payments must add up to the document total
|
|
578
|
+
"""A payment. The payments must add up to the document total; the last one may leave out
|
|
579
|
+
`amount` to take the rest of the total."""
|
|
579
580
|
|
|
580
581
|
method: DocumentPaymentMethod
|
|
581
582
|
"""Payment method: `cash` (without the financial system), `debt_offset`, `debit_card`,
|
|
@@ -583,8 +584,10 @@ class DocumentPayment(TypedDict):
|
|
|
583
584
|
transfers, checks and other payments through the financial system) or
|
|
584
585
|
`securities_endorsement`."""
|
|
585
586
|
|
|
586
|
-
amount: str
|
|
587
|
-
"""Amount paid with this method.
|
|
587
|
+
amount: NotRequired[str]
|
|
588
|
+
"""Amount paid with this method. Only the last payment may leave it out: Flashpi gives it
|
|
589
|
+
what the other payments leave of the total (the whole total when it is the only one). With
|
|
590
|
+
several payments none can be zero (`zero_payment`), the computed one included."""
|
|
588
591
|
|
|
589
592
|
term: NotRequired[str]
|
|
590
593
|
"""Payment term in `termUnit` units. Required on purchase settlements."""
|
|
@@ -1107,8 +1110,9 @@ class WithholdingPayment(TypedDict):
|
|
|
1107
1110
|
method: WithholdingPaymentMethod
|
|
1108
1111
|
"""Payment method (same values as `DocumentPayment.method`)."""
|
|
1109
1112
|
|
|
1110
|
-
amount: str
|
|
1111
|
-
"""Amount.
|
|
1113
|
+
amount: NotRequired[str]
|
|
1114
|
+
"""Amount. Only the last payment may leave it out: it takes what the other payments leave of
|
|
1115
|
+
the supporting document `total`. With several payments none can be zero (`zero_payment`)."""
|
|
1112
1116
|
|
|
1113
1117
|
|
|
1114
1118
|
class SupportingDocument(TypedDict):
|
|
@@ -1911,6 +1915,7 @@ FieldErrorCode: TypeAlias = Literal[
|
|
|
1911
1915
|
"too_many_additional_fields",
|
|
1912
1916
|
"reserved_name",
|
|
1913
1917
|
"amount_mismatch",
|
|
1918
|
+
"zero_payment",
|
|
1914
1919
|
"future_date",
|
|
1915
1920
|
"date_too_early",
|
|
1916
1921
|
"date_too_late",
|
|
@@ -2313,7 +2318,8 @@ StatusStatus: TypeAlias = Literal["operational"]
|
|
|
2313
2318
|
|
|
2314
2319
|
|
|
2315
2320
|
class Status(TypedDict):
|
|
2316
|
-
"""Public status of Flashpi.
|
|
2321
|
+
"""Public status of the Flashpi API. Components and SRI notices are on the status page,
|
|
2322
|
+
https://flashpi.com.ec/status."""
|
|
2317
2323
|
|
|
2318
2324
|
status: StatusStatus
|
|
2319
2325
|
"""Overall status of Flashpi."""
|
|
@@ -15,7 +15,9 @@ from flashpi.types import (
|
|
|
15
15
|
CompletedIssuerOnboarding,
|
|
16
16
|
CreateCreditNote,
|
|
17
17
|
CreateInvoice,
|
|
18
|
+
CreateWithholding,
|
|
18
19
|
Document,
|
|
20
|
+
DocumentPayment,
|
|
19
21
|
DocumentXml,
|
|
20
22
|
EmissionPoint,
|
|
21
23
|
Event,
|
|
@@ -24,6 +26,7 @@ from flashpi.types import (
|
|
|
24
26
|
Status,
|
|
25
27
|
WebhookDeliveryDetail,
|
|
26
28
|
WebhookEndpointSecret,
|
|
29
|
+
WithholdingPayment,
|
|
27
30
|
)
|
|
28
31
|
|
|
29
32
|
|
|
@@ -81,3 +84,17 @@ async def runs_with_response_calls_as_tasks(flashpi: AsyncFlashpi, invoice: Crea
|
|
|
81
84
|
async with asyncio.TaskGroup() as group:
|
|
82
85
|
grouped = group.create_task(flashpi.invoices.with_response.create(invoice))
|
|
83
86
|
assert_type(grouped, asyncio.Task[APIResponse[Document]])
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def leaves_out_the_last_payments_amount(
|
|
90
|
+
invoice: CreateInvoice, withholding: CreateWithholding
|
|
91
|
+
) -> None:
|
|
92
|
+
invoice["payments"] = [{"method": "credit_card", "amount": "10.00"}, {"method": "cash"}]
|
|
93
|
+
withholding["supportingDocuments"][0]["payments"] = [{"method": "other_financial_system"}]
|
|
94
|
+
payment: DocumentPayment = {"method": "cash"}
|
|
95
|
+
withheld: WithholdingPayment = {"method": "cash"}
|
|
96
|
+
assert_type(payment.get("amount"), str | None)
|
|
97
|
+
assert_type(withheld.get("amount"), str | None)
|
|
98
|
+
|
|
99
|
+
payment["amount"] = 10.35 # pyright: ignore[reportGeneralTypeIssues]
|
|
100
|
+
withheld = {"amount": "1.00"} # pyright: ignore[reportAssignmentType]
|
|
@@ -15,6 +15,7 @@ import httpx
|
|
|
15
15
|
import pytest
|
|
16
16
|
|
|
17
17
|
from flashpi import APIResponse, APITimeoutError, ConflictError, FlashpiError
|
|
18
|
+
from flashpi.types import CreateInvoice
|
|
18
19
|
from tests.conftest import MakeApi
|
|
19
20
|
from tests.support import (
|
|
20
21
|
ID,
|
|
@@ -392,6 +393,31 @@ class TestIssuingDocuments:
|
|
|
392
393
|
await api.op("invoices.create", {"options": {"waitTimeoutSeconds": 30}})
|
|
393
394
|
assert read_timeout(api.sent[0]) == 5
|
|
394
395
|
|
|
396
|
+
async def test_sends_a_last_payment_without_amount_for_flashpi_to_fill(
|
|
397
|
+
self, make: MakeApi
|
|
398
|
+
) -> None:
|
|
399
|
+
api = make(json_response(document_body(), 202))
|
|
400
|
+
body: CreateInvoice = {
|
|
401
|
+
"issuerId": ISSUER,
|
|
402
|
+
"establishment": "001",
|
|
403
|
+
"emissionPoint": "001",
|
|
404
|
+
"customer": {"idType": "final_consumer"},
|
|
405
|
+
"items": [
|
|
406
|
+
{
|
|
407
|
+
"code": "P-001",
|
|
408
|
+
"description": "Test service",
|
|
409
|
+
"quantity": "1",
|
|
410
|
+
"unitPrice": "10.00",
|
|
411
|
+
"taxes": [{"type": "vat", "rate": "15"}],
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"payments": [{"method": "credit_card", "amount": "10.00"}, {"method": "cash"}],
|
|
415
|
+
}
|
|
416
|
+
await api.op("invoices.create", body)
|
|
417
|
+
payments = sent_json(api.sent[0])["payments"]
|
|
418
|
+
assert payments == [{"method": "credit_card", "amount": "10.00"}, {"method": "cash"}]
|
|
419
|
+
assert "amount" not in payments[1]
|
|
420
|
+
|
|
395
421
|
async def test_sends_a_body_that_is_not_a_dict_as_it_is(self, make: MakeApi) -> None:
|
|
396
422
|
api = make(json_response({}, 202))
|
|
397
423
|
await api.op("invoices.create", [1, 2])
|
|
@@ -19,6 +19,7 @@ from flashpi.types import (
|
|
|
19
19
|
Event,
|
|
20
20
|
EventType,
|
|
21
21
|
FieldError,
|
|
22
|
+
FieldErrorCode,
|
|
22
23
|
Problem,
|
|
23
24
|
ThinWebhookEvent,
|
|
24
25
|
WebhookEndpointVerificationEventData,
|
|
@@ -54,6 +55,10 @@ def test_environments_and_list_params() -> None:
|
|
|
54
55
|
assert params["status"] == "authorized"
|
|
55
56
|
|
|
56
57
|
|
|
58
|
+
def test_field_error_codes_include_zero_payment() -> None:
|
|
59
|
+
assert "zero_payment" in get_args(FieldErrorCode)
|
|
60
|
+
|
|
61
|
+
|
|
57
62
|
def test_every_public_name_is_exported() -> None:
|
|
58
63
|
for name in flashpi.types.__all__:
|
|
59
64
|
assert getattr(flashpi.types, name) is not None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|