Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    transaction question

    Hi,

    My script runs 4 sub routines.

    The fourth of these sends data to a payment gateway, which in turn, directs to a response page.

    The first three subs run in a transaction, which is good. But how do I best ensure that the fourth sub will also run. If it doesn't, I may have made sales, without payment.

    Is there some script logic, that my illogical brain isn't realising, which would resolve this?

    is the likelihood of the fourth sub not running, even an issue?

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,877
    Thanks
    2
    Thanked 164 Times in 159 Posts
    Without knowing the logic that you're currently using and more details of what you need to accomplish, it will be impossible for anyone to say if that is the proper logic for what you want to accomplish.

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Thanks FishMonger,

    when a person clicks to buy something, (a buy button), a script is run to check the params for correctness. (two of the three sub routines).

    the third sub routine shows (in the db), that the purchase has been made.

    the fourth sub routine sends off to the payment gateway.


    the gateway then returns its response to a new script at which point the confirmation is shown ( and confirmation also shown to confirm purchase), or it is declined, at which point the purchase is removed from the db.

    if that process seems ok, what would happen if the 3rd sub ran (to input the purchase to the db), but the fourth didn't ( the run to the payment gateway)?

    if I were to put all of the subs into a transaction, how would the transaction finish when the last sub in the transaction) is the redirect to the gateway.

    I wonder if my logic is, well, illogical. is that explained ay better?

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •