My web-application suffers from duplicate payment transactions. It uses Payflow Pro JAVA SDK to make a call to PayPal Gateway to process users payments via PayPal.
As, a short term solution, we decided to pass INV NUM, as suggested in this article, so PayPal can track it and reject the transaction with the same invoice ID with corresponding error code and message.
While testing the fix I am still getting statusCode 0 and transaction message APPROVED for the duplicate transaction. However for the duplicate transaction, the DUPLICATE flag is set true which I believe identifies it as duplicate one, but I don't understand if it means that the transaction was not processed successfully, meaning user was not charged second time.
The invoice generation method looks like this:
Invoice inv = new Invoice();
/* Set Amount. */
Currency amt = new Currency(pip.getFeeAmount(), "USD");
inv.setAmt(amt);
inv.setPoNum(poNum);
// INV NUM e.g.: 988755aa8aeb262a506ec01
inv.setInvNum(pip.getInvNum());
BrowserInfo bi = new BrowserInfo();
bi.setButtonSource(buttonSource);
inv.setBrowserInfo(bi);
return inv;
Does anyone can tell me why it doesn't work?