[Webfunds-commits] java/webfunds/client/sox StoreReceiptStore.java

Ian Grigg iang@cypherpunks.ai
Sun, 16 Jul 2000 15:32:39 -0400 (AST)


iang        00/07/16 15:32:39

  Modified:    webfunds/client/sox StoreReceiptStore.java
  Log:
  minor change from pid to generic id, as storage by pid is not fixed,
  might be did in future.

Revision  Changes    Path
1.30      +16 -4     java/webfunds/client/sox/StoreReceiptStore.java

Index: StoreReceiptStore.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/client/sox/StoreReceiptStore.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- StoreReceiptStore.java	2000/05/28 02:59:56	1.29
+++ StoreReceiptStore.java	2000/07/16 19:32:39	1.30
@@ -1,5 +1,5 @@
 /*
- * $Id: StoreReceiptStore.java,v 1.29 2000/05/28 02:59:56 iang Exp $
+ * $Id: StoreReceiptStore.java,v 1.30 2000/07/16 19:32:39 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -255,11 +255,18 @@
     }
 
     /**
+     *  Get the current state machine for a transaction.
+     *  This is only for payouts and completed payins, there is no
+     *  recording of attempted payins (did used).
+     *
      *  Kludge:  because we store it by (incorrect) xid, we can't
      *  get the info quickly.
+     *
+     *  @param id is either pid or (completed) did - overloaded
+     *
      *  @return a specific StateReceipt for a subaccount (acct / item).
      */
-    public StateReceipt getReceipt(AccountId acct, ItemId item, String pid)
+    public StateReceipt getReceipt(AccountId acct, ItemId item, String id)
         throws StoreException
     {
         Store pen = getPen(acct, item);
@@ -275,7 +282,7 @@
                 continue ;
             }
             String paymentId = pend.getPaymentId();
-            if (paymentId.equals(pid))
+            if (paymentId.equals(id))
             {
                 return new StateReceipt(pend);
             }
@@ -299,7 +306,12 @@
                 continue ;
             }
             String paymentId = rec.getPaymentId();
-            if (paymentId.equals(pid))
+            if (paymentId.equals(id))
+            {
+                return new StateReceipt(rec);
+            }
+            String depositId = rec.getDepositId();
+            if (depositId.equals(id))
             {
                 return new StateReceipt(rec);
             }