Closed andymckay closed 9 years ago
@andymckay I'm able to access the processor response code on the transaction, using the data you provided:
>>> result = braintree.ErrorResult(None, data)
>>> result
<ErrorResult 'Invalid Secure Payment Data' at 10e01b250>
>>> result.transaction
<Transaction {amount: Decimal('2078.00')} at 4529960848>
>>> result.transaction.processor_response_code
u'2078'
This matches the docs for the Transaction object.
Gah I suck! Sorry about that.
... and thanks :)
It looks like there are some errors that return an error code, but the result of the parsing in ErrorResult is that the actual response code is thrown away.
Here's an example, given the gist at https://gist.github.com/andymckay/a9340d1b0a7ce483025e:
You can access that in the response, but once it gets parsed into a Transaction, its lost, because Transaction doesn't parse that at all:
Note that if you pass the Transaction information to the Verification object, you can get something useful:
We'd like to be able to return that unique to braintree response code up the stack, log it etc. But we can't unless we monkey patch ErrorResult. Unless I'm missing something on how to process the response for this kind of error.