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

Integrate sub merchant #86

Closed
dharshan opened this issue Aug 29, 2019 · 3 comments
Closed

Integrate sub merchant #86

dharshan opened this issue Aug 29, 2019 · 3 comments

Comments

@dharshan
Copy link
Contributor

dharshan commented Aug 29, 2019

How would you suggest using this library for both normal and a sub-merchant account transactions?

Currently razorpay-ruby gem is setup-ed with an initializer with single user/merchant's credentials.

Is it a good way to explicitly setup/override Razorpay with sub-merchant's credentials wherever we are require sub-merchant instance

  id = Rails.application.secrets.razorpay['sub_merchant_id']
  secret = Rails.application.secrets.razorpay['sub_merchant_secret']

  Razorpay.setup(id, secret)

  Razorpay::Orders.all
  ...
@harman28
Copy link
Contributor

@Dharshann It's been called out before that this gem isn't thread-safe, i.e. because the config is set just once and reused by all functions, it's not possible to use multiple merchant accounts in the same app. There are hacks that might work (maybe a local clone of the gem, after which the 2 gems can be used for separate accounts), but essentially this isn't supported right now.

We've got it on our roadmap though and hope to be able to get this done sometime later this year (pull requests are welcome!).

@harman28
Copy link
Contributor

I'd like to close this as basically a duplicate of #66. Let me know if this^ answers your question.

@dharshan
Copy link
Contributor Author

@harman28 didn't see the open issue. Hoping to see suggested changes in new release.

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

2 participants