Exemplo n.º 1
0
  /**
   * @param key key in nvp request string
   * @param value value in nvp request string
   * @param amount payment amount
   * @throws IllegalArgumentException
   */
  private MassPayItem(String key, String value, String amount) throws IllegalArgumentException {

    if (!Validator.isValidAmount(amount)) {
      throw new IllegalArgumentException("amount - " + amount + " is not valid");
    }

    nvpRequest = new HashMap<String, String>();
    nvpRequest.put(key, value);
    nvpRequest.put("L_AMT", amount);
  }
Exemplo n.º 2
0
  /**
   * @param email Email address of recipient. Character length and limitations: 127 single-byte
   *     characters maximum.
   * @param amount Payment amount.
   * @return
   * @throws IllegalArgumentException
   */
  public static MassPayItem getNewEmailMassPayItem(String email, String amount)
      throws IllegalArgumentException {

    if (!Validator.isValidEmail(email)) {
      throw new IllegalArgumentException("email is not valid");
    }
    if (email.length() > 127) {
      throw new IllegalArgumentException("email cannot be longer than " + "127 characters");
    }
    return new MassPayItem("L_EMAIL", email, amount);
  }