Skip to content

Commit

Permalink
written docs for payme-pkg 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ChogirmaliYigit committed Nov 20, 2023
1 parent 027c4a4 commit 8f18939
Show file tree
Hide file tree
Showing 6 changed files with 879 additions and 5 deletions.
6 changes: 5 additions & 1 deletion docs/src/en/payme-pkg/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
48 changes: 48 additions & 0 deletions docs/src/en/payme-pkg/initializing-payments.md
Original file line number Diff line number Diff line change
@@ -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 |
36 changes: 36 additions & 0 deletions docs/src/en/payme-pkg/merchant-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
5 changes: 1 addition & 4 deletions docs/src/en/payme-pkg/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ description: Setup
---

# Installation

Windows
```shell
pip install payme-pkg
Expand All @@ -14,10 +13,8 @@ Unix-based OS
```shell
pip3 install payme-pkg
```


<br/>
# Setup (django)

1. Add `'payme'` to your installed apps
```python
INSTALLED_APPS = [
Expand Down
Loading

0 comments on commit 8f18939

Please sign in to comment.