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

Inconsistent response from API #95

Open
cmclarnon88 opened this issue Jan 10, 2022 · 0 comments
Open

Inconsistent response from API #95

cmclarnon88 opened this issue Jan 10, 2022 · 0 comments

Comments

@cmclarnon88
Copy link

cmclarnon88 commented Jan 10, 2022

Submitted on behalf of merchant:

I just ran into an unexpected issue with the GoCardlessPro Ruby gem.

The issue is a Ruby exception because of some empty variable, details below.

I just ran into an unexpected response-body for calling sub-url: /scenario_simulators/:identity/actions/run in the GoCardlessPro::Services::ScenarioSimulatorsService.run method. This call is made by using example: https://developer.gocardless.com/api-reference/#scenario-simulators-simulate-a-scenario

Class Resource::ScenarioSimulator is instantiated on line lib/gocardless_pro/services/scenario_simulator_service.rb:152 with an empty un-enveloped body response, which throws an NoMethodError with message: 'undefined method [] for nil:NilClass'

The issue can be resolved by implementing the following:

  • lib/gocardless_pro/services/scenario_simulator_service.rb:150
    ** Replace return if response.body.nil? with return if response.body.nil? || response.body.empty?
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

1 participant