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;
}