Payment Capture Point

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
vashts1980
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 98
Joined: Fri Apr 29, 2011 2:56 pm

Payment Capture Point

Post by vashts1980 » Mon Mar 12, 2012 2:24 pm

It looks like I found an issue with capturing order submissions at the point of submission. The system I'm pushing the information to only should have the data once the order has been paid for, but it's getting pushed out as soon as the order is submitted. What file and method do I have to look at in order to capture and send the order data once payment has been confirmed? I believe this is also causing issues trying to send orders that use PayPal for payment, as well.

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

Re: Payment Capture Point

Post by jmestep » Tue Mar 13, 2012 6:53 am

Able saves the order, even though the payment fails. You would have to try to override that behavior on the checkout page.
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

vashts1980
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 98
Joined: Fri Apr 29, 2011 2:56 pm

Re: Payment Capture Point

Post by vashts1980 » Tue Mar 13, 2012 9:32 am

I think you missed my point. Currently I capture the order submission in the OnePageCheckout.ascx.cs file at the end of the CHeckedOut() method. However, this captures the order before it is paid, and I can't have unpaid orders being sent to the other system. I need to know which file handles the trigger for an order being paid and in what method, so long as it isn't a DLL file. If there isn't a CS page that handles this where I can hook into the activity, then I'll have to come up with something different.

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

Re: Payment Capture Point

Post by jmestep » Wed Mar 14, 2012 6:31 am

In that case, it is in the checkout payment form which has CheckingOut and CheckedOut Event handlers.
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

vashts1980
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 98
Joined: Fri Apr 29, 2011 2:56 pm

Re: Payment Capture Point

Post by vashts1980 » Wed Mar 14, 2012 2:34 pm

I already have my lines of code which call my custom DLL methods at the end of the CheckedOut() method on the page. The problem is that the payment hasn't always yet processed by time my custom code is called, and an unpaid order gets sent through to the other system. I need to know where in the site's code I can look for where the payment is actually received and marked as paid so unpaid orders don't get sent through.

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

Re: Payment Capture Point

Post by david-ebt » Wed Mar 14, 2012 2:52 pm

Have you taken a look in the Checkout\PaymentForms\CreditCardPaymentForm.ascx file? This is the user control that displays the credit card. The Conlib\OnePageCheckout.ascx.cs file sets the CheckingOut and CheckedOut callback functions for this control.

In the CreditCardPaymentForm.ascx file is the code that redirects the user to the receipt page if the payment was correct. Look inside the CreditCardButton_Click function. If you're putting your custom code into the OnePageCheckout CheckedOut function, I think you'll want to add it to the CreditCardPaymentForm CreditCardButton_Click function instead.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

vashts1980
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 98
Joined: Fri Apr 29, 2011 2:56 pm

Re: Payment Capture Point

Post by vashts1980 » Wed Mar 14, 2012 3:24 pm

Ok, looking at the code in that method, I'm wondering where to add my code to call my method to my custom DLL. I'm also wondering how to make it correctly call my method in my custom DLL, as well. At any rate, I'm not sure at what point in the method payment is properly captured or not. I'm guessing I would enter it into this chunk of code...

Code: Select all

                if (checkoutResponse.Success)
                {
                    if (CheckedOut != null) CheckedOut(this, new CheckedOutEventArgs(checkoutResponse));
                    <<< custom code added here >>>
                    Response.Redirect(NavigationHelper.GetReceiptUrl(checkoutResponse.OrderId));
                }

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

Re: Payment Capture Point

Post by david-ebt » Wed Mar 14, 2012 3:31 pm

That spot would be my guess, too.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

vashts1980
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 98
Joined: Fri Apr 29, 2011 2:56 pm

Re: Payment Capture Point

Post by vashts1980 » Wed Mar 14, 2012 4:27 pm

I just checked something...

I compared the transaction history for an order in AbleCommerce with the web services log in the other system. AbleCommerce shows the order as being paid for a credit card order several seconds before the connection to the other system is established. And this is what is occurring before changing files any further.

Also, I'm not entirely certain that moving the code to this new location will help. Instead of my code being called during the CheckedOut() method, it will just be called as soon as that method has completed. In theory, then, by time the CheckedOut() method is called, the payment should be completed.

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

Re: Payment Capture Point

Post by jmestep » Thu Mar 15, 2012 7:25 am

It looks like this must be related to your other post about PayPal? Normal PayPal orders don't get paid unless the customer clicks the button on the receipt page and goes to PayPal and completes the payment there. Then the site waits for PayPal and there can be some issues with IPN Pending. PayPal Express you mentioned on your other post is normally triggered with a button before the customer goes thru the Able checkout process. Then when it gets done, the Able order is completed.
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

Post Reply