lob-java icon indicating copy to clipboard operation
lob-java copied to clipboard

Check logo migration from legacy SDK (version 6.2.0) to version 13.4.3

Open better-charles opened this issue 2 years ago • 0 comments

The legacy SDK supported sending the check logo on check creation in a multipart request by passing a java.io.File to the logo method on the CheckRequest.Builder.

Here are the logo method signatures

        public Builder logo(final String logo) {
            this.logo = LobParam.strings(LOGO, logo);
            return this;
        }

        public Builder logo(final File logo) {
            this.logo = LobParam.file(LOGO, logo);
            return this;
        }

        public Builder logo(final LobParam logo) {
            this.logo = logo;
            return this;
        }

and the logo field on the Request Post Body in my Lob Dashboard logs for a successfully created check:

  "logo": {
    "path": "/tmp/lob-assets/1692735566246-1-ee7d69c4db092941",
    "bytes": 6887,
    "filename": "logo-square10161330255379002724.png",
    "headers": {
      "content-disposition": "form-data; name=\"logo\"; filename=\"logo-square10161330255379002724.png\"",
      "content-type": "application/octet-stream",
      "content-transfer-encoding": "binary"
    }
  }

By contrast, in version 13.4.3, CheckEditable.setLogo only takes a String. While the API doc mentions that logo "accepts a remote URL or local file upload", the SDK does not seem to support the latter -- I've tried specifying the file path as well as a data URI containing the base64-encoded image, and both result in a check that fails to render in the dashboard.

Is there still a way to send the logo image itself in the request in version 13.* of the SDK or is a remote URI the only option?

better-charles avatar Aug 24 '23 14:08 better-charles