Skip to content

Commit

Permalink
payme-pkg-3.0b ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
hoosnick authored Aug 24, 2023
2 parents 5170382 + e59fd92 commit aeb6022
Show file tree
Hide file tree
Showing 38 changed files with 678 additions and 78 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Documentation

on:
push:
branches:
- payme-pkg-3.0b
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install -r requirements/docs-requirements.txt
- run: mkdocs gh-deploy --force
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# virtual env
env/
venv/

# dev test
core/
my_app/
db.sqlite3
manage.py
dist/
venv/

# ide configs
.vscode/
.idea/

# caches
__pycache__/
paymentsuz.egg-info/
payme_pkg.egg-info/
manage.py
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[MASTER]
disable=no-member,
disable=no-member,invalid-name,
unnecessary-pass,
useless-option-value,
too-few-public-methods,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 Giorgos Myrianthous
Copyright (c) 2023 Muhammadali Akbarov

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Payme Uzbekistan Integration Uzcard and Humo

<p align="center">
<a href="https://youtu.be/r2RO3kJVP7g">
<img style="width: 60%;" src="https://i.postimg.cc/WbD32bHC/payme-pkg-demo-m4a.gif">
Expand Down Expand Up @@ -73,6 +74,7 @@ ORDER_MODEL = 'your_app.models.Your_Order_Model'
```

Create a new View that about handling call backs

```python
from payme.views import MerchantAPIView

Expand Down
Binary file added docs/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions docs/src/en/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Introduction
---

# **Welcome!**

### Uzbekistan Payment Providers Packages

