Giter VIP home page Giter VIP logo

Comments (5)

bsiddiqui avatar bsiddiqui commented on September 23, 2024

what version of the gem are you using?

from lob-ruby.

wxmerkt avatar wxmerkt commented on September 23, 2024

It is 1.1 as installed by gem install lob a few days ago.

from lob-ruby.

bsiddiqui avatar bsiddiqui commented on September 23, 2024

2 problems so far:

  1. it looks like the country needs to be US, not USA - I've submitted a PR to update the README
  2. the API seems to be expecting both front and back, though only back should be required per the docs - I'll open a new issue to resolve that

I'm still looking into the "error downloading file" issue but here's a temporary fix that should work:

@lob.postcards.create(
  name: "John Joe",
  to: {
    name: "ToAddress",
    address_line1: "120, 6th Ave",
    city: "Boston",
    country: "US",
    state: "MA",
    zip: "12345"
  },
  front: "https://www.lob.com/postcardfront.pdf",
  back: "https://www.lob.com/postcardback.pdf",
  from: {
      name: "FromAddress",
      address_line1: "120, 6th Ave",
      city: "Boston",
      country: "US",
      state: "MA",
      zip: "12345"
    }
)

from lob-ruby.

bsiddiqui avatar bsiddiqui commented on September 23, 2024

Ok @iamwolf looks like the API is fixed so you can have just back - to fix your file upload issue use File.new instead of File.read (I'll submit a PR to update the README).

Here is what your request will look like

@lob.postcards.create(
  name: "John Joe",
  to: {
    name: "ToAddress",
    address_line1: "120, 6th Ave",
    city: "Boston",
    country: "US",
    state: "MA",
    zip: 12345
  },
  back: File.new('postcardback.pdf'), # this is the file downloaded from lob.com/postcardback.pdf
  from: {
    name: "FromAddress",
    address_line1: "120, 6th Ave",
    city: "Boston",
    country: "US",
    state: "MA",
    zip: 12345
  }
)

from lob-ruby.

wxmerkt avatar wxmerkt commented on September 23, 2024

@bsiddiqui Thank you very much! We are using the cURL variant through the system command in our application right now but will revert to the updated gem soon. Many thanks for all your time and figuring out a solution to this bug.

from lob-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.