Transaction Rollback

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Kriksonix
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Mon Jul 27, 2009 7:53 am

Transaction Rollback

Post by Kriksonix » Mon Jul 27, 2009 8:14 am

Hi folks,
I have my site and would like to be informed when anybody bought my product. And I have some idea how to implement it.
I have created Web service for my site and add trigger into AC DB. And I will call my web service from this trigger if anybody has bought my product. I hope it will work.

But I have one problem:
If my web service is unavailable or if there is a timeout then I have to roll back purchase transaction. But I'm not sure if AC rollback all changes. (For Ex. if I payed by VISA, what happens if I rollback transaction by returning error from my trigger?)

Does anybody can help me and explain how it works?

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

Re: Transaction Rollback

Post by mazhar » Mon Jul 27, 2009 8:48 am

Why you want to be notified. Is this just an alert for your or you want to trigger some custom code against this event. if this is just an alert then better put your Email address in the CC section of order confirmation Email template. That would trigger Email alert to your upon order placement.

Kriksonix
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Mon Jul 27, 2009 7:53 am

Re: Transaction Rollback

Post by Kriksonix » Tue Jul 28, 2009 1:11 am

mazhar wrote:Why you want to be notified. Is this just an alert for your or you want to trigger some custom code against this event. if this is just an alert then better put your Email address in the CC section of order confirmation Email template. That would trigger Email alert to your upon order placement.
The main idea is to send information about purchasing some AC product (product ID, User ID and Date) directly to my site. Based on this information I will allow to user to make some manipulation with their data through my site. So I cannot use emails for these purposes.
As far as I understand AC make real payment transaction before adding new order to the AC DB.
If "Yes", then I think there are two possible situation when my trigger return error back to the AC:
1) AC roll back all payment transaction. This is very good for me.
2) AC doesn't rollback real payment and in this case I have problem - user already payed money, but my db doesn't have any information about this payment.
Can anybody help me to understand how it really works?

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

Re: Transaction Rollback

Post by mazhar » Tue Jul 28, 2009 3:46 am

AbleCommerce creates orders for both successful and failed payments and hence will be available to you in database. So you can always get order and payment data from database. You can write some component to sync your both database for orders information to make sure that both have same order information.

Kriksonix
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Mon Jul 27, 2009 7:53 am

Re: Transaction Rollback

Post by Kriksonix » Wed Jul 29, 2009 5:40 am

To Mazhar:
Probably you know about 100 attempts to insert data into orders table. viewtopic.php?f=42&t=11207
so I have two questions:
1) AC add new record into DB after real payment transaction. Correct?
2) What happens with user's payment if all these 100 attempts are unsuccessfull?

Post Reply