Flag When User Decides not to Complete an Authorize.net Transaction

stkoontz
stkoontz used Ask the Experts™
on
I'm developing a type of ticket purchase system using authorize.net (SIM).  The system needs to hold onto tickets until the purchase is complete.  That way if someone else comes through, they don't complete the payment transaction quicker and grab those tickets.  (There's a limit to the number of tickets that can be sold per event.)

My logic is...

1) Someone chooses x number of tickets for an event.
2) Write information into database putting x number of tickets on hold.
3) Person completes authorize.net transaction
4) Authorize.net sends variables back to my page to move tickets from 'hold' to purchased

The problem I'm trying to work out is: if someone gets to step #3 and decides not to complete the credit card transaction how does my application know to release those tickets?

If anyone can help me with this dilemma, I'd appreciate it.

Steve
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2016

Commented:
The process needs to be reversed.  The tickets should not be held until the client has paid for them.  Then the purchase is written into the data base.  

Your script can check before and after the reservation process to see how many tickets remain.  As you get closer to the sold-out condition, you can put warnings on the browser screen to tell the client "almost sold out!"  This will help with the occasional situation when one client order collides with another order and has to be denied.

Author

Commented:
Hi Ray_Paseur,

Thanks for the quick reply.

If I wait to update the database until the purchase has been made, I could have the possibility of someone completing the credit card transaction, then finding out that the event is sold out.  

Would I put a note on a page the person sees after they complete the transaction saying something like "Sold out.  Contact us for a refund"?

Steve
Most Valuable Expert 2011
Top Expert 2016
Commented:
Yes, I think I would do that.  You might also look under the covers of Authorize.net and see if they have an automatic refund capability.

Here is my 50,000-foot view of the design.

On the page that accepts orders, the script will check the data base and see how many tickets are available.  You'll tell the client this information when you build the page.

When the order is received, you'll check the data base again to see if there are enough tickets remaining to fill the order.  If not, you'll send the "sorry" page to the client and if less than "n" number of tickets remain,  you'll mark the event sold out.  You can decide what "n" is correct.  It might be 4 or 400 depending on the size of the event, the fire codes, the venue, etc.

Next you'll process the payment through Authorize.net.  When the payment is completed, you'll do the actual reservation of the tickets, including locking the tables, performing the updates and unlocking the tables.  If at this point, you're oversubscribed, then you will need to mark the event sold out and think about the refunds.

What I would avoid doing is taking the risk that many clients could come to the site and try to order the last two tickets, when only one ticket remains.  Nobody will be happy with that, and your charges to authorize.net might get run up.

Does this make sense to you?

Cheers, ~Ray

Author

Commented:
Thanks for the 'sky-high' view.  That's what I needed.

Steve
Most Valuable Expert 2011
Top Expert 2016

Commented:
Thanks for the points -- it's a great question! ~Ray

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial