Search code examples
javagoogle-checkout

Unable to make Digital Product in Google Checkout using java api


This is how I create my product for Google

DigitalContent dc = new DigitalContent();
dc.setEmailDelivery(true);
dc.setDisplayDisposition("OPTIMISTIC");
Money money = new Money();
money.setCurrency("GBP");
money.setValue(BigDecimal.valueOf(PRICE));
Item item = new Item();
item.setItemName(LICENSE);
item.setItemDescription(DESCRIPTION);
item.setUnitPrice(money);
item.setQuantity(QTY);
item.setDigitalContent(dc);
CartPoster.CheckoutShoppingCartBuilder builder = API_CONTEXT.cartPoster().makeCart()
    .addItem(item);

CheckoutRedirect checkoutRedirect = builder.buildAndPost();
return checkoutRedirect.getRedirectUrl();

It works except the product is not marked as digital, the important consequence of this is that users can cancel an order for 15 minutes after placing it, even if I have digitally sent the license.

What am I missing for Google to identify this as Digital Product ?


Solution

  • Never mind a reboot has solved the issue, so the code above is valid after all.