Skip to content

Bad Zipcodes Raise Exceptions in Checkout #51

@brchristian

Description

@brchristian

Currently if a user has Solidus::TaxCloud installed and checks out with a bad zip code - namely a zip code that does not exist in that US state, for instance 19130 in Rhode Island - the checkout flow will fail with an exception.

Ideally we should simply halt the checkout at the current step and display a error message attached to the form.

Is there a best practice for how to rescue TaxCloud::Errors::ApiError and return its error message attached to the address input form?

I know that in ActiveMerchant there is a pattern like

rescue Stripe::CardError => error
  payment.send(:gateway_error, error.message)
end

Is is possible to do something similar here but with the billing and shipping address step, rather than the payment step?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions