stbarnabas/django-pinpayments

PinTransaction.process_transaction() should raise an exception if not successful

Closed this issue · 0 comments

I'm of the opinion that in most cases, exceptions should be used instead of return values to indicate any sort of inability to do something / deviation from the sunshine scenario, even in situations that should normally be accounted for (as a sort of safety net).

Therefore, .process_transaction() should be moved to .process() (because transaction.process_transaction() is redundant), and the latter should raise an exception. The former will be modified to call the latter, catch the exception, return the appropriate value to provide backwards compatibility, and raise a deprecation warning.