From baff7df9c3a28611f222eb8d93e4b5222d04518b Mon Sep 17 00:00:00 2001 From: ChogirmaliYigit Date: Mon, 20 Nov 2023 13:47:11 +0500 Subject: [PATCH 1/5] update: payme-pkg/setup.md --- .idea/.gitignore | 3 + .idea/inspectionProfiles/Project_Default.xml | 30 ++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++ .idea/misc.xml | 10 +++ .idea/modules.xml | 8 ++ .idea/paytech-guides.iml | 10 +++ .idea/vcs.xml | 6 ++ docs/src/en/payme-pkg/setup.md | 74 ++++++++++++++++++- 8 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/paytech-guides.iml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..dcf2cc2 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,30 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5bda262 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..dc53579 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/paytech-guides.iml b/.idea/paytech-guides.iml new file mode 100644 index 0000000..a6903f7 --- /dev/null +++ b/.idea/paytech-guides.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/docs/src/en/payme-pkg/setup.md b/docs/src/en/payme-pkg/setup.md index d8582c3..0bc675d 100644 --- a/docs/src/en/payme-pkg/setup.md +++ b/docs/src/en/payme-pkg/setup.md @@ -3,4 +3,76 @@ title: Setup description: Setup --- -# Setup +# Installation + +Windows +```shell +pip install payme-pkg +``` + +Unix-based OS +```shell +pip3 install payme-pkg +``` + + +# Setup (django) + +1. Add `'payme'` to your installed apps +```python +INSTALLED_APPS = [ + ... + 'payme', + ... +] +``` + +2. Add `payme` credentials to your settings +```python +PAYME: dict = { + 'PAYME_ID': 'payme-id', + 'PAYME_KEY': 'payme-key', + 'PAYME_URL': 'payme-checkout-url', + 'PAYME_CALL_BACK_URL': 'your-callback-url', # merchant api callback url + 'PAYME_MIN_AMOUNT': 'payme-min-amount', # integer field + 'PAYME_ACCOUNT': 'order-id', +} + +ORDER_MODEL = 'your_app.models.Your_Order_Model' +``` + +3. Create a new view that about handling callbacks +```python +from payme.views import MerchantAPIView + + +class PaymeCallBackAPIView(MerchantAPIView): + def create_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"create_transaction for order_id: {order_id}, response: {action}") + + def perform_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"perform_transaction for order_id: {order_id}, response: {action}") + + def cancel_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"cancel_transaction for order_id: {order_id}, response: {action}") +``` + +4. Add a `payme` path to core of urlpatterns +```python +from django.urls import path + +from your_app.views import PaymeCallBackAPIView + +urlpatterns = [ + ... + path("payments/merchant/", PaymeCallBackAPIView.as_view()), + ... +] +``` + +5. Run migrations +```shell +python manage.py makemigrations +``` + +> 🎉 Congratulations you have been integrated merchant api methods with django, keep reading docs. After successfully migrations check your admin panel and see results what happened. From 027c4a4833c76646c323ad0102c9f2e62c7ff31b Mon Sep 17 00:00:00 2001 From: ChogirmaliYigit Date: Mon, 20 Nov 2023 13:48:05 +0500 Subject: [PATCH 2/5] fix: deleted .idea dir --- .gitignore | 3 +- .idea/.gitignore | 3 -- .idea/inspectionProfiles/Project_Default.xml | 30 ------------------- .../inspectionProfiles/profiles_settings.xml | 6 ---- .idea/misc.xml | 10 ------- .idea/modules.xml | 8 ----- .idea/paytech-guides.iml | 10 ------- .idea/vcs.xml | 6 ---- 8 files changed, 2 insertions(+), 74 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/paytech-guides.iml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index 99c7291..ad86c17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ venv/ -env/ \ No newline at end of file +env/ +.idea/ diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index dcf2cc2..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 5bda262..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index dc53579..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/paytech-guides.iml b/.idea/paytech-guides.iml deleted file mode 100644 index a6903f7..0000000 --- a/.idea/paytech-guides.iml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 8f189393ed90ec7aecc43bbcbd1d6af969d011f5 Mon Sep 17 00:00:00 2001 From: ChogirmaliYigit Date: Mon, 20 Nov 2023 21:54:49 +0500 Subject: [PATCH 3/5] written docs for payme-pkg :rocket: --- docs/src/en/payme-pkg/index.md | 6 +- .../src/en/payme-pkg/initializing-payments.md | 48 ++ docs/src/en/payme-pkg/merchant-api.md | 36 + docs/src/en/payme-pkg/setup.md | 5 +- docs/src/en/payme-pkg/subscribe-api.md | 788 ++++++++++++++++++ mkdocs.yml | 1 + 6 files changed, 879 insertions(+), 5 deletions(-) create mode 100644 docs/src/en/payme-pkg/initializing-payments.md diff --git a/docs/src/en/payme-pkg/index.md b/docs/src/en/payme-pkg/index.md index 7adecc7..dac12cc 100644 --- a/docs/src/en/payme-pkg/index.md +++ b/docs/src/en/payme-pkg/index.md @@ -2,4 +2,8 @@ title: Introduction --- -# **Welcome!** +# **Introduction** + +Welcome to our [payme-pkg](https://github.com/PayTechUz/payme-pkg/tree/master){:target="_blank"} package's documentation. + +You can keep reading the docs. See [setup section](setup/). diff --git a/docs/src/en/payme-pkg/initializing-payments.md b/docs/src/en/payme-pkg/initializing-payments.md new file mode 100644 index 0000000..0f034ca --- /dev/null +++ b/docs/src/en/payme-pkg/initializing-payments.md @@ -0,0 +1,48 @@ +--- +title: Initializing payments +description: Initializing payments +--- + +# [Generate pay link](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/generate_link.py){:target="_blank"} + +- Example +```python +from pprint import pprint + +from payme.methods.generate_link import GeneratePayLink + +pay_link = GeneratePayLink( + order_id="999", + amount=9999, + callback_url="your-callback-url" +).generate_link() + +pprint(pay_link) +``` +- Output +```shell +https://checkout.paycom.uz/bT01ZTczMGU4ZTBiODUyYTQxN2FhNDljZWI7YWMub3JkZXItaWQ9OTk5O2E9OTk5OTtjPXlvdXItY2FsbGJhY2stdXJs +``` + +- Parameters + +| Argument | Type | Description | +|--------------|---------|----------------------------------------------------------------------------------------------------------------------------------| +| order_id | str | _Required_. The order_id for paying | +| amount | Decimal | _Required_. The amount belong to the order | +| callback_url | str | _Optional_. The merchant api callback url to redirect after payment. By default, it takes PAYME_CALL_BACK_URL from your settings | + +### Methods +- generate_link() -> to generate payment link. +> Does not take any arguments +- to_tiyin() -> convert from sum to tiyin. + +| Argument | Type | Description | +|----------|---------|------------------------------| +| amount | Decimal | _Required_. The order amount | + +- to_sum() -> convert from tiyin to sum. + +| Argument | Type | Description | +|----------|---------|------------------------------| +| amount | Decimal | _Required_. The order amount | diff --git a/docs/src/en/payme-pkg/merchant-api.md b/docs/src/en/payme-pkg/merchant-api.md index 83c1c74..974dc06 100644 --- a/docs/src/en/payme-pkg/merchant-api.md +++ b/docs/src/en/payme-pkg/merchant-api.md @@ -4,3 +4,39 @@ description: Merchant API methods --- # Merchant API methods + +### [CheckPerformTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/check_perform_transaction.py){:target="_blank"} +_That's used to check perform transaction_ +> **Has no methods** + + +### [CreateTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/create_transaction.py){:target="_blank"} +_That's used to create transaction_ + + +#### Methods +- _convert_ms_to_datetime() -> convert from time ms to datetime format + +| Argument | Type | Description | +|----------|------|------------------------------------| +| time_ms | int | _Required_. The time ms to convert | + + +### [PerformTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/perform_transaction.py){:target="_blank"} +_That's used to perform a transaction_ +> **Has no methods** + + +### [CancelTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/cancel_transaction.py){:target="_blank"} +_That is used to cancel a transaction_ +> **Has no methods** + + +### [CheckTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/check_transaction.py){:target="_blank"} +_That's used to check transaction_ +> **Has no methods** + + +### [GetStatement](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/get_statement.py){:target="_blank"} +_Transaction information is used for reconciliation of merchant and Payme Business transactions_ +> **Has no methods** diff --git a/docs/src/en/payme-pkg/setup.md b/docs/src/en/payme-pkg/setup.md index 0bc675d..6051e1a 100644 --- a/docs/src/en/payme-pkg/setup.md +++ b/docs/src/en/payme-pkg/setup.md @@ -4,7 +4,6 @@ description: Setup --- # Installation - Windows ```shell pip install payme-pkg @@ -14,10 +13,8 @@ Unix-based OS ```shell pip3 install payme-pkg ``` - - +
# Setup (django) - 1. Add `'payme'` to your installed apps ```python INSTALLED_APPS = [ diff --git a/docs/src/en/payme-pkg/subscribe-api.md b/docs/src/en/payme-pkg/subscribe-api.md index 95b8128..878e155 100644 --- a/docs/src/en/payme-pkg/subscribe-api.md +++ b/docs/src/en/payme-pkg/subscribe-api.md @@ -4,3 +4,791 @@ description: Subscribe API methods --- # Subscribe API methods + +## [PaymeSubscribeCards](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/cards/subscribe_cards.py){:target="_blank"} +_The PaymeSubscribeCards class includes all paycom methods which are belongs to cards_ + +### cards_create() +_To create a new card's token_ + +| Argument | Type | Description | +|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| number | str | _Required_. The card number maximum length 18 char | +| expire | str | _Required_. The card expiration string maximum length 5 char | +| save | boolean | _Optional_. **By default it equals true**. Type of token. The option is enabled or disabled depending on the application's business logic. If the flag is true, the token can be used for further payments. If the flag is false the token can only be used once. The one-time token is deleted after payment | + +> Example to cards create method +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id" +) + +response = client.cards_create( + number="8600069195406311", + expire="0399", + save=True +) + +pprint(response) +``` +> Example response +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63119784d15d8d8d093b37b8_ADHrAykwnAIc2hm4hPPriktZ8nnuvR96S9Kzmjb3Fcix25IrJmMKrGxP9VUEP9rRDKRhtYjUw0vsXON7PYEyMCHtDKpMuM4krrIk8jdnyK7bXkSBSCyiGs2aahIrep6TSodIAxqutMJ4g3O8FZ8vC1DSMKzOaX0UF8fDKNexXV039Qnj4bNQc6NcpKGJn0wUX8d0RBqkmKid4WyUQnT987ZQDM2mT2IGNZtugvN4tDJTXBVTpqCWkXnZ0YWj64Ye0ztr91Mibtndo0Y1s5nCA6wufUZZugJ6c7rse19XNFSSieFM7AWi9VqybMe4eeWiZEBriAbFhrf8kQvrpBmwUEp05GjvFMgH0ku3vyUtSuJI36exHheXuJK66KstcX1i69EaF3", + "recurrent": true, + "verify": false, + "type": "22618" + } + } +} +``` + +### card_get_verify_code() +_To get the verification code_ + +| Argument | Type | Description | +|----------|---------|-----------------------------------------| +| token | str | _Required_. The card's non-active token | + +> Example to card get verify code +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id" +) + +resp = client.card_get_verify_code( + token="630e5ffdd15d8d8d093b379b_2fsaoABWafecn20kofV4PFafFZjeGDWS9adM1PmboQaEZbbaxMcnaskctMbU9Iv8qgrOuKGz8SnjvZvYXDK64m1eS9gA5jZ7BBRaQybMXrDPtFPJ1fwek5B1KoIv5cMiCWYXj7ezpYEdJAKTIQw0Np9HsTXjqco4gQG3m8MOfeH9ovkdm66O6yj45oKXRmJyAK5i0SchXNNomACH3Oq80KyoRE1VoBRxvoKyMkOx0xcepXovxK9d3v26a8z7UtyokwY33N8MupviM3A5WHB5Xh35WZJJyFnxTSi1vvnYnG7uVd6Bb1GjV2yAHnimss8aEZGW5V7ZiPrhf8r6WJAeHciYDGK3msRKZJBQTfjgOdE9tGrEnMezVkxr1JXX0xSn5qqec2" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "result": { + "sent": true, + "phone": "99890*****66", + "wait": 60000 + } +} +``` + +### cards_verify() +_Verification of the card using the code sent via SMS_ + +| Argument | Type | Description | +|-------------|---------|-----------------------------------------| +| verify_code | str | _Required_. Code for verification | +| token | str | _Required_. The card's non-active token | + +> Example to cards verify +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id" +) + +resp = client.cards_verify( + verify_code="666666", + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63118a5dd15d8d8d093b37b7_X2j34OIJPnROfsgzYZCZ0w7OcC50zzwiowTsotEVO1uUbxkzaDrvdOno6jicQTrcRmxvibxrye4vUS3AynTNPaPCTGpfk3RCKmT9NaOAyyTmctAjWsjwvqGR5XUzAP1Xcx12GkhuQi6VJ4BeaIXOokSRu06rRjaivmJQ8HTiJiR9b3OmZtrhkIRNcNXnnp9zYm1mFP4BuqGpS8BMnY0ASIE6ffxWykjgBcDTAfWBFt4mg7O9Dsvx0aj3IB8z3RIbZYtDZJnUVhCZrwW7ONVI9uEAdxNthorjO6PbV7TQ8XCjrztgGf6uCtOwwxasiIUVZN6tCVDk8A8NvVSUzUHXQHVkaPn5heJNa3K4WsffIckq7SwMbiw3UbawipeZKyD3iwk1Km", + "recurrent": true, + "verify": true, + "type": "22618" + } + } +} +``` + +### cards_check() +_Checking the card token active or non-active_ + +| Argument | Type | Description | +|----------|---------|-----------------------------------------| +| token | str | _Required_. The card's non-active token | + +> Example to cards check +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id" +) + +resp = client.cards_check( + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63119b36d15d8d8d093b37c1_IJtHxZ46h5viyo8RIJCmQyE8qBw6PUWUdFKTMCVWrPoMMi4kJYsKyVdjQrIx6a12jDfEPVhhEqWm94FYvYh7IEjIs4xn0n3mM8Quw5dhd6ZT0dOK6u1spqWRMIDBpDMhHj2Ga8zZMAfeoiDAcrWScXS1AP2tkQHcJ40rBzHGHS6DoVeIheF70c0wO1kVQG0G5hDWguSGf2ZRFcBtpabv5BQkqSchxWKdCSVPIGiS6X7eF8YStdz1aGPzFyjDbaKT0vXNUMbQ7gaKh4PeQbruVVwFDfeIWqGeNmgCCPU4X0wCHFjTt8K61e9VOauNeU81ckoKHD8XGzCwGFJHrC4sHvNv4no3RifWhHCQF9GmFKf8cP2qh4pqTKwu3gOITaX5Ss71tC", + "recurrent": true, + "verify": true, + "type": "22618" + } + } +} +``` + +### cards_remove() +_Delete card's token on success returns success_ + +| Argument | Type | Description | +|----------|---------|-----------------------------------------| +| token | str | _Required_. The card's non-active token | + +> Example to cards remove +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id" +) + +resp = client.cards_remove( + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "result": { + "success": true + } +} +``` + + +## [PaymeSubscribeReceipts](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/receipts/subscribe_receipts.py){:target="_blank"} +_The PaymeSubscribeReceipts class includes all paycom methods which are belongs receipts part_ + +### receipts_create() +_To create a new payment receipt_ + +| Argument | Type | Description | +|----------|-------|--------------------------------------| +| amount | float | _Required_. Payment amount in tiyins | +| order_id | int | _Required_. Order object ID | + +> Example to receipts create +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id", + paycom_key="your-paycom-key" +) + +resp = rclient.receipts_create( + amount=10000, + order_id=1 +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098412270, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + } + } +} +``` + +### receipts_pay() +_To pay for an exist receipt_ + +| Argument | Type | Description | +|------------|------|-------------------------------------------------| +| invoice_id | str | _Required_. Invoice id for identity transaction | +| token | str | _Required_. The card's active token | +| phone | str | _Required_. The payer's phone number | + +> Example to receipts pay +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id", + paycom_key="your-paycom-key" +) + +resp = rclient.receipts_pay( + invoice_id="631186b6c4420cbf2712a243", + token="63118a5dd15d8d8d093b37b7_X2j34OIJPnROfsgzYZCZ0w7OcC50zzwiowTsotEVO1uUbxkzaDrvdOno6jicQTrcRmxvibxrye4vUS3AynTNPaPCTGpfk3RCKmT9NaOAyyTmctAjWsjwvqGR5XUzAP1Xcx12GkhuQi6VJ4BeaIXOokSRu06rRjaivmJQ8HTiJiR9b3OmZtrhkIRNcNXnnp9zYm1mFP4BuqGpS8BMnY0ASIE6ffxWykjgBcDTAfWBFt4mg7O9Dsvx0aj3IB8z3RIbZYtDZJnUVhCZrwW7ONVI9uEAdxNthorjO6PbV7TQ8XCjrztgGf6uCtOwwxasiIUVZN6tCVDk8A8NvVSUzUHXQHVkaPn5heJNa3K4WsffIckq7SwMbiw3UbawipeZKyD3iwk1Km", + phone="998901304527" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098438706, + "pay_time": 1662098438804, + "cancel_time": 0, + "state": 4, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": { + "number": "860006******6311", + "expire": "9903" + }, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": 0 + } + } +} +``` + +### receipts_send() +_To send a receipt for payment in an SMS message_ + +| Argument | Type | Description | +|------------|------|-------------------------------------------------| +| invoice_id | str | _Required_. Invoice id for identity transaction | +| phone | str | _Required_. The payer's phone number | + +> Example to receipts send +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id", + paycom_key="your-paycom-key" +) + +resp = rclient.receipts_send( + invoice_id="631186b6c4420cbf2712a243", + phone="998901304527" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "success": true + } +} +``` + + +### receipts_cancel() +_A paid check in the queue for cancellation_ + +| Argument | Type | Description | +|------------|------|-------------------------------------------------| +| invoice_id | str | _Required_. Invoice id for identity transaction | + +> Example to receipts cancel +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id", + paycom_key="your-paycom-key" +) + +resp = rclient.receipts_cancel( + invoice_id="63119303c4420cbf2712a245" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098438706, + "pay_time": 1662098438804, + "cancel_time": 0, + "state": 21, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": { + "number": "860006******6311", + "expire": "9903" + }, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb", + "source_cancel": "subscribe" + }, + "processing_id": null + } + } +} +``` + + +### receipts_check() +_Check for an exist receipt_ + +| Argument | Type | Description | +|------------|------|-------------------------------------------------| +| invoice_id | str | _Required_. Invoice id for identity transaction | + +> Example to receipts check +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id", + paycom_key="your-paycom-key" +) + +resp = rclient.receipts_check( + invoice_id="63119303c4420cbf2712a245" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "state": 0 + } +} +``` + + +### receipts_get() +_Check status for an exist receipt_ + +| Argument | Type | Description | +|------------|------|-------------------------------------------------| +| invoice_id | str | _Required_. Invoice id for identity transaction | + +> Example to receipts get +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id", + paycom_key="your-paycom-key" +) + +resp = rclient.receipts_get( + invoice_id="6311946bc4420cbf2712a247" +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "6311946bc4420cbf2712a247", + "create_time": 1662096491076, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2325", + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + } + } +} +``` + + +### receipts_get_all() +_Get all complete information, on checks for a certain period_ + +| Argument | Type | Description | +|----------|------|------------------------------------------------------| +| count | int | _Required_. The number of checks. Maximum value - 50 | +| _from | int | _Required_. The date of the beginning | +| _to | int | _Required_. The date of the ending | +| offset | int | _Required_. The number of subsequent skipped checks | + +> Example to receipts get all +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="your-paycom-id", + paycom_key="your-paycom-key" +) + +resp = rclient.receipts_get_all( + count=2, + _from=1636398000000, + _to=1636398000000, + offset=0 +) + +pprint(resp) +``` + +> Example response +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": [ + { + "_id": "6311946bc4420cbf2712a247", + "create_time": 1662096491076, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": { + "ru": "Номер чека", + "uz": "Chek raqami" + }, + "value": 2325, + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": { + "ru": "Internet", + "uz": "Internet" + }, + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + }, + { + "_id": "63119303c4420cbf2712a245", + "create_time": 1662096131667, + "pay_time": 0, + "cancel_time": 1662096182979, + "state": 50, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": { + "ru": "Номер чека", + "uz": "Chek raqami" + }, + "value": 2324, + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": { + "ru": "Internet", + "uz": "Internet" + }, + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb", + "source_cancel": "subscribe" + }, + "processing_id": null + } + ] +} +``` diff --git a/mkdocs.yml b/mkdocs.yml index bbd6a59..e28b7e1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -79,6 +79,7 @@ nav: - payme-pkg/setup.md - payme-pkg/merchant-api.md - payme-pkg/subscribe-api.md + - payme-pkg/initializing-payments.md - payme-pkg/sandbox.md - Support: support.md From 3377387422b24cda203a6edff8341ddd5971a1a1 Mon Sep 17 00:00:00 2001 From: ChogirmaliYigit Date: Thu, 23 Nov 2023 18:32:53 +0500 Subject: [PATCH 4/5] update: uz and ru langs --- .../src/en/payme-pkg/initializing-payments.md | 7 +- docs/src/en/payme-pkg/setup.md | 1 + docs/src/ru/payme-pkg/index.md | 6 +- .../src/ru/payme-pkg/initializing-payments.md | 49 ++ docs/src/ru/payme-pkg/merchant-api.md | 36 + docs/src/ru/payme-pkg/setup.md | 72 +- docs/src/ru/payme-pkg/subscribe-api.md | 788 +++++++++++++++++ docs/src/uz/payme-pkg/index.md | 6 +- .../src/uz/payme-pkg/initializing-payments.md | 49 ++ docs/src/uz/payme-pkg/merchant-api.md | 36 + docs/src/uz/payme-pkg/setup.md | 72 +- docs/src/uz/payme-pkg/subscribe-api.md | 789 ++++++++++++++++++ 12 files changed, 1904 insertions(+), 7 deletions(-) create mode 100644 docs/src/ru/payme-pkg/initializing-payments.md create mode 100644 docs/src/uz/payme-pkg/initializing-payments.md diff --git a/docs/src/en/payme-pkg/initializing-payments.md b/docs/src/en/payme-pkg/initializing-payments.md index 0f034ca..394a336 100644 --- a/docs/src/en/payme-pkg/initializing-payments.md +++ b/docs/src/en/payme-pkg/initializing-payments.md @@ -5,7 +5,7 @@ description: Initializing payments # [Generate pay link](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/generate_link.py){:target="_blank"} -- Example +> Example ```python from pprint import pprint @@ -19,7 +19,7 @@ pay_link = GeneratePayLink( pprint(pay_link) ``` -- Output +> Output ```shell https://checkout.paycom.uz/bT01ZTczMGU4ZTBiODUyYTQxN2FhNDljZWI7YWMub3JkZXItaWQ9OTk5O2E9OTk5OTtjPXlvdXItY2FsbGJhY2stdXJs ``` @@ -34,7 +34,8 @@ https://checkout.paycom.uz/bT01ZTczMGU4ZTBiODUyYTQxN2FhNDljZWI7YWMub3JkZXItaWQ9O ### Methods - generate_link() -> to generate payment link. -> Does not take any arguments +> **Does not take any arguments** + - to_tiyin() -> convert from sum to tiyin. | Argument | Type | Description | diff --git a/docs/src/en/payme-pkg/setup.md b/docs/src/en/payme-pkg/setup.md index 6051e1a..c719c85 100644 --- a/docs/src/en/payme-pkg/setup.md +++ b/docs/src/en/payme-pkg/setup.md @@ -14,6 +14,7 @@ Unix-based OS pip3 install payme-pkg ```
+ # Setup (django) 1. Add `'payme'` to your installed apps ```python diff --git a/docs/src/ru/payme-pkg/index.md b/docs/src/ru/payme-pkg/index.md index 5554065..2ffc50c 100644 --- a/docs/src/ru/payme-pkg/index.md +++ b/docs/src/ru/payme-pkg/index.md @@ -2,4 +2,8 @@ title: Введение --- -# **Добро пожаловать!** +# **Введение** + +Добро пожаловать в документацию нашего пакета [payme-pkg](https://github.com/PayTechUz/payme-pkg/tree/master){:target="_blank"}. + +Продолжайте читать документацию. Смотреть [раздел настройки](setup/). diff --git a/docs/src/ru/payme-pkg/initializing-payments.md b/docs/src/ru/payme-pkg/initializing-payments.md new file mode 100644 index 0000000..9a34767 --- /dev/null +++ b/docs/src/ru/payme-pkg/initializing-payments.md @@ -0,0 +1,49 @@ +--- +title: Инициализация платежей +description: Инициализация платежей +--- + +# [Generate pay link](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/generate_link.py){:target="_blank"} + +> Пример +```python +from pprint import pprint + +from payme.methods.generate_link import GeneratePayLink + +pay_link = GeneratePayLink( + order_id="999", + amount=9999, + callback_url="callback-url" +).generate_link() + +pprint(pay_link) +``` +> Результат +```shell +https://checkout.paycom.uz/bT01ZTczMGU4ZTBiODUyYTQxN2FhNDljZWI7YWMub3JkZXItaWQ9OTk5O2E9OTk5OTtjPXlvdXItY2FsbGJhY2stdXJs +``` + +- Параметры + +| Аргумент | Тип | Описание | +|--------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| order_id | str | _Oбязательный_. ID заказа для оплаты | +| amount | Decimal | _Oбязательный_. Сумма принадлежит заказу | +| callback_url | str | _Необязательный_. URL обратного вызова API продавца, который будет перенаправлен после оплаты. По умолчанию требуется PAYME_CALL_BACK_URL из ваших настроек. | + +### Методы +- generate_link() -> создать ссылку для оплаты. +> **Не принимает никаких аргументов** + +- to_tiyin() -> перевести сум в тийин. + +| Аргумент | Тип | Описание | +|----------|---------|------------------------------| +| amount | Decimal | _Oбязательный_. Сумма заказа | + +- to_sum() -> convert from tiyin to sum. + +| Аргумент | Тип | Описание | +|----------|---------|------------------------------| +| amount | Decimal | _Oбязательный_. Сумма заказа | diff --git a/docs/src/ru/payme-pkg/merchant-api.md b/docs/src/ru/payme-pkg/merchant-api.md index 1398766..d074637 100644 --- a/docs/src/ru/payme-pkg/merchant-api.md +++ b/docs/src/ru/payme-pkg/merchant-api.md @@ -4,3 +4,39 @@ description: Методы Merchant API --- # Методы Merchant API + +### [CheckPerformTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/check_perform_transaction.py){:target="_blank"} +_Это используется для проверки выполнения транзакции_ +> **Не имеет методов** + + +### [CreateTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/create_transaction.py){:target="_blank"} +_Это используется для создания транзакции_ + + +#### Методы +- _convert_ms_to_datetime() -> конвертировать время из мс в формат даты и времени + +| Аргумент | Тип | Описание | +|----------|------|----------------------------------------| +| time_ms | int | _Oбязательный_. Время конвертации в мс | + + +### [PerformTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/perform_transaction.py){:target="_blank"} +_Это используется для выполнения транзакции_ +> **Не имеет методов** + + +### [CancelTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/cancel_transaction.py){:target="_blank"} +_Используется для отмены транзакции_ +> **Не имеет методов** + + +### [CheckTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/check_transaction.py){:target="_blank"} +_Это используется для проверки транзакции_ +> **Не имеет методов** + + +### [GetStatement](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/get_statement.py){:target="_blank"} +_Информация о транзакциях используется для сверки транзакций продавца и Payme Business._ +> **Не имеет методов** diff --git a/docs/src/ru/payme-pkg/setup.md b/docs/src/ru/payme-pkg/setup.md index 38307c2..512b70d 100644 --- a/docs/src/ru/payme-pkg/setup.md +++ b/docs/src/ru/payme-pkg/setup.md @@ -3,4 +3,74 @@ title: Настройка description: Настройка --- -# Настройка +# Установка +Windows +```shell +pip install payme-pkg +``` + +Unix-based OS +```shell +pip3 install payme-pkg +``` +
+ +# Настройка (Джанго) +1. Добавьте `'payme'` в установленные приложения. +```python +INSTALLED_APPS = [ + ... + 'payme', + ... +] +``` + +2. Добавьте учетные данные `'payme'` в свои настройки. +```python +PAYME: dict = { + 'PAYME_ID': 'payme-id', + 'PAYME_KEY': 'payme-key', + 'PAYME_URL': 'payme-checkout-url', + 'PAYME_CALL_BACK_URL': 'your-callback-url', # merchant api callback url + 'PAYME_MIN_AMOUNT': 'payme-min-amount', # integer field + 'PAYME_ACCOUNT': 'order-id', +} + +ORDER_MODEL = 'your_app.models.Your_Order_Model' +``` + +3. Создайте новое представление об обработке обратных вызовов. +```python +from payme.views import MerchantAPIView + + +class PaymeCallBackAPIView(MerchantAPIView): + def create_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"create_transaction for order_id: {order_id}, response: {action}") + + def perform_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"perform_transaction for order_id: {order_id}, response: {action}") + + def cancel_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"cancel_transaction for order_id: {order_id}, response: {action}") +``` + +4. Добавьте путь `payme` в ядро URL-шаблонов. +```python +from django.urls import path + +from your_app.views import PaymeCallBackAPIView + +urlpatterns = [ + ... + path("payments/merchant/", PaymeCallBackAPIView.as_view()), + ... +] +``` + +5. Запуск миграции +```shell +python manage.py makemigrations +``` + +> 🎉 Поздравляем, вы интегрировали методы торгового API с Django, продолжайте читать документацию. После успешной миграции проверьте панель администратора и посмотрите, что произошло. diff --git a/docs/src/ru/payme-pkg/subscribe-api.md b/docs/src/ru/payme-pkg/subscribe-api.md index b1fe530..3489112 100644 --- a/docs/src/ru/payme-pkg/subscribe-api.md +++ b/docs/src/ru/payme-pkg/subscribe-api.md @@ -4,3 +4,791 @@ description: Методы Subscribe API --- # Методы Subscribe API + +## [PaymeSubscribeCards](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/cards/subscribe_cards.py){:target="_blank"} +_Класс PaymeSubscribeCards включает в себя все методы paycom, принадлежащие картам._ + +### cards_create() +_Чтобы создать токен новой карты_ + +| Аргумент | Тип | Описание | +|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| number | str | _Oбязательный_. Номер карты. Максимальная длина 18 символов. | +| expire | str | _Oбязательный_. Строка срока действия карты. Максимальная длина 5 символов. | +| save | boolean | _Необязательный_. **По умолчанию оно равно true**. Тип токена. Опция включается или отключается в зависимости от бизнес-логики приложения. Если флаг true, токен можно использовать для дальнейших платежей. Если флаг false, токен можно использовать только один раз. Одноразовый токен удаляется после оплаты | + +> Пример метода создания карточка +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +response = client.cards_create( + number="8600069195406311", + expire="0399", + save=True +) + +pprint(response) +``` +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63119784d15d8d8d093b37b8_ADHrAykwnAIc2hm4hPPriktZ8nnuvR96S9Kzmjb3Fcix25IrJmMKrGxP9VUEP9rRDKRhtYjUw0vsXON7PYEyMCHtDKpMuM4krrIk8jdnyK7bXkSBSCyiGs2aahIrep6TSodIAxqutMJ4g3O8FZ8vC1DSMKzOaX0UF8fDKNexXV039Qnj4bNQc6NcpKGJn0wUX8d0RBqkmKid4WyUQnT987ZQDM2mT2IGNZtugvN4tDJTXBVTpqCWkXnZ0YWj64Ye0ztr91Mibtndo0Y1s5nCA6wufUZZugJ6c7rse19XNFSSieFM7AWi9VqybMe4eeWiZEBriAbFhrf8kQvrpBmwUEp05GjvFMgH0ku3vyUtSuJI36exHheXuJK66KstcX1i69EaF3", + "recurrent": true, + "verify": false, + "type": "22618" + } + } +} +``` + +### card_get_verify_code() +_Чтобы получить код подтверждения_ + +| Аргумент | Тип | Описание | +|----------|-------|----------------------------------------| +| token | str | _Oбязательный_. Неактивный токен карты | + +> Пример получения кода подтверждения карты +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.card_get_verify_code( + token="630e5ffdd15d8d8d093b379b_2fsaoABWafecn20kofV4PFafFZjeGDWS9adM1PmboQaEZbbaxMcnaskctMbU9Iv8qgrOuKGz8SnjvZvYXDK64m1eS9gA5jZ7BBRaQybMXrDPtFPJ1fwek5B1KoIv5cMiCWYXj7ezpYEdJAKTIQw0Np9HsTXjqco4gQG3m8MOfeH9ovkdm66O6yj45oKXRmJyAK5i0SchXNNomACH3Oq80KyoRE1VoBRxvoKyMkOx0xcepXovxK9d3v26a8z7UtyokwY33N8MupviM3A5WHB5Xh35WZJJyFnxTSi1vvnYnG7uVd6Bb1GjV2yAHnimss8aEZGW5V7ZiPrhf8r6WJAeHciYDGK3msRKZJBQTfjgOdE9tGrEnMezVkxr1JXX0xSn5qqec2" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "result": { + "sent": true, + "phone": "99890*****66", + "wait": 60000 + } +} +``` + +### cards_verify() +_Верификация карты с помощью кода, отправленного по SMS_ + +| Аргумент | Тип | Описание | +|-------------|------|----------------------------------------| +| verify_code | str | _Oбязательный_. Код для проверки | +| token | str | _Oбязательный_. Неактивный токен карты | + +> Пример проверки карты +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.cards_verify( + verify_code="666666", + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63118a5dd15d8d8d093b37b7_X2j34OIJPnROfsgzYZCZ0w7OcC50zzwiowTsotEVO1uUbxkzaDrvdOno6jicQTrcRmxvibxrye4vUS3AynTNPaPCTGpfk3RCKmT9NaOAyyTmctAjWsjwvqGR5XUzAP1Xcx12GkhuQi6VJ4BeaIXOokSRu06rRjaivmJQ8HTiJiR9b3OmZtrhkIRNcNXnnp9zYm1mFP4BuqGpS8BMnY0ASIE6ffxWykjgBcDTAfWBFt4mg7O9Dsvx0aj3IB8z3RIbZYtDZJnUVhCZrwW7ONVI9uEAdxNthorjO6PbV7TQ8XCjrztgGf6uCtOwwxasiIUVZN6tCVDk8A8NvVSUzUHXQHVkaPn5heJNa3K4WsffIckq7SwMbiw3UbawipeZKyD3iwk1Km", + "recurrent": true, + "verify": true, + "type": "22618" + } + } +} +``` + +### cards_check() +_Проверка активности или неактивности токена карты_ + +| Аргумент | Тип | Описание | +|----------|-------|----------------------------------------| +| token | str | _Oбязательный_. Неактивный токен карты | + +> Пример проверки карт +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.cards_check( + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63119b36d15d8d8d093b37c1_IJtHxZ46h5viyo8RIJCmQyE8qBw6PUWUdFKTMCVWrPoMMi4kJYsKyVdjQrIx6a12jDfEPVhhEqWm94FYvYh7IEjIs4xn0n3mM8Quw5dhd6ZT0dOK6u1spqWRMIDBpDMhHj2Ga8zZMAfeoiDAcrWScXS1AP2tkQHcJ40rBzHGHS6DoVeIheF70c0wO1kVQG0G5hDWguSGf2ZRFcBtpabv5BQkqSchxWKdCSVPIGiS6X7eF8YStdz1aGPzFyjDbaKT0vXNUMbQ7gaKh4PeQbruVVwFDfeIWqGeNmgCCPU4X0wCHFjTt8K61e9VOauNeU81ckoKHD8XGzCwGFJHrC4sHvNv4no3RifWhHCQF9GmFKf8cP2qh4pqTKwu3gOITaX5Ss71tC", + "recurrent": true, + "verify": true, + "type": "22618" + } + } +} +``` + +### cards_remove() +_Удалить токен карты в случае успеха возвращает успех_ + +| Аргумент | Тип | Описание | +|----------|--------|----------------------------------------| +| token | str | _Oбязательный_. Неактивный токен карты | + +> Пример удаления карт +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.cards_remove( + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "result": { + "success": true + } +} +``` + + +## [PaymeSubscribeReceipts](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/receipts/subscribe_receipts.py){:target="_blank"} +_Класс PaymeSubscribeReceipts включает в себя все методы paycom, относящиеся к квитанциям._ + +### receipts_create() +_Чтобы создать новую квитанцию об оплате_ + +| Аргумент | Тип | Описание | +|----------|-------|----------------------------------------------| +| amount | float | _Oбязательный_. Сумма платежа в тиынах | +| order_id | int | _Oбязательный_. Идентификатор объекта заказа | + +> Пример создания квитанций +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_create( + amount=10000, + order_id=1 +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098412270, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + } + } +} +``` + +### receipts_pay() +_Для оплаты существующего чека_ + +| Аргумент | Тип | Описание | +|------------|-------|------------------------------------------------------------------| +| invoice_id | str | _Oбязательный_. Идентификатор счета для идентификации транзакции | +| token | str | _Oбязательный_. Неактивный токен карты | +| phone | str | _Oбязательный_. Телефон плательщика | + +> Пример оплаты квитанций +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_pay( + invoice_id="631186b6c4420cbf2712a243", + token="63118a5dd15d8d8d093b37b7_X2j34OIJPnROfsgzYZCZ0w7OcC50zzwiowTsotEVO1uUbxkzaDrvdOno6jicQTrcRmxvibxrye4vUS3AynTNPaPCTGpfk3RCKmT9NaOAyyTmctAjWsjwvqGR5XUzAP1Xcx12GkhuQi6VJ4BeaIXOokSRu06rRjaivmJQ8HTiJiR9b3OmZtrhkIRNcNXnnp9zYm1mFP4BuqGpS8BMnY0ASIE6ffxWykjgBcDTAfWBFt4mg7O9Dsvx0aj3IB8z3RIbZYtDZJnUVhCZrwW7ONVI9uEAdxNthorjO6PbV7TQ8XCjrztgGf6uCtOwwxasiIUVZN6tCVDk8A8NvVSUzUHXQHVkaPn5heJNa3K4WsffIckq7SwMbiw3UbawipeZKyD3iwk1Km", + phone="998901304527" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098438706, + "pay_time": 1662098438804, + "cancel_time": 0, + "state": 4, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": { + "number": "860006******6311", + "expire": "9903" + }, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": 0 + } + } +} +``` + +### receipts_send() +_Отправить квитанцию об оплате в SMS-сообщении_ + +| Аргумент | Тип | Описание | +|------------|-------|------------------------------------------------------------------| +| invoice_id | str | _Oбязательный_. Идентификатор счета для идентификации транзакции | +| phone | str | _Oбязательный_. Телефон плательщика | + +> Пример отправки квитанций +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_send( + invoice_id="631186b6c4420cbf2712a243", + phone="998901304527" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "success": true + } +} +``` + + +### receipts_cancel() +_Оплаченный чек в очереди на аннулирование_ + +| Аргумент | Тип | Описание | +|------------|-------|------------------------------------------------------------------| +| invoice_id | str | _Oбязательный_. Идентификатор счета для идентификации транзакции | + +> Пример отмены чеков +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_cancel( + invoice_id="63119303c4420cbf2712a245" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098438706, + "pay_time": 1662098438804, + "cancel_time": 0, + "state": 21, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": { + "number": "860006******6311", + "expire": "9903" + }, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb", + "source_cancel": "subscribe" + }, + "processing_id": null + } + } +} +``` + + +### receipts_check() +_Проверьте наличие квитанции_ + +| Аргумент | Тип | Описание | +|------------|------|------------------------------------------------------------------| +| invoice_id | str | _Oбязательный_. Идентификатор счета для идентификации транзакции | + +> Пример проверки чеков +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_check( + invoice_id="63119303c4420cbf2712a245" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "state": 0 + } +} +``` + + +### receipts_get() +_Проверить статус существующего чека_ + +| Аргумент | Тип | Описание | +|------------|------|------------------------------------------------------------------| +| invoice_id | str | _Oбязательный_. Идентификатор счета для идентификации транзакции | + +> Пример получения квитанций +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_get( + invoice_id="6311946bc4420cbf2712a247" +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "6311946bc4420cbf2712a247", + "create_time": 1662096491076, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2325", + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + } + } +} +``` + + +### receipts_get_all() +_Получите всю полную информацию по проверкам за определенный период_ + +| Аргумент | Тип | Описание | +|----------|------|-----------------------------------------------------------------| +| count | int | _Oбязательный_. Количество проверок. Максимальное значение - 50 | +| _from | int | _Oбязательный_. Дата начала | +| _to | int | _Oбязательный_. Дата окончания | +| offset | int | _Oбязательный_. Количество последующих пропущенных проверок | + +> Пример квитанций получить все +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_get_all( + count=2, + _from=1636398000000, + _to=1636398000000, + offset=0 +) + +pprint(resp) +``` + +> Пример ответа +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": [ + { + "_id": "6311946bc4420cbf2712a247", + "create_time": 1662096491076, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": { + "ru": "Номер чека", + "uz": "Chek raqami" + }, + "value": 2325, + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": { + "ru": "Internet", + "uz": "Internet" + }, + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + }, + { + "_id": "63119303c4420cbf2712a245", + "create_time": 1662096131667, + "pay_time": 0, + "cancel_time": 1662096182979, + "state": 50, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": { + "ru": "Номер чека", + "uz": "Chek raqami" + }, + "value": 2324, + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": { + "ru": "Internet", + "uz": "Internet" + }, + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb", + "source_cancel": "subscribe" + }, + "processing_id": null + } + ] +} +``` diff --git a/docs/src/uz/payme-pkg/index.md b/docs/src/uz/payme-pkg/index.md index 7905467..68365bc 100644 --- a/docs/src/uz/payme-pkg/index.md +++ b/docs/src/uz/payme-pkg/index.md @@ -2,4 +2,8 @@ title: Kirish --- -# **Xush kelibsiz!** +# **Kirish** + +[payme-pkg](https://github.com/PayTechUz/payme-pkg/tree/master){:target="_blank"} kutubxonamizning yo'riqnomasiga xush kelibsiz! + +O'qishda davom eting. Dastlab [sozlash bosqichini](setup/) ko'ring. diff --git a/docs/src/uz/payme-pkg/initializing-payments.md b/docs/src/uz/payme-pkg/initializing-payments.md new file mode 100644 index 0000000..74ad0c4 --- /dev/null +++ b/docs/src/uz/payme-pkg/initializing-payments.md @@ -0,0 +1,49 @@ +--- +title: Tezkor to'lovlar +description: Tezkor to'lovlar +--- + +# [Generate pay link](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/generate_link.py){:target="_blank"} + +> Namuna +```python +from pprint import pprint + +from payme.methods.generate_link import GeneratePayLink + +pay_link = GeneratePayLink( + order_id="999", + amount=9999, + callback_url="callback-url" +).generate_link() + +pprint(pay_link) +``` +> Natija +```shell +https://checkout.paycom.uz/bT01ZTczMGU4ZTBiODUyYTQxN2FhNDljZWI7YWMub3JkZXItaWQ9OTk5O2E9OTk5OTtjPXlvdXItY2FsbGJhY2stdXJs +``` + +- Parameterlar + +| Argument | Turi | Izoh | +|--------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------| +| order_id | str | _Majburiy_. To'lanadigan buyurtmaning ID'si | +| amount | Decimal | _Majburiy_. Buyurtmaning miqdori | +| callback_url | str | _Ixtiyoriy_. Merchant API uchun to'lovdan keyingi yo'naltiriladigan link. Birlamchi holatda loyiha sozlamalaridan PAYME_CALL_BACK_URL ni oladi | + +### Metodlari +- generate_link() -> to'lov linkini generatsiya qilish uchun. +> **Hech qanday argument olmaydi** + +- to_tiyin() -> so'mdan tiyinga konvertatsiya qiladi. + +| Argument | Turi | Izoh | +|----------|---------|------------------------------| +| amount | Decimal | _Majburiy_. Buyurtma miqdori | + +- to_sum() -> tiyindan so'mga konvertatsiya qiladi. + +| Argument | Turi | Izoh | +|----------|---------|------------------------------| +| amount | Decimal | _Majburiy_. Buyurtma miqdori | diff --git a/docs/src/uz/payme-pkg/merchant-api.md b/docs/src/uz/payme-pkg/merchant-api.md index 8e5f324..8a73f1a 100644 --- a/docs/src/uz/payme-pkg/merchant-api.md +++ b/docs/src/uz/payme-pkg/merchant-api.md @@ -4,3 +4,39 @@ description: Merchant API metodlari --- # Merchant API metodlari + +### [CheckPerformTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/check_perform_transaction.py){:target="_blank"} +_Tranzaksiyalarni bajarishni tekshirish uchun ishlatiladi_ +> **Hech qanday metodlari yo'q** + + +### [CreateTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/create_transaction.py){:target="_blank"} +_Tranzaksiyalarni yaratish uchun ishlatiladi_ + + +#### Metodlari +- _convert_ms_to_datetime() -> time ms formatidan datetime formatiga konvertatsiya qiladi + +| Argument | Turi | Izoh | +|----------|------|-----------------------------------------------------------| +| time_ms | int | _Majburiy_. Konvertatsiya qilinishi kerak bo'lgan time ms | + + +### [PerformTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/perform_transaction.py){:target="_blank"} +_Tranzaksiyalarni amalga oshirish uchun ishlatiladi_ +> **Hech qanday metodlari yo'q** + + +### [CancelTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/cancel_transaction.py){:target="_blank"} +_Tranzaksiyalarni bekor qilish uchun ishlatiladi_ +> **Hech qanday metodlari yo'q** + + +### [CheckTransaction](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/check_transaction.py){:target="_blank"} +_Tranzaksiyalarni tekshirish uchun ishlatiladi_ +> **Hech qanday metodlari yo'q** + + +### [GetStatement](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/methods/get_statement.py){:target="_blank"} +_Tranzaksiya ma'lumotlari savdogar va Payme Business operatsiyalarini solishtirish uchun ishlatiladi_ +> **Hech qanday metodlari yo'q** diff --git a/docs/src/uz/payme-pkg/setup.md b/docs/src/uz/payme-pkg/setup.md index fb18afd..115a047 100644 --- a/docs/src/uz/payme-pkg/setup.md +++ b/docs/src/uz/payme-pkg/setup.md @@ -3,4 +3,74 @@ title: Sozlash (Setup) description: Sozlash (Setup) --- -# Sozlash (Setup) +# O'rnatish +Windows +```shell +pip install payme-pkg +``` + +Unix-ga asoslangan OS'larda (Linux, macOS, ...) +```shell +pip3 install payme-pkg +``` +
+ +# Sozlash (django) +1. Loyihangiz sozlamarining INSTALLED_APPS qismiga `'payme'` ni qo'shing +```python +INSTALLED_APPS = [ + ... + 'payme', + ... +] +``` + +2. `payme` hisob ma'lumotlarini qo'shing +```python +PAYME: dict = { + 'PAYME_ID': 'payme-id', + 'PAYME_KEY': 'payme-key', + 'PAYME_URL': 'payme-checkout-url', + 'PAYME_CALL_BACK_URL': 'your-callback-url', # merchant api callback url + 'PAYME_MIN_AMOUNT': 'payme-min-amount', # integer field + 'PAYME_ACCOUNT': 'order-id', +} + +ORDER_MODEL = 'your_app.models.Your_Order_Model' +``` + +3. Callbacklarni boshqarish uchun yangi view yarating +```python +from payme.views import MerchantAPIView + + +class PaymeCallBackAPIView(MerchantAPIView): + def create_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"create_transaction for order_id: {order_id}, response: {action}") + + def perform_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"perform_transaction for order_id: {order_id}, response: {action}") + + def cancel_transaction(self, order_id, action, *args, **kwargs) -> None: + print(f"cancel_transaction for order_id: {order_id}, response: {action}") +``` + +4. Loyihangizning asosiy urlpatternlari qatoriga `payme` ni qo'shing. +```python +from django.urls import path + +from your_app.views import PaymeCallBackAPIView + +urlpatterns = [ + ... + path("payments/merchant/", PaymeCallBackAPIView.as_view()), + ... +] +``` + +5. Migratsiya qiling +```shell +python manage.py makemigrations +``` + +> 🎉 Tabriklaymiz! Siz merchant api va django loyihangizni integratsiya qildingiz, yo'riqnomani o'qishda davom eting. Migratsiyalar muvaffaqiyatli amalga oshganidan so'ng, nima sodir bo'lganini ko'rish uchun admin panelni tekshiring. diff --git a/docs/src/uz/payme-pkg/subscribe-api.md b/docs/src/uz/payme-pkg/subscribe-api.md index cce1674..db044c4 100644 --- a/docs/src/uz/payme-pkg/subscribe-api.md +++ b/docs/src/uz/payme-pkg/subscribe-api.md @@ -4,3 +4,792 @@ description: Subscribe API metodlari --- # Subscribe API metodlari + + +## [PaymeSubscribeCards](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/cards/subscribe_cards.py){:target="_blank"} +_Subscribe cards ga bog'liq bo'lgan barcha paycom metodlarini o'z ichiga oladi_ + +### cards_create() +_Yangi kartaning tokenini yaratish uchun_ + +| Argument | Turi | Izoh | +|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| number | str | _Majburiy_. Kartaning raqami. Maksimum uzunligi 18 sondan iborat. | +| expire | str | _Majburiy_. Kartaning amal qilish muddati Maksimum uzunligi 5 belgidan iborat. | +| save | boolean | _Ixtiyoriy_. **Birlamchi holatda _true_ qiymatini oladi**. Token turi. Biznes logikaga qarab faol yoki nofaol holatda bo'lishi mumkin. Agar qiymat true bo'lsa, kartaning tokenidan yana qayta foydalanish mumkin bo'ladi. Agar false bo'lsa kartaning tokeni faqat bir marta ishlatiladi. Bu bir martalik token esa to'lovdan keyin o'chirib tashlanadi | + +> cards create metodi uchun namuna +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +response = client.cards_create( + number="8600069195406311", + expire="0399", + save=True +) + +pprint(response) +``` +> Natija +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63119784d15d8d8d093b37b8_ADHrAykwnAIc2hm4hPPriktZ8nnuvR96S9Kzmjb3Fcix25IrJmMKrGxP9VUEP9rRDKRhtYjUw0vsXON7PYEyMCHtDKpMuM4krrIk8jdnyK7bXkSBSCyiGs2aahIrep6TSodIAxqutMJ4g3O8FZ8vC1DSMKzOaX0UF8fDKNexXV039Qnj4bNQc6NcpKGJn0wUX8d0RBqkmKid4WyUQnT987ZQDM2mT2IGNZtugvN4tDJTXBVTpqCWkXnZ0YWj64Ye0ztr91Mibtndo0Y1s5nCA6wufUZZugJ6c7rse19XNFSSieFM7AWi9VqybMe4eeWiZEBriAbFhrf8kQvrpBmwUEp05GjvFMgH0ku3vyUtSuJI36exHheXuJK66KstcX1i69EaF3", + "recurrent": true, + "verify": false, + "type": "22618" + } + } +} +``` + +### card_get_verify_code() +_Tasdiqlash kodini olish uchun_ + +| Argument | Turi | Izoh | +|----------|------|-------------------------------------| +| token | str | _Majburiy_. Kartaning nofaol tokeni | + +> card get verify code metodi uchun namuna +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.card_get_verify_code( + token="630e5ffdd15d8d8d093b379b_2fsaoABWafecn20kofV4PFafFZjeGDWS9adM1PmboQaEZbbaxMcnaskctMbU9Iv8qgrOuKGz8SnjvZvYXDK64m1eS9gA5jZ7BBRaQybMXrDPtFPJ1fwek5B1KoIv5cMiCWYXj7ezpYEdJAKTIQw0Np9HsTXjqco4gQG3m8MOfeH9ovkdm66O6yj45oKXRmJyAK5i0SchXNNomACH3Oq80KyoRE1VoBRxvoKyMkOx0xcepXovxK9d3v26a8z7UtyokwY33N8MupviM3A5WHB5Xh35WZJJyFnxTSi1vvnYnG7uVd6Bb1GjV2yAHnimss8aEZGW5V7ZiPrhf8r6WJAeHciYDGK3msRKZJBQTfjgOdE9tGrEnMezVkxr1JXX0xSn5qqec2" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "result": { + "sent": true, + "phone": "99890*****66", + "wait": 60000 + } +} +``` + +### cards_verify() +_Telefonga SMS orqali jo'natilgan kodni tasdiqlash uchun_ + +| Argument | Turi | Izoh | +|-------------|-------|-------------------------------------| +| verify_code | str | _Majburiy_. Tasdiqlash kodi | +| token | str | _Majburiy_. Kartaning nofaol tokeni | + +> cards verify metodi uchun namuna +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.cards_verify( + verify_code="666666", + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63118a5dd15d8d8d093b37b7_X2j34OIJPnROfsgzYZCZ0w7OcC50zzwiowTsotEVO1uUbxkzaDrvdOno6jicQTrcRmxvibxrye4vUS3AynTNPaPCTGpfk3RCKmT9NaOAyyTmctAjWsjwvqGR5XUzAP1Xcx12GkhuQi6VJ4BeaIXOokSRu06rRjaivmJQ8HTiJiR9b3OmZtrhkIRNcNXnnp9zYm1mFP4BuqGpS8BMnY0ASIE6ffxWykjgBcDTAfWBFt4mg7O9Dsvx0aj3IB8z3RIbZYtDZJnUVhCZrwW7ONVI9uEAdxNthorjO6PbV7TQ8XCjrztgGf6uCtOwwxasiIUVZN6tCVDk8A8NvVSUzUHXQHVkaPn5heJNa3K4WsffIckq7SwMbiw3UbawipeZKyD3iwk1Km", + "recurrent": true, + "verify": true, + "type": "22618" + } + } +} +``` + +### cards_check() +_Karta tokeni faol yoki nofaolligini tekshirish uchun_ + +| Argument | Turi | Izoh | +|----------|------|-------------------------------------| +| token | str | _Majburiy_. Kartaning nofaol tokeni | + +> cards check metodi uchun namuna +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.cards_check( + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "result": { + "card": { + "number": "860006******6311", + "expire": "03/99", + "token": "63119b36d15d8d8d093b37c1_IJtHxZ46h5viyo8RIJCmQyE8qBw6PUWUdFKTMCVWrPoMMi4kJYsKyVdjQrIx6a12jDfEPVhhEqWm94FYvYh7IEjIs4xn0n3mM8Quw5dhd6ZT0dOK6u1spqWRMIDBpDMhHj2Ga8zZMAfeoiDAcrWScXS1AP2tkQHcJ40rBzHGHS6DoVeIheF70c0wO1kVQG0G5hDWguSGf2ZRFcBtpabv5BQkqSchxWKdCSVPIGiS6X7eF8YStdz1aGPzFyjDbaKT0vXNUMbQ7gaKh4PeQbruVVwFDfeIWqGeNmgCCPU4X0wCHFjTt8K61e9VOauNeU81ckoKHD8XGzCwGFJHrC4sHvNv4no3RifWhHCQF9GmFKf8cP2qh4pqTKwu3gOITaX5Ss71tC", + "recurrent": true, + "verify": true, + "type": "22618" + } + } +} +``` + +### cards_remove() +_Karta tokenini o'chirish uchun_ + +| Argument | Turi | Izoh | +|----------|------|-------------------------------------| +| token | str | _Majburiy_. Kartaning nofaol tokeni | + +> cards remove metodi uchun namuna +```python +from pprint import pprint + +from payme.cards.subscribe_cards import PaymeSubscribeCards + + +client = PaymeSubscribeCards( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id" +) + +resp = client.cards_remove( + token="630e691fd15d8d8d093b379c_70mKyzqS8d1wTWzovIGjt9dKmjpn1KI8Y9XakPrfpbUASTBaZYbC1DjDcjYRmuNJep9gZrTRtHyEGBQYmBaPufuozF51bv4qEPsQnodq1VcD7tYyREwUXjMXXZUeu7Ek0REQCekCvVHX6rtNBpb4vtViJoNVjp94XpTqu0Bn3yYYb0CHu951wFydzRsieGxjGNrvx1oKyBcq0CdOUwoffRIt2VPvx5R2aVmc6ahwyhn387FEEcpO1PnjIJkWKTBWdI35ZPQnb1u1oss5aPg06E279THXRkoTThixbeqiD2JkWSXweNVGGDhTS30V4j61G3NWEPO2H3k4uFmCjjIQSzx4TxKzUgHg1i2q953PRUGjT4JZBRHMDxaN5tWuctEMNmY06p" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "result": { + "success": true + } +} +``` + + +## [PaymeSubscribeReceipts](https://github.com/PayTechUz/payme-pkg/blob/master/lib/payme/receipts/subscribe_receipts.py){:target="_blank"} +_Subscribe receipts ga bog'liq bo'lgan barcha paycom metodlarini o'z ichiga oladi_ + +### receipts_create() +_Yangi to'lov kvitansiyasini yaratish uchun_ + +| Argument | Turi | Izoh | +|----------|-------|---------------------------------------| +| amount | float | _Majburiy_. To'lov qiymati tiyinlarda | +| order_id | int | Majburiy_. Buyurtmaning ID'si | + +> receipts create metodi uchun namuna +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_create( + amount=10000, + order_id=1 +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098412270, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + } + } +} +``` + +### receipts_pay() +_Allaqachon mavjud kvitansiyaga to'lash uchun_ + +| Argument | Turi | Izoh | +|------------|------|--------------------------------------------------------------| +| invoice_id | str | _Majburiy_. Tranzaksiyani aniqlash uchun hisob-faktura ID'si | +| token | str | _Majburiy_. Kartaning faol tokeni | +| phone | str | _Majburiy_. To'lovchining telefon raqami | + +> receipts pay metodi uchun namuna +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_pay( + invoice_id="631186b6c4420cbf2712a243", + token="63118a5dd15d8d8d093b37b7_X2j34OIJPnROfsgzYZCZ0w7OcC50zzwiowTsotEVO1uUbxkzaDrvdOno6jicQTrcRmxvibxrye4vUS3AynTNPaPCTGpfk3RCKmT9NaOAyyTmctAjWsjwvqGR5XUzAP1Xcx12GkhuQi6VJ4BeaIXOokSRu06rRjaivmJQ8HTiJiR9b3OmZtrhkIRNcNXnnp9zYm1mFP4BuqGpS8BMnY0ASIE6ffxWykjgBcDTAfWBFt4mg7O9Dsvx0aj3IB8z3RIbZYtDZJnUVhCZrwW7ONVI9uEAdxNthorjO6PbV7TQ8XCjrztgGf6uCtOwwxasiIUVZN6tCVDk8A8NvVSUzUHXQHVkaPn5heJNa3K4WsffIckq7SwMbiw3UbawipeZKyD3iwk1Km", + phone="998901304527" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098438706, + "pay_time": 1662098438804, + "cancel_time": 0, + "state": 4, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": { + "number": "860006******6311", + "expire": "9903" + }, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": 0 + } + } +} +``` + +### receipts_send() +_SMS orqali to'lov kvitansiyasini yuborish uchun_ + +| Argument | Turi | Izoh | +|------------|------|--------------------------------------------------------------| +| invoice_id | str | _Majburiy_. Tranzaksiyani aniqlash uchun hisob-faktura ID'si | +| phone | str | _Majburiy_. To'lovchining telefon raqami | + +> receipts send metodi uchun namuna +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_send( + invoice_id="631186b6c4420cbf2712a243", + phone="998901304527" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "success": true + } +} +``` + + +### receipts_cancel() +_To'langan tranzaksiyani bekor qilish uchun_ + +| Argument | Turi | Izoh | +|------------|------|--------------------------------------------------------------| +| invoice_id | str | _Majburiy_. Tranzaksiyani aniqlash uchun hisob-faktura ID'si | + +> receipts cancel metodi uchun namuna +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_cancel( + invoice_id="63119303c4420cbf2712a245" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "63119becc4420cbf2712a24c", + "create_time": 1662098438706, + "pay_time": 1662098438804, + "cancel_time": 0, + "state": 21, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2326", + "main": true + } + ], + "card": { + "number": "860006******6311", + "expire": "9903" + }, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb", + "source_cancel": "subscribe" + }, + "processing_id": null + } + } +} +``` + + +### receipts_check() +_Mavjud tranzaksiyani tekshirish uchun_ + +| Argument | Turi | Izoh | +|------------|------|--------------------------------------------------------------| +| invoice_id | str | _Majburiy_. Tranzaksiyani aniqlash uchun hisob-faktura ID'si | + +> receipts check metodi uchun namuna +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_check( + invoice_id="63119303c4420cbf2712a245" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "state": 0 + } +} +``` + + +### receipts_get() +_Mavjud tranzaksiyani holatini tekshirish uchun_ + +| Argument | Turi | Izoh | +|------------|------|--------------------------------------------------------------| +| invoice_id | str | _Majburiy_. Tranzaksiyani aniqlash uchun hisob-faktura ID'si | + +> receipts get metodi uchun namuna +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_get( + invoice_id="6311946bc4420cbf2712a247" +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": { + "receipt": { + "_id": "6311946bc4420cbf2712a247", + "create_time": 1662096491076, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": "Номер чека", + "value": "2325", + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": "Internet", + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + } + } +} +``` + + +### receipts_get_all() +_Muayyan davr uchun cheklar bo'yicha barcha to'liq ma'lumotlarni olish uchun_ + +| Argument | Turi | Izoh | +|----------|------|-----------------------------------------------------------| +| count | int | _Majburiy_. Tranzaksiyalar soni. Maksimum qiymat - 50 | +| _from | int | _Majburiy_. Boshlanish sanasi | +| _to | int | _Majburiy_. Tugash sanasi | +| offset | int | _Majburiy_. Keyingi tranzaksiyalar soni | + +> receipts get all metodi uchun namuna +```python +from pprint import pprint + +from payme.receipts.subscribe_receipts import PaymeSubscribeReceipts + + +rclient = PaymeSubscribeReceipts( + base_url="https://checkout.test.paycom.uz/api/", + paycom_id="paycom-id", + paycom_key="paycom-key" +) + +resp = rclient.receipts_get_all( + count=2, + _from=1636398000000, + _to=1636398000000, + offset=0 +) + +pprint(resp) +``` + +> Natija +```json +{ + "jsonrpc": "2.0", + "id": 123, + "result": [ + { + "_id": "6311946bc4420cbf2712a247", + "create_time": 1662096491076, + "pay_time": 0, + "cancel_time": 0, + "state": 0, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": { + "ru": "Номер чека", + "uz": "Chek raqami" + }, + "value": 2325, + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": { + "ru": "Internet", + "uz": "Internet" + }, + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb" + }, + "processing_id": null + }, + { + "_id": "63119303c4420cbf2712a245", + "create_time": 1662096131667, + "pay_time": 0, + "cancel_time": 1662096182979, + "state": 50, + "type": 2, + "external": false, + "operation": -1, + "category": null, + "error": null, + "description": "", + "detail": null, + "amount": 400000, + "currency": 860, + "commission": 0, + "account": [ + { + "name": "transaction", + "title": { + "ru": "Номер чека", + "uz": "Chek raqami" + }, + "value": 2324, + "main": true + } + ], + "card": null, + "merchant": { + "_id": "5e730e8e0b852a417aa49ceb", + "name": "test", + "organization": "ЧП «test test»", + "address": "", + "business_id": "5e730e740b852a417aa49cea", + "epos": { + "merchantId": "106600000050000", + "terminalId": "20660000" + }, + "date": 1584598670296, + "logo": null, + "type": { + "ru": "Internet", + "uz": "Internet" + }, + "terms": null + }, + "meta": { + "source": "subscribe", + "owner": "5e730e8e0b852a417aa49ceb", + "source_cancel": "subscribe" + }, + "processing_id": null + } + ] +} +``` From 89fc1f995b24fac24ccd6f46a0b896dbd4afeade Mon Sep 17 00:00:00 2001 From: ChogirmaliYigit Date: Fri, 24 Nov 2023 20:59:49 +0500 Subject: [PATCH 5/5] docs: almost done :party: --- docs/src/en/index.md | 35 ++++- docs/src/en/payme-pkg/sandbox.md | 226 ++++++++++++++++++++++++++++++ docs/src/ru/index.md | 35 ++++- docs/src/ru/payme-pkg/sandbox.md | 225 ++++++++++++++++++++++++++++++ docs/src/uz/index.md | 35 ++++- docs/src/uz/payme-pkg/sandbox.md | 231 ++++++++++++++++++++++++++++++- 6 files changed, 781 insertions(+), 6 deletions(-) diff --git a/docs/src/en/index.md b/docs/src/en/index.md index b353401..c540644 100644 --- a/docs/src/en/index.md +++ b/docs/src/en/index.md @@ -5,4 +5,37 @@ hide: - toc --- -# **Welcome!** +# **PayTechUz guides!** + + +Welcome to our guides. This documentation dedicated to providing you with a collection of comprehensive documentation and guides related to the financial technology solutions and projects developed by our [organization](https://github.com/PayTechUz){:target="_blank"}. We are excited to have you on board and explore the possibilities that our payment integration solutions bring to your projects. + +### **Who We Are:** +PayTechUz - we are passionate about simplifying the world of payments. Our team has crafted a suite of packages designed to empower developers, startups and enterprises in enhancing their payment processing capabilities. + + +### **Explore Our Packages:** +Dive into our collection of packages available on the Python Package Index (PyPI). Each package is crafted to address specific needs in payment integration. Find the perfect fit for your project and elevate your payment processing experience. + +- [payme-pkg](https://github.com/PayTechUz/payme-pkg){:target="_blank"} + + +### **Join Our Community:** +Your journey with PayTechUz doesn't end here. Join our community to share insights, ask questions and collaborate with fellow developers. We believe in the power of community and collective knowledge. + + +- Telegram Group: [PayTechUz in Telegram](https://t.me/+7Gn-JZ99TfgwZDNi){:target="_blank"} +- GitHub Organization: [PayTechUz in GitHub](https://github.com/PayTechUz/){:target="_blank"} +- WebSite: [PayTechUz](https://pay-tech.uz){:target="_blank"} + + +!!! info "" + **Thank you for choosing us! We're here to make your payment integration experience not only seamless but also enjoyable.** + +
+ +**Happy coding!** + +

