Package com.brienwheeler.lib.util

Examples of com.brienwheeler.lib.util.OperationDisallowedException


      UserEmailAddress existing = userEmailAddressDao.findByEmailAddress(emailAddress);
      if (existing == null)
        return false;
     
      if (!existing.getUser().equals(user))
        throw new OperationDisallowedException(user.toString() + " is not associated with email address " + emailAddress.getAddress());
     
      userEmailAddressDao.delete(existing);
      return true;
  }
View Full Code Here


  public ForgottenPasswordData getForgottenPasswordData(EmailAddress emailAddress)
  {
    ValidationUtils.assertNotNull(emailAddress, "emailAddress cannot be null");
   
    if (EnvironmentUtils.isProduction())
      throw new OperationDisallowedException("getForgottenPasswordData() not allowed in production environments");
   
    return doGetForgottenPasswordData(emailAddress);
  }
View Full Code Here

    @GracefulShutdown
  public String authorizePayment(DbId<User> userId, String paymentProfileId, String cardCode, BigDecimal amountToAuthorize)
  {
    String customerProfileId = userAttributeService.getAttribute(userId, ATTR_PROFILE_ID);
    if (customerProfileId == null)
      throw new OperationDisallowedException(userId + " has no Authorize.Net customer profile");
   
    List<PaymentMethod> paymentMethods = getPaymentMethods(userId, customerProfileId);
    PaymentMethod paymentMethodToUse = null;
    for (PaymentMethod paymentMethod : paymentMethods)
      if (paymentMethod.getPaymentProfileId().equals(paymentProfileId)) {
        paymentMethodToUse = paymentMethod;
        break;
      }
    if (paymentMethodToUse == null)
      throw new OperationDisallowedException(userId + " does not have paymentProfileId " + paymentProfileId);

    Order order = Order.createOrder();
    order.setTotalAmount(amountToAuthorize);

    PaymentTransaction paymentTransaction = PaymentTransaction.createPaymentTransaction();
View Full Code Here

    @GracefulShutdown
  public String settlePayment(DbId<User> userId, String transactionId, BigDecimal amountToSettle)
  {
    String customerProfileId = userAttributeService.getAttribute(userId, ATTR_PROFILE_ID);
    if (customerProfileId == null)
      throw new OperationDisallowedException(userId + " has no Authorize.Net customer profile");
   
    Order order = Order.createOrder();
    order.setTotalAmount(amountToSettle);

    PaymentTransaction paymentTransaction = PaymentTransaction.createPaymentTransaction();
View Full Code Here

TOP

Related Classes of com.brienwheeler.lib.util.OperationDisallowedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.