Capture behavior changed from R6 to R8

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
abradley
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 101
Joined: Wed Feb 12, 2014 4:46 pm

Capture behavior changed from R6 to R8

Post by abradley » Tue Jul 15, 2014 7:46 am

Small change to the way the capture payment screen worked now that we are on R8. It will allow us to accidentally charge the customer too much sometimes and then we have to wait a day to refund. One way this could happen is if we remove an item from an order, then the balance would be less than the authorization. We can always capture a second payment easily, refunds have to wait a day so we would rather have the system protect us from the more costly mistake.

Before the capture amount would automatically populate to the order balance. Now it auto populates to the original authorization amount. I have attached a screenshot for clarity. In the screenshot we would like the capture population to be 1,527.82 instead of the $1,588.79 which was the previous behavior.

Image
Austin

sweeperq
Commodore (COMO)
Commodore (COMO)
Posts: 497
Joined: Tue Jan 03, 2006 2:45 pm

Re: Capture behavior changed from R6 to R8

Post by sweeperq » Tue Jul 15, 2014 8:30 am

good to know, thanks!

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Capture behavior changed from R6 to R8

Post by jmestep » Wed Jul 16, 2014 3:55 am

That is weird. They made a change in R8 and it looks like it might not be behaving as intended. Both files have

Code: Select all

    decimal rem = _Payment.Transactions.GetRemainingAuthorized();
                decimal bal = _Order.GetBalance(false);
Then R6 has

Code: Select all

                CaptureAmount.Text = string.Format("{0:F2}", bal);

R8 has

Code: Select all

  CaptureAmount.Text = string.Format("{0:F2}", rem);
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

abradley
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 101
Joined: Wed Feb 12, 2014 4:46 pm

Re: Capture behavior changed from R6 to R8

Post by abradley » Wed Jul 16, 2014 5:42 am

So this

Code: Select all

CaptureAmount.Text = string.Format("{0:F2}", rem);
just needs to be reverted to this then it looks like.

Code: Select all

CaptureAmount.Text = string.Format("{0:F2}", bal);
Austin

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Capture behavior changed from R6 to R8

Post by Katie » Wed Jul 16, 2014 11:21 am

I reported this as a bug, but I still can't figure out why the code was changed between the two versions.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Capture behavior changed from R6 to R8

Post by mazhar » Tue Sep 02, 2014 2:56 am

The change we made in Gold R7 was to address the exact inverse of this case. In this case you removed the items which is resulting in order balance less the authorized amount. Previously it was reported by a customer that when they add items to an existing order with authorized payment, capture fails due to capture amount being greater then authorized amount.

I think the correct fix to deal with both situations should be first we check if authorized amount is greater then balance. If it is then we pre populate with balance amount otherwise we use authorized amount. So you need to use

Code: Select all

CaptureAmount.Text = string.Format("{0:F2}", rem > bal ? bal : rem);

abradley
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 101
Joined: Wed Feb 12, 2014 4:46 pm

Re: Capture behavior changed from R6 to R8

Post by abradley » Tue Sep 02, 2014 5:03 am

mazhar wrote:The change we made in Gold R7 was to address the exact inverse of this case. In this case you removed the items which is resulting in order balance less the authorized amount. Previously it was reported by a customer that when they add items to an existing order with authorized payment, capture fails due to capture amount being greater then authorized amount.

I think the correct fix to deal with both situations should be first we check if authorized amount is greater then balance. If it is then we pre populate with balance amount otherwise we use authorized amount. So you need to use

Code: Select all

CaptureAmount.Text = string.Format("{0:F2}", rem > bal ? bal : rem);
This works great, thanks for the explanation. I think this behavior is well designed. Thanks mazhar!
Austin

Post Reply