Debug.logInfo("-- Product Store : " + productStoreId, module);
Debug.logInfo("-- Locale : " + locale.toString(), module);
Debug.logInfo("-- Google Order # : " + externalId, module);
// set the customer information
Address shippingAddress = info.getBuyerShippingAddress();
Address billingAddress = info.getBuyerBillingAddress();
String[] partyInfo = getPartyInfo(shippingAddress, billingAddress);
if (partyInfo == null || partyInfo.length != 3) {
throw new GeneralException("Unable to parse/create party information, invalid number of parameters returned");
}
cart.setOrderPartyId(partyInfo[0]);
cart.setPlacingCustomerPartyId(partyInfo[0]);
cart.setShippingContactMechId(partyInfo[1]);
// contact info
String shippingEmail = shippingAddress.getEmail();
if (UtilValidate.isNotEmpty(shippingEmail)) {
setContactInfo(cart, "PRIMARY_EMAIL", shippingEmail);
}
String billingEmail = billingAddress.getEmail();
if (UtilValidate.isNotEmpty(billingEmail)) {
setContactInfo(cart, "BILLING_EMAIL", billingEmail);
}
String shippingPhone = shippingAddress.getPhone();
if (UtilValidate.isNotEmpty(shippingPhone)) {
setContactInfo(cart, "PHONE_SHIPPING", shippingPhone);
}
String billingPhone = billingAddress.getPhone();
if (UtilValidate.isNotEmpty(billingPhone)) {
setContactInfo(cart, "PHONE_BILLING", billingPhone);
}
// set the order items