MarkEdmondson1234 / stripeR

Interface between Stripe API and R
Other
8 stars 7 forks source link

idempotency() returning repeated values/keys #13

Open YO-SC opened 4 years ago

YO-SC commented 4 years ago

Hi there, while using the package I stumbled into a weird issue with the idempotency() function. For some reason, it seems that the function returns the same value. Even weirder, this behavior seems to be quite random.

I followed the README.md instructions but this is the output on the console:

Request: https://api.stripe.com/v1/charges
Stripe API fetch successful
Error in checkRequest(req) : idempotency_error
Keys for idempotent requests can only be used with the same parameters they were first used with. Try using a key other than 'fz2hOL2pm9AcxCi' if you meant to execute a different request.
In addition: Warning messages:
1: In retryRequest(do.call(request_type, args = arg_list, envir = asNamespace("httr"))) :
  Request Status Code: 400
2: In retryRequest(do.call(request_type, args = arg_list, envir = asNamespace("httr"))) :
  No retry attempted

What could be the issue here? Is this a package issue or am I doing something wrong?

Note: I tried using random numbers for the seed parameter on the idempotency() function but the problem still persists.

MarkEdmondson1234 commented 4 years ago

I think it will be if you have or have not set the seed. A later version let you pass in a seed.