Skip to content
← Back to activity

Public problem

GoCardlessPro::InvalidApiUsageError 'One of your parameters was incorrectly typed' after Rails 6.0.2.1...

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

After upgrading to Rails 6.0.2.1, creating a GoCardless redirect flow failed with GoCardlessPro::InvalidApiUsageError: One of your parameters was incorrectly typed. Rack changed session.id to return a Rack::Session::SessionId object instead of a String; the SDK serialized it as a JSON object and the API rejected it. A maintainer confirmed the diagnosis but declined to auto-cast parameters in the client library.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Pass a real string for the session token - use session.id combined with public_id (the fix recommended by the Rails team) instead of bare session.id when creating the redirect flow. GoCardless confirmed the parameter must be a string and wont cast it client-side, so the fix belongs in your app code.

Source: https://github.com/gocardless/gocardless-pro-ruby/issues/67