Skip to content

Commit

Permalink
πŸ“– Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammadali-Akbarov committed Aug 10, 2023
1 parent df1f197 commit c96af62
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
...
]
```
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit c96af62

Please sign in to comment.