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

Issue with create customer when customer is already exist and fail_existing value is 0 #381

Open
hardikhari96 opened this issue Oct 3, 2023 · 1 comment · May be fixed by #415
Open

Comments

@hardikhari96
Copy link

Steps to reproduce the behavior

  1. create customer in Razorpay with email id, mobile number and name (new) and fail_existing : 0
  2. try to create it again with same details it will

Expected behavior

In second time I am trying to create user it should return customer id ,

Actual behavior

its throwing error that customer is already exist but it should return customer id as I sending fail_existing : 0

Code snippets

// Package : ^2.0.6 :   

new API({
      hostUrl: 'https://api.razorpay.com/v1/',
      ua: 'razorpay-node@' + Razorpay.VERSION,
      key_id: key_id,
      key_secret: key_secret,
      headers: headers
    });

// Package : ^2.9.2:   
    this.api = new API({
      hostUrl: 'https://api.razorpay.com',
      ua: 'razorpay-node@' + Razorpay.VERSION,
      key_id: key_id,
      key_secret: key_secret,
      headers: headers
    });

Node version

v18.13.0

Library version

^2.9.2

Additional Information

It is working in old package version (2.0.6) of Razorpay

I found API URL is different , may be its issue in API

https://api.razorpay.com/v1

but in new Updated package API is

https://api.razorpay.com

@OutdatedGuy
Copy link

I too have the same issue. I have filed it here #377

OutdatedGuy added a commit to OutdatedGuy/razorpay-node that referenced this issue May 18, 2024
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
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

Successfully merging a pull request may close this issue.

2 participants