razorpay / razorpay/razorpay-node

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

Open
#381 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
243
Forks
129
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing customer creation with fail_existing set to 0 on Node.js package versions 2.0.6 and 2.9.2, comparing the API URLs shown in the issue. Check whether the changed base URL affects the duplicate-customer response, and confirm that the newer version returns the existing customer ID as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.