Move more code into change_payment_provider

This commit is contained in:
Raphael Michel
2019-10-04 16:47:23 +02:00
parent 81b6188777
commit 27a32173e6
3 changed files with 35 additions and 28 deletions

View File

@@ -119,8 +119,9 @@ def _handle_transaction(trans: BankTransaction, code: str, event: Event=None, or
}
if created:
# We're perform a payment method switchign on-demand here
old_fee, new_fee, fee = change_payment_provider(trans.order, p.payment_provider, p.amount, new_payment=p) # noqa
# We're perform a payment method switching on-demand here
old_fee, new_fee, fee, p = change_payment_provider(trans.order, p.payment_provider, p.amount,
new_payment=p, create_log=False) # noqa
if fee:
p.fee = fee
p.save(update_fields=['fee'])