razorpay / razorpay-node

Razorpay node.js bindings
MIT License
164 stars 108 forks source link

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

Open hardikhari96 opened 9 months ago

hardikhari96 commented 9 months ago

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 commented 3 months ago

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