-
Notifications
You must be signed in to change notification settings - Fork 110
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
Customer Already exists error #377
Comments
@ankitdas13 @razorpay can you check on this? |
@OutdatedGuy Apologies for the long delay, if you want to throw an error if the customer already existed then dont pass |
@ankitdas13 the docs you mentioned says that if the value of I want to retrieve the data of existing customer if available, but the code is throwing error instead. |
@OutdatedGuy Here I'm creating the same customer which is already existing
|
@ankitdas13 Which version of the package are you using? Can you give link to the example above as a repo? |
Yo @ankitdas13, below is the code I'm using to create customers and retrieve if already present: razorpayInstance.customers.create({
name: userDoc.data()?.name ?? "User",
contact: request.auth.token.phone_number,
fail_existing: 0,
}); And this is the error I'm getting if the customer with same details is already present:
I'm using razorpay version I have tried using a live production key just in case and it still throws the error. Please help. |
@OutdatedGuy Apologise for the delay. Have you resolved this issue? |
@ankitdas13, No, It's giving me the same issue mentioned in this comment. |
for me also the same issue , but while i am trying from public postman collection apis its working as expected but not with node-sdk |
just pass It seems to be working fine with this. |
@nimesh-trackerbin cannot do that in typescript: |
@ankitdas13 looks like the issue is when v2.9.1...v2.9.2#diff-a98fa4bf7fc9f2f4fab13f09ea5583d3097f5d1bc661b0af3c1759ea3bf053b8L3-R10 Can you verify and fix this ASAP? @ankitdas13 |
Hi @ankitdas13, is this issue being worked on? We are unable to update the package due to this issue. |
According to [official docs for customer creation](https://razorpay.com/docs/api/customers/create/) using razorpay API, `fail_existing` should be a string. But the types defined where `boolean`, numeric `1` & `0`. fixes razorpay#377, fixes razorpay#381
Steps to reproduce the behavior
Expected behavior
If customer with similar data already exists, their data should be returned when
fail_existing
is set to 0.Actual behavior
Error is thrown when customer is similar data already exists.
Code snippets
Node version
Node v18.17.1
Library version
razorpay v2.9.2
Additional Information
No response
The text was updated successfully, but these errors were encountered: