Installation¶
Windows
Unix-based OS
Test-Credentials¶
Card Numer: 8600 4954 7331 6478 Expire Date: 03/99 SMS Code: 666666
Card Numer: 8600 0691 9540 6311 Expire Date: 03/99 SMS Code: 666666
Setup (django)¶
-
Add
'payme'
to your installed apps -
Add
payme
credentials to your settingsPAYME: dict = { 'PAYME_ID': 'payme-id', 'PAYME_KEY': 'payme-key', 'PAYME_URL': 'payme-checkout-url', 'PAYME_CALL_BACK_URL': 'your-callback-url', # merchant api callback url 'PAYME_MIN_AMOUNT': 'payme-min-amount', # integer field 'PAYME_ACCOUNT': 'order-id', } ORDER_MODEL = 'your_app.models.Your_Order_Model'
-
Create a new view that about handling callbacks
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 -
Run migrations
🎉 Congratulations you have been integrated merchant api methods with django, keep reading docs. After successfully migrations check your admin panel and see results what happened.