order.setCustomer(customer);
}
// shipping address
if (attributes.get("shipping_address") != null) {
OrderAddress shippingAddress = new OrderAddress();
Map<String, Object> atts = (Map<String, Object>) attributes
.get("shipping_address");
for (Map.Entry<String, Object> att : atts.entrySet())
shippingAddress.set(att.getKey(), att.getValue());
order.setShippingAddress(shippingAddress);
}
// billing address
if (attributes.get("billing_address") != null) {
OrderAddress billingAddress = new OrderAddress();
Map<String, Object> atts = (Map<String, Object>) attributes
.get("billing_address");
for (Map.Entry<String, Object> att : atts.entrySet())
billingAddress.set(att.getKey(), att.getValue());
order.setBillingAddress(billingAddress);
}
// items