Features: 1) Add match-case logic for selecting gateway in process_transaction_changes.
Fixes: None. Extra: 1) Minor adjustment to default `AbstractGateway` instantiation.
This commit is contained in:
parent
1e2b64514b
commit
4efaeaea8f
1 changed files with 7 additions and 1 deletions
|
|
@ -17,6 +17,12 @@ def create_balance_on_user_creation_signal(instance, created, **_kwargs):
|
|||
def process_transaction_changes(instance, created, **_kwargs):
|
||||
if created:
|
||||
try:
|
||||
match instance.process.get("gateway", "default"):
|
||||
case "gateway":
|
||||
gateway = AbstractGateway
|
||||
case "default":
|
||||
gateway = AbstractGateway
|
||||
case _:
|
||||
gateway = AbstractGateway()
|
||||
gateway.process_transaction(instance)
|
||||
except Exception as e: # noqa:
|
||||
|
|
|
|||
Loading…
Reference in a new issue