google-code-export / google-checkout-java-sdk

Automatically exported from code.google.com/p/google-checkout-java-sdk
1 stars 0 forks source link

DigitalContent is missing "display-disposition" from the google spec #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I can't use the Google checkout API to deliver digital content correctly.
Here is a fix:

Add this snippet to the DigitalContent class:

    public void setDisplayDisposition(DisplayDisposition dd) {
        Utils.findElementAndSetElseCreateAndSet(document, element,
                "display-disposition", dd.getDispositionString());
    }

And you'll need the DisplayDisposition class (which provides typesafety,
without enum):

public class DisplayDisposition {

    final static public DisplayDisposition OPTIMISTIC  = new
DisplayDisposition("OPTIMISTIC");
    final static public DisplayDisposition PESSIMISTIC = new
DisplayDisposition("PESSIMISTIC");

    private String disposition;

    private DisplayDisposition(String disposition) {
        this.disposition = disposition;
    }

    public String getDispositionString() {
        return this.disposition;
    }

    public String toString() {
        return getDispositionString();
    }

}

Original issue reported on code.google.com by broc.s...@gmail.com on 12 Mar 2009 at 9:09

GoogleCodeExporter commented 9 years ago
I also faced this issue and make custom fix

Original comment by wizi...@gmail.com on 20 Oct 2009 at 8:39

GoogleCodeExporter commented 9 years ago
It's really important issue

Original comment by smazu...@gmail.com on 20 Oct 2009 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by mihai.io...@gmail.com on 28 Mar 2011 at 11:26