razorpay / razorpay/razorpay-java

BAD_REQUEST_ERROR:Account number is mandatory for this merchant

Open
#303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
74
Forks
83
PR merge metrics
No merged PRs in 30d

Description

I'm trying to generate the orderId in Razorpay, and I'm following the steps given in documentation
https://razorpay.com/docs/payments/server-integration/java/payment-gateway/build-integration/#api-sample-code
. But its throwing an error saying com.razorpay.RazorpayException: BAD_REQUEST_ERROR:Account number is mandatory for this merchant

My code:
`RazorpayClient client = null;
try {
client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
JSONObject options = new JSONObject();
options.put("amount", 100);
options.put("currency", "INR");
options.put("receipt", "order_receipt_id");
Order order = client.orders.create(options);
System.out.println("ORDER Details: "+order);

        String orderId = order.get("id");  // Corrected property name to lowercase "id"
        System.out.println("ORDER ID: " + orderId);
        response.getWriter().append(orderId);
    }catch(Exception e){
        e.printStackTrace();
    }`

Note: I've added my key id and key secret in their respective "[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]"

Then I tried adding

options.put("account_number", "[accNO]");
then it threw a different error saying Internal server error try after some time... and I've tried many times but still nothing.

and the Razorpay version I'm using is 1.4.3

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 with the linked Java payment-gateway documentation and the RazorpayClient.orders.create entry point shown in the issue. Reproduce the request using SDK version 1.4.3 and compare the behavior with and without account_number; done means the required merchant configuration or a reproducible SDK/API defect is clearly identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.