Showing only successful payments

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

Showing only successful payments

Post by deverill » Thu Jul 12, 2012 11:40 am

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!
Jim Sewell - Web Programmer
Trusted Tours & Attractions

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: Showing only successful payments

Post by david-ebt » Thu Jul 12, 2012 12:22 pm

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.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

Re: Showing only successful payments

Post by deverill » Thu Jul 12, 2012 1:09 pm

Perfect, thanks David!

Post Reply