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',