getting stats on failed transactions

Discussion in 'Payments processing' started by andy_b, Apr 20, 2010.

  1. andy_b

    andy_b New Member

    Joined:
    Apr 20, 2010
    Messages:
    1
    Hi,

    I need to create a MySQL query that returns the number of failed credit card transactions in a given period of time.

    Which fields would I join on to do this, and what restrictions need to be placed in the WHERE clause?

    many thanks,

    andy_b
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This can be done for rebills only. For all CC transactions you need to write php code that will get all payments and check each payment record to find an error if transaction was processed.
    For rebills you can use rebill_log table:
    select count(*) from amember_rebill_log where payment_date > '2010-01-01' and payment_date < '2010-01-01' and status <>0

Share This Page