[Webfunds-commits] java/webfunds/client SimplePaymentFrame.java

Ian Grigg iang@cypherpunks.ai
Thu, 22 Mar 2001 21:21:41 -0400 (AST)


iang        01/03/22 21:21:41

  Modified:    webfunds/client/sox PendingReceipt.java
               webfunds/client/sox/gui PaymentFrame.java
               webfunds/client SimplePaymentFrame.java
  Log:
  use CASH instead of BEARER

Revision  Changes    Path
1.13      +3 -3      java/webfunds/client/sox/PendingReceipt.java

Index: PendingReceipt.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/client/sox/PendingReceipt.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- PendingReceipt.java	2001/03/07 00:10:18	1.12
+++ PendingReceipt.java	2001/03/23 01:21:40	1.13
@@ -1,5 +1,5 @@
 /*
- * $Id: PendingReceipt.java,v 1.12 2001/03/07 00:10:18 gelderen Exp $
+ * $Id: PendingReceipt.java,v 1.13 2001/03/23 01:21:40 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -170,8 +170,8 @@
                 return false;
         }
         ot = other.target;
-        if (ot.isBearer()) {
-            if (!target.isBearer())
+        if (ot.isCash()) {
+            if (!target.isCash())
                 return false ;
         } else {
             if (!ot.equals(target))



1.8       +19 -15    java/webfunds/client/sox/gui/PaymentFrame.java

Index: PaymentFrame.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/client/sox/gui/PaymentFrame.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PaymentFrame.java	2001/03/17 22:06:04	1.7
+++ PaymentFrame.java	2001/03/23 01:21:40	1.8
@@ -1,5 +1,5 @@
 /*
- * $Id: PaymentFrame.java,v 1.7 2001/03/17 22:06:04 iang Exp $
+ * $Id: PaymentFrame.java,v 1.8 2001/03/23 01:21:40 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -61,9 +61,12 @@
     protected final static String TEXT_PAY = "Make Payment",
                                   DIRECT_TFR = "Direct Deposit";
 
-    protected final static String SOX = "SOX", FRZ = "Rollover",
-                                  BRN = "Big Random Numbers", DAW = "Wagner";
-    protected final static String[] types = { SOX, FRZ, BRN, DAW };
+    protected final static String SOX = "SOX",
+                                  FRZ = "Rollover",
+                                  BRN = "Big Random Numbers",
+                                  DAW = "Wagner",
+                                  CHM = "Chaum";
+    protected final static String[] types = { SOX, FRZ, BRN, DAW, CHM };
     
     public PaymentFrame() { }
     
@@ -97,9 +100,9 @@
             AccountInfo[] accounts = pm.getAddressbook(this).getAccounts();
             DefaultComboBoxModel acList;
             acList = new DefaultComboBoxModel(accounts);
-            AccountInfo bearer = new AccountInfo();
-            acList.insertElementAt(bearer, 0);
-            acList.setSelectedItem(bearer);
+            AccountInfo emptyInfo = new AccountInfo();
+            acList.insertElementAt(emptyInfo, 0);
+            acList.setSelectedItem(emptyInfo);
 
             DefaultComboBoxModel typeList;
             typeList = new DefaultComboBoxModel(types);
@@ -336,7 +339,7 @@
 
         //
         //  Get the target.  Text box of KHID overrides address book list.
-        //  Default is bearer.
+        //  Default is to Cash.
         //
         AccountInfo target = (AccountInfo)target2.getSelectedItem();
         byte[] rawTgtName = target.getByteArray();
@@ -348,8 +351,8 @@
 
             target = new AccountInfo(bytes, null, null);
         }
-        else if (target.isBearer())             // what does target return ?
-            tgtName = "BEARER";
+        else if (target.isCash())             // what does target return ?
+            tgtName = AccountId.CASH_STRING;
         else
             tgtName = target.getName() + " (" + Hex.data2hex(rawTgtName) + ")";
 
@@ -359,7 +362,7 @@
         Date validTill = new Date(System.currentTimeMillis() + future);
 
         AccountId tgt = new AccountId();
-        if (target != null)               // target probably bearer
+        if (target != null)               // target probably CASH
             tgt.setByteArray(rawTgtName);
          
 
@@ -376,7 +379,8 @@
         if (SOX.equals(typeString))
         {
             // the payment itself
-            pay = wallet.makePayment(contractid, source, target,
+            pay = wallet.makePayment(contractid,
+                             source, target,
                              longamount, desc,
                              validFrom, validTill);
             if (pay == null)     // wallet encountered error, already reported
@@ -411,7 +415,7 @@
             String q = "This experimental TOKEN payment is highly dangerous "+
                        "and could lose your value." +
                        "\n\nAre you absolutely sure?";
-            if ( !wallet.ask(q) )
+            if ( longamount > 0 && !wallet.ask(q) )
                 return;
 
             int typ = webfunds.sox.PaymentFactory.RANDOM_TOKEN;
@@ -424,7 +428,7 @@
                              from, till,
                              typ);
             } catch (PaymentException ex) {
-                String e = "Wothdrawal Failed:\n\n" + ex;
+                String e = "Withdrawal Failed:\n\n" + ex;
                 if (ex.getNumber() == Errors.ERROR_UNAVAILABLE)
                 {
                     e = "The Issuer for " + contractName + "\n" +
@@ -486,7 +490,7 @@
 
         else if (DIRECT_TFR.equals(command))
         {
-            if (target == null || target.isBearer())
+            if (target == null || target.isCash())
             {
                 String e = "You have to specify a target";
                 pm.getUInterface(this).errorMessage(e);



1.53      +8 -8      java/webfunds/client/SimplePaymentFrame.java

Index: SimplePaymentFrame.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/client/SimplePaymentFrame.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- SimplePaymentFrame.java	2001/03/17 22:06:04	1.52
+++ SimplePaymentFrame.java	2001/03/23 01:21:40	1.53
@@ -1,5 +1,5 @@
 /*
- * $Id: SimplePaymentFrame.java,v 1.52 2001/03/17 22:06:04 iang Exp $
+ * $Id: SimplePaymentFrame.java,v 1.53 2001/03/23 01:21:40 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -79,9 +79,9 @@
             dcbm = new DefaultComboBoxModel();
         }
 
-        AccountInfo bearer = new AccountInfo();
-        dcbm.insertElementAt(bearer, 0);
-        dcbm.setSelectedItem(bearer);
+        AccountInfo emptyInfo = new AccountInfo();
+        dcbm.insertElementAt(emptyInfo, 0);
+        dcbm.setSelectedItem(emptyInfo);
 
         amount      = new TextField(15);
         target      = new TextField(15);
@@ -285,7 +285,7 @@
         long longamount = contract.getUnitsOfContract(dub);
 
         // who to
-        AccountInfo tgt = (AccountInfo)combo.getSelectedItem(); //default BEARER
+        AccountInfo tgt = (AccountInfo)combo.getSelectedItem(); //default CASH
         String tgtName = target.getText();
 
         if (!"".equals(tgtName))
@@ -294,8 +294,8 @@
 
             tgt = new AccountInfo(bytes, null, null);
         }
-        else if (tgt.isBearer())             // what does tgt return ?
-            tgtName = "BEARER";
+        else if (tgt.isCash())             // what does tgt return ?
+            tgtName = AccountId.CASH_STRING;
         else
             tgtName = tgt.getName() + " ("+Hex.data2hex(tgt.getByteArray())+")";
 
@@ -346,7 +346,7 @@
 
         else if ("Direct Transfer".equals(command))
         {
-            if (tgt == null || tgt.isBearer())
+            if (tgt == null || tgt.isCash())
             {
                 String e = "You have to specify a target";
                 pm.getUInterface(this).errorMessage(e);