+ +

diff --git a/docs/src/en/payme-pkg/sandbox.md b/docs/src/en/payme-pkg/sandbox.md index 95e9f6f..b12d327 100644 --- a/docs/src/en/payme-pkg/sandbox.md +++ b/docs/src/en/payme-pkg/sandbox.md @@ -4,3 +4,229 @@ description: Sandbox --- # Sandbox + + +!!! info + Testing on a production server creates additional load. Accounts associated with malfunctioning applications are blocked. + +### About sandbox + +**Sandbox** — _environment for safe testing of the implemented [Merchant API](merchant-api.md){:target="_blank"}. Sandbox tests will help verify the interaction of the implemented API with Payme Business. Sandbox testing allows you to get a detailed description of the [errors](https://developer.help.paycom.uz/protokol-merchant-api/obschie-oshibki){:target="_blank"}._ + +???+ info + The merchant developer initiates testing and runs tests. Testing is carried out using [requests](https://developer.help.paycom.uz/protokol-merchant-api/format-zaprosa){:target="_blank"} and [responses](https://developer.help.paycom.uz/protokol-merchant-api/format-otveta){:target="_blank"}. Requests are sent by the Payme Business server, responses are sent by the merchant server. + + +### Preparing for testing + +Add a web cash register in the merchant's account. After creating a web cash register, Payme Business will issue 2 keys: + +- key for cabinet — key; +- key for sandbox — TEST_KEY. + +!!! info "" + **Go to [sandbox](https://test.paycom.uz/){:target="_blank"}. In the sandbox, enter Merchant ID (web cash register ID) and TEST_KEY.** + +!!! info + Merchant ID is stored in the web cash register developer settings. + + + +!!! info + It is important that the Endpoint URL is specified in the cash register settings - the billing web address. Payme Business will send inquiries to this address. + +When creating transactions in the sandbox, it is important to correctly specify the account type: + +- Money can be transferred to your **savings account** an unlimited number of times. An example of a savings account is a mobile operator account; +- To a **one-time account**, money can be received only 1 time. An example of a one-time invoice is an order in an online store. + +!!! info + Testing of [payment initialization](initializing-payments.md){:target="_blank"} is recommended to be carried out only after successful completion of testing in the sandbox: first test the payment initialization in the sandbox, then in production. + +**Sandbox url:** [https://test.paycom.uz](https://test.paycom.uz){:target="_blank"} + +**URL for sending a check to the sandbox:** [https://test.paycom.uz](https://test.paycom.uz){:target="_blank"} + +**URL for sending a check to the production:** [https://checkout.paycom.uz](https://checkout.paycom.uz){:target="_blank"} + + +### Testing + +Testing is carried out according to 2 scenarios: + +1. [Creating and canceling an unconfirmed transaction](#_4) +2. [Creating, confirming and canceling a confirmed financial transaction](#_5) + +The first scenario includes a security check, so the first scenario is tested first, then the second. + +!!! info + The Merchant API has already been implemented in the payment plugin, so testing of the payment plugin is carried out according to the same scenarios. + +#### Creating and canceling an unconfirmed transaction + +Log in to the store as a customer. Add the item to your cart and pay for your order using Payme. After payment there will be an automatic transition to the “Sandbox” to the page for creating a financial transaction. + +**Check authorization with incorrect credentials** + +In the “Invalid Data” section, click on the “Invalid Authorization” link and run the test. + + + +!!! info + For requests to implemented methods, the implemented Merchant API returns responses with error -32504: “Insufficient privileges to execute the method.” + +**Check payment with incorrect or invalid amount** + +In the “Incorrect Data” section, click on the “Invalid Amount” link. + + + +In the test parameters, specify a valid order number, an incorrect amount and run the test. + + + +!!! info + For requests to the implemented methods [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} and [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"}, implemented by the Merchant API returns responses with error -31001: "Invalid amount." + +**Check payment of a non-existent invoice** + +In the “Invalid data” section, click on the “Nonexistent account” link. + + + +In the test parameters, specify the actual order amount, an incorrect order number and run the test. + + + +!!! info + For requests to the implemented methods [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} and [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"}, implemented by the Merchant API returns responses with errors -31050 - -31099: “Invalid order code.” + +**Check the possibility of creating a financial transaction** + +!!! info + Checking the possibility of creating a financial transaction is ensured by the implemented method [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"}. + +In the “Payment Requests” section, click on the “CheckPerformTransaction” link. + + + +Make sure that the test parameters include the value of the Account parameter and the payment amount in tiyins and run the test. + + + +When a request is made to the implemented CheckPerformTransaction method, the implemented Merchant API returns a response without errors. + +**Create a transaction** + +!!! info + The creation of a transaction is ensured by the implemented method [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"}. + +In the Payment Requests section, click on the “CreateTransaction” link. + + + +Make sure that in the test launch parameters the account type is “One-time” and the account status is “Awaiting payment” and run the test. + + + +!!! info + Requests for the CreateTransaction, PerformTransaction, and CancelTransaction methods are sent twice. If the first request fails, the second one will definitely pass. When repeated calls to the CreateTransaction, PerformTransaction, CancelTransaction methods, the response must match the response from the first request. + +The implemented Merchant API returns: + +- to a request to the implemented method [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} - response with the result “allow”: true; +- to a request to the implemented method [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} - response without errors; +- for a repeated request to the implemented method [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} - response without errors; +- to a request to the implemented method [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} - response without errors; +- to a request to the implemented method [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} with a new transaction and the account status “Waiting for payment” - a response with error -31008: “The operation cannot be completed.” + +**Cancel an unconfirmed transaction** + +!!! info + Transaction cancellation is ensured by the implemented [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} method. + +Cancellation of a transaction is ensured by the implemented one. In the “Payment requests” section, click on the “CancelTransaction” link. method [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"}. + + + +Make sure that the test launch parameters include the transaction id and transaction status “1” (transaction created) and run the test. + + + +!!! info + For requests to the implemented methods [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} and [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"}, implemented by the Merchant API returns responses without errors. + +#### Creating, confirming and canceling a confirmed financial transaction + +Log in to the store as a customer. Add the item to your cart and pay for your order using Payme. After payment there will be an automatic transition to the “Sandbox” to the page for creating a financial transaction. + +**Check the possibility of creating a financial transaction** + +!!! info + Checking the possibility of creating a financial transaction is ensured by the implemented method [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"}. + +In the “Payment Requests” section, click on the “CheckPerformTransaction” link. + + + +Make sure that the test parameters include the value of the Account parameter and the payment amount in tiyins and run the test. + + + +When a request is made to the implemented CheckPerformTransaction method, the implemented Merchant API returns a response without errors. + +**Create a transaction** + +!!! info + The creation of a transaction is ensured by the implemented method [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"}. + +In the Payment Requests section, click on the “CreateTransaction” link. + + + +Make sure that in the test launch parameters the account type is “One-time” and the account status is “Awaiting payment” and run the test. + + + +The implemented Merchant API returns: + +- to a request to the implemented method [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} - response with the result “allow”: true; +- to a request to the implemented method [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} - response without errors; +- for a repeated request to the implemented method [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} - response without errors; +- to a request to the implemented method [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} - response without errors; +- to a request to the implemented method [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} with a new transaction and the account status “Waiting for payment” - a response with error -31008: “The operation cannot be completed.” + +**Confirm the transaction** + +!!! info + Transaction confirmation is provided by the implemented [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"} method. + +In the “Payment Requests” section, click on the “PerformTransaction” link. + + + +Make sure that the test launch parameters include the transaction id and transaction status “1” (created) and run the test. + + + +The implemented Merchant API returns a response without errors: + +- to a request to the implemented method [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"}; +- for a repeated request to the implemented method [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"}; +- to a request to the implemented method [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"}. + +**Cancel a confirmed transaction** + +!!! info + Transaction cancellation is ensured by the implemented [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} method. + +In the Payment Requests section, click on the “CancelTransaction” link. + + + +Make sure that the test launch parameters include the transaction id and transaction status “1” (transaction created) and run the test. + + + +!!! info + For requests to the implemented methods [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} and [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"}, implemented by the Merchant API returns responses without errors. diff --git a/docs/src/ru/index.md b/docs/src/ru/index.md index cbc7691..44bafac 100644 --- a/docs/src/ru/index.md +++ b/docs/src/ru/index.md @@ -5,4 +5,37 @@ hide: - toc --- -# **Добро пожаловать!** +# **PayTechUz гайди!** + + +Добро пожаловать в наши гиды. Эта документация предназначена для предоставления вам коллекции исчерпывающей документации и руководств, связанных с решениями и проектами в области финансовых технологий, разработанными нашей [организацией](https://github.com/PayTechUz){:target="_blank"}. Мы рады приветствовать вас и изучить возможности, которые наши решения по интеграции платежей привносят в ваши проекты. + +### **Кто мы:** +PayTechUz - мы стремимся упростить мир платежей. Наша команда разработала набор пакетов, призванных помочь разработчикам, стартапам и предприятиям расширить возможности обработки платежей. + + +### **Изучите наши пакеты:** +Погрузитесь в нашу коллекцию пакетов, доступных в Индексе пакетов Python (PyPI). Каждый пакет создан для удовлетворения конкретных потребностей в интеграции платежей. Найдите решение, идеально подходящее для вашего проекта, и улучшите качество обработки платежей. + +- [payme-pkg](https://github.com/PayTechUz/payme-pkg){:target="_blank"} + + +### **Присоединяйтесь к нашему сообществу:** +Ваше путешествие с PayTechUz на этом не заканчивается. Присоединяйтесь к нашему сообществу, чтобы делиться идеями, задавать вопросы и сотрудничать с другими разработчиками. Мы верим в силу сообщества и коллективных знаний. + + +- Telegram-группа: [PayTechUz в Telegram](https://t.me/+7Gn-JZ99TfgwZDNi){:target="_blank"} +- Организация GitHub: [PayTechUz в GitHub](https://github.com/PayTechUz/){:target="_blank"} +- Веб-сайт: [PayTechUz](https://pay-tech.uz){:target="_blank"} + + +!!! info "" + **Спасибо, что выбрали нас! Мы здесь, чтобы сделать вашу интеграцию платежей не только удобной, но и приятной.** + +
+ +**Happy coding!** + +

