shellbot97
shellbot97

Reputation: 328

request() got an unexpected keyword argument 'amount' in razorpay integration with django

I am trying to integrate Razorpay with my django application,

As suggested in their documentation I did,

pip install razorpay

and Now I'm trying to create an order by doing,

client = razorpay.Client(auth=("<key>", "<secret>"))
resp = client.order.create(amount=5000, currency='INR', receipt='TR110462011',
                                   payment_capture='1')

But I'm getting,

request() got an unexpected keyword argument 'amount'

I referred, request() got an unexpected keyword argument 'customer'

But it was not much of a help.

What am I doing wrong here?

Thank you for your suggestions.

Upvotes: 3

Views: 1108

Answers (1)

apurvmishra99
apurvmishra99

Reputation: 388

According to their API documentation here you need to pass a dictionary.

So, you can just modify your code by wrapping your arguments in dict() and it will work.

client = razorpay.Client(auth=("<key>", "<secret>"))
resp = client.order.create(dict(amount=5000, currency='INR', receipt='TR110462011', payment_capture='1'))

Upvotes: 8

Related Questions