First commit fixes an issue with authentication when trying to get a list of schedules for a customer
Later commits add missing TS types for customer and schedules.
What was the authentication issue?
Authentication error returned when trying to get schedules for a customer using omise.customers.schedules(customerID)
This happened because in apiResources.js, the resourceActions function was taking an options argument (which includes private key), but further down in the schedules method, a new variable called options was be declared as var options =. This variable was hoisted and therefore leaving options as undefined
Fixed by remove duplicate options variable, and instead passing _makeOptions() as an argument directly which is consistent with the rest of the file
Overview
What was the authentication issue?
omise.customers.schedules(customerID)
apiResources.js
, theresourceActions
function was taking anoptions
argument (which includes private key), but further down in theschedules
method, a new variable called options was be declared asvar options =
. This variable was hoisted and therefore leavingoptions
asundefined
_makeOptions()
as an argument directly which is consistent with the rest of the file