#esset
1 messages ยท Page 1 of 1 (latest)
So you are sending the same idempotency_key but different orders in body?
Yes
I'm not sure if that's why idempotency fails but it's the best guess so far
here's a req id: req_zsLRbSfU3qzi9u
Yeah I believe it's pretty much the case. The body should be the same
Hm... does that really make sense though; the ordering of JSON object properties cannot be guaranteed, right?
You can think the whole body as a string, to be encoded. If the order is different then the string is different
hm, ok. not quite sure it's easy to resolve on the calling end (all properties are being constructed in the same way, so the different order isn't applied deliberately).
Can I ask you about the Stripe Node.js SDK, too?
Sure!
I'm trying to handle the errors better, and am reading these docs: https://github.com/stripe/stripe-node/wiki/Error-Handling
we're using typescript, so this should apply: https://github.com/stripe/stripe-node/wiki/Error-Handling#typescript
but... we're using "await" rather than ".then()", and, looking at the type definitions, I can't see the returned object from accounts.create() matching the example where the first value is the error...
would the StripeError be thrown = we should catch it and check the type?
An error is only thrown when you don't pass a required argument to a resource method. All REST or otherwise asynchronous errors will be available as the first argument of any Stripe method's callback:
Um I am not super familiar with Typescript, but I think you still be able to try/catch, no? Let's see this example code: https://github.com/stripe-samples/accept-a-payment/blob/main/custom-payment-flow/server/node-typescript/src/server.ts#L102
thanks. yes, that was my expectation, too, but the part about not throwing errors...threw me off a bit.
does the error object include the same properties as the HTTP error, e.g. type + message + param?
Um not sure but I think it should. Have you tried it?
was hoping to be able to see it in the docs or type defs ๐ but I'll figure it out
thanks
oh, one last thing;
Does creating a Person also disallow PO box addresses in the US? Or is it just when creating company accounts?
Um what is PO box addresses? Sorry...