Features: 1) Use AbstractGateway for processing transactions in signals;
Fixes: 1) Add missing import for `AbstractGateway` in `signals.py`; Extra: n/a;
This commit is contained in:
parent
489ceeaa2a
commit
d1f385e387
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from django.db.models.signals import post_save
|
||||
from django.dispatch import receiver
|
||||
|
||||
from payments.gateways import AbstractGateway
|
||||
from payments.models import Balance, Transaction
|
||||
from payments.utils.emailing import balance_deposit_email
|
||||
from vibes_auth.models import User
|
||||
|
|
@ -16,7 +17,7 @@ def create_balance_on_user_creation_signal(instance, created, **_kwargs):
|
|||
def process_transaction_changes(instance, created, **_kwargs):
|
||||
if created:
|
||||
try:
|
||||
gateway = object()
|
||||
gateway = AbstractGateway()
|
||||
gateway.process_transaction(instance)
|
||||
except Exception as e: # noqa:
|
||||
instance.process = {"status": "NOGATEWAY", "error": str(e)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue