cashfree / cashfree-pg-sdk-nodejs

Cashfree Nodejs Plugin
https://www.cashfree.com/
Apache License 2.0
6 stars 3 forks source link

Can't use SDK in multi-tenant environments #76

Open mdwt opened 5 days ago

mdwt commented 5 days ago

We want to integrate Cashfree into our multi-tenant platform, but it seems the current implementation of the SDK doesn't allow that because all the configuration parameters are all static variables of the Cashfree class, so you can only ever have one Cashfree merchant per runtime.

export class Cashfree {
...
    static XClientId?: string;
    static XClientSecret?: string;
    static XPartnerKey?: string;
    static XClientSignature?: string;
    static XPartnerMerchantId?: string;
...

Are there any plans to change this to member variables so that one can use different instances for different merchants?

suhas-cashfree commented 4 days ago

Hi @mdwt

Initially, the SDK was designed to keep it simple. But yes, this use case of multiple creds has to be supported. Will get back to you once we discuss internally.