[<img align="right" alt="PayTechUz" height="280" width="280" src="https://github.com/PayTechUz/.github/assets/73847672/90e1c28a-f3ae-409a-8d8c-341b0fbe39e3" />](https://pay-tech.uz)

Welcome to the PayTechUz organization! This project aims to provide developers with seamless integration and implementation of Payment Providers APIs in Uzbekistan. Whether you're a Python enthusiast or a Go guru, we've got you covered with our versatile tech stack.

## Table of Contents

- [Introduction](#introduction)
- [Website](#website)
- [Telegram Group](#telegram-group)
- [Tech Stack](#tech-stack)
- [Usage](#usage)
- [Contributing](#contributing)
- [Support](#support)
- [License](#license)

## Introduction

Integrating payment providers into your applications is crucial in today's digital landscape. This project simplifies the process of integrating Payment Providers APIs in Uzbekistan, allowing you to focus on building amazing products while leaving the payment processing worries behind.

## Website

Visit our website [pay-tech.uz](https://pay-tech.uz) to explore detailed documentation, guides, and API references. We regularly update the documentation to ensure you have the most up-to-date information at your disposal.

## Telegram Group

Join our vibrant developer community on Telegram to connect with fellow developers, ask questions, share experiences, and stay updated with the latest news and announcements.

[Telegram Group](https://t.me/+krHlGUizJrI1Zjli)

## Tech Stack

We have carefully chosen the following tech stack to ensure flexibility and ease of use:

- [![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://python.org/)
- [![Go](https://img.shields.io/badge/Go-00ADD8?style=for-the-badge&logo=go&logoColor=white)](https://go.dev/)

The combination of Python and Go offers a wide range of possibilities to cater to the preferences of different developers.

## Usage

Our packages are designed to streamline the integration process. Follow the detailed instructions in the documentation for each package to integrate the desired Payment Providers API seamlessly.

## Contributing

We welcome contributions from the community to make this project even better. If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Please ensure you follow our [contribution guidelines](https://github.com/PayTechUz/.github/blob/main/profile/CONTRIBUTING.md).

## Support

If you encounter any problems, have questions, or need assistance with the integration, our team is here to help. Reach out to us on our [Telegram Group](https://t.me/+ydVV_9B3Xh02NGEy) or email us at [email protected].

## License

This project is licensed under the [MIT License](https://github.com/PayTechUz/.github/blob/main/profile/LICENSE.txt), making it open and free for everyone to use, modify, and distribute.

---

We hope our PayTechUz packages make your payment integration process a delightful experience. Happy coding!
6 changes: 6 additions & 0 deletions docs/src/en/merchant-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Merchant API methods
description: Merchant API methods
---

# Merchant API methods
6 changes: 6 additions & 0 deletions docs/src/en/sandbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Sandbox (Testing)
description: Sandbox (Testing)
---

# Sandbox (Testing)
6 changes: 6 additions & 0 deletions docs/src/en/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Interaction setup
description: Interaction setup
---

# Interaction setup
6 changes: 6 additions & 0 deletions docs/src/en/subscribe-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Subscribe API methods
description: Subscribe API methods
---

# Subscribe API methods
6 changes: 6 additions & 0 deletions docs/src/en/support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Technical support
description: Technical support
---

# Technical support
23 changes: 23 additions & 0 deletions docs/src/overrides/partials/nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<nav
class="md-nav md-nav--primary"
aria-label="{{ lang.t('nav.title') }}"
data-md-level="0"
>
<label class="md-nav__title" for="__drawer">
<a
href="{{ config.site_url | default(nav.homepage.url, true) | url }}"
title="{{ config.site_name }}"
class="md-nav__button md-logo"
aria-label="{{ config.site_name }}"
>
{% include "partials/logo.html" %}
</a>
</label>
{% if config.repo_url %}
<div class="md-nav__source">{% include "partials/source.html" %}</div>
{% endif %}
<ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav %} {% set path = "nav-" + loop.index | string %} {%
set level = 1 %} {% include "partials/nav-item.html" %} {% endfor %}
</ul>
</nav>
5 changes: 5 additions & 0 deletions docs/src/ru/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Введение
---

# **Добро пожаловать!**
6 changes: 6 additions & 0 deletions docs/src/ru/merchant-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Методы Merchant API
description: Методы Merchant API
---

# Методы Merchant API
6 changes: 6 additions & 0 deletions docs/src/ru/sandbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Песочница (Тестирование)
description: Песочница (Тестирование)
---

# Песочница (Тестирование)
6 changes: 6 additions & 0 deletions docs/src/ru/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Настройка взаимодействия
description: Настройка взаимодействия
---

# Настройка взаимодействия
6 changes: 6 additions & 0 deletions docs/src/ru/subscribe-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Методы Subscribe API
description: Методы Subscribe API
---

# Методы Subscribe API
6 changes: 6 additions & 0 deletions docs/src/ru/support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Техническая поддержка
description: Техническая поддержка
---

# Техническая поддержка
5 changes: 5 additions & 0 deletions docs/src/uz/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Kirish
---

# **Xush kelibsiz!**
6 changes: 6 additions & 0 deletions docs/src/uz/merchant-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Merchant API metodlari
description: Merchant API metodlari
---

# Merchant API metodlari
6 changes: 6 additions & 0 deletions docs/src/uz/sandbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Qumdon (Sandbox)
description: Qumdon (Sandbox)
---

# Qumdon (Sandbox)
6 changes: 6 additions & 0 deletions docs/src/uz/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Sozlash (Setup)
description: Sozlash (Setup)
---

# Sozlash (Setup)
6 changes: 6 additions & 0 deletions docs/src/uz/subscribe-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Subscribe API metodlari
description: Subscribe API metodlari
---

# Subscribe API metodlari
6 changes: 6 additions & 0 deletions docs/src/uz/support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Texnik yordam
description: Texnik yordam
---

# Texnik yordam
25 changes: 17 additions & 8 deletions lib/payme/admin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
from django.contrib import admin

from payme.models import CUSTOM_ORDER
from payme.models import Order as DefaultOrderModel
from payme.models import (
Item, MerchatTransactionsModel,
OrderDetail, ShippingDetail
)
# pylint: disable=fixme
# TODO: order Payme models in admin panel
# 1. OrderDetail
# 2. Item
# 3. ShippingDetail
# 4. MerchatTransactionsModel

from payme.models import MerchatTransactionsModel

if not CUSTOM_ORDER:
admin.site.register(DefaultOrderModel)

admin.site.register(MerchatTransactionsModel)
admin.site.register(
[
OrderDetail, Item,
ShippingDetail,
MerchatTransactionsModel,
]
)
7 changes: 7 additions & 0 deletions lib/payme/errors/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,10 @@ class PaymeTimeoutException(Exception):
"""
Payme timeout exception that means that payme is working slowly.
"""


class QRCodeError(Exception):
"""
QRCodeError Exception \
Raises when an error occurs while generating a QR code.
"""
19 changes: 17 additions & 2 deletions lib/payme/methods/check_perform_transaction.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from payme.serializers import (
MerchatTransactionsModelSerializer,
OrderModelSerializer
)
from payme.utils.get_params import get_params
from payme.serializers import MerchatTransactionsModelSerializer
from payme.utils.order_finder import Order


class CheckPerformTransaction:
Expand All @@ -11,16 +15,27 @@ class CheckPerformTransaction:
-------------------------
https://developer.help.paycom.uz/metody-merchant-api/checktransaction
"""

def __call__(self, params: dict) -> dict:
serializer = MerchatTransactionsModelSerializer(
data=get_params(params)
)
serializer.is_valid(raise_exception=True)

order = OrderModelSerializer(
instance=Order.objects.get(
id=serializer.validated_data.get('order_id')
)
)

response = {
"result": {
"allow": True,
}
"detail": order.data.get("detail")
}
}

if not order.data.get("detail"):
del response["result"]["detail"]

return None, response
Loading

0 comments on commit aeb6022

Please sign in to comment.