[Webfunds-commits] java/webfunds/sox Payment.java

Ian Grigg iang@cypherpunks.ai
Tue, 27 Feb 2001 10:22:23 -0400 (AST)


iang        01/02/27 10:22:23

  Modified:    webfunds/sox Payment.java
  Log:
  dropped ItemId.example munging (does it itself now)
  and added some better formatting

Revision  Changes    Path
1.26      +24 -12    java/webfunds/sox/Payment.java

Index: Payment.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Payment.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- Payment.java	2000/11/30 13:39:13	1.25
+++ Payment.java	2001/02/27 14:22:23	1.26
@@ -1,5 +1,5 @@
 /*
- * $Id: Payment.java,v 1.25 2000/11/30 13:39:13 iang Exp $
+ * $Id: Payment.java,v 1.26 2001/02/27 14:22:23 iang Exp $
  *
  * Copyright (c) Systemics Inc 1995-2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -336,22 +336,24 @@
         retval += "  Q: "+qty;
         retval += "  PID: "+paymentId;
 
-        retval += "\n  "+item;
+        retval += "\n\t\t"+item;
 
-        retval += "\n";
-        retval += "  "+source;
-        retval += " => "+target+"\n";
-
-        retval += "  ";
-        retval += "from: "+validFrom+"\t";
-        retval += "  till: "+validTill+"\t";
-        retval += "  sig: "+sig+"\n";
+        retval += "\n\t\t";
+        retval += "   "+source;
+        retval += "\n\t\t=> "+target;
+
+        retval += "\n\t\t";
+        retval += "from: "+validFrom;
+        retval += "  till: "+validTill;
+        retval += "\n\t\tsig: "+sig+"\n";
 
         if (desc == null)
-            retval += "  Desc: <none>\n";
+            retval += "\n\t\tDesc: <none>\n";
         else
-            retval += "  Desc: "+webfunds.utils.Hex.printable(desc)+"\n";
+            retval += "\n\t\tDesc: "+webfunds.utils.Hex.printable(desc)+"\n";
 
+        retval += "\n\t\t, , , , , , , , , , , , end Pay\n";
+
         return retval;
     }
 
@@ -426,6 +428,16 @@
     public static Payment example()
     {
         ItemId item   = ItemId.example();
+/* now does it itself
+        int len;
+        do {                              // no payment with null ItemId?
+            item   = ItemId.example();
+            byte[] b = item.getByteArray();
+            len = (b == null) ? 0 : b.length;
+        }
+            while (len <= 0);
+*/
+
         AccountId ac1 = AccountId.example();
         AccountId ac2 = AccountId.example();