if (customerId != null) {
customerProps.put("mode", "customer");
customerProps.put("customer_id", customerId);
} else {
// TODO: mode=guest, register
throw new ServiceException(
"Customer must exist; modes [guest|register] not supported yet");
}
callParams.put("quoteId", cart.getId());
callParams.put("customer", customerProps);
callParams.put("storeId", cart.getStoreId());
Boolean success = (Boolean) soapClient.call(
ResourcePath.ShoppingCartCustomerSet, callParams);
if (!success) {
throw new ServiceException("Could not set customer");
}
} catch (AxisFault e) {
if (debug) {
e.printStackTrace();
}
throw new ServiceException(e.getMessage());
}
}