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

BAD_REQUEST_ERROR:Account number is mandatory for this merchant #303

Open
Shekhar-J-Lobo opened this issue Jan 31, 2024 · 0 comments
Open

Comments

@Shekhar-J-Lobo
Copy link

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

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

No branches or pull requests

1 participant