+ +

diff --git a/docs/src/ru/payme-pkg/sandbox.md b/docs/src/ru/payme-pkg/sandbox.md index 4343e4c..3142049 100644 --- a/docs/src/ru/payme-pkg/sandbox.md +++ b/docs/src/ru/payme-pkg/sandbox.md @@ -4,3 +4,228 @@ description: Песочница (Sandbox) --- # Песочница (Sandbox) + +!!! info "К СВЕДЕНИЮ" + Тестирование на рабочем сервере создает дополнительную нагрузку. Учетные записи, которые связаны с некорректно работающими приложениями, блокируются. + +### О песочнице + +**Песочница** — _среда для безопасного тестирования реализованного [Merchant API](merchant-api.md){:target="_blank"}. Тесты в песочнице помогут проверить взаимодействие реализованного API с Payme Business. Тестирование в песочнице позволяет получить детальное описание возникающих [ошибок](https://developer.help.paycom.uz/protokol-merchant-api/obschie-oshibki){:target="_blank"}._ + +???+ info "Инфо" + Инициирует тестирование и запускает тесты — разработчик мерчанта. Тестирование проводится с помощью [запросов](https://developer.help.paycom.uz/protokol-merchant-api/format-zaprosa){:target="_blank"} и [ответов](https://developer.help.paycom.uz/protokol-merchant-api/format-otveta){:target="_blank"}. Запросы отправляет сервер Payme Business, ответы — сервер мерчанта. + + +### Подготовка к тестированию + +Добавьте веб кассу в кабинете мерчанта. После создания веб-кассы, Payme Business выдаст 2 ключа: + +- ключ для кабинета — key; +- ключ для песочницы — TEST_KEY. + +!!! info "" + **Перейдите в [песочницу](https://test.paycom.uz/){:target="_blank"}. В песочнице введите Merchant ID (ID веб-кассы) и TEST_KEY.** + +!!! info "К СВЕДЕНИЮ" + Merchant ID хранится в параметрах разработчика веб-кассы. + + + +!!! info "К СВЕДЕНИЮ" + Важно чтобы в настройках кассы был указан Endpoint URL — веб-адрес биллинга. По этому адресу Payme Business будет посылать запросы. + +При создании транзакций в песочнице, важно правильно указать тип счёта: + +- На **накопительный счёт** деньги могут поступать неограниченное количество раз. Пример накопительного счёта — счет мобильного оператора; +- На **одноразовый счёт**, деньги могут поступать только 1 раз. Пример одноразового счёта — заказ в интернет магазине. + +!!! info "К СВЕДЕНИЮ" + Тестирование [инициализации платежа](initializing-payments.md){:target="_blank"} рекомендуется проводить только после успешного завершения тестирования в песочнице: вначале протестируйте инициализацию платежа в песочнице, затем в продакшене. + +**Веб-адрес песочницы:** [https://test.paycom.uz](https://test.paycom.uz){:target="_blank"} + +**URL отправки чека в песочницу:** [https://test.paycom.uz](https://test.paycom.uz){:target="_blank"} + +**URL отправки чека в продакшн:** [https://checkout.paycom.uz](https://checkout.paycom.uz){:target="_blank"} + + +### Тестирование + +Тестирование проводится по 2 сценариям: + +1. [Создание и отмена неподтвержденной транзакции](#_4) +2. [Создание, подтверждение и отмена подтверждённой финансовой транзакции](#_5) + +В первый сценарий включена проверка безопасности, поэтому вначале проводится тестирование по первому сценарию, затем по второму. + +!!! info "К СВЕДЕНИЮ" + В платёжном плагине Merchant API уже реализовано, поэтому тестирование платёжного плагина проводится по тем же сценариям. + +#### Создание и отмена неподтвержденной транзакции + +Войдите в магазин как покупатель. Добавьте товар в корзину и оплатите заказ с помощью Payme. После оплаты произойдёт автоматический переход в «Песочницу» на страницу создания финансовой транзакции. + +**Проверьте авторизацию с неверными учетными данными** + +В разделе «Неверные данные» нажмите на ссылку «Неверная авторизация» и запустите тест. + + + +!!! info "К СВЕДЕНИЮ" + На запросы к реализованным методам, реализованное Merchant API возвращает ответы с ошибкой -32504: «Недостаточно привилегий для выполнения метода». + +**Проверьте оплату неверной или недопустимой суммой** + +В разделе «Неверные данные» нажмите на ссылку «Неверная сумма». + + + +В параметрах теста укажите действительный номер заказа, неверную сумму и запустите тест. + + + +!!! info "К СВЕДЕНИЮ" + На запросы к реализованным методам [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} и [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"}, реализованное Merchant API возвращает ответы с ошибкой -31001: «Неверная сумма». + +**Проверьте оплату несуществующего счёта** + +В разделе «Неверные данные» нажмите на ссылку «Несуществующий счёт». + + + +В параметрах теста укажите действительную сумму заказа, неверный номер заказа и запустите тест. + + + +!!! info "К СВЕДЕНИЮ" + На запросы к реализованным методам [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} и [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"}, реализованное Merchant API возвращает ответы с ошибками -31050 — -31099: «Неверный код заказа». + +**Проверьте возможность создания финансовой транзакции** + +!!! info "К СВЕДЕНИЮ" + Проверку возможности создания финансовой транзакции обеспечивает реализованный метод [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"}. + +В разделе «Платежные запросы» нажмите на ссылку “CheckPerformTransaction”. + + + +Убедитесь что в парметрах теста присутствует значение парметра Account, сумма оплаты в тийинах и запустите тест. + + + +На запрос к реализованному методу CheckPerformTransaction, реализованное Merchant API возвращает ответ без ошибок. + +**Создайте транзакцию** + +!!! info "К СВЕДЕНИЮ" + Создание транзакции обеспечивает реализованный метод [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"}. + +В разделе «Платежные запросы» нажмите на ссылку “CreateTransaction”. + + + +Убедитесь что в параметрах запуска теста тип счета «Одноразовый», статус счета «Ожидает оплаты» и запустите тест. + + + +!!! info "К СВЕДЕНИЮ" + Запросы по методам CreateTransaction, PerformTransaction, CancelTransaction посылаются два раза. В случае, если первый запрос даст сбой - второй обязательно пройдет. При повторных вызовах методов CreateTransaction, PerformTransaction, CancelTransaction ответ должен совпадать с ответом из первого запроса. + +Реализованное Merchant API возвращает: + +- на запрос к реализованному методу [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} — ответ с результатом “allow”: true,; +- на запрос к реализованному методу [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} — ответ без ошибок; +- на повторный запрос, к реализованному методу [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} — ответ без ошибок; +- на запрос к реализованному методу [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} — ответ без ошибок; +- на запрос к реализованному методу [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} c новой транзакцией и состоянием счета «В ожидании оплаты» — ответ с ошибкой -31008: “Невозможно выполнить операцию”. + +**Отмените неподтвержденную транзакцию** + +!!! info "К СВЕДЕНИЮ" + Отмену транзакции обеспечивает реализованный метод [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"}. + +В разделе «Платежные запросы» нажмите на ссылку “CancelTransaction”. + + + +Убедитесь что в параметрах запуска теста присутствует id транзакции, статус транзакции “1” (транзакция создана) и запустите тест. + + + +!!! info "К СВЕДЕНИЮ" + На запросы к реализованным методам [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} и [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"}, реализованное Merchant API возвращает ответы без ошибок. + +#### Создание, подтверждение и отмена подтвержденной транзакции + +Войдите в магазин как покупатель. Добавьте товар в корзину и оплатите заказ с помощью Payme. После оплаты произойдет автоматический переход в «Песочницу» на страницу создания финансовой транзакции. + +**Проверьте возможность создания финансовой транзакции** + +!!! info "К СВЕДЕНИЮ" + Проверку возможности создания финансовой транзакции обеспечивает реализованный метод [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"}. + +В разделе «Платежные запросы» нажмите на ссылку “CheckPerformTransaction”. + + + +Убедитесь что в парметрах теста присутствует значение парметра Account, сумма оплаты в тийинах и запустите тест. + + + +На запрос к реализованному методу CheckPerformTransaction, реализованное Merchant API возвращает ответ без ошибок. + +**Создайте транзакцию** + +!!! info "К СВЕДЕНИЮ" + Создание транзакции обеспечивает реализованный метод [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"}. + +В разделе «Платежные запросы» нажмите на ссылку “CreateTransaction”. + + + +Убедитесь что в параметрах запуска теста тип счета «Одноразовый», статус счета «Ожидает оплаты» и запустите тест. + + + +Реализованное Merchant API возвращает: + +- на запрос к реализованному методу [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} — ответ с результатом “allow”: true,; +- на запрос к реализованному методу [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} — ответ без ошибок; +- на повторный запрос, к реализованному методу [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} — ответ без ошибок; +- на запрос к реализованному методу [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} — ответ без ошибок; +- на запрос к реализованному методу [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} c новой транзакцией и состоянием счета «В ожидании оплаты» — ответ с ошибкой -31008: “Невозможно выполнить операцию”. + +**Подтвердите транзакцию** + +!!! info "К СВЕДЕНИЮ" + Подтверждение транзакции обеспечивает реализованный метод [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"}. + +В разделе «Платежные запросы» нажмите на ссылку “PerformTransaction”. + + + +Убедитесь что в параметрах запуска теста присутствует id транзакции, статус транзакции “1” (создана) и запустите тест. + + + +Реализованное Merchant API возвращает ответ без ошибок: + +- на запрос к реализованному методу [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"}; +- на повторный запрос, к реализованному методу [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"}; +- на запрос к реализованному методу [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"}. + +**Отмените подтвержденную транзакцию** + +!!! info "К СВЕДЕНИЮ" + Отмену транзакции обеспечивает реализованный метод [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"}. + +В разделе «Платежные запросы» нажмите на ссылку “CancelTransaction”. + + + +Убедитесь что в параметрах запуска теста присутствует id транзакции, статус транзакции “1” (транзакция создана) и запустите тест. + + + +!!! info "К СВЕДЕНИЮ" + На запросы к реализованным методам [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} и [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"}, реализованное Merchant API возвращает ответы без ошибок. diff --git a/docs/src/uz/index.md b/docs/src/uz/index.md index 5b3a5e2..40b21c2 100644 --- a/docs/src/uz/index.md +++ b/docs/src/uz/index.md @@ -5,4 +5,37 @@ hide: - toc --- -# **Xush kelibsiz!** +# **PayTechUz yo'riqnomalari!** + + +Yo'riqnomalarga xush kelibsiz. Ushbu hujjat sizga [jamoamiz](https://github.com/PayTechUz){:target="_blank"} tomonidan ishlab chiqilgan moliyaviy texnologiya yechimlari va loyihalariga oid keng qamrovli hujjatlar va qo'llanmalar to'plamini taqdim etishga bag'ishlangan. Sizni qabul qilishdan va Bizning to'lov integratsiyasi yechimlarimiz loyihalaringizga olib keladigan imkoniyatlarni o'rganayotganimizdan xursandmiz. + +### **PayTechUz nima:** +PayTechUz - biz to'lovlar dunyosini soddalashtirishga ishtiyoqlimiz. Bizning jamoamiz dasturchilar, startaplar va bizneslarga ularning to‘lovlarni qayta ishlash imkoniyatlarini kengaytirish uchun mo‘ljallangan paketlar to‘plamini ishlab chiqdi. + + +### **Paketlarimiz bilan tanishing:** +Python Package Index (PyPI) da mavjud bo'lgan paketlar to'plamimiz bilan tanishing. Har bir paket toʻlov integratsiyasidagi muayyan ehtiyojlarni qondirish uchun ishlab chiqilgan. Loyihangiz uchun eng mos variantni toping va toʻlovlarni qayta ishlash tajribangizni oshiring. + +- [payme-pkg](https://github.com/PayTechUz/payme-pkg){:target="_blank"} + + +### **Hamjamiyatimizga qo'shiling:** +PayTechUz bilan sayohatingiz shu bilan tugamaydi. Fikr almashish, savollar berish va boshqa dasturchilar bilan hamkorlik qilish uchun hamjamiyatimizga qo‘shiling. Biz jamiyat va jamoaviy bilim kuchiga ishonamiz. + + +- Telegram Guruh: [PayTechUz Telegramda](https://t.me/+7Gn-JZ99TfgwZDNi){:target="_blank"} +- GitHub Organization: [PayTechUz GitHubda](https://github.com/PayTechUz/){:target="_blank"} +- Web sayt: [PayTechUz](https://pay-tech.uz){:target="_blank"} + + +!!! info "" + **Bizni tanlaganingiz uchun tashakkur! Biz sizning toʻlov integratsiyasi tajribangizni nafaqat muammosiz, balki yoqimli qilish uchun ham shu yerdamiz.** + +
+ +**Happy coding!** + +

