razorpay / razorpay/razorpay-node
Invalid Pan field when creating Linked account using razorpay-node
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
export const razorPayInstance = new Razorpay({
// Replace with your key_id
key_id: process.env.RAZOR_PAY_KEY_ID!,
// Replace with your key_secret
key_secret: process.env.RAZOR_PAY_KEY_SECRET!,
})
const linkedAccBody = {
"email": "maneshwar@gmail.com",
"phone": "9620107401",
"type": "route",
"legal_business_name": "Antino",
"business_type": "individual",
"contact_name": "Antino",
"profile": {
"category": "services",
"subcategory": "automotive_service_shops",
"addresses": {
"registered": {
"street1": "HSR layout",
"street2": "HSR",
"city": "Bangalore",
"state": "KARNATAKA",
"postal_code": "560041",
"country": "India"
}
},
},
"legal_info": {
"pan": "ETFPM5333C",
"gst": "18AABCU9603R1ZM"
}
}
const createLinkedAccRes = await razorPayInstance.accounts.create(linkedAccBody)
Expected behaviour
- Expected a linked account to be created and API returning the id.
Actual behaviour
The problem exists both in the Test keys and Live keys.
The problem is we are getting an invalid pan field when giving the original Pan number
{
"code": "BAD_REQUEST_ERROR",
"description": "The pan field is invalid",
"source": "business",
"step": "payment_initiation",
"reason": "input_validation_failed",
"metadata": {},
"field": "pan"
}
Test cases done:
Case 1: Used the test Pan field mentioned in the API docs with Node.js Razorpay Instance.
Result: Works fine
{
"pan": "AAACL1234C",
"gst": "36AAECL6705C1ZS"
}
Case 2: Used the test Pan field mentioned in the API docs with Rest API POST request.
Result: Works fine
{
"pan": "AAACL1234C",
"gst": "36AAECL6705C1ZS"
}
Case 3: Used my real Pan field with Node.js Razorpay Instance.
Result: Pan field invalid
{
"pan": "AGJPY1257C",
"gst": "36AAECL6705C1ZS"
}
Case 4: Used my real Pan field with Rest API POST request.
Result: Pan field invalid
{
"pan": "ETFPM5333C",
"gst": "36AAECL6705C1ZS"
}
Node version
Node v18.18.2
Library version
"razorpay": "^2.9.2"
Additional Information
@razorpay-sanjib @amitrazorpay @KanhaRazorpay @bala-razorpay @ankitdas13
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the linked-account request with the documented test PAN and the reported real PAN, using both razorpay-node and the REST API. Compare the resulting requests and responses with the linked-account API documentation; the issue is done when the cause of the real PAN rejection is identified and the accepted behavior or required change is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100