throw new OperationDisallowedException(userId + " does not have paymentProfileId " + paymentProfileId);
Order order = Order.createOrder();
order.setTotalAmount(amountToAuthorize);
PaymentTransaction paymentTransaction = PaymentTransaction.createPaymentTransaction();
paymentTransaction.setTransactionType(net.authorize.TransactionType.AUTH_ONLY);
paymentTransaction.setCustomerPaymentProfileId(paymentProfileId);
paymentTransaction.setOrder(order);
if (cardCode != null)
paymentTransaction.setCardCode(cardCode);
Transaction transaction = createTransaction(TransactionType.CREATE_CUSTOMER_PROFILE_TRANSACTION);
transaction.setPaymentTransaction(paymentTransaction);
transaction.setCustomerProfileId(customerProfileId);