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.

Comments

jnowka’s picture

StatusFileSize
new1.21 KB

The previous patch left open the possibility that there would be no $transaction_payload variable set. Providing an updated patch to prevent this from occurring.

jnowka’s picture

Status: Patch (to be ported) » Active
mglaman’s picture

Status: Active » Needs review
StatusFileSize
new1.22 KB

Here is an improved patch that provides documentation as to why, and also reverses the array we can reach a valid transaction more quickly.

jgrunert’s picture

Status: Needs review » Reviewed & tested by the community

This looks good. I applied the latest patch to the latest dev version of the module and everything looks to be in order.

mglaman’s picture

Issue tags: +Commerce Sprint
jgrunert’s picture

  • mglaman committed 079ac48 on 7.x-1.x
    Issue #2287335 by jnowka, mglaman, jgrunert: Unable to perform credit...
mglaman’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.