commerce_authnet when performing a credit loads the last item in the payload array for the transaction. If a void has been attempted previously, then the credit will fail because the last four digits of the credit card can not be determined. Attached is a patch file that will remove the use of the end() function and replace it with a foreach loop that checks to see if the transaction payload object is success and has valid data in index 50, aka the credit card number. Once found the foreach statement is broken out of, and everything continues on as normal.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | unable_to_perform-2287335-3.patch | 1.22 KB | mglaman |
Comments
Comment #1
jnowka commentedThe previous patch left open the possibility that there would be no $transaction_payload variable set. Providing an updated patch to prevent this from occurring.
Comment #2
jnowka commentedComment #3
mglamanHere is an improved patch that provides documentation as to why, and also reverses the array we can reach a valid transaction more quickly.
Comment #4
jgrunert commentedThis looks good. I applied the latest patch to the latest dev version of the module and everything looks to be in order.
Comment #5
mglamanComment #6
jgrunert commentedComment #8
mglamanCommitted, thanks!