I am using the Java SDK to send remote mobile payment requests. That requires creating a Paynow object as shown below:
Paynow paynow = new Paynow(“xxxx”, “yyyyyf”);
Q.1. My question is on the thread safety of the Paynow object. In other words can I create a single instance of Paynow object per class as shown above and use it to make multiple simultaneous calls from different threads?
Q.2. Do I need to create a new instance of Paynow for each call I make if the object is not thread safe? If I do so will that cause leaks. In fact as we speak I have my integration setup so that I create a new instance for every call. Something tells me that cant be right but it’s worked so far.
The second part of the question is based on the fact that my platform hosts multiple tenants / clients each of whom will have their own Integration ID and I guess API Key as well. And yet all the calls from my platform to the Payment Gateway will be made by the same platform.
Is there a way to share an API key (and maybe the integration ID too) for the different accounts / tenants / clients and still be able to send funds into the different bank accounts for my tenants?