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

Update plan throws an error #21

Closed
emmaadesile opened this issue May 29, 2021 · 3 comments
Closed

Update plan throws an error #21

emmaadesile opened this issue May 29, 2021 · 3 comments

Comments

@emmaadesile
Copy link
Contributor

emmaadesile commented May 29, 2021

I'm trying to make an update plan request using the SDK but it keeps throwing an error. After digging into the code, I discovered that the SDK sends a default value of monthly for the interval but the API doesn't accept interval param for the update plan endpoint.

This is the updatePlan function

  updatePlan: {
    method: 'PUT',
    path: '/plan/{:id_or_plan_code}',
    send_json: true,
    params: { name$: String, interval$: String, currency: String, amount$: Number, send_invoices: Boolean, send_sms: Boolean, invoice_limit: Number, description: String },
    param_defaults: { interval: 'monthly', currency: 'NGN', send_invoices: false, send_sms: false, invoice_limit: 0 },
    route_params: { id_or_plan_code: String }
  }

Screeenshot:

Screenshot 2021-05-29 at 15 07 20

Screenshot 2021-05-29 at 15 53 26

Possible Fix

This error should be fixed after the interval is removed from the params_defaults and params fields in the updatePlan function

@emmaadesile
Copy link
Contributor Author

Here's a link to the fix

@stitchng
Copy link
Owner

stitchng commented Jun 3, 2021

Hello @emmaadesile. According to the API reference, the interval request body param is lsited however, you are right. It throws an error like you depicted here. So, i have merged it in. Thanks a lot! Your cpntribution will be part of the next patch update.

@stitchng stitchng closed this as completed Jun 3, 2021
@emmaadesile
Copy link
Contributor Author

@stitchng Thanks. Kindly update the npm package.

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