+ +

diff --git a/docs/src/uz/payme-pkg/sandbox.md b/docs/src/uz/payme-pkg/sandbox.md index 99c75ae..b73edbb 100644 --- a/docs/src/uz/payme-pkg/sandbox.md +++ b/docs/src/uz/payme-pkg/sandbox.md @@ -1,6 +1,231 @@ --- -title: Qumdon (Sandbox) -description: Qumdon (Sandbox) +title: Sandbox +description: Sandbox --- -# Qumdon (Sandbox) +# Sandbox + +!!! info "Ma'lumot" + Test serverda qo'shimcha yuk yaratadi. Noto'g'ri ishlaydigan ilovalar bilan bog'liq hisoblar bloklanadi. + +### Sandbox haqida + +**Sandbox** — _amalga oshirilgan [Merchant API](merchant-api.md){:target="_blank"} xavfsiz sinov muhiti. Sandbox testlari joriy qilingan API ning Payme Business bilan o‘zaro aloqasini tekshirishga yordam beradi. Sandbox testi [xatolar](https://developer.help.paycom.uz/protokol-merchant-api/obschie-oshibki){:target="_blank"} batafsil tavsifini olish imkonini beradi._ + +???+ info "Ma'lumot" + Merchant dasturchisi testlashni boshlaydi va testlarni o'tkazadi. Test [so'rovlar](https://developer.help.paycom.uz/protokol-merchant-api/format-zaprosa){:target="_blank"} va [javoblar](https://developer.help.paycom.uz/protokol-merchant-api/format-otveta){:target="_blank"}. So'rovlar Payme Business serveri tomonidan yuboriladi, javoblar merchant serveri tomonidan yuboriladi. + + +### Testga tayyorgarlik + +Merchantning hisobiga veb-kassa apparatini qo'shing. Veb-kassa apparatini yaratgandan so'ng Payme Business ikkita kalitni chiqaradi: + +- kabinet uchun kalit — key; +- sandbox uchun kalit — TEST_KEY. + +!!! info "" + **[Sandbox](https://test.paycom.uz/){:target="_blank"}ga kiring. Sandboxda Merchant ID (veb-kassa ID'si) va TEST_KEY kiriting.** + +!!! info "Ma'lumot" + Merchant ID veb-kassa dasturchisi sozlamalarida saqlanadi. + + + +!!! info "Ma'lumot" + Endpoint URL manzili kassa sozlamalarida - hisob-kitob veb-manzilida ko'rsatilishi muhim. Payme Business ushbu manzilga so'rov yuboradi. + +Sandboxda tranzaktsiyalarni yaratishda hisob turini to'g'ri ko'rsatish muhimdir: + +- Pulni **jamg'arma hisob raqamiga** cheklanmagan miqdorda o'tkazish mumkin. Jamg'arma hisobiga misol sifatida uyali aloqa operatorining hisob raqamini ko'rsatish mumkin; +- **bir martalik hisobga** pulni faqat 1 marta olish mumkin. Bir martalik hisob-fakturaga misol - onlayn-do'kondagi buyurtma. + +!!! info "Ma'lumot" + [Tezkor to'lovlar](initializing-payments.md){:target="_blank"} testini sinov muhitida testdan muvaffaqiyatli oʻtgandan keyingina oʻtkazish tavsiya etiladi: avval tezkor to'lovlarni test muhitida, keyin esa productionda sinab koʻring. + +**Sandbox sayti:** [https://test.paycom.uz](https://test.paycom.uz){:target="_blank"} + +**Sandboxda chek yuborish uchun:** [https://test.paycom.uz](https://test.paycom.uz){:target="_blank"} + +**Productionda chek yuborish uchun:** [https://checkout.paycom.uz](https://checkout.paycom.uz){:target="_blank"} + + +### Testlash + +Test 2 senariy bo'yicha amalga oshiriladi: + +1. [Tasdiqlanmagan tranzaksiyani yaratish va bekor qilish](#_4) +2. [Tasdiqlangan moliyaviy operatsiyani yaratish, tasdiqlash va bekor qilish](#_5) + +Birinchi senariy xavfsizlik tekshiruvini o'z ichiga oladi, shuning uchun birinchi senariy avval sinovdan o'tkaziladi, keyin ikkinchisi. + +!!! info "Ma'lumot" + Merchant API allaqachon to'lov plaginida joriy qilingan, shuning uchun to'lov plaginini sinovdan o'tkazish xuddi shu senariylar bo'yicha amalga oshiriladi. + +#### Tasdiqlanmagan tranzaksiyani yaratish va bekor qilish + +Do'konga mijoz sifatida kiring. Buyumni savatga qo'shing va buyurtmangiz uchun Payme orqali to'lang. To'lovdan so'ng moliyaviy operatsiyani yaratish sahifasiga "Sandbox" ga avtomatik o'tish amalga oshiriladi. + +**Noto'g'ri hisob ma'lumotlari bilan avtorizatsiyani tekshiring** + +"Yaroqsiz ma'lumotlar" bo'limida "Yaroqsiz avtorizatsiya" havolasini bosing va testni o'tkazing. + + + +!!! info "Ma'lumot" + Amalga oshirilgan usullarga so'rovlar uchun joriy Merchant API javoblarni -32504 xato bilan qaytaradi: "Usulni bajarish uchun imtiyozlar etarli emas". + +**To'lovni noto'g'ri yoki mavjud bo'lmagan summa bilan tekshiring** + +"Неверные данные" bo'limida "Неверная сумма" havolasini bosing. + + + +"Неверные данные" bo'limida "Неверная сумма" havolasini bosing. Test parametrlarida to'g'ri buyurtma raqamini, noto'g'ri miqdorni belgilang va testni o'tkazing. + + + +!!! info "Ma'lumot" + Amalga oshirilgan [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} va [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"} metodlariga so'rovlar uchun Merchant API javoblarni -31001 xatosi bilan qaytaradi: "Noto'g'ri miqdor". + +**Mavjud bo'lmagan hisob-fakturaning to'lovini tekshiring** + +"Неверные данные" bo'limida "Несуществующий счёт" havolasini bosing. + + + +Test parametrlarida haqiqiy buyurtma miqdorini, noto'g'ri buyurtma raqamini belgilang va testni o'tkazing. + + + +!!! info "Ma'lumot" + Amalga oshirilgan [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} va [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"} metodlariga so'rovlar uchun Merchant API -31050 - -31099 xatolar bilan javoblarni qaytaradi: “Buyurtma kodi noto'g'ri”. + +**Moliyaviy operatsiyani yaratish imkoniyatini tekshiring** + +!!! info "Ma'lumot" + Moliyaviy operatsiyani yaratish imkoniyatini tekshirish amalga oshirilgan [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} metodi bilan ta'minlanadi. + +"Платежные запросы" bo'limida "CheckPerformTransaction" havolasini bosing. + + + +Test parametrlari Hisob parametri qiymatini va tiyinlardagi toʻlov miqdorini oʻz ichiga olganligiga ishonch hosil qiling va testni oʻtkazing. + + + +Amalga oshirilgan CheckPerformTransaction metodiga so'rov yuborilganda, joriy Merchant API xatosiz javob qaytaradi. + +**Tranzaksiya yarating** + +!!! info "Ma'lumot" + Tranzaktsiyani yaratish amalga oshirilgan [CreateTransaction](merchant-api.md#checktransaction){:target="_blank"} metodi bilan ta'minlanadi. + +"Платежные запросы" bo'limida "CreateTransaction" havolasini bosing. + + + +Testni ishga tushirish parametrlarida hisob turi “Одноразовый” va hisob holati “Ожидает оплаты” ekanligiga ishonch hosil qiling va testni oʻtkazing. + + + +!!! info "Ma'lumot" + CreateTransaction, PerformTransaction va CancelTransaction metodlari uchun so'rovlar ikki marta yuboriladi. Agar birinchi so'rov bajarilmasa, ikkinchisi albatta o'tadi. CreateTransaction, PerformTransaction, CancelTransaction metodlari takroriy so'rovlar bo'lsa, javob birinchi so'rovdagi javobga mos kelishi kerak. + +Amalga oshirilgan Merchant API qaytaradi: + +- amalga oshirilgan [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} metodi bo'yicha so'rovga - "allow": true; +- amalga oshirilgan [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} metodi bo'yicha so'rovga - xatosiz javob; +- amalga oshirilgan [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} metodiga takroriy so'rov uchun - xatosiz javob; +- amalga oshirilgan [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} metodi bo'yicha so'rovga - xatosiz javob; +- amalga oshirilgan [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} metodiga yangi tranzaksiya va hisob holati “В ожидании оплаты” soʻroviga -31008 xatoli javob: “Невозможно выполнить операцию". + +**Tasdiqlanmagan tranzaksiyani bekor qiling** + +!!! info "Ma'lumot" + Tranzaksiyani bekor qilish joriy qilingan [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} metodi bilan ta'minlanadi. + +"Платежные запросы" bo'limida "CancelTransaction" havolasini bosing. + + + +Testni ishga tushirish parametrlarida tranzaksiya identifikatori va tranzaksiya holati “1” (tranzaksiya yaratilgan) mavjudligiga ishonch hosil qiling va testni bajaring. + + + +!!! info "Ma'lumot" + Amalga oshirilgan [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} va [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} metodlariga so'rovlar uchun Merchant API javoblarni xatosiz qaytaradi. + +#### Tasdiqlangan moliyaviy operatsiyani yaratish, tasdiqlash va bekor qilish + +Do'konga mijoz sifatida kiring. Buyumni savatga qo'shing va buyurtmangiz uchun Payme orqali to'lang. To'lovdan so'ng moliyaviy operatsiyani yaratish sahifasiga "Sandbox" ga avtomatik o'tish amalga oshiriladi. + +**Moliyaviy operatsiyani yaratish imkoniyatini tekshiring** + +!!! info "Ma'lumot" + Moliyaviy operatsiyani yaratish imkoniyatini tekshirish amalga oshirilgan [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} usuli bilan ta'minlanadi. + +"Платежные запросы" bo'limida "CheckPerformTransaction" havolasini bosing. + + + +Test parametrlari Hisob parametri qiymatini va tiyinlardagi toʻlov miqdorini oʻz ichiga olganligiga ishonch hosil qiling va testni oʻtkazing. + + + +Amalga oshirilgan CheckPerformTransaction metodiga so'rov yuborilganda, joriy Merchant API xatosiz javob qaytaradi. + +**Tranzaksiya yarating** + +!!! info "Ma'lumot" + Tranzaktsiyani yaratish amalga oshirilgan [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} usuli bilan ta'minlanadi. + +"Платежные запросы" bo'limida "CreateTransaction" havolasini bosing. + + + +Testni ishga tushirish parametrlarida hisob turi “Одноразовый” va hisob holati “Ожидает оплаты” ekanligiga ishonch hosil qiling va testni oʻtkazing. + + + +Amalga oshirilgan Merchant API qaytaradi: + +- amalga oshirilgan [CheckPerformTransaction](merchant-api.md#checkperformtransaction){:target="_blank"} metodi bo'yicha so'rovga - "allow": true; +- amalga oshirilgan [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} metodi bo'yicha so'rovga - xatosiz javob; +- amalga oshirilgan [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} metodi takroriy so'rov uchun - xatosiz javob; +- amalga oshirilgan [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} metodi bo'yicha so'rovga - xatosiz javob; +- joriy qilingan [CreateTransaction](merchant-api.md#createtransaction){:target="_blank"} metodiga yangi tranzaksiya va hisob holati “В ожидании оплаты” soʻroviga -31008 xatoli javob: “ Невозможно выполнить операцию" + +**Tranzaktsiyani tasdiqlang** + +!!! info "Ma'lumot" + Tranzaksiyani tasdiqlash joriy qilingan [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"} metodi bilan ta'minlanadi. + +"Платежные запросы" bo'limida "PerformTransaction" havolasini bosing. + + + +Testni ishga tushirish parametrlarida tranzaksiya identifikatori va tranzaksiya holati “1” (yaratilgan) mavjudligiga ishonch hosil qiling va testni bajaring. + + + +Amalga oshirilgan Merchant API javobni xatosiz qaytaradi: + +- amalga oshirilgan [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"} metodiga so'rovga; +- amalga oshirilgan [PerformTransaction](merchant-api.md#performtransaction){:target="_blank"} metodiga takroriy so'rov uchun; +- amalga oshirilgan [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} metodiga so'rovga. + +**Tasdiqlangan tranzaksiyani bekor qiling** + +!!! info "Ma'lumot" + Tranzaksiyani bekor qilish joriy qilingan [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} metodi bilan ta'minlanadi. + +"Платежные запросы" bo'limida "CancelTransaction" havolasini bosing. + + + +Testni ishga tushirish parametrlarida tranzaksiya identifikatori va tranzaksiya holati “1” (tranzaksiya yaratilgan) mavjudligiga ishonch hosil qiling va testni bajaring. + + + +!!! info "Ma'lumot" + Amalga oshirilgan [CancelTransaction](merchant-api.md#canceltransaction){:target="_blank"} va [CheckTransaction](merchant-api.md#checktransaction){:target="_blank"} metodlariga so'rovlar uchun Merchant API javoblarni xatosiz qaytaradi.