iATSPayments / com.iatspayments.civicrm

CiviCRM Extension supporting iATS Payments services
Other
14 stars 38 forks source link

Recurring contributions show Failed in CiviCRM but completed in journal #413

Open yashodha opened 1 year ago

yashodha commented 1 year ago

Is there a follow up on https://github.com/iATSPayments/com.iatspayments.civicrm/issues/253

Some of our recurring contributions are showing as Failed in CiviCRM even though in the journal table status_id is updated as Completed. Somehow the civicrm contributions are not updated/sync. We ran the verify job as well still no update. The users get confused with this and try multiple recurring contributions which have all completed but show as Failed.

We are running Civi 5.19 /iats 1.7.4.

Is this behavior fixed in the later versions of iats/CiviCRM?

Should we be processing Failed contributions in addition to the Pending as well in this case? https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/api/v3/Job/Iatsverify.php#L87

adixon commented 1 year ago

Are these credit card or ACH/EFT? Is this is one-time, occasional, or recurring issue?

Normally, I'd expect that a contribution marked as failed in CiviCRM to have been marked as failed in iATS as well (and the iats journal on CiviCRM should reflect what iATS thinks). There could be ways that a transaction is initially identified as failed by iATS and only later changed to completed, but I would expect that to be a weird edge case related to issues over at iATS.

adixon commented 1 year ago

Interestingly, a client just had a similar issue, maybe the same one. It was for a credit card transaction, which showed up on Feb 16 as Failed, but was showing as completed in the iATS journal.

The way I fixed it was:

  1. Update the contribution status to "Pending" (the interface wouldn't let me do this, so I did it with some sql, the pending status id is '2').
  2. Run the verify job, e.g. cv api3 job.iatsverify contribution_id=102672 [you could do it via the web gui as well].

As I think about it, it might be nice if you could do the verify without resetting the status to pending.

shaneonabike commented 1 year ago

We have been experiencing this as well (CC payments)... once a month which is strange. I'm investigating whether some job is taking up resources but I haven't found anything just yet.

I was wondering if perhaps it could be good to create a new job that basically retrieves transactions that have passed (maybe configurable to how many days). Then these could then be put in the journal and verified against pending/failed transactions OR even in the future import the transactions done via iATS.

Ideally though, it would compare against existing transaction ids to see if there is already one in Civi and then change the status and all the rest.

adixon commented 1 year ago

Yes, the journal would be a useful tool for reconciling CiviCRM vs iATS. I'm not convinced you want it to be making any automated changes - these discrepancies point to issues as iATS that need attention. But some kind of button to fix these apparently failed transactions seems like a good idea.

shaneonabike commented 1 year ago

Ahh! A button is a great idea that allows our clients to intervene to rectify this is a great idea. :+1:

yashodha commented 1 year ago

+1 on button or some way to reconcile the transactions.

shaneonabike commented 1 year ago

I was thinking that maybe we could gleen a bit of what veda-consulting did for ncn-civi-zoom. They add a button to their form for entries that don't match an actual item.

@yashodha would you be willing to fund some of this work perhaps to get it going?