Page 1 of 1

Showing only successful payments

Posted: Thu Jul 12, 2012 11:40 am
by deverill
We have AC 7.0.6 and have some confused customers.

The reason for the confusion is that if they mess up the first credit card payment information they end up at the MyOrder page. In this page the invoice has a repeater that shows all payments, successful and not, and the customer thinks it's a multiple charge even though it says Void. I can't blame them, I get nervous on that kind of thing too.

So, in the code we have

Code: Select all

        PaymentRepeater.DataSource = _Order.Payments;
        PaymentRepeater.DataBind();
but I only want the non-"Status: void" ones to show. Anyone have an idea how to do this easily. I'd rather not get into creating my own SQL statements for this if there is an easier way.

Thanks!

Re: Showing only successful payments

Posted: Thu Jul 12, 2012 12:22 pm
by david-ebt
You can check _Order.Payments.PaymentStatus and only display the ones you want. Here are the valid options:
  • Unprocessed
    AuthorizationPending
    Authorized
    AuthorizationFailed
    CapturePending
    Captured
    CaptureFailed
    RefundPending
    Refunded
    VoidPending
    Void
    Completed
You can load the _Order.Payments into a new PaymentCollection and loop through to remove the ones you don't want and then bind the repeater to the new PaymentCollection variable. Or you can use the repeater OnItemDataBound to remove them as the repeater is loaded.

Re: Showing only successful payments

Posted: Thu Jul 12, 2012 1:09 pm
by deverill
Perfect, thanks David!