public void getredemption(redmess rm, vendor v) { btb.AppendText("Redemption received from vendor: "+v.name+" !\n"); if(verifyuser(rm.getucomm())) { BigInteger start = rm.getucomm().getc0(); BigInteger temp = rm.getlpay().getci(); int l=rm.getlpay().geti(); for(int i=l;i>0;i--) temp=hashf.hash(temp.ToString()); if (start == temp) { btb.AppendText("\tRedemption verified ( for " + l.ToString() + "$ ), transaction initiated for vendor: " + v.name + " !\n"); v.gettransinfo(l, this); } else { btb.AppendText("\tRedemption failed (invalid payment), sent message to vendor: " + v.name + " !\n"); v.gettransinfo(0, this); } } else { btb.AppendText("\tRedemption failed (invalid user), sent message to vendor: " + v.name + " !\n"); v.gettransinfo(0, this); } }
public void sendredemption(broker b) { if (lastpay.geti() == 0) vtb.AppendText("No payments made !\n"); else { vtb.AppendText("Redepmtion sent to broker: " + b.ToString() + " !\n"); redmess rm = new redmess(lastpay, ucomm); b.getredemption(rm, this); } }