From c96af628f347693c1b359a48f54e4162e2dc950a Mon Sep 17 00:00:00 2001 From: Muhammadali-Akbarov Date: Thu, 10 Aug 2023 14:33:26 +0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20Updated=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 20 +++++++++++++++++++- setup.py | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 26be05d..ebc4012 100644 --- a/README.md +++ b/README.md @@ -71,15 +71,33 @@ PAYME: dict = { ORDER_MODEL = 'your_app.models.Your_Order_Model' ``` +Create a new View that about handling call backs +```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}") +``` + 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("payments/", include("payme.urls")) + path("payments/merchant/", PaymeCallBackAPIView.as_view()), ... ] ``` diff --git a/setup.py b/setup.py index cb8ae3e..bdfac0e 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='payme-pkg', - version='2.5', + version='2.5.1', license='MIT', author="Muhammadali Akbarov", author_email='muhammadali17abc@gmail.com',