Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list_account_subscriptions example incorrect #675

Closed
noctivityinc opened this issue Mar 18, 2021 · 9 comments
Closed

list_account_subscriptions example incorrect #675

noctivityinc opened this issue Mar 18, 2021 · 9 comments

Comments

@noctivityinc
Copy link

The list_account_subscriptions example says this:

params = {
  limit: 200
}
subscriptions = @client.list_account_subscriptions(
  account_id: account_id,
  params: params
)

Which is incorrect and caused a validation error. You need to send params directly, like this:

subscriptions = @client.list_account_subscriptions(
  account_id: account_id,
  limit: 200
)

Please update the README and docs.

@douglasmiller
Copy link
Contributor

I saw in another issue that you're using the 3.18.1 version of the client. We released the 4.0.0 version of the client at the beginning of the month which changes this behavior.

The master branch is for the current 4.0.0 version of the client which pairs with the 2021-02-25 version of Recurly API. The 3.x client pairs with the 2019-10-10 version of Recurly API and it's source can be found on the v3-v2019-10-10 branch of the repository. The documentation for the 2019-10-10 API can be found on the developer hub as well as a listing of available documentation versions.

This change was introduced with pull request #619 and is included in the breaking changes section of the CHANGELOG for the 4.x release.

I apologize for the confusion. We will look into adding more visibility to these differences to the README.

@noctivityinc
Copy link
Author

@douglasmiller you may want to update the getting started, as this is right at the top:

gem 'recurly', '~> 3.18'

@douglasmiller
Copy link
Contributor

Where are you seeing that? The GETTING_STARTED on master has 4.0. If there's something off, I'd like to fix it.

@noctivityinc
Copy link
Author

Sorry @douglasmiller , this may be ANOTHER 3.0 issue. I upgraded the gem to 4.0 as you requested and this is the method:

 params = {
      limit: 200
    }

    @subscriptions = RECURLY_CLIENT.list_account_subscriptions(
      account_id: account_id
      params: params
    )

and I get this:

wrong number of arguments (given 1, expected 0)

@noctivityinc
Copy link
Author

Relevant trace...

Application Trace | Framework Trace | Full Trace
recurly (4.0.0) lib/recurly/client.rb:299:in `validate_path_parameters!'
recurly (4.0.0) lib/recurly/client.rb:319:in `interpolate_path'
recurly (4.0.0) lib/recurly/client/operations.rb:1233:in `list_account_subscriptions'
app/controllers/subscriptions_controller.rb:13:in `index'

@noctivityinc
Copy link
Author

@douglasmiller any updates on this one? I see it's still closed even though it appears broken.

@douglasmiller
Copy link
Contributor

The ruby 3.0.0 fixes were not included in the 4.0.0 client library release. They were merged up to the 4.x client branch in #671 which we will be releasing soon.

@noctivityinc
Copy link
Author

ahh - that explains what I just found.

When I use this:
gem 'recurly', '~> 4.0'

I get errors but when I reference the github branch directly:

gem 'recurly', '~> 4.0', github: 'recurly/recurly-client-ruby'

Then it works properly. Count still doesn't work, which I know you are fixing, but good to know about the other situation. You guys really need to update your README for these situations. I wasted the day.

@douglasmiller
Copy link
Contributor

@noctivityinc I just published the 4.0.1 version of the client which fixes this ruby 3.x issue with the Pager#count functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants