razorpay / razorpay-python

Razorpay Python SDK
https://pypi.python.org/pypi/razorpay
MIT License
154 stars 81 forks source link

USD is not supported for creating a plan in razorpay #148

Closed kanav-raina closed 1 year ago

kanav-raina commented 3 years ago
client = razorpay.Client(auth=(keyId, keySecret))

plan=client.plan.create({
            "period": "weekly",
            "interval": 1,
            "item": {
                "name": "Test plan - Weekly",
                "amount": 1000,
                "currency": "USD",
                "description": "Description for the test plan"
            },
            "notes": {
                "notes_key_1": "note 1",
                "notes_key_2": "note2"
            }
})

I want to create a plan for subscription which support USD as currency but its throwing this error "razorpay.errors.BadRequestError: Currency provided is not supported"

When I am using INR as currency its working fine. How to use USD as currency type in razorpay python for reating a plan for subscription

kanav-raina commented 3 years ago

Screenshot from 2021-08-13 15-05-51

sanzzzay commented 3 years ago

I don't think there's any issue with the currency USD. I have tested myself in test mode. Try the following code:

period = 'monthly'
interval = 1
name= "Test plan monthly USD"
amount= 30000
currency="USD"
description= "Description for the test plan monthly"

notes = {
    "key1": "Testing",
    "env": "local"
  }
item = {'name': name, 'amount': amount, 'currency': currency, 'description': description}
data = {'period': period, 'interval': interval, 'item': item, 'notes':notes}
# get the razorpay client
plan_data= client.plan.create(data=data)

Let me know if you still facing the issue after trying the above sample code.

kanav-raina commented 3 years ago

Screenshot from 2021-08-27 14-12-15 For international payment I think we need to send permission request to razorpay

sanzzzay commented 3 years ago

Yeah. might be you need a permission. Found this issue mentioned here - https://github.com/razorpay/razorpay-php/issues/95 BTW are you able to create plan in INR currency?

kanav-raina commented 3 years ago

yes I was able to create plan in INR

kanav-raina commented 3 years ago

In international payment I have enabled paypal but its still not accepting currency as USD while creating a plan Screenshot from 2021-09-28 10-36-06

sanzzzay commented 3 years ago

In international payment I have enabled paypal but its still not accepting currency as USD while creating a plan Screenshot from 2021-09-28 10-36-06 I am just guessing what went wrong for you. Did you enable international payments? Watch this: https://youtu.be/lPvasqEJqK8 You might need to select USD in "currencies to focus". Lastly, you might need to reach their help and support.

kanav-raina commented 3 years ago

Screenshot from 2021-09-30 14-09-33 I dont have this option @sanzzzay

kanav-raina commented 3 years ago

In the video you have option to request international card but I dont have option to request international card and when I use this https://razorpay.com/support/#request, its asking me to login and redirecting to dashboard

sanzzzay commented 3 years ago

In the video you have option to request international card but I dont have option to request international card and when I use this https://razorpay.com/support/#request, its asking me to login and redirecting to dashboard

@kanav-raina I am not sure why there is no option to enable International Cards here. I guess you have appropriate roles - any one of them - Owner, Admin and Manager. Meanwhile I will suggest you to go through this: https://razorpay.com/docs/payments/dashboard/settings/payment-methods/ and https://razorpay.com/accept-international-payments/ Rest if I get anything, I will let you know.

kanav-raina commented 3 years ago

Thanks @sanzzzay

ankitdas13 commented 1 year ago

Thanks a lot @sanzzzay for helping the users . Closing this issue since it has been resolved. If you need further help, please let us know.

simmifoundationmadhu commented 1 year ago

How it's resolved?