-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from PayTechUz/feat/nakapitel
Feat/nakapitel
- Loading branch information
Showing
69 changed files
with
2,325 additions
and
3,293 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length = 120 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,5 @@ paymentsuz.egg-info/ | |
payme_pkg.egg-info/ | ||
|
||
.DS_Store | ||
build/ | ||
build/ | ||
migrations/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
[MASTER] | ||
disable=no-member, | ||
unnecessary-pass, | ||
useless-option-value, | ||
too-few-public-methods, | ||
missing-module-docstring, | ||
missing-function-docstring | ||
disable=W0613,E1101,W0718,W0223,W0621,W1203,W0622,C0116,E0213, C0114 | ||
|
||
ignore-long-lines = True | ||
max-line-length = 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,125 @@ | ||
# Payme Uzbekistan Integration Uzcard and Humo | ||
<h1 align="center">Payme PKG</h1> | ||
|
||
|
||
<p align="center"> | ||
<a href="https://youtu.be/r2RO3kJVP7g"> | ||
<img style="width: 60%;" src="https://i.postimg.cc/WbD32bHC/payme-pkg-demo-m4a.gif"> | ||
</a> | ||
<a href="https://docs.pay-tech.uz"><img src="https://img.shields.io/static/v1?message=Documented%20on%20GitBook&logo=gitbook&logoColor=ffffff&label=%20&labelColor=5c5c5c&color=3F89A1"></a> | ||
<a href="https://github.com/PayTechUz/payme-pkg"><img src="https://img.shields.io/badge/Open_Source-❤️-FDA599?"/></a> | ||
<a href="t.me/+DK7n7lKx8GY5ZDZi"><img src="https://img.shields.io/badge/Community-Join%20Us-blueviolet"/></a> | ||
<a href="https://github.com/PayTechUz/payme-pkg/issues"><img src="https://img.shields.io/github/issues/gitbookIO/gitbook"/></a> | ||
</p> | ||
Support Group - <a href="https://t.me/+Ng1axYLNyBAyYTRi">Telegram</a> <br/> | ||
YouTube - <a href="https://youtu.be/sJORIyykHcw">Watch Video</a><br/> | ||
Implementation Sample - https://github.com/PayTechUz/payme-sample | ||
|
||
<p align="center">Welcome to payme-pkg, the open source payme sdk for python.</p> | ||
|
||
<p align="center">You can use for test and production mode. Join our community and ask everything you need. | ||
</p> | ||
<a href="https://docs.pay-tech.uz"> | ||
<p align="center">Visit to full documentation for Merchant and Subcribe Api</p> | ||
</a> | ||
<p align="center"> | ||
<br> | ||
<a href="https://www.buymeacoffee.com/paytechuz" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a> | ||
<img style="width: 60%;" src="https://i.postimg.cc/WbD32bHC/payme-pkg-demo-m4a.gif"> | ||
</p> | ||
|
||
## Installation | ||
|
||
```shell | ||
pip install payme-pkg | ||
``` | ||
|
||
## Installation to Django | ||
|
||
Add `'payme'` in to your settings.py | ||
|
||
```python | ||
INSTALLED_APPS = [ | ||
... | ||
'payme', | ||
... | ||
] | ||
``` | ||
|
||
Add `'payme'` credentials inside to settings.py | ||
|
||
One time payment configuration settings.py | ||
```python | ||
PAYME_ID = "your-payme-id" | ||
PAYME_KEY = "your-payme-key" | ||
PAYME_ACCOUNT_FIELD = "id" | ||
PAYME_AMOUNT_FIELD = "total_amount" | ||
PAYME_ACCOUNT_MODEL = "orders.models.Orders" | ||
PAYME_ONE_TIME_PAYMENT = True | ||
``` | ||
|
||
Multi payment configuration settings.py | ||
```python | ||
PAYME_ID = "your-payme-id" | ||
PAYME_KEY = "your-payme-key" | ||
PAYME_ACCOUNT_FIELD = "id" | ||
PAYME_ACCOUNT_MODEL = "clients.models.Client" | ||
PAYME_ONE_TIME_PAYMENT = False | ||
``` | ||
|
||
Create a new View that about handling call backs | ||
```python | ||
from payme.views import PaymeWebHookAPIView | ||
|
||
|
||
class PaymeCallBackAPIView(PaymeWebHookAPIView): | ||
def handle_created_payment(self, params, result, *args, **kwargs): | ||
""" | ||
Handle the successful payment. You can override this method | ||
""" | ||
print(f"Transaction created for this params: {params} and cr_result: {result}") | ||
|
||
def handle_successfully_payment(self, params, result, *args, **kwargs): | ||
""" | ||
Handle the successful payment. You can override this method | ||
""" | ||
print(f"Transaction successfully performed for this params: {params} and performed_result: {result}") | ||
|
||
def handle_cancelled_payment(self, params, result, *args, **kwargs): | ||
""" | ||
Handle the cancelled payment. You can override this method | ||
""" | ||
print(f"Transaction cancelled for this params: {params} and cancelled_result: {result}") | ||
``` | ||
|
||
Add a `payme` path to core of urlpatterns: | ||
|
||
```python | ||
from django.urls import path | ||
from django.urls import include | ||
|
||
from your_app.views import PaymeCallBackAPIView | ||
|
||
urlpatterns = [ | ||
... | ||
path("payment/update/", PaymeCallBackAPIView.as_view()), | ||
... | ||
] | ||
``` | ||
|
||
Run migrations | ||
```shell | ||
python3 manage.py makemigrations && python manage.py migrate | ||
``` | ||
🎉 Congratulations you have been integrated merchant api methods with django, keep reading docs. After successfull migrations check your admin panel and see results what happened. | ||
|
||
## Generate Pay Link | ||
|
||
Example to generate link: | ||
|
||
- Input | ||
|
||
```python | ||
from payme import Payme | ||
|
||
## 📚 **Full Documentation:** | ||
payme = Payme(payme_id="your-payme-id") | ||
pay_link = payme.initializer.generate_pay_link(id=123456, amount=5000, return_url="https://example.com") | ||
print(pay_link) | ||
``` | ||
|
||
For in-depth details, examples, and comprehensive documentation, please visit our official documentation website: [Documentation Website](https://docs.pay-tech.uz). | ||
- Output | ||
|
||
Happy coding! 🚀 | ||
``` | ||
https://checkout.paycom.uz/bT15b3VyLXBheW1lLWlkO2FjLmlkPTEyMzQ1NjthPTUwMDAwMDtjPWh0dHBzOi8vZXhhbXBsZS5jb20= | ||
``` |
Oops, something went wrong.