• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Booking Transaction

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Before saving the itinerary as a paid one, credit card must be authorised. Suppose whole flow is managed by a SLSB.
First step, authorization of the card succeeds and it goes to second step which is, updating the model. But suppose, at that time,the db crashes...

In this type of scenario , what transaction type should I use? Also how can I rollback the TransMaster CC payment?

Thanks a lot,
Murat
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Murat Balkan:
Hi all,

Before saving the itinerary as a paid one, credit card must be authorised. Suppose whole flow is managed by a SLSB.
First step, authorization of the card succeeds and it goes to second step which is, updating the model. But suppose, at that time,the db crashes...

In this type of scenario , what transaction type should I use? Also how can I rollback the TransMaster CC payment?

Thanks a lot,
Murat




You can assume that :

1) Transmaster api provides 'void transaction' support. i.e. you swipe the card and paid, but you cant update the iternary. In which case you will void the transaction by calling another method on transmaster.
2) You should assume that DB update and Transmaster verification is being done in a single transaction (atomic). So if either fails, you will rollback. For card related api it means that a void transaction call is supported.

In the real world app .. that is how it is done.
 
Murat Balkan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply.
In this type of a tx, how should I implement it?(BMT or CMT)
Thanks,
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am planning to use BMT. With this I have the flexibility of taking appropriate error handling approach based on actual error.
Say, I got a connection time out with database, i will roll back the payment with showing a message to user :'try after some time' and I will keep the Itinerary saved (without booking it). If the cr. card authorization is failed, I wil delete the Itinerary from the users account.
 
Arthur, where are your pants? Check under this tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic