1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
package epayment.request;
import epayment.framework.IPaymentRequest;
/**
* The <code>PaymentRequest</code> class is an
* <code>IPaymentRequest</code> that encapsulates
* the basic payment request information.
* <p>
* This class is strictly an example.
*
* @author <a href="mailto:mike@clarkware.com">Mike Clark</a>
* @author <a href="http://www.clarkware.com">Clarkware Consulting</a>
*/
public class PaymentRequest implements IPaymentRequest {
private String _userId;
private String _userPassword;
private String _name;
private String _accountNumber;
private double _amount;
private String _comment;
/**
* Constructs a <code>PaymentRequest</code>.
* with default values.
*/
public PaymentRequest() {
_userId = "";
_userPassword = "";
_name = "";
_accountNumber = "";
_amount = 0.0;
_comment = "";
}
/**
* Sets the user id.
*
* @param id User id.
*/
public void setUserId(String id) {
_userId = id;
}
/**
* Returns the user id.
*
* @return User id.
*/
protected String getUserId() {
return _userId;
}
/**
* Sets the user password.
*
* @param password User password.
*/
public void setUserPassword(String password) {
_userPassword = password;
}
/**
* Returns the user password.
*
* @return User password.
*/
protected String getUserPassword() {
return _userPassword;
}
/**
* Sets the name.
*
* @param name Name.
*/
public void setAccountName(String name) {
_name = name;
}
/**
* Returns the name.
*
* @return Name.
*/
protected String getAccountName() {
return _name;
}
/**
* Sets the account number.
*
* @param number Account number.
*/
public void setAccountNumber(String number) {
_accountNumber = number;
}
/**
* Returns the account number.
*
* @return Account number.
*/
protected String getAccountNumber() {
return _accountNumber;
}
/**
* Sets the amount of the transaction.
*
* @param amount Amount in dollars.
*/
public void setAmount(double amount) {
_amount = amount;
}
/**
* Returns the amount of the transaction.
*
* @return Amount in dollars.
*/
protected double getAmount() {
return _amount;
}
/**
* Sets the reporting comment.
*
* @param comment Reporting comment.
*/
public void setComment(String comment) {
_comment = comment;
}
/**
* Returns the reporting comment.
*
* @return Reporting comment.
*/
protected String getComment() {
return _comment;
}
/**
* Returns the string representation of this object.
*
* @return String representation.
*/
public String toString() {
StringBuffer contents = new StringBuffer();
contents.append("User ID = " + _userId + "\n");
contents.append("User Password = " + _userPassword + "\n");
contents.append("Name = " + _name + "\n");
contents.append("Account Number = " + _accountNumber + "\n");
contents.append("Amount = " + _amount + "\n");
return contents.toString();
}
}
|