GenericValue order = findGoogleOrder(delegator, orderId);
if (order != null) {
MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(order));
if (mInfo != null) {
String externalId = order.getString("externalId");
CancelOrderRequest cor = new CancelOrderRequest(mInfo, externalId, "Order Cancelled", ""); // TODO: configure the reason and comment
try {
cor.send();
} catch (CheckoutException e) {
Debug.logError(e, module);
}
}
}