Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Payment Gateway - dual verification check

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

Not sure, if i am posting to the correct forum ... (Dear Moderator, please advise the correct one)

My environment: Struts + Spring + Hibernate application running on Jboss 5.1 GA with Oracle as backend.
Operating Sys: Windows
JDK: ver 1.7

My application is a B2C app, where in end users, add something to their cart and proceed to payment.

App is integrated with a Payment gateway, where in the happy flow is as

User --> browses-to -> https//
--> adds-to-his-cart
--> proceeds to payment (transaction is marked 'PAYMENT-INITIATED' in database)
-----> user is redirected to
--> enters CC, Cvv etc (payment is processed)

-----> user is redirected from paymentGateway back to to https//
--> myapp, processes the incoming details from PG and shows user confirmation/ thank you page.
(and transaction is marked 'PAYMENT-SUCCESS' or 'PAYMENT-FAILED' in database))

But in practice, it so happens, due to varied reasons, user leaves https// (for payment), but never returns (could be network failure/ or simply user closed his browser)

So the status of the transaction on my application side, remains 'PAYMENT-INITIATED'; indefinitely.

Later support team gets calls from user, money has got debited from their account/ CC but they have received no acknowledgement from my B2C system.

What can be done for such transactions ?

For one, we have a cron job; which runs every hour, queries the payment-gateway about the state of these 'PAYMENT-INITIATED' transactions.
1. If payment gateway, reports that money has truly been debited; we mark the transaction as 'REFUNDABLE' and refund the money.
else mark it as FAILURE (if gateway reports it as so) or simply ABANDONED.

Is there a better way to handle this ?
Note; I cannot accept credit card/ Cvv info on my web-site and then call payment gateway;
so the synchronous round trip ( --to-- payment gateway --back-to-- cannot be done without.

thank you.
Posts: 10445
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has some good explanation on how it typically works.
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic