lob / lob-ruby

Ruby Wrapper for Lob API
lob.com
MIT License
97 stars 43 forks source link

US Bulk Verifications API error - `Invalid ENUM value C1 for class #DpvFootnote` #217

Closed arich closed 8 months ago

arich commented 11 months ago

Hello, we're using the US Address Verifications Bulk API Lob::UsVerificationsApi.new.verifyBulk and for certain errors, it raises a RuntimeError: Invalid ENUM value C1 for class #DpvFootnote

According to https://postalpro.usps.com/CASS_DPV_DSF2_RCFTNote_Possble, it looks like this is an issue with the secondary address field.

The primary number DPV confirmed; secondary information was present and did not confirm; secondary is required - C1

So I think what's happening is your API is returning a value of C1, which cannot be coerced to a valid DpvFootnote enum value in the gem.

Your docs do not list C1 as a DpvFootnote value: https://docs.lob.com/#tag/US-Verification-Types, but it appears it can be returned in the API.

It looks like C1 is missing here: https://github.com/lob/lob-ruby/blob/main/lib/openapi_client/models/dpv_footnote.rb#L21

Can this be added so this error can be handled properly without a runtime error? Thank you!

arich commented 11 months ago

We are also getting this for PB: Invalid ENUM value PB for class #DpvFootnote

basabin54 commented 10 months ago

I'm seeing both of those errors as well -- Invalid ENUM value C1 for class #DpvFootnote and Invalid ENUM value PB for class #DpvFootnote

arich commented 10 months ago

Hi, we updated to lob gem version 6.0.5 and are getting a new error now. ArgumentError: invalid value for "dpv_inactive_reason", must be one of ["01", "02", "03", "04", "05", "06", ""].

It looks like it's coming from here: https://github.com/lob/lob-ruby/compare/v6.0.4...v6.0.5#diff-fec11cf1e2dbcad86fa8f955687ba5e02147cb70591f0dafdce5d365caebd747R367-R375

Unfortunately the error message doesn't contain what value was passed, so I can't provide that for debugging easily.

arich commented 8 months ago

I contacted lob support (support@lob.com) and got support through their zendesk portal. They appear to be more active there than on github.

They implemented an internal fix:

[We've] been working closely together with our AV team to get the correct updates in place for the error you have been experiencing. The good news is that our AV product team released an update that should fix this issue for you. They also tested with the addresses you provided previously and successfully saw the proper returned values instead of the "00" you were getting.

They released the fix on 12/26/2023. I confirmed this worked with the problematic address. Thanks for all your help! Closing.