Plugin works in developpement but not in live

Hello,

I created a plugin to interact with the Woocommerce REST API. The plugin works fine on the development version, but it won’t work on the live version.

This is the error :
erreur

On development version the request is correct (status 201) and the workflow is working

Do you have any ideas?

Without knowing which data you are sending, there’s no way to help you. The error is a bad request, this mean that probably you have an empty field in live.
Are you using API in the plugin or a server side action?

Hello, I’m working with the Woocommerce API.
To do that, I’m using a server-side action and importing the node package.

When I examine the workflow action, I can see that my data is completely filled in.

I’m creating an order with the API.
Here’s the code :

some quick tip:

  • secret keys hardcoded in the code should be avoided. You can declare keys that will be filled by the plugin user. You can retrieve them with context.keys
  • context.async needs to call the callback in every possible case. Your code is leaving a branch that does not call the callback.
  • instead of relying on bubble handling the error you can do something like this to return error information in an actionable format
  • the plugin is working as expected: the request failed with status 400, you call the callback with the error, bubble notifies it. Probably the request is not well formed because some data is missing and there is no logic to validate the inputs of the action.
1 Like