You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We are using this library to process payment with different paymongo account in the same application runtime. Cause of the Singleton design pattern we sometime don't have the ref to the expected Paymongo instance.
To Reproduce
paymongo1 = new Paymongo("secretKey1");
...
paymongo2 = new Paymongo("another_secretKey");
...
Expected behavior
The constructor should double check the existing instance API Key to avoid this
The text was updated successfully, but these errors were encountered:
exportdefaultclassPaymongo{constructor(secret){if(!secret)thrownewError('API key is required!');if(Paymongo.instanceinstanceofPaymongo){if(Paymongo.instance.secret===secret){returnPaymongo.instance;}}this.secret=secret;
Describe the bug
We are using this library to process payment with different paymongo account in the same application runtime. Cause of the Singleton design pattern we sometime don't have the ref to the expected Paymongo instance.
To Reproduce
paymongo1 = new Paymongo("secretKey1");
...
paymongo2 = new Paymongo("another_secretKey");
...
Expected behavior
The constructor should double check the existing instance API Key to avoid this
The text was updated successfully, but these errors were encountered: